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

1. [10 marks] Give concise answers to the two questions below. Use either emacs

ID: 3878190 • Letter: 1

Question

1. [10 marks] Give concise answers to the two questions below. Use either emacs or vi to type your answers in one single plain ASCII file, with a1q1.txt as its name. Each line of this file should have at most 80 characters.

(i) [4 marks] A student wrote a program and was testing it under UNIX. However, there was a bug in this program, and the program kept running without generating useful output. The student would like to terminate the execution of this program. There is a special character (or metacharacter) that he could type to terminate it. What is this special character?

(ii) [6 marks] Suppose that in my current working directory, there is a sub-directory named csci2132. Its permission is set to 666. When I entered a command cd csci2132, I got an error message. Why was this command unsuccessful? Give a detailed explanation. In addition, give a new command that I can run such that, after this new command is executed, the command cd csci2132 can successfully change my current working directory to csci2132.

use putty

Explanation / Answer

1. control-c

control-c is used to terminate the execution of a program in unix. control-z suspends the program but doesn't kill the program while control-c kills the process/program

2. When 666 is set for a directory, the directory can't be accessed. The reason is, to access directories, the x(execute/search in case of directories) needs to be set. Otherwise, it will throw an error while trying to access the directory.

The command to be used to gain access is chmod +x csci2132

Hope this helps. Do Upvote :)