bug-bash
[Top][All Lists]
Advanced

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

Re: $(<file) requotes the quotes?


From: Phil Edwards
Subject: Re: $(<file) requotes the quotes?
Date: Wed, 27 Nov 2002 13:18:59 -0500
User-agent: Mutt/1.2.5i

On Wed, Nov 27, 2002 at 09:16:25AM -0500, Chet Ramey wrote:
> > Where?  "Command Substitution" doesn't mention anything about quoting or
> > quote removal.  The section on "Quote Removal" talks about "the preceeding
> > expansions," and makes no exception for command substitution.
> > 
> > 
> > > Nor does $(<file).  It's a matter of what *isn't* being done, which
> > > normally is done (by bash) for text that is part of the script itself.
> > > You would see the same behavior with cat.
> > 
> > Ah.  Bummer.
> > 
> > 
> > Thanks for the answer!
> 
> One additional thing that was not pointed out in this discussion is the
> fact that the xtrace (set -x) code attempts to quote its output in such
> a way that it can be reused as input.  This accounts for the additional
> quotes you saw when you enabled set -x.

So, the act of investigating the output changes the output.  (The sed is
both alive /and/ dead until I open the box?)

I can see why -x works that way, but it'd be nice to have a way to turn
that off, and even nicer to have it documented in the first place.

I've hacked around this in the meantime.


Thanks again,
Phil

-- 
I would therefore like to posit that computing's central challenge, viz. "How
not to make a mess of it," has /not/ been met.
                                                 - Edsger Dijkstra, 1930-2002




reply via email to

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