$ gcc -Wall -o  ch8-4 ch8-4.c
$ ./ch8-4 
Welcome to the sample shell!  You may enter commands here, one
per line.  When you're finished, press Ctrl+D on a line by
itself.  I understand basic commands and arguments separated by
spaces, redirection with < and >, up to two commands joined
by a pipe, tilde expansion, and background commands with &.


$ echo Hello!
Hello!

$ ls /proc
1    2    224  240  295  321      cpuinfo      kmsg     partitions  version
13   200  226  241  296  344      devices      ksyms    pci
141  206  227  242  297  4        dma          loadavg  scsi
143  209  228  243  3    486      fb           locks    self
151  216  229  257  306  487      filesystems  meminfo  slabinfo
156  219  230  262  316  508      fs           misc     stat
159  220  231  263  317  510      ide          modules  swaps
179  221  232  266  318  apm      interrupts   mounts   sys
186  222  238  290  319  bus      ioports      mtrr     tty
196  223  239  294  320  cmdline  kcore        net      uptime

$ ls /dev/hda*
ls: /dev/hda*: No such file or directory

$ pwd
/home/jgoerzen/rec/private/t/cs697l_3

$ echo ~root
/root

$ cd ~root

$ pwd
/home/username

$ some_nonexistant_command

$ ls /proc | grep in
cmdline
cpuinfo
interrupts
meminfo
slabinfo

$ ls /proc | grep in > foo

$ rev < foo
enildmc
ofniupc
stpurretni
ofnimem
ofnibals

$ rm foo

$ echo "Bye"   
"Bye"

$ Ctrl+D
