[Top][All Lists]

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

Re: ensure a VPATH build

From: Keith Marshall
Subject: Re: ensure a VPATH build
Date: Sat, 18 Feb 2006 14:25:58 +0000

On Saturday 18 February 2006 12:53 pm, Ralf Wildenhues wrote:
> I'm sorry, but please be more precise and quote which part of the node
> you mean.  I cannot find this exact bug described there (CVS Autoconf).

>From autoconf-2.59
|File:,  Node: Shell Substitutions,  Next: Assignments,  
|Prev: File System Conventions,  Up: Portable Shell
|Shell Substitutions
|Contrary to a persistent urban legend, the Bourne shell does not
|systematically split variables and back-quoted expressions, in
|particular on the right-hand side of assignments and in the argument of
|`case'.  For instance, the following code:
|     case "$given_srcdir" in
|     .)  top_srcdir="`echo "$dots" | sed 's,/$,,'`"
|     *)  top_srcdir="$dots$given_srcdir" ;;
|     esac
|is more readable when written as:
|     case $given_srcdir in
|     .)  top_srcdir=`echo "$dots" | sed 's,/$,,'`
|     *)  top_srcdir=$dots$given_srcdir ;;
|     esac
|and in fact it is even _more_ portable: in the first case of the first
|attempt, the computation of `top_srcdir' is not portable, since not all
|shells properly understand `"`..."..."...`"'.  Worse yet, not all
|shells understand `"`...\"...\"...`"' the same way.  There is just no
|portable way to use double-quoted strings inside double-quoted
|back-quoted expressions (pfew!).

Granted, that's referring primarily to nested double quotes, with 
backtick substitution, but there is an inference that the two interact in 
a non-portable manner, which is best avoided.


reply via email to

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