Last active
July 20, 2023 14:11
-
-
Save rafaelmaeuer/fe2fb6af4dbee0791195ded8de2f7b4c to your computer and use it in GitHub Desktop.
https://stackoverflow.com/questions/6482377/check-existence-of-input-argument-in-a-bash-shell-script
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
# variable $# is the number of input arguments | |
if [ $# -eq 0 ] | |
then | |
echo "No arguments supplied" | |
fi | |
# check if an argument is an empty string or not | |
if [ -z "$1" ] | |
then | |
echo "No argument supplied" | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment