Skip to content

Instantly share code, notes, and snippets.

@hellojinjie
Created September 10, 2013 07:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hellojinjie/6506126 to your computer and use it in GitHub Desktop.
Save hellojinjie/6506126 to your computer and use it in GitHub Desktop.
神奇的一段 shell 代码用来判断当前脚本所在的位置,从 hadoop 的启动脚本里复制过来的
this="${BASH_SOURCE-$0}"
dir=$(cd -P -- "$(dirname -- "$this")" && pwd -P)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment