Skip to content

Instantly share code, notes, and snippets.

@BiosElement
Created February 19, 2010 07:54
Show Gist options
  • Select an option

  • Save BiosElement/308536 to your computer and use it in GitHub Desktop.

Select an option

Save BiosElement/308536 to your computer and use it in GitHub Desktop.
Bash: Find path to script location.
#!/bin/bash
#==========================
# bash - find path to script
#==========================
abspath="$(cd "${0%/*}" 2>/dev/null; echo "$PWD"/"${0##*/}")"
# to get the path only - not the script name - add
path_only=`dirname "$abspath"`
echo $path_only
#Actual Syntensity Launch
cd ${path_only}
./cbuild/src/client/Intensity_CClient -r $@
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment