[comp.sys.amiga.programmer] How do you use shell wild cards in a program?

maxc0949@ucselx.sdsu.edu (Victor Martinez) (03/23/91)

	Greetings,
     How do you does a program use wild cards from the shell? Does the
shell pass a modified argv to a program or is it up to the program to 
expand the wild cards?  I hope the shell expands the wild cards for the
program.  I am using Wshell on a A3000.
	Thanks
	Victor Martinez

Jay@deepthot.cary.nc.us (Jay Denebeim) (03/26/91)

In article <1991Mar22.170715.14128@ucselx.sdsu.edu> maxc0949@ucselx.sdsu.edu (Victor Martinez) writes:
>     How do you does a program use wild cards from the shell? Does the
>shell pass a modified argv to a program or is it up to the program to 
>expand the wild cards?  I hope the shell expands the wild cards for the
>program.  I am using Wshell on a A3000.

The shell does NOT expand wildcards.  WShell does not anyway, SKsh
does, its a (sorta) implementation of csh on U*IX.

This is not the 'amiga way' however.  Each program is supposed to
do its own wildcard expansion, at least under 1.x of the operating
system.

Under 2.0 (which is what you're probably running on the 3000) there
are new calls in the dos library for command parsing and wildcard
expansion.  They are quite nice.  Unfortunately, I don't think
you'll be able to get any docs on them yet.

>	Thanks
>	Victor Martinez

--

 |_o_o|\\
 |. o.| || The           Jay Denebeim
 | .  | ||  Software
 | o  | ||   Distillery
 |    |//        Address: UUCP:     mcnc.org!deepthot.uucp!jay
 ======                   Internet: jay@deepthot.cary.nc.us
                 BBS:(919)-460-7430      VOICE:(919)-460-6934

daveh@cbmvax.commodore.com (Dave Haynie) (03/26/91)

In article <1991Mar22.170715.14128@ucselx.sdsu.edu> maxc0949@ucselx.sdsu.edu (Victor Martinez) writes:

>     How do you does a program use wild cards from the shell? Does the
>shell pass a modified argv to a program or is it up to the program to 
>expand the wild cards?  I hope the shell expands the wild cards for the
>program.  I am using Wshell on a A3000.

Most Amiga shells pass the wildcards to the program, though a few of the UNIX
flavored shells may do wildcard expansion for you.  Under 2.0, there are DOS
library functions to expand wildcards in various ways.  There is no such
facility in 1.3, though I did a wildcard matching routine for DiskSalv V1.4x,
and split off the code as a separate demo which I placed in the public
domain.  My code only matches 1.3 wildcards; 2.0 adds character sets and
negation not part of the 1.3 specification, which I suppose could be hacked
into my code (character sets would be easy, negation not-so-easy).  This was
posted awhile back, but I'll email it to anyone in need.


-- 
Dave Haynie Commodore-Amiga (Amiga 3000) "The Crew That Never Rests"
   {uunet|pyramid|rutgers}!cbmvax!daveh      PLINK: hazy     BIX: hazy
      "That's me in the corner, that's me in the spotlight" -R.E.M.