CS 497C - Homework 7 - Name:_________________ DUE: Friday, December 7 (in class) Please show all work on a separate sheet attached to this sheet. (hint: Self-Test and Exercises of Chapter 11, 18, 19) (50 points - 5 points for each problem) + (5 bonus points) 1. (1) What is a socket? (2) What is FQDN? 2. (1) Name some common networking daemons and their functions. (2) How do you use talk to communicate with user brenda on host kirk? (3) When using ftp, how do you change your directory on the lcoal machine? 3. (1) How is a TCP/IP network different from a telephone network? (2) Why is TCP termed a reliable protocol? 4. (1) How will you find out the port number finger uses? (2) If talk throws up a message Your party is refusing messages, what could be the cause? (3) You copied a graphics file with ftp, and the file appears to be corrupted. What could be the possible reason? Assume the original file is not corrupted. 5. (1) If a script calls itself, what do you think will happen? (2) If a script is run as foo -l -t bar[1-3], what are the values of $# and $*? Does it make any difference if the options are combined? 6. (1) What is the exit status of a command? What is its normal value, and where is the value stored? (2) Can you use sh < foo.sh instead of sh foo.sh to execute the script? 7. If x has the value 5, and you reassign it with x="expr $x + 10", what is the new value of x? What would have been the value if single quotes were used? 8. (1) What could be the problem with this command? set `grep -c "A HREF" catalog.html` (2) What will this statement do? filename=${1:-emp.lst} 9. (1) Why won't the exit command, when placed in a shell script like this, terminate the script? How do you get it over. (statements; exit) (2) Why isn't the exit statement used inside a function to return control to the calling program? 10. (1) You have to run a job at night and need to have both the output and error message in the same file. How will you run the script? (2) A script containg the statement while [${count:=1} -lt 50] is not executing the loop at all. What could be he possible reason? 11. There are at least six syntactial mistakes in this program. Locate them. (Line numbers are shown on left.) 1 ppprunning = yes 2 while $ppprunning = yes ; do 3 echo " Internet Menu\n 4 1. Dial out 5 2. Exit 6 Choice: 7 read choice 8 case choice in 9 1) if [ -z "$ppprunning" ] 10 echo "Enter your username and password" 11 else 12 chat.sh 13 endif ; 14 *) ppprunning=no 15 endcase 16 done