Created
April 16, 2016 23:43
-
-
Save Adron/bf39c6807869e0899ef505fa2ff01c09 to your computer and use it in GitHub Desktop.
Pass Parameters to Bash 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
name=$1 | |
if [[ -n "$name" ]]; then | |
echo "Got $name Parameter." | |
else | |
echo "argument error" | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The command is executed as
./pass-parameter some_name_value
and the result will look like this.Got some_name_value Parameter.