Skip to content

Instantly share code, notes, and snippets.

@kevinhughes27
Created April 4, 2013 16:17
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 kevinhughes27/5311785 to your computer and use it in GitHub Desktop.
Save kevinhughes27/5311785 to your computer and use it in GitHub Desktop.
Sets the directory for execution to be the lowest directory. This is helpful for ensuring relative paths work inside your program
#!/bin/bash
set -e
cd $(readlink -f $(dirname $0))
exec ./exe $*
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment