[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Generating file lists
From: |
NightStrike |
Subject: |
Re: Generating file lists |
Date: |
Fri, 16 Oct 2009 13:52:11 -0400 |
On Fri, Oct 16, 2009 at 1:32 PM, Ralf Wildenhues <address@hidden> wrote:
> * NightStrike wrote on Fri, Oct 16, 2009 at 07:24:36PM CEST:
>> On Fri, Oct 16, 2009 at 1:22 PM, Ralf Wildenhues wrote:
>> > SYSHEAD_LIST=`echo $srcdir/include/sys/*.h`
>> >
>> > or
>> > set x $srcdir/include/sys/*.h
>> > shift
>> > SYSHEAD_LIST="$*"
>>
>> Which is more autoconfy-correct?
>
> Both have drawbacks and advantages. The first has a problem if $srcdir
> starts with a hyphen (not realistic; that would break lots of other
> places as well) or has other special characters; you could use AS_ECHO
> instead though as a remedy. The second does not fork, which is nice.
> But note that inside a macro, $* has relevance to M4, so you might need
> to write $][* or $[]*, depending on quotation level.
Thanks for the synopsis of both. I'll go with the first. I use
AS_ECHO everywhere anyway.
>> > This is purely a shell question.
>>
>> Well, doing it my way worked fine on the command line, both in bash
>> and sh, so I was confused.
>
> But the expansion that you hoped to happen did in fact only happen later
> in your testing. Try this on the command line:
> f=*
> echo "$f"
> echo $f
As always, Ralf, your perception is astounding. That's exactly how I
tested it, and you're entirely right. If I do 'set' to look at the
environment directly, it contains just the wildcard, not the
expansion. Darn. Foiled again!