Linux Shell Script – Special Variables #008 #shorts



Linux Shell Script – Special Variables #008 #shorts

Linux Shell Script - Special Variables #008 #shorts

👨🏼‍💻👨🏼‍💻👨🏼‍💻
There are special parameters that allow accessing all the command-line arguments at once. Both the parameters specify the command-line arguments.

$0 – The filename of the current script.
$# – The number of arguments supplied to a script.
$* – All the arguments are double quoted. If a script receives two arguments, $* is equivalent to $1 $2.
$@ – All the arguments are individually double quoted. If a script receives two arguments, $@ is equivalent to $1 $2.
$? – The exit status of the last command executed.
$$ – The process number of the current shell. For shell scripts, this is the process ID under which they are executing.

#keeponcoding #programming #shorts #linux #scripting #coding #shell #terminal #commands #education #teaching #learning #shortscraft #ubuntu