Created
July 19, 2022 01:31
-
-
Save haeramkeem/81f1db4569fe3a433bf72191180eadec to your computer and use it in GitHub Desktop.
Bash) Check if variable is set
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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