[ale] Bash wildcard

Ed Cashin ecashin at noserose.net
Mon Mar 26 22:45:17 EDT 2012


If there are so many version control artifacts that it affects search
times, you can use the find command's prune feature.  It took me a
while to get used to using it, but it's worth it when it means
skipping a lot of work.

ecashin at Ed-Cashins-MacBook-Pro tmp$ find . -name 'OURmak*'
./.svn/OURmakefile
./.svn/OURmakefile.TEMPLATE
./foo/OURmakefile
./foo/OURmakefile.TEMPLATE
./OURmakefile
./OURmakefile.not_me
ecashin at Ed-Cashins-MacBook-Pro tmp$ cat om.sh
find . \( -type d -name .svn -prune -false \) \
    -o \( -type d -name .git -prune -false \) \
    -o \( -type d -name .hg -prune -false \) \
    -o \( -type f -name 'OURmakefile' -print \) \
    -o \( -type f -name 'OURmakefile.TEMPLATE' -print \)

ecashin at Ed-Cashins-MacBook-Pro tmp$ sh om.sh
./foo/OURmakefile
./foo/OURmakefile.TEMPLATE
./OURmakefile
ecashin at Ed-Cashins-MacBook-Pro tmp$

On Mon, Mar 26, 2012 at 8:23 PM, Jim Lynch
<ale_nospam at fayettedigital.com> wrote:
> On 03/26/2012 03:40 PM, Chris Fowler wrote:
>> This one stummped me.  I wanted to create a tar of my makefiles so I
>> used find.
>>
>> I wanted OURmakefile and OURmakefile.TEMPLATE.  I could not use a
>> standard wildcard because I'd pull in svn files.
>>
>> To get the wildcard for find I tried many differences of the following
>> with no luck.
>>
>> [DEVEL PERL]$ ls OURmakefil[{e},{e.TEMPLATE}]
>> OURmakefile
>> [DEVEL PERL]$
>>
>> [DEVEL PERL]$ ls -l OURmakefile*
>> -rw-rw-r-- 1 cfowler cfowler 3203 Mar 25 21:53 OURmakefile
>> -rw-rw-r-- 1 cfowler cfowler   63 Mar 21 13:16 OURmakefile.inc
>> -rw-rw-r-- 1 cfowler cfowler  563 Mar 26 15:29 OURmakefile.TEMPLATE
>> [DEVEL PERL]$
>>
>>
>> Ignore .inc
>>
>> So what is the secret sauce?
>>
>> Chris
>> _______________________________________________
>> Ale mailing list
>> Ale at ale.org
>> http://mail.ale.org/mailman/listinfo/ale
>> See JOBS, ANNOUNCE and SCHOOLS lists at
>> http://mail.ale.org/mailman/listinfo
>>
> I remove svn via: find . | grep -v svn
>
>
> And have you looked at cmake?
>
> Jim.
> _______________________________________________
> Ale mailing list
> Ale at ale.org
> http://mail.ale.org/mailman/listinfo/ale
> See JOBS, ANNOUNCE and SCHOOLS lists at
> http://mail.ale.org/mailman/listinfo



-- 
  Ed Cashin <ecashin at noserose.net>
  http://noserose.net/e/
  http://www.coraid.com/



More information about the Ale mailing list