home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #16 / NN_1992_16.iso / spool / comp / sys / atari / st / tech / 4183 < prev    next >
Encoding:
Text File  |  1992-07-29  |  1.5 KB  |  40 lines

  1. Newsgroups: comp.sys.atari.st.tech
  2. Path: sparky!uunet!mnemosyne.cs.du.edu!nyx!ilepore
  3. From: ilepore@nyx.cs.du.edu (Ian Lepore)
  4. Subject: Re: Problems with ARGV
  5. Message-ID: <1992Jul29.221225.24054@mnemosyne.cs.du.edu>
  6. X-Disclaimer: Nyx is a public access Unix system run by the University
  7.     of Denver for the Denver community.  The University has neither
  8.     control over nor responsibility for the opinions of users.
  9. Sender: usenet@mnemosyne.cs.du.edu (netnews admin account)
  10. Organization: Nyx, Public Access Unix at U. of Denver Math/CS dept.
  11. References: <9130026@hpbbrd.bbn.hp.com> <92211.111512RESCHKE@DMSWWU1A.UNI-MUENSTER.DE> <1992Jul29.130755.27902@mks.com>
  12. Date: Wed, 29 Jul 92 22:12:25 GMT
  13. Lines: 25
  14.  
  15.  > ARGV doesn't allow passing empty arguments
  16.  > use another env var to pass the position of the empty args
  17.  
  18.  I don't like it.  It sounds needlessly complicated to create a whole 
  19. 'nother env var for this.  
  20.  
  21.   I have two variations on an idea for coping with this.  The first variation
  22. assumes that we never pass binary values in the ARGV.  (IE, isprint() is 
  23. TRUE for all chars appearing in the args in the ARGV area.)  In this case,
  24. I'd recommend using \001 as a placeholder for an empty arg.  Using this,
  25.  
  26.    grep "" *.c
  27.  
  28.  would be passed as ARGV=\0grep\0\1\0*.c\0\0.  If my assumption is invalid,
  29. and folks do pass binary data in ARGV, then use an escape system where an
  30. empty arg is \1\1, but a true binary 1 is \1\2.  (You could even extend
  31. this to allow passing binary zeros, escaped as \1\3 for example.)
  32.  
  33.   Thoughts?
  34.  
  35.     
  36. --
  37. - Ian
  38. (void *) where prohibited by law
  39.  
  40.