autoconf
[Top][All Lists]
Advanced

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

Re: Autoconf Digest, Vol 128, Issue 6


From: David A. Wheeler
Subject: Re: Autoconf Digest, Vol 128, Issue 6
Date: Wed, 31 Dec 2014 12:19:37 -0500 (EST)

Bob Friesenhahn <address@hidden>
> The POSIX-style shell tosses the double quotes at first point of use.

When a variable reference is itself "..." quoted, like "$variable",
a POSIX shell does NOT toss the double-quotes.
When it's unquoted, a POSIX shell *does* toss the double-quotes.
I am *counting* on that behavior to make this scheme work.

This works out in makefiles at least.
Going back to my examples in a makefile:
SBCL =/cygdrive/c/"Program Files/Steel Bank Common Lisp/1.2.6/sbcl"
EGREP = /usr/bin/grep -E

Typically programs are invoked in a makefile as $(NAME),
and this 'just works' in the proposed convention:
dostuff:
  $(SBCL) < x.src > x.dest
  $(EGREP) pattern y.src >> x.dest


> Arguments must be escaped varying amounts of times to survive a given 
> data path, and the data path may not be a fixed one.

Many shell programmers, out of habit,
always reference shell variables as "$variable_name" instead of $variable_name,
and then quoting survives just fine.  It might not be hard to fix up the
remaining ones (it is a good habit anyway).

There might need to be a way to vary how replacements are done
(e.g., a Makefile would have the quoting scheme, while a #include file would 
not).
But the fundamental problem is that there's no way to distinguish the
different uses of spaces; once there's an input and storage convention,
you can then decide how to best output them.

--- David A. Wheeler



reply via email to

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