Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Shell Variables
#!/usr/bin/env bash
echo "I was called with $# parameters"
echo "My name is: $0"
echo "All parameters are: $@"
echo "With @"
for var in "$@"
do
echo " Parameter: $var"
done
echo "With *"
for var in "$*"
do
echo " Parameter: $var"
done
echo "This contains the exit value of the last run command: $?"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.