Question: 1 . Special parameters: $@ and $ * The special parameter $@ is referenced twice in the out script (

"1. Special parameters: $@ and $*
The special parameter ""$@"" is referenced twice in the out script (p 436 in the text).
Explain what would be different if the parameter ""$*"" were used in its place.
$ cat out2
if [ $# -eq 0]
then
echo ""Usage: out2[-v] filenames"" 1>&2
exit 1
fi
if [""$1""=""-v""]
then
shift
exec less ""$@""
else
exec cat --""$@""
fi
------------------------------------------------------------------------
2. Write a script lab7_5 that tells you whether the permissions for two files, whose names are given as arguments to the script, are identical.
If the permissions for the two files are identical, output the common permission field.
Otherwise, output each filename followed by its permission field.
Hint: Start by identifying the command that will return the permissions for a given file, then make a pipeline which takes the output of that command,
and uses awk or the the cut utility or some other method to isolate just the permissions string.
Then, in your script, use that pipeline to trap that output into two separate variables or each of the files passed as arguments.
Then implement a comparison between the two variables.
Your script should look for two filename arguments when it is called and exit with a message if
a) there are not two arguments and
b) either of the files do not exist
Paste your completed script below:
Paste below the output of a comparison of both cases: two files where permissions match, and two files where they do not:
------------------------------------------------------------------------
3.
Write a Bourne shell script lab7_6 that takes the side of a cube as a command line argument and displays the volume of the cube.
Paste your script and two sample executions below:
(you may pick values for the side XX04 of the cube.)"

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!