Writing a Simple Shell Script
VI display
Line 1 # This script displays thedate, time, username and
Line 2 # current directory.
Line 3 clear
Line 4 echo “Date and timeis:”
Line 5 date
Line 6 echo
Line 7 echo “Your username is: `whoami`n”
Line 8 echo “Your current directory is:c”
Line 9 pwd
Answer the following question using the above shell scriptprogram:
⦁ I just created and save the above file in VI. To runit as a shell script program, what do I need to do next?
⦁ What would I type to run the program?
⦁ Why does the # sign do in the above program line 1and 2?
⦁ What does line 3 do in the program?
⦁ What does line 4 do in the program?
⦁ What does line 5 do in the program?
⦁ What does line 6 do in the program?
⦁ What does line 7 do in the program?
⦁ What does line 8 do in the program?
⦁ What does line 9 do in the program?
Expert Answer
Answer to Writing a Simple Shell Script VI display Line 1 # This script displays the date, time, username and Line 2 # current dir…