Instantly share code, notes, and snippets.

Embed
What would you like to do?
#!/usr/bin/env bash
echo "----- Positional Parameters -----"
echo $0
echo $1
echo $2
echo $#
echo "----- All the positional parameters -----"
IFS='-'
echo $@
echo $*
echo "$@"
echo "$*"
echo "----- Iterate over the arguments -----"
for arg in "$@"
do
echo $arg
done
echo "----- More $ -----"
echo "The exit status of last command (it was echo): $?"
echo "background" >/dev/null & # >/dev/null to discard its output
echo "PID of the background command: $!"
echo "The current PID: $$"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment