[net.sources] Critique of 4.2BSD Doc, sec 39,40

jkcohen@udenva.UUCP (08/22/84)

                                 CRITIQUE

                                  of the

               BERKELEY 4.2 UNIX DOCUMENTATION - Volume IIc
                              Sections 39-40



                                    by



                              Jack K. Cohen






                             August 21, 1984



                     Copyright 1984 by Jack K. Cohen


       Permission to copy all or part of this material  is  granted
       provided  that  the  copies  are not made or distributed for
       direct commercial advantage, the author's  copyright  notice
       and the title of the article and its date appear, and notice
       is given that copying is by permission of  the  author.   To
       copy  otherwise,  or  to  republish,  requires  a fee and/or
       specific permission.
















       4.2BSD                                                   -1-


       Introduction

            I am hoping to issue a set  of  mini-critiques  of  the
       Programmer's Manual Volume IIc to supplement the Critique of
       Volume  I  which  was  recently  distributed.   This   first
       installement  covers  the  first two sections of Volume IIc.
       There are many sections  totally  beyond  my  interests  and
       abilities,  but  in addition to sections 39 and 40 presented
       here, I anticipate eventually covering at least sections 41,
       43, 45, 53, 54, and 56.













































                                                        J. K. Cohen







       4.2BSD                                                   -2-


       Bug Fixes and changes in 4.2BSD, section 39

       csh  In the third line, add the word, 'be', after the  word,
            'to.'

       script
            Last phrase should probably be 'at a terminal.'

       sdb  We are told that "it still lives on in/usr/src/old  for
            those  with  a personal attachment." However, if anyone
            does have  such  an  attachment,  they  are  doomed  to
            unrequited love since /usr/src is a private directory.

       stty The defaults mentioned here disagree with  those  given
            on the manual page.

       su   Changes noted do not appear on manual  page.   I  could
            not get the extra argument business to work:

                su myfriend 'ls /u/gsis/myfriend'

            evoked:

                ls /u/gsis/myfriend: File or directory not found


       tail Need something after the word, 'similar.'




























                                                        J. K. Cohen







       4.2BSD                                                   -3-


       An Introduction to the C Shell, section 40

       p2.  The mail example shows a visible EOT signal being  sent
            to  the  terminal,  and the text claims the characters,
            'EOT', are echoed by the mail program.  However,  these
            characters do not really appear at the terminal.

            It is stated that the uparrow character will be used to
            represent  the  control key.  This conflicts with other
            documents in this volume and  conflicts  with  internal
            usage  in  this  document.  For on pages 14-16, we find
            uparrow being used in  the  discussion  of  history  to
            represent the hat character.

            Locally, you get  reasonable  terminal  characteristics
            without  using  'tset'.   In particular, the default is
            that the backspace key works fine.

       p3.  The command 'ls  -s'  gives  file  sizes  in  terms  of
            kilobytes  (1024  characters)  instead  of  in terms of
            blocks of 512 characters.

       p4.  Again, 'ls -s' is said  to  use  512  character  blocks
            instead of the actual 1024.

       p7.  The first complete sentence on this page ('There exists
            ...'), is confusing because the list at the end of this
            lengthy beast uses ',' instead of 'or' as the delimiter
            between  cases.   Making a list of cases would be yet a
            better solution.

            The local interrupt signal is 'break'  (control-c)  not
            'del.'

       p8.  The example may mislead the novice into believing  that
            people  can  put  files into his/her directories.  Rest
            easy,  dear  novice,  your  directories   are   default
            protected  against  such intrusions both on this system
            and on any  professionally  administered  UNIX  system.
            Except  for the system administrator (aka 'super user',
            aka 'support'),  no  one  can  write  in  any  of  your
            directories  unless  you  take  special action (see the
            'chmod' command) to allow  them  to  do  so.   Again  a
            visible EOT is shown.

       p9.  Again, a claim is made for the appearance of a  visible
            EOT.

            Third sentence of  second  paragraph  gives  the  shell
            human  attributes (it can be 'provoked', but apparently
            only sometimes).




                                                        J. K. Cohen







       4.2BSD                                                   -4-


            After the example of using the command,  'more',  as  a
            filter, we find the awkward phrase, 'more simple more'.

       p11. The example of a typical  .login  could  be  made  more
            useful   if   here,   or  elsewhere,  a  more  complete
            explanation was given.

            The   method   shown   of    setting    the    terminal
            characteristics  is  archaic  (e.g. the option -s is no
            longer even documented in TSET(1)).

            The 'msgs' command does not currently function here.

            The if-then-endif structure shown at  the  end  of  the
            .login fails if one (see CSH(1), page 16) puts:

                set mail=(300 /usr/spool/mail/username)

            or the like.

            It is stated that the default 'mail check' interval  is
            5  minutes;  it  seems  to  be  10 minutes as stated in
            CSH(1), page 16.

       p14-15.
            The commands 'num' and 'ssp' do not exist.

       p14-16.
            As noted above, uparrow (defined  as  control  key)  is
            used when the hat character is meant.

       p15. To make the alias examples intelligible, it  should  be
            explained  that  !*  is  the  history  notation for all
            arguments of the previous (i.e. unaliased) command  and
            similarly  that  !^ means the first argument (and while
            we are at it that !$ means the last argument).

       p17. In the first sentence of the last paragraph,  the  word
            'background' is misspelled.

       p19. Before first example, 'background' is misspelled again.

            Why does the 'ls'  command  produce  only  one  process
            number  (cf.  same  command  and explanation thereof on
            page 18)?

       p23. This is scary, but despite the explicit note about  the
            \  inside  the  quotes,  I found that I got exactly the
            prompt whether or not I used the \.  (cf.  my  comments
            about  the  same  issue  under  'csh' in part I of this
            Critique).




                                                        J. K. Cohen







       4.2BSD                                                   -5-


            The reference to the repeat command (which has  limited
            usefulness  since  it  iterates  only a simple command)
            might well be supplemented  with  a  scaled  down  (and
            improved!) version of the following shell program:

            #! /bin/csh
            # Usage: loop ntimes cmd ...
            # Repeat group of commands n times
            # Note: The built-in, 'repeat' works only on simple cmds.
            # Note: Quote cmds with args, eg., loop 2 "sleep 10" who
            set c=$0
            set c=$c:t
            set N=$#argv

            if ($N < 2) then
                    echo Usage $c ntimes cmd ...
                    exit(1)
            endif
            @ x = $1
            shift
            @ N--
            while ($x)
                    @ i = 1
                    while ($i <= $N)
                            $argv[$i]
                            @ i++
                    end
                    @ x--
            end


            The discussion of setenv needs to be supplemented  with
            some discussion of what an 'environment' is.

       p25ff.
            There should be far more examples of shell programs  to
            illustrate  the many items mentioned all too fleetingly
            in this part of the tutorial.

       p25. In 4.2BSD, it would be better to start csh files with

                #! /bin/csh

            instead of just an arbitrary comment line.  In fact, if
            the first line of the file is

                #! /bin/sh

            then despite the fact that the file  begins  with  a  #
            line,   it   will   be  handled  by  the  Bourne  shell
            interpreter.




                                                        J. K. Cohen







       4.2BSD                                                   -6-


       p26. Near the bottom of the page the wrong form of 'echo' is
            cited, it should be:

                echo -n 'yes or no? '


       p27. At midpage the 'd' is omitted from 'replaced.'

       p29. I had trouble using set n=$0:t in shell  scripts.   (so
            the  program would be able to 'know' its name for error
            messages).  I found that  set  n=$0,  followed  by  set
            n=$n:t worked, but I have no idea why!

       p30. I advocate illustrating the structures shown;  this  is
            supposed to be a tutorial.

       p31. A  comment  should  be  added,  explaining   what   the
            'oldstring'  is  in the ed 's' command.  Note that here
            the uparrow is again  used  in  the  non-  control  key
            sense.

            Section 3.10 is too terse to be of any use.   And  then
            one-third  of  it re-explains the archaic usage of # to
            distinguish Bourne from C shells.

       p37. In the last paragraph, 'messages' is misspelled.





























                                                        J. K. Cohen



-- 
Jack Cohen
{nbires|denelcor|hao}!udenva!jkcohen