home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #20 / NN_1992_20.iso / spool / comp / unix / shell / 3954 < prev    next >
Encoding:
Text File  |  1992-09-14  |  1.1 KB  |  33 lines

  1. Newsgroups: comp.unix.shell
  2. Path: sparky!uunet!spool.mu.edu!yale.edu!ira.uka.de!math.fu-berlin.de!uniol!tpki.toppoint.de!kris
  3. From: kris@tpki.toppoint.de (Kristian Koehntopp)
  4. Subject: Re: How to do $#a in Bourne shell?
  5. X-Copyright: (C) Copyright 1992 Kristian Koehntopp -- All rights reserved.
  6.          Reproduktion, auch auszugsweise, ausserhalb elektronischer,
  7.          nichtkommerzieller Datennetze nur mit ausdruecklichem,
  8.          schriftlichem Einverstaendnis des Autors.
  9. Organization: Toppoint Mailbox e.V.
  10. Date: Tue, 15 Sep 1992 08:51:48 GMT
  11. Message-ID: <1992Sep15.085148.9807@tpki.toppoint.de>
  12. References: <peter.716085132@merlin> <1992Sep10.190928.7699@oracle.us.oracle.com> <1992Sep12.022450.20682@sq.sq.com>
  13. X-Excuse: X-Copyright wegen Emma, Suedwestpresse und /C'T/DISKUSSIONEN.
  14. Lines: 17
  15.  
  16. In <1992Sep12.022450.20682@sq.sq.com> msb@sq.sq.com (Mark Brader) writes:
  17. >    listcount=`set dummy $list; shift; echo $#`
  18.  
  19. This is a kludge. Use "--" instead:
  20.  
  21. listcount=`set -- $list; echo $#`
  22.  
  23. Of course there are certainly shells which fail to understand
  24. "--" as "end of options".
  25.  
  26. Kristian
  27. -- 
  28. Kristian Koehntopp, Harmsstrasse 98, FRG W-2300 Kiel, +49 431 676689
  29. "Look up!"
  30.     -- Asylum
  31.  
  32.  
  33.