Skip to content

Instantly share code, notes, and snippets.

@sechiro
Created February 16, 2013 09:48
Show Gist options
  • Save sechiro/4966281 to your computer and use it in GitHub Desktop.
Save sechiro/4966281 to your computer and use it in GitHub Desktop.
You can get script the absolute directory name on your Linux or Mac OS X machine.
#!/bin/bash
SCRIPT_DIR=$(cd $(dirname $0);pwd)
# $(dirname $(readlink -f $0)も可能だが、こちらはMac OS Xのreadlinkでは動かない。(-fオプションがないため)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment