----------------------------------------------------- Week 2 Notes for CST8129 - Ian Allen - idallen@ncf.ca ----------------------------------------------------- Remember - knowing how to find out an answer is more important than memorizing the answer. Learn to fish! RTFM! (Read The Fine Manual) ------- Review: ------- In Week 1 (see week01notes.txt) you learned about News groups and how to read the course announcements, post, and cancel articles. You logged in to the Linux Lab (T127) and then to ACADUNIX and verified your userid, password, and disk quota. You changed your password. ---------- This week: ---------- Monday is a holiday this week - section 011 has no scheduled lab hours. For this reason, sections 012 and 013 will also have no scheduled lab hours this week. I will be available during lab hours for consultation as you work on the material given below; but, no attendance will be taken. Anyone from any section may attend any lab period this week. Last week, people in section 014 were unable to complete their work on Friday because the network was misconfigured. That missed lab will be finished in the usual time on Friday this week. Section 014 students who can attend the section 012 or 013 time slots this week may also do the work before Friday, if there is room in the Lab. The work done is listed in the week01_labnotes.txt file. Work to be done this week: * readings: Chapter 1 - what is "fork"? "exec"? - download, compile, and run the simpleshell.c program - what is your "environment"? - what is your "umask"? [the book is wrong about 'subtracted' on p.17] - how do octal permission numbers (e.g. 755) relate to rwx style permissions? - what is your "working directory"? if a child changes directory, does it affect the parent process too? - what is the difference between a local and environment variable? - what are "stdin", "stdout", and "stderr"? - what is "redirection"? can I redirect stdout and stderr separately? - what is a "pipe"? - what do most "signals" do to a process? [the book is wrong about signal 0 on p.29 - see the textErrata.txt file] NOTE: Signal numbers and names may change from one version of Unix to another, especially signal numbers above 15. Don't memorize them. Most Unix systems agree on these numbers: HUP INT QUIT KILL and TERM - what key sequence usually generates a SIGINT signal? - estimate how many lines of C language code you would need to write to implement any one of the scripts in section 1.6. - copy one of the scripts in section 1.6 from the cdrom and have it ready for editing for next week. * review and remember the VI text editor - see the intro.html file for a quick review - find a Unix system on which to practice - currently (Monday) from the dial-up modem pool, you can use the "ssh" protocol to connect to machines in the Linux lab in T-127 using IP addresses 10.50.15.1xx where xx ranges from 01 to 24. The "ssh" protocol is available in such programs as "ewan" and "PuTTY", which you can download from the Internet. - connecting to the Lab does not work from on campus yet (Monday) - ADADUNIX has a new version of "vim" installed; you should be able to telnet into this machine when the network is repaired. - ssh is not installed on ACADUNIX yet; you must use telnet - the new editor is named "vim"; "vi" is the stock AIX version of VI that is missing most of the modern features (and help). * do an example - use VI to type in the script example 9.2 on p.387. - add the "-u" option to bash on the first line of the script - use your name in the comment instead of Barbara Bashful - pay careful attention to the use of back-quotes and double quotes; don't mix them up - use the Unix "diff" utility to compare your script with the one on the CDROM. In the Lab, you will find a copy of the CDROM under Unix directory ~alleni/cst8129/02f/cdrom - try the "-w" option to the diff command (what does it do?) - WARNING: some of the files on the CDROM are in DOS format, not Unix format. (DOS uses CR/LF at line end; Unix uses only LF.) The files in my directory have been converted to Unix format. - execute the script you typed in - see Example 9.1 for help in making it executable. - what is the difference between typing "./greetings" and just "greetings" when you enter them at the shell prompt? - In a future lab, I will ask you to edit this script and make a minor change to it while I watch over your shoulder. Your mark for the lab will depend on how quickly you perform the change using VI. * get help from your instructor if you can't remember your VI - see me during a scheduled lab time; or, make an appointment