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

  1. Newsgroups: comp.sys.atari.st.tech
  2. Path: sparky!uunet!usc!sdd.hp.com!ux1.cso.uiuc.edu!news.iastate.edu!vincent1.iastate.edu!sourada
  3. From: sourada@iastate.edu (Steven D Ourada)
  4. Subject: Re: Problems with ARGV
  5. Message-ID: <sourada.712465676@vincent1.iastate.edu>
  6. Sender: news@news.iastate.edu (USENET News System)
  7. Organization: Iowa State University, Ames IA
  8. References: <9130026@hpbbrd.bbn.hp.com> <92211.111512RESCHKE@DMSWWU1A.UNI-MUENSTER.DE> <1992Jul29.130755.27902@mks.com> <1992Jul29.221225.24054@mnemosyne.cs.du.edu>
  9. Date: Thu, 30 Jul 1992 03:07:56 GMT
  10. Lines: 40
  11.  
  12. In <1992Jul29.221225.24054@mnemosyne.cs.du.edu> ilepore@nyx.cs.du.edu (Ian Lepore) writes:
  13.  
  14. > > ARGV doesn't allow passing empty arguments
  15. > > use another env var to pass the position of the empty args
  16. > I don't like it.  It sounds needlessly complicated to create a whole 
  17. >'nother env var for this.  
  18.  
  19. I agree on that point.
  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. >   grep "" *.c
  26.  
  27. > would be passed as ARGV=\0grep\0\1\0*.c\0\0.  If my assumption is invalid,
  28. >and folks do pass binary data in ARGV, then use an escape system where an
  29. >empty arg is \1\1, but a true binary 1 is \1\2.  (You could even extend
  30. >this to allow passing binary zeros, escaped as \1\3 for example.)
  31.  
  32. I was thinking something along these lines, also. What I was thinking about
  33. was using a single space to signify an empty argument. Then, for arguments
  34. that consist of spaces (fairly rare, I'd think), a space is added to the
  35. string. A program using this convention (or compiled with a runtime that
  36. handled it) would subtract a space off any argument that consisted of
  37. only spaces.
  38.  
  39. The question is, of the schemes mentioned so far (or related ones), which
  40. would break the least of the existing ARGV programs? (I vote for mine :-))
  41.  
  42.                   Later,     
  43.                     Steven Ourada
  44.  
  45. -- 
  46. -----------------
  47. Steven Ourada  Member of the Students for Electronic Freedom
  48. Ask me how Iowa State University is censoring my Usenet access!
  49. sourada@iastate.edu     "can't casts no shadow" -- cummings
  50.