Skip to content

Instantly share code, notes, and snippets.

@flipsi
Created April 15, 2016 10:51
Show Gist options
  • Save flipsi/996a7509f6ab9c95eb79db3d727f1663 to your computer and use it in GitHub Desktop.
Save flipsi/996a7509f6ab9c95eb79db3d727f1663 to your computer and use it in GitHub Desktop.
Shellscripting: cd to path of script itself
#!/usr/bin/env bash
CURRENT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
echo $CURRENT_DIR
cd $CURRENT_DIR
touch foobarbaz
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment