Last active
December 22, 2015 06:39
-
-
Save liuyix/6432518 to your computer and use it in GitHub Desktop.
shell script: 返回当前script所在路径,即使是symlink也可以。
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# http://stackoverflow.com/a/422123 | |
# http://stackoverflow.com/questions/242538/unix-shell-script-find-out-which-directory-the-script-file-resides | |
dir=$(dirname $(readlink -f "$BASH_SOURCE")) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment