[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Using $bindir in

From: Stepan Kasal
Subject: Re: Using $bindir in
Date: Mon, 10 Jan 2005 16:47:06 +0100
User-agent: Mutt/1.4.1i


On Mon, Jan 10, 2005 at 04:32:51PM +0100, Andreas Schwab wrote:
> Stepan Kasal <address@hidden> writes:
> > +  ac_define_dir=`eval echo "\"[$]$2\""`
> > +  ac_define_dir=`eval echo "\"[$]ac_define_dir\""`
> In this case the quotes are not necessary because assignments are not word
> splitted.

Both `eval' and `echo' do word-splitting.  So both pairs of quotes are needed.
(My terminology may be wrong, but my tests show you need the quotes.)

> But it can be further simplified:
> eval ac_define_dir=\"[$]$2\"
> eval ac_define_dir=\"[$]ac_define_dir\"

You are right, bu you need to quote more:

eval ac_define_dir="\"[$]$2\""
eval ac_define_dir="\"[$]ac_define_dir\""

I use the following to test:

a='a  $b'  # double space
b='b  $c'
c='c  $d'
d='d  $e'
e='e  $f'

eval x="\"$a\""; echo "$x"
eval x="\"$a\""; echo "$x"

Updated patch attached.

Stepan Kasal

Attachment: ac-archive-ac_define_dir3.patch
Description: Text document

reply via email to

[Prev in Thread] Current Thread [Next in Thread]