Skip to content

Remembering the shells special variables…

I can never seem to remember what all of these default parameter variables are. I found this small shell script that prints them out when I forget.

#!/bin/sh -vx
#######################################################
# example_1.1 (c) R.H.Reepe 1996 March 28 Version 1.0 #
#######################################################
echo "Script name is [$0]"
echo "First Parameter is [$1]"
echo "Second Parameter is [$2]"
echo "This Process ID is [$$]"
echo "This Parameter Count is [$#]"
echo "All Parameters [$@]"
echo "The FLAGS are [$-]"

Found that code here along with some other neat stuff.

Related posts:

  1. Spawning sub-shells Creating sub-shells in bash is simple: just put the commands...
  2. Do you have parasites? Found a neat script on doxdesk.com. It essentially checks your...
  3. Remembering RepTIDE Well, the new header is up. I’m not really thrilled...

Post a Comment

Your email is never published nor shared.

SEO Powered by Platinum SEO from Techblissonline