[prev in list] [next in list] [prev in thread] [next in thread] 

List:       autoconf
Subject:    Re: Autoconf Digest, Vol 128, Issue 6
From:       "David A. Wheeler" <dwheeler () dwheeler ! com>
Date:       2014-12-31 17:19:37
Message-ID: E1Y6Mvp-0007xz-9A () rmm6prod02 ! runbox ! com
[Download RAW message or body]

Bob Friesenhahn <bfriesen@simple.dallas.tx.us>
> 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


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic