Using the following script:
#This is a shell script
echo $name1 "is the first parameter"
echo $name2 "is the second parameter"
echo $0 "was executed with" $# "parameters on the command line."
Explain the function of each line in the script, assuming that it is executed as follows:
knoppix[knoppix]$ myscript joe mary bob© BrainMass Inc. brainmass.com March 21, 2019, 6:32 pm ad1c9bdddf
knoppix[knoppix]$ myscript joe mary bob
This line is to print out the number of arguments. We have 3 of them, joe, mary, bob
This line is to print our the name of the script. So it is myscript.
This line is to print out the first argument. So it is joe.
echo $2 ...
The expert uses the Linus operator to explain the function.