Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

To complete this question, you need to log into bluenose and run a tool called script. The command script file starts a shell and records

To complete this question, you need to log into bluenose and run a tool called script. The command script file starts a shell and records all output and all input you type at the shell prompt in the file file. When you are done, you type exit or press C-d to log out of the shell and cause script to write the data it has collected to the file file. The content of this file is exactly what was printed to the screen and what was entered, including keys like Backspace used to edit the command line. Thus, the content of file will look strange when inspected using a text editor such as emacs or vi. Inspecting its content using more file or less file works fine, though. Now, log into bluenose and enter the correct shell commands to perform the following actions. Use script a1q2.log to record your session in a file a1q2.log. Put a1q2.log under Subversion control using svn add . Do not use a text editor to accomplish any of the following steps. To keep the markers happy (and you want them to be happy), find out the correct command for each question without using script first. Once you know the right command for each question, record your answers using script. (a) Use the date command to print the current date and time. (b) Use the date command to print the current date and time in the following format: 10:46 PM AST on Jan 14, 2019 (c) Use a Unix command to print your current username. (d) Use a Unix command to print your current user ID. (e) Use the cat command to create a file user_info.txt that contains exactly 4 lines: your banner number, your first name, your last name, and your CSID. (f) Display the contents of the file you just created. (g) Display the lines of user_info.txt in sorted order. (Use a pipeline of two Unix commands to achieve this.) (h) Display only the alphabetically smallest line of user_info.txt. (Use a pipeline of three Unix commands to achieve this.) (i) Use a Unix command to verify that user_info.txt does indeed have 4 lines. The command should print the number of lines in the file and nothing else to the screen. (j) Create a file double_vision.txt that contains content of user_info.txt twice. (k) Change the permissions of double_vision.txt so you can read it but not write to it and nobody else has any access to this file at all. (l) Check that you have set the permissions of the file correctly. Put only the a1q2.log file under Subversion control. Do not add any of the files you created as part of your answers, such as user_info.txt and double_vision.txt.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access with AI-Powered 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

Students also viewed these Databases questions