symlinkを考慮すると、スクリプトのディレクトリを取得するには dirname $0 では不十分 - grep Tips *
https://www.greptips.com/posts/1266/
#shell
#URL