Created
February 6, 2018 16:10
-
-
Save hisener/458f6d60d3fb334127f80a1bd89d671c to your computer and use it in GitHub Desktop.
Examples from https://halilsener.com/the-dollar-sign-in-nix/
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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