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

Re: first adventures



On 11/01/2014 11:40 AM, Peter Stephenson wrote:

This isn't fair in this case.  The character \ was picked to be a
special character because it isn't commonly used in normal text.  So
it's special to the command line.  You now need it to be special
somewhere else *as well*, at a later stage, for something that also
picked the backslash to be special for exactly the same reason.  It's
not surprising that takes a bit of doing.


Yeah, I see that. Still, all those {( ) .... processors are arbitrary, tho useful, tools. One could, I suppose create new ones to do whatever one wanted, including stripping quotation marks while leaving the 'special' backslash pairs. But I understand the logic of (Q) now, and I'm happy with (z) anyway because quoted strings are naturally single arguments, and (z) leaves ' \n ' alone.

But my thinking is anticipated by the ' -r ' switch, which recognizes the specialness of the ' \n ' family of escapes, so one could imagine other parts of the shell recognizing that, too. It would just 'harmonize' what print and read and echo do with what the shell itself might be
able to provide, namely special treatment for  \n \t \b , etc. if requested.
With your analogy, you're trying to put a coffee bean into a roaster and
saying that you want it to emerge unscathed in such a way that it can be roast by
something else after it emerges.
I'd rather say that I'd like to be able look at the bean before it's roasted at all. Anyway, TRAPDEBUG
seems to do exactly that, so my itch is scratched.

If you want text not to be processed by the shell, the best way of doing
that is to pass it via standard input and output rather than the command
line, using "read -r" and "print -r".

Can you give me an example of that, please?
pws




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