Skip to content

Instantly share code, notes, and snippets.

@carlessanagustin
Created March 15, 2019 10:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save carlessanagustin/9adcbeaabbbf5a6f9159cd6be623b4f3 to your computer and use it in GitHub Desktop.
Save carlessanagustin/9adcbeaabbbf5a6f9159cd6be623b4f3 to your computer and use it in GitHub Desktop.
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