Description
Purpose: Learn how to write basic shell script.
Write a report by answering the questions and upload the report
(named as Lab5_P1_FirstNameLastName.pdf or
Lab5_P1_FirstNameLastName.doc) to google classroom.
This lab assignment is related to the slides #12 to #14 in chapter 4 Part 1:
Now it is your turn to create your first shell script file by following the steps below.
Question 1) : What did you see in the output of step 3?
Question 2) : What did you see in the output of step 4?
Question 3): Attach a screenshot of the output in step 6.
Question 4): Describe the meaning of -n option in echo command.
Read the slides #13 in Chapter 4 and then answer the following two questions.
Question 5): Is “Simple Script” a comment? If not, what is the meaning of it or why we use it?
Question 6): Is “#!/bin/bash” a comment? If not, what is the meaning of it or why we use it in first line?
Part 2:
To discard the ./ before the script file name when executing it, we need to change the PATH variable’s value and add current working directory into it.
Question 7) : How many directories you can find in the output? Note: the directories are separated by colon.
Question 8) : Can you find errors prompted in step 9 ? If not, please briefly describe why there is no need to put ./ before the file name.
Question 9: Can you find the current working directory . in the PATH variable?
Question 10) : Can you find errors prompted in step 11 ? If yes, please explain why?
Part 3 – Optional:
This part is optional, but you will find more questions about this part in your next lab.
Questions:
Can you find some errors when executing the command in step 4? If yes, please point out which lines contain errors. Think about the correction in your next lab. Before the correction, you could pre-view the slides #15 #24 in Chapter 4.
Reviews
There are no reviews yet.