Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

This assignment is worth 6 points total, partial credit will be given, *********

ID: 3863398 • Letter: T

Question

This assignment is worth 6 points total, partial credit will be given, ***************************************************** * USE UBUNTU TERMINAL MODE COMMANDS ONLY * * DO NOT USE ANY EDITORS TO CREATE THIS PROGRAM * ***************************************************** 1) Create a file called lastNameFirstNameInitialpgm3.sh ex: robinsonMpgm1.sh 2) Append to the above file the necessary commands that when this file is executed it will display the following: - Using your own set of multi-line comments enter your program identification as described in the Syllabus, example: <

Explanation / Answer

By reading the question, it seems like you need to print the line: "Using your own set of multi-line comments enter your program identification as described in the Syllabus, example: <" via the shell-script file.

These are the details I could extract from the question so answering for the same...

You will have either $ (for normal user) or #(for root user) sign on your ubuntu terminal after it displays the username and hostname. So, you need to do the following things in sequence to make this thing work. I am answering from Ubuntu itself and answering after testing it,

(1) write a command : cat > lastNameFirstNameInitialpgm3.sh (replace the first name and last name with yours)

(2). Press Enter. The cursor will go in the next line. This means that you have created the file with this name. And now it is asking to enter content inside the file.

(3). Now, you are not supposed to write anything, you will append the code as it is mentioned. So, we will first close this file, then again open it and then write the command OK..? So, close this file by pressing Ctrl + D

This means your file has been created. Now, you need to append the content in the file.

(4). The command for printing some data on the terminal window is 'echo' and the operator you need to use for append is the redirection operator >>. This is named as the redirection operator which redirects the content from the left-hand side to the file specified on its right hand side.

So, you need to write something like

echo "Using your own set of multi-line comments enter your program identification as described in the Syllabus, example: <" >> lastNameFirstNameInitialpgm3.sh

(5). This means you appended the line in the file. Now, to run this shell-script, you should use the sh command.

So, type sh lastNameFirstNameInitialpgm3.sh and press Enter.

This will display that particular line.

Note: If you do not want to use the >> operator, you can directly write inside the file when it is created i.e. when you have created a file using cat command and the cursor goes to next line, that means this file is created and opened in writing mode. So, you can directly write inside it this echo ..... line and then press Ctrl + D and then run it.

Please comment if there is any query. Thank you. :)