May 2024
M T W T F S S
 12345
6789101112
13141516171819
20212223242526
2728293031  

Categories

May 2024
M T W T F S S
 12345
6789101112
13141516171819
20212223242526
2728293031  

BASH – Default variables for a bash shell

$? => Return code of previous command
$0 => Name of the script itself
$1-9 => Argument number 1 to 9 given to script
${10} => Argument number 10 given to script
$# => Total number of arguments given to script
$@ => All arguments given to script but as an individual string values
“$*” => All arguments given to script as a single string value (must be in double quotes)
$$ => Process id of the script
$! => Process id of last job run in backgroup
$_ => Last argument given to previous command

Leave a Reply

You can use these HTML tags

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>