If we want to use system variables then see following example:-
set 10 20 30
echo $1
output = 10
in above given small program we can see that set keyword sets the system variables values and when we echo $1 then it prints our set variable value.
In linux when we pass parameter in shell script then Linux automatically create a variable $#.
$# counts total number of command line argument which has passed.
set 10 20 30
echo $1
output = 10
in above given small program we can see that set keyword sets the system variables values and when we echo $1 then it prints our set variable value.
In linux when we pass parameter in shell script then Linux automatically create a variable $#.
$# counts total number of command line argument which has passed.
No comments:
Post a Comment