Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Pass Parameters to Bash Script
name=$1
if [[ -n "$name" ]]; then
echo "Got $name Parameter."
else
echo "argument error"
fi
@Adron

This comment has been minimized.

Copy link
Owner Author

@Adron 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