ot, a programming question

Gregory Nowak gnowak1 at uic.edu
Sat Dec 22 12:21:19 EST 2001


Thanks, even though I haven't responded, I'm still following this thread.
Very interesting.
I have wondered too, why I saw this feature in Linux software, but not in DOS software. Now I guess I know why (grin).
Greg


On Sat, Dec 22, 2001 at 06:42:39AM -0500, Charles Hallenbeck wrote:
> Another way to illustrate that it is the shell that expands the
> wildcards is to use single quotes to prevent it from happening,
> so that a wildcard is passed to the application instead of being
> seen by the shell. Try this for instance:
> 
> mpg123 '*.mp3'
> 
> and the application will not be able to find the file whose name
> contains the star!
> 
> In the bad old days (under DOS) the Borland C++ libraries had a
> linkable module called "wildargs.obj" and if your program linked
> with that module it would behave just like a Linux application
> does with the shell expansion. Later versions of Borland
> compilers abandoned this module and expected programmers to use
> calls to "findfirst" and "findnext" to yield the names that
> matched the wildcards. In Linux the expansion of wildcards is
> _USUALLY the job of the shell.
> 
> HTH - Chuck
> 
> 
> On Sat, 22 Dec 2001, Geoff Shang wrote:
> 
> > Hi:
> >
> > The shell expands the wildcard, the wildcard itself never gets passed to
> > the application.  This can be demonstrated by the following script:
> >
> > #!/bin/sh
> > echo $1 $2 $3 $4 $5
> >
> > Now, you can see here that it's important to read the correct number of
> > parameters.  Running this script will only output the first 5 matching
> > files, so you need to be able to read in all the names.  I don't know how
> > you'd do this in a shell script, but it'd be easy in say C.
> >
> > Geoff.
> >
> >
> >
> > _______________________________________________
> > Speakup mailing list
> > Speakup at braille.uwo.ca
> > http://speech.braille.uwo.ca/mailman/listinfo/speakup
> >
> 
> Visit me at http://www.mhonline.net/~chuckh
> The Moon is Waxing Crescent (46% of Full)
> 
> 
> _______________________________________________
> Speakup mailing list
> Speakup at braille.uwo.ca
> http://speech.braille.uwo.ca/mailman/listinfo/speakup




More information about the Speakup mailing list