Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

General Instructions: How to Submit Your Work You must submit your assignment answers electronically: Change into your subversion directory on bluenose: cd /csci2132/svn/CSID Create a

image text in transcribedimage text in transcribed

General Instructions: How to Submit Your Work You must submit your assignment answers electronically: Change into your subversion directory on bluenose: cd /csci2132/svn/CSID Create a directory to hold your assignment answers: mkdir al Change into your assignment directory: cd a1 Create files inside the al directory as instructed in the questions below and put them under Subversion control using svn add . Only add the files you are asked to add! Once you are done answering all questions in the assignment (or the ones that you are able to answer-hopefully all), the contents of your a1 directory should look something like this: alql.txt a1q2.log a1q3.log Submit your work using svn commit -m"Submit Assignment 1" (Q2) Practice: Various Unix utilities (12 marks) 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 orless 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 questiorn 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. (1) 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 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

Database Processing

Authors: David M. Kroenke

12th Edition International Edition

1292023422, 978-1292023427

More Books

Students also viewed these Databases questions