bug-bash
[Top][All Lists]
Advanced

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

Re: Unexpected behavior observed when using address@hidden/pattern/strin


From: Chet Ramey
Subject: Re: Unexpected behavior observed when using address@hidden/pattern/string} construct
Date: Fri, 26 Jan 2007 18:36:45 -0500
User-agent: Thunderbird 1.5.0.9 (Macintosh/20061207)

Stahlman Family wrote:

> The result of all this is that for the "+", "-", and "=" parameter
> expansion
> constructs, nested double-quote pairs in the rhs are stripped, but for
> patsub
> constructs they are not. Is this difference by design?

Yes.  The patsub construct is implemented as in ksh93.  When Dave put
it into ksh, he decided that since Posix didn't standardize it, he was
not constrained by their standardization of the historical Bourne shell
behavior of nested quotes.  And so we have it today.


> Understood. (Provided that the phrase "the appropriate rules" does not
> refer to
> the respective top-level rules.) I wonder whether anyone has ever
> floated the
> idea of supporting a `compatible' option, which would determine whether
> Bourne
> shell compatibility is required in such contexts. With such an option, one
> could put
> 
> set +o compatible
> 
> at the top of a script to enable a more natural form of nested string
> processing. 

I will consider it for a future version.  Thanks for the suggestion.

Chet
-- 
``The lyf so short, the craft so long to lerne.'' - Chaucer
                       Live Strong.  No day but today.
Chet Ramey, ITS, CWRU    address@hidden    http://cnswww.cns.cwru.edu/~chet/




reply via email to

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