[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: globstar syntax
From: |
Chet Ramey |
Subject: |
Re: globstar syntax |
Date: |
Tue, 20 Jan 2009 23:27:56 -0500 |
User-agent: |
Thunderbird 2.0.0.19 (Macintosh/20081209) |
Sebastian Kapfer wrote:
> Am Montag, den 19.01.2009, 10:14 -0800 schrieb Alex Reed:
>> Should the globstar (**) syntax allow for partial parameter matching
>> (i.e. **.c to find all *.c files in the current directory and its sub-
>> directories)?
>>
>> Currently this can be implemented like this:
>> for i in **; do if [[ ${i} =~ \.c$ ]]; then <my_operation>; fi; done
>
> Huh?
>
> So what's the difference between the following two lines
>
> echo **
>
> echo `find`
Nothing. But now try to duplicate the effect of **/*.c, which does
what Alex wants. The difference between his desired syntax and what's
implemented is that the `**' has to appear on its own as a directory
element to have its special meaning. Sorry if my rather terse reply
to his question didn't make that clear.
Chet
--
``The lyf so short, the craft so long to lerne.'' - Chaucer
Chet Ramey, ITS, CWRU address@hidden http://cnswww.cns.cwru.edu/~chet/