Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: auto-quoting inside braces in arguments



On 2021-02-19 13:17:05 +0100, Vincent Lefevre wrote:
> On 2021-02-18 10:30:50 -0800, Bart Schaefer wrote:
> > It needs to be a bit more complicated than that, because you first
> > have to be sure that the braces are not already quoted and do not form
> > a valid comma-separated (or ".." range) brace expression.  Also,
> > should anything special happen if there is a valid brace expression
> > inside the invalid brace pair?   Is this single- or double-quote
> > equivalent, or something new?
> 
> I think that { would just appear as a quote mechanism until a
> matching }. This should probably similar to double-quote.
> For instance
> 
>   echo {ab cd"ef }" $ZSH_VERSION {0..2} }
> 
> should be equivalent to
> 
>   echo "{ab cdef } $ZSH_VERSION {0..2} }"

though this would introduce a difference. Currently:

zira% echo {{a..c}
{a {b {c
zira% echo {{a..c}}
{a} {b} {c}
zira% echo {a..c}}
zsh: parse error near `}'

-- 
Vincent Lefèvre <vincent@xxxxxxxxxx> - Web: <https://www.vinc17.net/>
100% accessible validated (X)HTML - Blog: <https://www.vinc17.net/blog/>
Work: CR INRIA - computer arithmetic / AriC project (LIP, ENS-Lyon)




Messages sorted by: Reverse Date, Date, Thread, Author