Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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?
image text in transcribed

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions

Question

How is slaked lime powder prepared ?

Answered: 1 week ago

Question

Why does electric current flow through acid?

Answered: 1 week ago

Question

What is Taxonomy ?

Answered: 1 week ago

Question

1. In taxonomy which are the factors to be studied ?

Answered: 1 week ago