Skip to content

Instantly share code, notes, and snippets.

@Adron
Created April 16, 2016 23:43
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Adron/bf39c6807869e0899ef505fa2ff01c09 to your computer and use it in GitHub Desktop.
Save Adron/bf39c6807869e0899ef505fa2ff01c09 to your computer and use it in GitHub Desktop.
Pass Parameters to Bash Script
name=$1
if [[ -n "$name" ]]; then
echo "Got $name Parameter."
else
echo "argument error"
fi
@Adron
Copy link
Author

Adron commented Apr 16, 2016

The command is executed as ./pass-parameter some_name_value and the result will look like this.

Got some_name_value Parameter.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment