Unix - Hour 14 Getting the Most out the C Shell 14.1.1) internet% history 1 source .login 2 history internet% 14.1.2) internet% set argv () cwd /home2/stud-30/spantaro filec history 100 home /home2/stud-30/spantaro path (/usr/bin /usr/ucb /home2/stud-30/spantaro/bin .) prompt internet% shell /bin/csh status 0 term xterm user spantaro internet% 14.1.3) internet% w | head 10:49pm up 13 day(s), 15:34, 7 users, load average: 0.02, 0.03, 0.04 User tty login@ idle JCPU PCPU what root console Wed 2am 7days /usr/dt/bin/sdt_shell -c ? u ctsai pts/1 8:44pm 1:57 pico question.html mbrownel pts/2 9:08pm 1:28 csh mbrownel pts/3 9:30pm 1:12 csh wyang pts/7 10:33pm 15 csh spantaro pts/8 10:08pm -ksh mbrownel pts/9 10:08pm 12 csh root pts/6 Wed 2am 6days internet% ls OWL cis316 forLoopScript.sio sioFile1 README cis325 m13com sioFile2 README.2 cis327 m1feedback sioFile3 README2 cis328 my.new.cmd sort.manpage.Z READMES cis377 new.login spying.sio TEST cis396q newfile test arguments.sio demo prokids testdir beepscript.sio example public-web testme buckaroo file say.hi visible.ps_data bugTrack file1 say.hitoo internet% date Tue Jul 3 22:50:17 PDT 2001 internet% internet% history 1 source .login 2 history 3 set 4 w | head 5 ls 6 date 7 history internet% 14.2.1) Typed many commands to create a list in history internet% w | head 11:09pm up 13 day(s), 15:54, 8 users, load average: 0.02, 0.02, 0.04 User tty login@ idle JCPU PCPU what root console Wed 2am 7days /usr/dt/bin/sdt_shell -c ? u eitelman pts/1 11:04pm 5 bash mbrownel pts/2 9:08pm 1:48 csh mbrownel pts/3 9:30pm 1:32 csh wyang pts/7 10:33pm vi loop2 spantaro pts/8 10:08pm -ksh mbrownel pts/9 10:08pm 32 csh jiliu pts/10 11:04pm pine internet% date Tue Jul 3 23:10:06 PDT 2001 internet% ls OWL cis316 forLoopScript.sio sioFile1 README cis325 m13com sioFile2 README.2 cis327 m1feedback sioFile3 README2 cis328 my.new.cmd sort.manpage.Z READMES cis377 new.login spying.sio TEST cis396q newfile test arguments.sio demo prokids testdir beepscript.sio example public-web testme buckaroo file say.hi visible.ps_data bugTrack file1 say.hitoo 14.2.2) internet% history 1 source .login 2 w | head 3 date 4 ls 5 history internet% 14.2.3) internet% !3 date Tue Jul 3 23:11:58 PDT 2001 internet% 14.2.4) internet% !d date Tue Jul 3 23:12:39 PDT 2001 internet% 14.2.5) !3 was stored as date and not !3 in the history internet% history 1 source .login 2 w | head 3 date 4 ls 5 history 6 date 7 date 8 history 9 vi buckaroo 10 history internet% 14.2.6) internet% ls OWL cis316 forLoopScript.sio sioFile1 README cis325 m13com sioFile2 README.2 cis327 m1feedback sioFile3 README2 cis328 my.new.cmd sort.manpage.Z READMES cis377 new.login spying.sio TEST cis396q newfile test arguments.sio demo prokids testdir beepscript.sio example public-web testme buckaroo file say.hi visible.ps_data bugTrack file1 say.hitoo internet% !! -F ls -F OWL/ cis316/ forLoopScript.sio* sioFile1 README* cis325/ m13com/ sioFile2 README.2* cis327/ m1feedback/ sioFile3 README2* cis328/ my.new.cmd* sort.manpage.Z READMES cis377/ new.login spying.sio* TEST cis396q/ newfile test arguments.sio* demo prokids/ testdir/ beepscript.sio* example* public-web/ testme buckaroo file say.hi* visible.ps_data bugTrack/ file1 say.hitoo* internet% internet% echo b* d* s* beepscript.sio buckaroo bugTrack demo say.hi say.hitoo sioFile1 sioFile2 sioFile 3 sort.manpage.Z spying.sio internet% echo bu* d* sa* buckaroo bugTrack demo say.hi say.hitoo internet% echo bu* d* sa*2 buckaroo bugTrack demo internet% wc -l !* wc -l bu* d* sa*2 6 buckaroo 1 bugTrack 32 demo 39 total internet% 14.2.7) Takes only the last argument internet% wc -l !$ wc -l sa*2 No match internet% echo bu* d* buckaroo bugTrack demo internet% wc -l !$ wc -l d* 32 demo internet% 14.2.8) The system did not respond internet% awk -F: '{print $5}' internet% !! < /etc/passwd Admin Line Printer Admin uucp Admin uucp Admin Network Admin Nobody No Access User SunOS 4.x Nobody SunLink Server account SunLink Server Administrator SunLink Server GUEST Login SunLink Server World Login WWW Server Infotrac Client Software Infotrac Login internet% !! | awk '{print $1}' Admin Line uucp uucp Network Nobody No SunOS SunLink SunLink SunLink SunLink WWW Infotrac Infotrac 14.3.1) internet% ls OWL cis316 forLoopScript.sio sioFile1 README cis325 m13com sioFile2 README.2 cis327 m1feedback sioFile3 README2 cis328 my.new.cmd sort.manpage.Z READMES cis377 new.login spying.sio TEST cis396q newfile test arguments.sio demo prokids testdir beepscript.sio example public-web testme buckaroo file say.hi visible.ps_data bugTrack file1 say.hitoo internet% alias ls 'ls -CF' internet% ls OWL/ cis316/ forLoopScript.sio* sioFile1 README* cis325/ m13com/ sioFile2 README.2* cis327/ m1feedback/ sioFile3 README2* cis328/ my.new.cmd* sort.manpage.Z READMES cis377/ new.login spying.sio* TEST cis396q/ newfile test arguments.sio* demo prokids/ testdir/ beepscript.sio* example* public-web/ testme buckaroo file say.hi* visible.ps_data bugTrack/ file1 say.hitoo* internet% 14.3.2) internet% alias DIR 'ls -lF' internet% alias REN 'mv' internet% alias COPY 'cp -i' internet% alias DEL 'rm -i' internet% internet% DIR total 66 drwxr-xr-x 3 spantaro students 512 Jun 3 16:14 OWL/ -rwx------ 1 spantaro students 1373 Maay 22 23:42 README* -rwx------ 1 spantaro students 1417 Juun 6 17:09 README.2* -rwx------ 1 spantaro students 1373 Juun 25 22:16 README2* -rw-r--r-- 1 spantaro students 1373 Maay 30 17:08 READMES -rw-r--r-- 1 spantaro students 0 Juun 2 18:32 TEST -rwxr-xr-x 1 spantaro students 39 Juun 20 18:00 arguments.sio* -rwxr-xr-x 1 spantaro students 159 Juun 20 17:22 beepscript.sio* -rw-r--r-- 1 spantaro students 162 Juun 26 23:00 buckaroo drwx------ 2 spantaro students 1024 May 9 16:50 bugTrack/ drwx------ 2 spantaro students 1024 Apr 13 11:18 cis316/ drwx------ 3 spantaro students 2048 Sep 19 2000 cis325/ drwx----... 14.3.3) internet% alias COPY cp -i DEL rm -i DIR ls -lF REN mv ls ls -CF rm (/bin/rm -i) internet% 14.3.4) internet% alias DIR 'ls -lF | more' internet% alias DIR ls -lF | more internet% 14.4) Read |