Skip to content

Instantly share code, notes, and snippets.

@nuada
Created January 3, 2017 13:44
Show Gist options
  • Save nuada/099c079b56fba2e7efbf544f238a9697 to your computer and use it in GitHub Desktop.
Save nuada/099c079b56fba2e7efbf544f238a9697 to your computer and use it in GitHub Desktop.
Test if script was called with some flag.
#!/bin/bash
if [[ " $* " =~ ' flag ' ]]; then
echo "Flag is present"
else
echo "Flag is missing"
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment