Last active
May 14, 2018 20:49
-
-
Save lemajes/60a9a9a6020a28d0a5ee55c88aa93bf2 to your computer and use it in GitHub Desktop.
[Ask parameter in Bash] Function for asking var to user and check if it's empty or not #bash #variable #loop #example
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
echo -e "\nEnter your var :" | |
VAR=$1 | |
if [ -z $VAR ] | |
then | |
clear | |
echo -e "\nvar is empty, try again ..." | |
else | |
echo -e "\nvar is okay, lets do this ..." | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment