티스토리 뷰

반응형
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
댓글
반응형
공지사항
최근에 올라온 글
최근에 달린 댓글
Total
Today
Yesterday
«   2024/12   »
1 2 3 4 5 6 7
8 9 10 11 12 13 14
15 16 17 18 19 20 21
22 23 24 25 26 27 28
29 30 31
글 보관함