Re: Shell Expansion in Bourne Shell Script Question
On 20100728_082732, Martin McCormick wrote:
> Cesar Garcia writes:
> > Perhaps, try with this:
> >
> > for MAGFILE in `ls $MAGDIR/*.[Zz][Ii][Pp]`; do
It probably doesn't really matter in practice, but this will
pick up also files that match $MAGDIR/*.zIp , etc. (mixed case)
To avoid getting these, try
for MAGFILE in `ls $MAGDIR/*.ZIP $MAGDIR/*.zip`; do
I haven't tested this, but I'm pretty sure it will work. I
prefer this in a script because I find it much faster to
aprehend what is intended when reading old code.
>
> That worked. Thank you.
>
> As soon as I saw the example, I realized that in the
> script, there was no way for it to know where these files were
> that I was looking for. Also my thanks to the others who replied
> with equally useful information.
>
> Martin
>
>
> --
> To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
> with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
> Archive: [🔎] 201007281327.o6SDRWLZ070271@dc.cis.okstate.edu">http://lists.debian.org/[🔎] 201007281327.o6SDRWLZ070271@dc.cis.okstate.edu
>
--
Paul E Condon
pecondon@mesanetworks.net
Reply to: