Skip to content

Instantly share code, notes, and snippets.

@woods
Created January 30, 2014 17: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 woods/8713516 to your computer and use it in GitHub Desktop.
Save woods/8713516 to your computer and use it in GitHub Desktop.
Command line options in bash
#!/bin/bash
if [ "$1" == "-t" ] ; then
test_mode='true'
else
if [ "$1" == "" ] ; then
test_mode='false'
else
echo "Unrecognized option \"$1\""
echo "Usage: asdf.sh [-t]"
exit 1
fi
fi
echo $test_mode
@Rupayan36
Copy link

hh

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment