Re: new line added to a variable passed to a macro

2007-03-26 Thread Andreas Schwab
Vincent Torri <[EMAIL PROTECTED]> writes: > off topic : is it better to use ${have_ecore_con} or $have_ecore_con ? It does not really matter, but the former is more robust. Andreas. -- Andreas Schwab, SuSE Labs, [EMAIL PROTECTED] SuSE Linux Products GmbH, Maxfeldstraße 5, 90409 Nürnberg, Germa

Re: new line added to a variable passed to a macro

2007-03-26 Thread Keith MARSHALL
Andreas Schwab wrote, quoting Vincent Torri: >> off topic : is it better to use ${have_ecore_con} >> or $have_ecore_con ? > > It does not really matter, but ... Depending on context, it might: $foobar is the same as ${foobar}, but not ${foo}bar. In any context, where you need to append text to th

Re: new line added to a variable passed to a macro

2007-03-26 Thread Thomas Dickey
On Mon, 26 Mar 2007, Andreas Schwab wrote: Vincent Torri <[EMAIL PROTECTED]> writes: off topic : is it better to use ${have_ecore_con} or $have_ecore_con ? It does not really matter, but the former is more robust. That's contradictory (you should be able to explain it better). For instanc

Why if test "xSTRING1= "xSTRING2" (the 'x') ?

2007-03-26 Thread Jules Colding
Hi, I'm wondering why I keep seeing the if test "xSTRING1" = "xSTRING2"; then else fi construction when you want to compare the strings STRING1 and STRING2. The thing that I'm wondering about is the "x" in front of the two strings. Probably something entirely fundamental that I just forgot...

Re: Why if test "xSTRING1= "xSTRING2" (the 'x') ?

2007-03-26 Thread Eric Blake
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 According to Jules Colding on 3/26/2007 7:10 AM: > if test "xSTRING1" = "xSTRING2"; then > else > fi > > Probably something entirely fundamental that I just forgot... Portability. Suppose STRING1 is '(' and STRING2 is ')'. Then 'test "x(" = "x)"'

Re: Why if test "xSTRING1= "xSTRING2" (the 'x') ?

2007-03-26 Thread Jules Colding
On Mon, 2007-03-26 at 07:18 -0600, Eric Blake wrote: > -BEGIN PGP SIGNED MESSAGE- > Hash: SHA1 > > According to Jules Colding on 3/26/2007 7:10 AM: > > if test "xSTRING1" = "xSTRING2"; then > > else > > fi > > > > Probably something entirely fundamental that I just forgot... > > Portabi

Re: Why if test "xSTRING1= "xSTRING2" (the 'x') ?

2007-03-26 Thread Keith MARSHALL
Jules Colding wrote: > I'm wondering why I keep seeing the > > if test "xSTRING1" = "xSTRING2" ... The common idiom is `if test x$foo = xbar ...', and the `x' is a placeholder, in case $foo happens to expand to nothing. When quotes are added, the `x' seems redundant, until the test goes through

Re: Why if test "xSTRING1= "xSTRING2" (the 'x') ?

2007-03-26 Thread Andreas Schwab
Jules Colding <[EMAIL PROTECTED]> writes: > Hi, > > I'm wondering why I keep seeing the > > if test "xSTRING1" = "xSTRING2"; then > else > fi > > construction when you want to compare the strings STRING1 and STRING2. This avoids any spurious interpretation as an operator if either string might

Re: Why if test "xSTRING1= "xSTRING2" (the 'x') ?

2007-03-26 Thread Andreas Schwab
Keith MARSHALL <[EMAIL PROTECTED]> writes: > Jules Colding wrote: >> I'm wondering why I keep seeing the >> >> if test "xSTRING1" = "xSTRING2" ... > > The common idiom is `if test x$foo = xbar ...', and the `x' is > a placeholder, in case $foo happens to expand to nothing. If $foo happens to exp

Re: Why if test "xSTRING1= "xSTRING2" (the 'x') ?

2007-03-26 Thread Andreas Schwab
Eric Blake <[EMAIL PROTECTED]> writes: > According to Jules Colding on 3/26/2007 7:10 AM: >> if test "xSTRING1" = "xSTRING2"; then >> else >> fi >> >> Probably something entirely fundamental that I just forgot... > > Portability. Suppose STRING1 is '(' and STRING2 is ')'. Then 'test "x(" > = "

Re: Why if test "xSTRING1= "xSTRING2" (the 'x') ?

2007-03-26 Thread Paul Eggert
In reviewing this thread I found a few infelicities in the documentation and installed this patch: 2007-03-26 Paul Eggert <[EMAIL PROTECTED]> * doc/autoconf.texi (Shellology): Rework treatment of the 'test' command and case statements to make it a bit clearer and describe

Re: Why if test "xSTRING1= "xSTRING2" (the 'x') ?

2007-03-26 Thread Bruce Korb
Hi Paul, On 3/26/07, Paul Eggert <[EMAIL PROTECTED]> wrote: [EMAIL PROTECTED] Shell Pattern Matching [EMAIL PROTECTED] Shell Pattern Matching [EMAIL PROTECTED] Shell pattern matching + +Nowadays portable patterns can use negated character classes like [EMAIL PROTECTED] The older syntax @samp{[^