Skip to content

Instantly share code, notes, and snippets.

@andrealbinop
Last active January 21, 2016 15:07
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 andrealbinop/d23fb88de651b4cd33d9 to your computer and use it in GitHub Desktop.
Save andrealbinop/d23fb88de651b4cd33d9 to your computer and use it in GitHub Desktop.
File with usefull shell commands
#!/bin/bash
# fail on first error
set -e
# cd to the dir containing the script
cd $(readlink -f $(dirname $0))
# if file exists...
if [ -f $file ];then
echo "file exists: $file"
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment