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

Re: triviality with prompts



On 12/03/2014 09:06 PM, Bart Schaefer wrote:
On Dec 3,  3:14pm, Ray Andrews wrote:
} Subject: Re: triviality with prompts
}
} \
} ' '
} " "
} $' '
} $( )
}
} ... all cross-pollinating each other in various ways, but is that it for
} the main species?

$( ) is substitution, not quoting.  It is true that if you have both
outer double quotes and a $( ) inside them, then the rules for parsing
command substitution take over until the matching close-paren is found;
but otherwise nothing is quoted differently just because it is inside
a command substitution.

} Oh, and of course there's the various flavorings like 'rc_quotes' and
} I guess a few others like that.  Tractable.

The other major one is aritmetic evaluation in (( )) where everything
behaves as if double quoted, and then there are the special cases in
parameter subscript expressions, which can get a bit strange but in
practice you'll almost never run into.

<ignorable-philosophical-musing>

Thinking about all that, I find my self still fuzzy.  What do we really mean
by 'quote'?  It's a delineated block of characters in which some prescribed
semantics will apply. So " $() " is also a delineated block of characters
in which some prescribed semantics will apply,  ditto "  (())   " and
" [[]] ", yes? So, what's so special about what we call 'quoting'? Maybe
what I'm reaching for with the list above is a complete list of
'delineators'.  So, if one had such a list, one could learn the syntactic
rules inside each one in a tractable way.  Maybe the whole idea of 'quote'
is not so special, it's just two or three of the many more ways that zsh
will process a delineated block of characters.  The only thing 'special'
about it is that the delineators are the keyboard characters that we call
quotation marks, thus we are 'quoting'.  Or is quoting really,
syntactically, a different 'kind'  of thing than "  $()  "  or " []  "?




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