Skip to content

Instantly share code, notes, and snippets.

@radamhu
Created July 15, 2022 08:24
Show Gist options
  • Save radamhu/8f4cef6358ad10de5b42ea4623495179 to your computer and use it in GitHub Desktop.
Save radamhu/8f4cef6358ad10de5b42ea4623495179 to your computer and use it in GitHub Desktop.
#!/bin/bash
# source : https://www.howtogeek.com/442332/how-to-work-with-variables-in-bash/
echo "There were $# command line parameters"
echo "They are: $@"
echo "Parameter 1 is: $1"
echo "The script is called: $0"
# any old process so that we can report on the exit status
pwd
echo "pwd returned $?"
echo "This script has Process ID $$"
echo "The script was started by $USER"
echo "It is running on $HOSTNAME"
sleep 3
echo "It has been running for $SECONDS seconds"
echo "Random number: $RANDOM"
echo "This is line number $LINENO of the script"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment