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

Re: append to history entry?



On 27/12/16 11:09 AM, Bart Schaefer wrote:
Neither, really.  It's a case of gradually accumulating requirements
on what shells do, rather than any flaw in the original design.
Well, the flaw is just that the additional stuff wasn't anticipated. Mind, foretelling the future
can be difficult.

Seriously, you can't ask for a way to muck with something that is
normally handled transparently by the shell internals and then gripe
about having to replicate some of that hidden processing.  Well, you
can, but it doesn't really help. :-)
Yeah, the chaffing is just because however useful some of that is in most situations, it would be nice to be able to occasionally have a string be just a string be just a string in a C sort of way. Plain vanilla a literal. Like my old gripe about a command not being able to know the literal keystrokes that called it *except* that it's perfectly literal in history *except* that if commands are chained with semicolons one can't just grab it back from history for the obvious reason that any given command doesn't know where it is in a string of chained commands -- one would think that one should be able to intercept the string before all the expansions. So I hafta do all this 'noglob'. Most of my irritations with zsh
are in trying to *stop* it from doing things on occasion.

Daniel is rather dogmatic about handling edge cases that I tend to
ignore for the sake of not throwing out all the details that make you
"take it on faith" (a phrase that makes ME grind my teeth whenever you
write it).
Well, I trust you guys and until I see the logic, I'm just going to take your words for it.
There is so much to know.


} One thing tho Bart, it seems it should be 'echo' because when the
} command line is recalled and executed, the colon throws an error

It shouldn't.  There's no difference between "echo" and ":" except
that ":" discards its arguments without printing them.  If you're
getting an error on ":" you've done something else to cause it.

What error?

Ah ... seems there must be a space after the colon:


    print -rS -- "rap ${${(q+)@}}; : ${(q-)HOST}"

... that works fine, and doesn't bother with the echo, so it seems to be exactly the sort of thing I'm looking for as to writing to history. So much to love, frustrations or no.



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