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

Re: playing with IFS





On 2026-04-12 16:26, dana wrote:
On Sun 12 Apr 2026, at 18:10, Ray Andrews wrote:
I hear you.  But as often as not I've made some simple syntax error
that's reparable without having to dig into the agenda
you often rewrite or cut parts out of what you're actually doing so even
finding syntax errors requires digging.
Believe it or not, it seems polite to cut the problem down to the minimal specimen.  But of course that can be taken too far and I end up showing something that misses the crux of the problem cuz I misunderstand the problem.  In this case I had both the illegal space -- sometimes they're optional, sometimes they're mandatory and sometimes they are verboten -- and a stupid error:

BTW, here's the actual thing:

[ "$nospaces" ] && _execute_output=( ${{f}"$( sed -r 's/(\x1b\[K[:-]\x1b\[m\x1b\[K)[[:space:]]*/\1 /g' <<< ${(F)_execute_output} )"} )

Yup, it throws an error alright.  This is rather better:

[ "$nospaces" ] && _execute_output=( ${(f)"$( sed -r 's/(\x1b\[K[:-]\x1b\[m\x1b\[K)[[:space:]]*/\1 /g' <<< ${(F)_execute_output} )"} )

BTW Mark, I trust that sed can't be done native.  Fantastic if it could be tho.

Oh ... as to speed, 20% improvement, but in the real world microscopic.  But on principle I'd avoid the pipe if possible.

Thank you gentlemen








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