Skip to content

Instantly share code, notes, and snippets.

@mylesjao
Last active August 29, 2015 14:01
Show Gist options
  • Save mylesjao/539fdd222b21c9496b10 to your computer and use it in GitHub Desktop.
Save mylesjao/539fdd222b21c9496b10 to your computer and use it in GitHub Desktop.
get script file path and set to APP_HOME environment variable
#!/bin/bash
SCRIPT_DIR=$(readlink -f $(dirname ${BASH_SOURCE[0]}))
# assume this script is in APP_HOME/bin directory
cd $SCRIPT_DIR/..
APP_HOME="`pwd -P`"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment