Skip to content

Instantly share code, notes, and snippets.

@haeramkeem
Created July 19, 2022 01:31
Show Gist options
  • Save haeramkeem/81f1db4569fe3a433bf72191180eadec to your computer and use it in GitHub Desktop.
Save haeramkeem/81f1db4569fe3a433bf72191180eadec to your computer and use it in GitHub Desktop.
Bash) Check if variable is set
#!/bin/bash
# @see https://stackoverflow.com/a/3601734
if [ -n "$1" ]; then
echo "You supplied the first parameter!"
else
echo "First parameter not supplied."
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment