EnderUNIX Team.


EnderUNIX tips

Mail to My Friend , Home Page

[ Shell Scripting ]

"Special Shell Variables" - Mehmet Uluer - (2006-11-14 14:42:27)   [10960]

Variable ==> Meaning
------------------------------
$0 ==> Name of script
$1 ==> Positional parameter #1
$2-$9 ==> Positional parameters #2-#9
${10} ==> Positional parameter #10
$# ==> Number of positional parameters
"$*" ==> All the positional parameters (as a single word)
"$@" ==> All the positional parameters (as separate strings)
${#*} ==> Number of command line parameters passed to script
${#@} ==> Number of command line parameters passed to script
$? ==> Return value
$$ ==> Process ID (PID) of script
$- ==> Flags passed to script (using set)
$_ ==> Last argument of previous command
$! ==> Process ID (PID) of last job run in background

Mail to My Friend , Home Page