Parameter description
1:$# indicates the number of arguments passed into the script
2:$* indicates the execution of a script passed in the parameter list
3:$$ represents the Process ID
4:[email protected] means that the execution script passes all parameters
5:$0 represents the execution script name
6:$1 represents the first parameter
7:$2 represents the second argument
8:$? Indicates script execution status 0 Normal, other indicates error
Experiments and results (shelltest.sh)
#!/bin/SHEcho "parm number is: $#"Echo "parm list is: $*"Echo "All parm are: [email protected]"Echo "process is: $$"Echo "file name is: $"Echo "The first Parm is: $"Echo "stat is: $?"
Implementation and Results
Execution: Sh shelltest.sh "the first Parm" "The second Parm"
Parm number Is:2
Parm List Is:the First parm the second parm
All Parm is:the First parm the second parm
Process is:28669
File name is:shellTest.sh
The first parm is:the first parm
Stat is:0
Reprinted: 51859503
Shell script variable $#,$*,$$,[email protected], meaning of $0,$1,$2,$?