Unit 3 Chapter Exercises
Chapter 7, p. 251, Exercises 1, 3, 4, 8
1. The shell waits for the command to finish executing. You can send the command to the background by using "&".
3. A PID number is an identification number assigned to a command running in the background, which can be used to differentiate between commands. The PS (process status) utility.
4. a. $ ls section*
b. $ ls section[1-3]
c. $ ls i*
d. $ ls *
8. a. $ grep \$Id < *.c > id_list
b. $ grep -i suzi < addresses
c. $ grep -il memo *.txt > memoranda_files
d. $ file /usr/bin/* | grep "Again shell script" | sort –r
Example d uses grep as a filter.
Chapter 9, p. 356, Exercises 1, 2, 3, 4, 6, 8
1. a. $ whereis date - tells us where the executable file "date" is located, according to the current $PATH value. The result tells us that the executable file "date" is found in /bin b. $ echo $PATH - tells us what is the content of the $PATH environment parameter. Each path is separated by a colon ":". c. $ cat > date - takes standard input (stdin) from the keyboard and put the keyed in content into a new file in the current directory called date. The file "date" usually has a permission of 644 or 600 (depending on the computer implementation), which means that it is not executable. d. $ ./date - attempts to execute the file ./date, but it is not executable (by default). Again, depending on the implementation of the system, it may return "permission denied", or possibly search for the next directory from the $PATH environment variable, which outputs the current date and time. 2. First way is to copy the script to your directory and add the execute permission. The second way is to call the correct shell interpreter program directly. No, the shell needs both execute and read permissions to run the script. 3. a. export PATH=/usr/local/bin;/usr/bin/;/bin;/usr/kerberos/bin;/pwd b. it is determined by the order in the path statement. the command will...
Please join StudyMode to read the full document