Skip to content

Instantly share code, notes, and snippets.

@thegitfather
Last active August 29, 2015 14:25
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 thegitfather/babd5d6d195032d1e318 to your computer and use it in GitHub Desktop.
Save thegitfather/babd5d6d195032d1e318 to your computer and use it in GitHub Desktop.
bash test examples
#!/bin/bash
# test if some command exists - like 'curl'
command -v curl >/dev/null 2>&1 || { echo "please make sure curl is properly installed. aborting..." >&2; exit 1; }
echo "ok all fine. proceeding..."
exit 0
# test if file exits
if [ -f "$HOME/.bash/bash_aliases.sh" ]; then
source "$HOME/.bash/bash_aliases.sh"
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment