[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Generating file lists
From: |
Ralf Wildenhues |
Subject: |
Re: Generating file lists |
Date: |
Fri, 16 Oct 2009 19:32:58 +0200 |
User-agent: |
Mutt/1.5.20 (2009-08-09) |
* 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.
> > 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
Cheers,
Ralf