) , , . , , , . , , . . - , , ! -------------------------------------------------------- : phone -------------------------------------------------------- phone  , -   phone   phone s russ phone 1 : 2 # @(#) phone v1.0 Maintain telephone database Author: Russ Sage 2 4 if [ $# -gt 0 ] 5 then echo "phone: argument error" >&2 6 echo "usage: phone" >&2 7 exit 1 8 fi 10 BASE="$HOME/.phone.list" 12 while : 13 do 14 echo " 16 phonebase = $BASE 18 PHONE MENU 19 ---------- 20 add name to list 21 delete name from list 22 edit list 23 search for name in list 24 view complete list 25 - exit program 27 Press a,d,e,s,v or : \c" 28 read RSP 30 case $RSP in 31 "") exit 0 32 ;; 33 a|A) echo "\nEnter name to add ( to exit ): \c" 34 read NAME 35 if [ "$NAME" = "" ] 36 then continue 37 fi 38 echo "Enter description of person: \c" 39 read DESC 40 echo "Enter number to add: \c" 41 read NUM 42 echo "$NAME\t$DESC\t\t\t$NUM" >> $BASE 43 sort -t" " +1 -1.3b -o $BASE $BASE 44 ;; 45 d|D) echo "\nEnter name to delete ( to exit ): \c" 46 read NAME 47 if [ "$NAME" = "" ] 48 then continue 49 fi 50 sed -e "/$NAME/d" $BASE.new 51 mv $BASE.new $BASE 52 ;; 53 e|E) vi $BASE 54 ;; 55 s|S) echo "\nEnter name to search: \c" 56 read NAME 57 echo "\n----------------------------------" 58 grep -y "$NAME" $BASE 59 echo "------------------------------------" 60 ;; 61 v|V) echo "\n\tPhone List\n\t---------" & 62 more $BASE 63 echo "\nhit \c" 64 read RSP 65 ;; 66 *) echo "Not a valid command" 67 ;; 68 esac 69 done   BASE DESC , NAME , NUM , RSP  phone? . , . . , - . ? . - , , . , , . phone? Phone - . - , phone , : , , , . , , - . $HOME/.phone.list. Phone , - . , phone , , - - shell HOME. . , . - . : ------------------------ | | | phonebase = /usr/russ/.phone.list | | PHONE MENU | ---------- | add name to list ( ) | delete name from list ( ) | edit list ( ) | search for name in list ( ) | view complete list ( ) | - exit program ( ) | | Press a,d,e,s,v or : | , - . , , - . , - . , - .  1. $ phone a russ sage unix master 123-4567 . , - phone , . 2. $ phone V .  4-8 . phone - , . phone , . 10 BASE . HOME . 12-69 while. , - , . - echo. , echo - , . 28 , 30-68 case, . - , . a, . ( , ). , , , . - , - . - , , . - . , , . , . , . - , . d, 45. - . , - continue while . sed, , - . , - 51 . , - , . , . , , . . . - vi . 53 - vi . vi, , . "" - . . vi, - . shell . shell', . phone , ZZ, :x :wq. 55 , , , grep . grep 58 -y, - . , , . , . 61. - . . , , - . . more. more - , . ( m 4 , more.) 63 , . 64 . - , . , , . 66 . , - , *. , case while . ---------------------------------------------------------- : office ---------------------------------------------------------- office  - , .   office   office , m office 1 : 2 # @(#) office v1.0 Office Manager Author: Russ Sage 2 4 if [ $# -gt 0 ] 5 then echo "office: argument error" >&2 6 echo "usage: office" >&2 7 exit 1 8 fi 10 while : 11 do 12 c 13 set `date` 14 echo " 15 $1, $2 $3 $4 17 Office Menu 18 ----------- 19 Mail 20 News 21 Calendar 22 Phone 23 Automatic Reminders 24 Shell Command 25 to exit 27 press m,n,c,p,a,s or : \c" 29 read CMD 31 case $CMD in 32 "") exit;; 33 m|M) if [ -s /usr/spool/mail/$LOGNAME ] 34 then echo 35 ll /usr/spool/mail/$LOGNAME 36 echo "\nWould yuo like to see it ( y/n): \c" 37 read CMD 38 if [ "$CMD" = "y" ] 39 then echo 40 mail 41 fi 42 else echo "\nNo mail today" 43 fi 44 echo "\nhit \c" 45 read CMD;; 46 n|N) PWD=`pwd` 47 cd /usr/news 48 echo "\nThe following files are news item in /usr/news:\n" 49 lc 50 echo "\nEnter filename or to exit: \c" 51 read NAME 52 while [ "$NAME" != "" ] 53 do 54 if [ -s $NAME ] 55 then echo "\n-------------------" 56 cat $NAME 57 echo "---------------------" 58 else echo "$NAME is not a news file" 59 fi 60 echo "\nEnter filename or to exit: \c" 61 read NAME 62 done 63 cd $PWD;; 64 c|C) echo "\n" 65 today 66 if [ -s $HOME/calendar ] 67 then echo "Calendar file:\n`ll $HOME/ calendar`" 68 echo "\nCalendar notifications:" 69 PWD=`pwd` 70 cd $HOME 71 calendar 72 cd $PWD 73 echo "\nCheck your mail for calendar notifications" 74 else echo "\nYou do not have a calendar file at $HOME" 75 fi 76 echo "\nhit \c" 77 read CMD;; 78 p|P) phone;; 79 a|A) greet 80 $HB/at 11:45 echo ^GLunch in 15 minutes 81 $HB/at 16:45 echo ^GShift change in 15 minutes 83 echo "\nYou will receive notices at 11:45 & 4:45" 84 echo "\nWould you like to leave some reminders (y/n): \c" 85 read CMD 86 if [ "$CMD" = "y" ] 87 then echo "\nThe syntax is: at HR:MN executable_phrase" 88 echo "The time now : `date '+%T'`" 89 echo "\n\ncmd ( to exit): \c" 90 read CMD 91 while [ "$CMD" != "" ] 92 do 93 eval $CMD 94 echo "cmd ( to exit ): \c" 95 read CMD 96 done 97 fi;; 98 s|S) echo "\nenter command: \c" 99 read CMD 100 eval $CMD 101 echo "\nhit \c" 102 read CMD;; 103 *) echo "\nInvalid command" 104 echo "\nhit \c" 105 read CMD;; 106 esac 107 done   CMD HOME , LOGNAME Shell-, NAME  office? UNIX , . - UNIX, . , - , , - . . , , UNIX, . '? , , . , . office? Office - , . office , , . - UNIX, . - , . office , . , . , , - . , at, shell, office. , . . : ----------------------- | | Fri, Jun 20 16:18:23 | | Office Menu | ----------- | Mail () | News () | Calendar () | Phone () | Automatic Reminders ( ) | Shell Command ( shell) | to exit () | | press m,n,c,p,a,s or : | UNIX date. . , , . . . ( ), "no mail today" ( ). , - ls , - . "yes" (), - UNIX mail. . , - . /usr/news. Office , . , - more. , - . - . , . - . today, . . calendar, calendar ( cron ) - . - , . office . . , , , . calendar. , . - calendar, cron, . , , - . . - phone, - . phone , , , . - . , - . - greet. at. 11:45 16:45 . , - "yes" () . - at, , - at. ! ( - at, at , .) at, , at. , , . . - office, office. shell office ( - sh), control-D office. . office . - shell.  $ office s sh $ office shell. shell- sh, .. shell. shell . shell ^d office.  4-8 . office - , . 10-107 - while. - , . 12 c (. 7). - , - , BSD, clear. 13 - date. 14-27 , 29 - . 31-106 case, - . 32 office, . 33-45 mail. test , - . , ls. - , . "y", - mail. . 46-63 . PWD . , cd - , - , . - cd /usr/news. , - . Berkeley /usr/msgs. /usr/news - , . /usr/news ( 49), - , - - . , test while. while , NAME ( 52). . , cat, - . , , . . , . 62, cd , - . cd - office. cd - shell. , shell, cd. 64-77 . . ? echo , . 65 today. - . 66 , - . , ls 67. - "Calendar Notifications" ( ). 69 PWD. - cd $HOME, , . 71 UNIX calendar. - . cd - , . 73 , - . , calendar - . else 74 , . if, 76 77 - , , - read. , - . , . , , shell - . , . 78 phone. phone, , while. , . 79-97 . - greet. . 80 81 - at, . 84 , - . "y", 87-96. "y", else , . , - . 87-89 , , . at, ( ) - . 90 . 91 , , . - while , . 93 , . eval , , . 94 - , 95 . , while . 98-102 shell. - , . , , - eval. shell, sh - shell. 101 102 , . 103-105 . - . - "hit " ( ).  * 6. II: *        activ info uchk watch whox who   acme inuse lock II:      , . - . . , . -, , , , . - . , - , , , - , . , , . - , - , , , . . , , . - . , "- ". activ, info, uchk, watch whox. activ who, , , = . , , , , . - info. . , . - uchk. - , . , - . - watch. "", - . , , . , , . - whox. Whox , . , who, , .   ------------------------------------------------------------ : activ ------------------------------------------------------------- activ  , , .   activ   activ   1 : 2 # @(#) activ v1.0 Display terminal activity Author: Russ Sage 2 4 if [ $# -gt 0 ] 5 then echo "activ: argument error" >&2 6 echo "usage: activ" >&2 7 exit 1 8 fi 10 who -u | cut -c1-17,38-42  activ? , . - . - . UNIX mail write . , - , , , . UNIX , , , , , . , . Activ , , - . , , . activ? Activ - . , , , . , . - 24 , "old". . : ------------------------ | | root tty01 01:23 | sage tty05 . | batch tty12 old | nuucp tty16 . | , , - ? , , . - . , , . -u who. , , AT&T UNIX System V, - activ, , . Activ "who -u" "" , . , , , "who -u", "- " , stat(2). stat - , . . 6.1 : 6.1 -------------------------------------------------------------- , -------------------------------------------------------------- creat, mknod, pipe, utime, read creat, mknod, pipe, utime, write creat, mknod, pipe, utime, write, chmod, chown, link -------------------------------------------------------------- , . : UNIX . , . , , . , , login. - - . , /bin/login - ls, , . UNIX - . . utime(2) . touch(1) , . touch . , . fsdb(1) ( ) - . fsdb . - fsdb . , . , , , . - fsdb , , . ,