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

Re: unreproducible bug with ${=...}

Thank you dana for the reply.

On Sat, Dec 14, 2019 at 09:59:49AM -0600, dana wrote:
On 13 Dec 2019, at 22:53, frederik@xxxxxxx wrote:
P.S. I switched to using "zip" expansion, as suggested by Mikachu on IRC,
which seems more elegant and doesn't use IFS: ${${:---exclude}:^^excludes}

In this case you could also just do: --exclude=$^excludes

Thanks, that's a good point, what with rsync following the GNU long option conventions.

As to why your ${=...} result sometimes differs, the most obvious thing that
comes to mind is IFS getting changed somehow. But i don't know how that would
be happening intermittently. As far as debugging, i guess just add logging to
show what IFS is set to immediately before the command, and/or run the script
with -x if you can?

Yeah, by the time I made that edit to print IFS, I was having a hard time reproducing.

I do have a shell function which I use a lot that sets IFS within a () subshell. That's the only occurrence of the variable in my .zshrc.



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