Skip to content

Instantly share code, notes, and snippets.

@dblalock
Last active August 29, 2015 14:04
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 dblalock/367252f15d12189737b8 to your computer and use it in GitHub Desktop.
Save dblalock/367252f15d12189737b8 to your computer and use it in GitHub Desktop.
Bash remove file if exists
function removeIfExists {
if [ -e "$1" ]; then
echo removing "$1"
rm -rf "$1" 2>&1 > /dev/null
fi
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment