Question: Chapter 8 , Lab 1 : Writing and Executing a Shell Script ( 3 0 Minutes ) Learning Objectives and Outcomes In this lab you

Chapter 8, Lab 1: Writing and Executing a Shell Script
(30 Minutes)
Learning Objectives and Outcomes
In this lab you will leam to wrile and execule a shell script that includes cumments. You will use chmod to make the file that
introduces posibonal parameters.
Reading
Read "Wriling and Execuling a Simple Shell Scripk" on pages 284-269 of Sobell.
Procedure
echo "hi there cronet"
Ue eat to verify the cuentents of shart and then try to execule it.
Ue k-I to dipplay the permisions for shart. Read the tip an Sobell, page 286.
Une ehmod (Sobell) to make the file execulable.
Diplay the permisions for short.
Try eveculing the file again.
Add a fine that starts with a!(Sobell) to the beyinaing of shart to make nure it is eveculed by bath.
Add a conmcal linc (Sobell) lo shart that explains what the script does.
obenmind line the icript was called wilh.
Wrile and execule a script ramed first that diplays (scnda to slandard oulput) the fird argument on the command line it was
called wilh. Include the if line and a comencmi. Remember to make the file execulable.
Wrile a shell script numed eptobak that cupics the file named by is finst argunent to a file wilh the same name with the
filename exlension of .bak.
Thus, if you call the script wilh the argument first (and a fle named first exists in the working directory), afler the acript rums
you would have two files: firnt and fint loak.
Demorsirale that the icript cpintbak woek properly-
Use twuch lo creale a file whaie name has a spacr in it.
What happens when you give that filename as an argument to eptehak frum the previous slep?
Modify the cptahak scripl frum the previous step by quoting the poilisonal parameters in the ep line.
Now what hoppens when you wec the script to make acupy of a file with a sPAct in ils name?
 Chapter 8, Lab 1: Writing and Executing a Shell Script (30

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