November 2024
M T W T F S S
 123
45678910
11121314151617
18192021222324
252627282930  

Categories

November 2024
M T W T F S S
 123
45678910
11121314151617
18192021222324
252627282930  

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>