Skip to content

Instantly share code, notes, and snippets.

@hisener
Created February 6, 2018 16:10
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 hisener/458f6d60d3fb334127f80a1bd89d671c to your computer and use it in GitHub Desktop.
Save hisener/458f6d60d3fb334127f80a1bd89d671c to your computer and use it in GitHub Desktop.
#!/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