Skip to content

Instantly share code, notes, and snippets.

@vpnwall-services
Last active May 14, 2018 20:49
Show Gist options
  • Save vpnwall-services/60a9a9a6020a28d0a5ee55c88aa93bf2 to your computer and use it in GitHub Desktop.
Save vpnwall-services/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
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