From: Hongyi Zhao on
Hi all,

I want to do a for loop on the following files:

DO*.pdf,
Do*.pdf,
dO*.pdf,
do*.pdf,

So I use the following code:

for i in [Dd][Oo]*.pdf

Am I right or not?
--
..: Hongyi Zhao [ hongyi.zhao AT gmail.com ] Free as in Freedom :.
From: pk on
Hongyi Zhao wrote:

> Hi all,
>
> I want to do a for loop on the following files:
>
> DO*.pdf,
> Do*.pdf,
> dO*.pdf,
> do*.pdf,
>
> So I use the following code:
>
> for i in [Dd][Oo]*.pdf
>
> Am I right or not?

Why don't you just try?

From: Ed Morton on
On 2/16/2010 8:43 AM, Hongyi Zhao wrote:
> Hi all,
>
> I want to do a for loop on the following files:
>
> DO*.pdf,
> Do*.pdf,
> dO*.pdf,
> do*.pdf,
>
> So I use the following code:
>
> for i in [Dd][Oo]*.pdf
>
> Am I right or not?

Depends what you plan to do inside the loop.

Ed.
From: Dominic Fandrey on
On 16/02/2010 15:43, Hongyi Zhao wrote:
> I want to do a for loop on the following files:
>
> DO*.pdf,
> Do*.pdf,
> dO*.pdf,
> do*.pdf,
>
> So I use the following code:
>
> for i in [Dd][Oo]*.pdf
>
> Am I right or not?

To my knowledge you are right. I don't know whether it's POSIX,
but ash-derivates work that way.

--
A: Because it fouls the order in which people normally read text.
Q: Why is top-posting such a bad thing?
A: Top-posting.
Q: What is the most annoying thing on usenet and in e-mail?
From: j-o-e-h on
looks good:

u're usin the [] thin for the wirst two letters which can be either
capital or not an u're using the "." which a shell needs to verify you
mean e *.* file