Question: 2 . Comment every line in the script bellow and tell what each line is doing. Look up the command in the man pages if

2. Comment every line in the script bellow and tell what each line is doing. Look up the command in the man pages if you don't understand it. The script name is 'myargs'. Copy the script and run it on your system and give detailed comments of what each line is doing.
-----------------------------------------------------
#!/bin/bash
# Script name: myargs
#
# Date:
# Name:
# Script to test command line arguments
if [ $# ==0] ; then
echo "Usage: $(basename $0) arg1 arg2... argn" \
1>&2
exit 1
fi
echo "The name of this script is $0."
echo "The arguments are $*"
echo "The first argument is $1"
echo "The second argument is $2"
echo "The number of arguments is $#"
previous_args=$*
set niel khail nobo
echo "All the positional parameters are $*"
echo "The number of positional parameters is $#"
echo $previous_args
set --
echo "Current args after -- are : $*"
set $previous_args
echo $*

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 Finance Questions!