🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.sys.amiga.tech
Article #14155

Wildcards, and argument parsing. Re: SKsh completion bug.

#14155
From: Peter da Silva
Date: Sat, 10 Mar 1990 03:57
35 lines
1992 bytes
> Quick: how do you get a ".*" to a sed being run from a shell script
> run via 'system' from the program you're actually invoking?

If the script is competantly written (i.e., it uses "$@" or "for i" and
quotes arguments itself), system("command '.*'");

Arguing from the basis that buggy software makes things harder is a double
edged sword, I agree. But at least it's easier to fix the script than someone's
mondo uncommented pseudo-basic C code.

*when* I get my Amiga back up to multiple megabytes, I'll make parseargs a
library routine. And provide two versions. So programs that use wildcards
will be simply able to do:

main(ac, av)
int ac;
char **av;
{
	parseargs(av, ad);

}

And folks with "unixargs.library" will get UNIX arguments and wildcards, and
folks with "amiargs.library" will get AmigaDos arguments and wildcards. You
can already do the argument part with the version of parseargs I sent to
comp.sources, and getting the wildcards right is just a SMOP.

In the meantime, parseargs is a way better way of implementing command line
arguments than getopt. You merely have to relink the program to switch back
and forth. Kudos to Eric Allman.
-- 
 _--_|\  Peter da Silva <peter@sugar.hackercorp.com>.
/      \
\_.--._/ I haven't lost my mind, it's backed up on tape somewhere!
      v  "Have you hugged your wolf today?" `-_-'
Technical Details
Message-ID: <5369@sugar.hackercorp.com>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!cs.utexas.edu!usc!brutus.cs.uiuc.edu!zaphod.mps.ohio-state.edu!lavaca.uh.edu!uhnix1!sugar!peter
References: <8289@wpi.wpi.edu> <13920055@hpfelg.HP.COM> <392@icebox.nsc.com> <5367@sugar.hackercorp.com> <MWM.90Mar9132152@raven.pa.dec.com>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!cs.utexas.edu!usc!brutus.cs.uiuc.edu!zaphod.mps.ohio-state.edu!lavaca.uh.edu!uhnix1!sugar!peter
From: peter@sugar.hackercorp.com (Peter da Silva)
Newsgroups: comp.sys.amiga.tech
Subject: Wildcards, and argument parsing. Re: SKsh completion bug.
Message-ID: <5369@sugar.hackercorp.com>
Date: 10 Mar 90 03:57:17 GMT
References: <8289@wpi.wpi.edu> <13920055@hpfelg.HP.COM> <392@icebox.nsc.com> <5367@sugar.hackercorp.com> <MWM.90Mar9132152@raven.pa.dec.com>
Reply-To: peter@sugar.hackercorp.com (Peter da Silva)
Organization: Sugar Land Unix - Houston
Lines: 35