From: Hongyi Zhao on
On Tue, 16 Feb 2010 14:46:11 +0000, pk <pk(a)pk.invalid> wrote:

>Why don't you just try?

I'm using cygwin under windows xp, so the filename in my case isn't
case sensitive.
--
..: Hongyi Zhao [ hongyi.zhao AT gmail.com ] Free as in Freedom :.
From: Tony Sequeira on
Hongyi Zhao wrote:
> On Tue, 16 Feb 2010 14:46:11 +0000, pk <pk(a)pk.invalid> wrote:
>
>> Why don't you just try?
>
> I'm using cygwin under windows xp, so the filename in my case isn't
> case sensitive.

http://sources.redhat.com/cygwin/cygwin-ug-net/using-cygwinenv.html

The CYGWIN environment variable
.....
This option also accepts an optional [no]ignorecase modifer. If
supplied, wildcard matching is case insensitive. The default is noignorecase


--
S. Anthony Sequeira
++
Good-bye. I am leaving because I am bored.
-- George Saunders' dying words
++
From: Ed Morton on
On Feb 16, 8:43 am, Hongyi Zhao <hongyi.z...(a)gmail.com> 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?
> --
> .: Hongyi Zhao [ hongyi.zhao AT gmail.com ] Free as in Freedom :.

It's interesting that so far most of the reponses have been addressing
the syntax of the "for" loop rather than the question of whether or
not you actually need a "for" loop.

If the OPs code actually looks something like this:

for i in [Dd][Oo]*.pdf
do
cat "$i"
done

I wonder if the OP will be happy in the long run to know he really
nailed that for loop syntax rather than learning he didn't need a loop
in the first place :-).

Ed.
From: j-o-e-h on
Am 17.02.2010 18:54, schrieb Ed Morton:
> On Feb 16, 8:43 am, Hongyi Zhao<hongyi.z...(a)gmail.com> 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?
>> --
>> .: Hongyi Zhao [ hongyi.zhao AT gmail.com ] Free as in Freedom :.
>
> It's interesting that so far most of the reponses have been addressing
> the syntax of the "for" loop rather than the question of whether or
> not you actually need a "for" loop.
>
> If the OPs code actually looks something like this:
>
> for i in [Dd][Oo]*.pdf
> do
> cat "$i"
> done
>
> I wonder if the OP will be happy in the long run to know he really
> nailed that for loop syntax rather than learning he didn't need a loop
> in the first place :-).
>
> Ed.

I do agree, that I didn't think of that before.
A loop would be needed if u were going to work on those files (e.g. add
a # copyright by ... line to the end of the files).
Cat will "caternate" everything that matches your Wildcard-pattern anyways.
From: Ben Bacarisse on
j-o-e-h <j-o-e-h(a)web.de> writes:

> Am 17.02.2010 18:54, schrieb Ed Morton:
<snip>
>> It's interesting that so far most of the reponses have been addressing
>> the syntax of the "for" loop rather than the question of whether or
>> not you actually need a "for" loop.
>>
>> If the OPs code actually looks something like this:
>>
>> for i in [Dd][Oo]*.pdf
>> do
>> cat "$i"
>> done
>>
>> I wonder if the OP will be happy in the long run to know he really
>> nailed that for loop syntax rather than learning he didn't need a loop
>> in the first place :-).
>
> I do agree, that I didn't think of that before.
> A loop would be needed if u were going to work on those files
> (e.g. add a # copyright by ... line to the end of the files).

Not necessarily:

sed -i -e '$aCopyright Me 2010' [Dd][Oo].pdf

<snip>
--
Ben.