반응형
file_name=`basename "$0"`
directory=$(pwd)
echo "same as $(realpath)/$(basename "$0")"
echo "this is $(pwd)/$(basename "$0")"
echo "also in $(cd "$(dirname "$1")" && pwd -P)/$(basename "$1")$(basename "$0")"
echo "my name is ${directory}/${file_name}"
##
test/answer.sh:4: command not found: realpath
same as /answer.sh
this is /Users/giljaeeun/Documents/work_dir/answer.sh
also in /Users/giljaeeun/Documents/work_dir/answer.sh
my name is /Users/giljaeeun/Documents/work_dir/answer.sh
# realpath가 맥에서 안먹음
반응형
'tips' 카테고리의 다른 글
linux tree 분석 (0) | 2022.04.10 |
---|---|
argoCD (0) | 2022.02.21 |
Pycharm, vim 에 black 세팅하기 (0) | 2021.09.16 |