home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.sys.atari.st.tech
- Path: sparky!uunet!cs.utexas.edu!torn!watserv1!mks.com!ant
- From: ant@mks.com (Anthony Howe)
- Subject: Re: Problems with ARGV
- Message-ID: <1992Jul29.130755.27902@mks.com>
- Organization: Mortice Kern Systems Inc., Waterloo, Ontario, CANADA
- References: <9130026@hpbbrd.bbn.hp.com> <92211.111512RESCHKE@DMSWWU1A.UNI-MUENSTER.DE>
- Date: Wed, 29 Jul 1992 13:07:55 GMT
- Lines: 37
-
- Julian F. Reschke writes:
- >In article <9130026@hpbbrd.bbn.hp.com>, jensk@hpbbrd.bbn.hp.com (Jens Kilian)
- >says:
- >>
- >>Yesterday I ran into a problem with the ARGV parameter passing scheme that
- >>I'm sure others must have seen before. The ARGV scheme can't pass empty
- >>strings
- >>as parameters !
- >
- >Well, that's a known problem :-) Fortunately, empty parameters mostly
- >occur as parameters to 'test', and this is normally (or can be) a
- >builtin command of the shell.
-
- Not so. I found this problem just recently, while working on 'grep'.
- If 'grep' is passed an empty string for the pattern, it is suppose to match
- every line in the file, since the pattern is normally bracketed with
- ".*(pattern).*" when no anchoring is used. It took me about three nights
- to figure this out.
-
- >Your proposal for an ARGV extension seems to work. If 'we' all (MiNT-Libs,
- >and GNU-Libs, PureC startup code and so on) agree on this, that could be
- >a solution...
-
- Well, I've been working on an ANSI/POSIX library for Sozobon C 1.2. I've
- provided my own C startup that supports ARGV. If you're going to do
- this, which seems reasonable, you'll have to pick a better name than
- ARRGH for the env.var. since it has no meaning. Something like
-
- ARGV_EMPTY=index1, index2, ... indexN\0
-
- would be more acceptable.
-
- -ant
- --
- ant@mks.com Anthony C Howe
- Mortice Kern Systems Inc. 35 King St. N., Waterloo, Ontario, Canada, N2J 6W9
- "Nice legs. For a human that is." - Worf (Q-pid)
-