LAB 5 Week 6 Oct 7th. 48 pts Name __________________________________ Due at the end of lab Oct 14th. Chapter 6, a little bit of chapter 11 and the Online manual pages for some extra information. Remember the vi handout, cat > file, >> = append 1) On page 90 of the text there is a description of the /etc/passwd file format. Use the grep command on the /etc/passwd file to print your own user account entry line on the screen. 14 pts grep account /etc/passwd where account is YOUR own login name Write out the complete line *WITH LABELS*. _______:____________:______:_____:___________________:__________:_______ _________________________________________________________________________ _________________________________________________________________________ 2) The group ID number that is listed in the /etc/passwd file also has a name. It is stored in the /etc/group file. What is the format for that file? ( give an example and label it also.) Man F group 4 pts _________________________________________________________________________ _________________________________________________________________________ 3) Use the echo command to display your PATH variable. (echo $PATH) Write it down. 1 pt _________________________________________________________________________ _________________________________________________________________________ 4) There are several other environment variables. What are the values for 11 pts HZ ____________ EDITOR ___________ LOGNAME ___________ PAGER ____________ PS1 ___________ SHELL ___________ HOME ____________ TERM ___________ ENV ___________ TZ ____________ LINES ___________ 5) What shell variables are set up in your .profile file? 2 pts _________________________________________________________________________ _________________________________________________________________________ 6) What variables are listed on page 98 of the text that aren't listed in your environment? 2 pts _________________________________________________________________________ _________________________________________________________________________ 7) Change the value of your primary prompt. What is it now and what was the command you used? 4 pts ________________________________________________________________________ 8) How would you put spaces in our prompt? For example what would the command to change your prompt to "ready -> " ? 2 pts ________________________________________________________________________ 9) If you start up another shell, "type /bin/ksh at the !$ prompt" what is your prompt now? 1 pt ________________________________________________________________________ 10) Change this prompt to ">>". What commands did you enter? 1 pt _________________________________________________________________________ 11) What is the stty command and what does it do? 2 pts man stty ... _________________________________________________________________________ _________________________________________________________________________ 12) The -a option to stty has several more lines of information. What do the following entries mean? You don't have to explain all the fields. 2 pts intr = DEL; quit = ^\; erase = ^H; eof = ^D; eol = ^@; start = ^Q; stop = ^S; _________________________________________________________________________ _________________________________________________________________________ 13) The stty command has some "echo" options. What do they do? 4 pts _________________________________________________________________________ _________________________________________________________________________ 14) Use vi(C) if you can, to add a shell function to your .profile. Please add the lines at the bottom. When you are done run the following command. ". ./.profile " NOTE !!! copy your .profile to profile.sav BEFORE you start. Once you are done type cls. Don't type bye until you are ready to log out. No points just FYI. cls(){ bye(){ clear clear } exit } There are other commands you can use. Try tput home, or tput cup 12 35.