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

Re: protect backslash before space



On Wed, Apr 1, 2026 at 9:08 AM Ray Andrews <rayandrews@xxxxxxxxxxx> wrote:
>
> I like my functions to be able to see their own tail.

I have no idea what that means.

> BTW, question: why does the script version above add the single quotes to indicate a single filename whereas the 'eval'ed version doesn't see the need?  I'd vaguely expect the single quotes in both.

I'm not entirely sure what this question means, either, but there's
something strange about your examples, because you don't have noglob
for the "." (dot) command so
% . test junk*
should be expanding and therefore passing two arguments to the "ls" at
the end of the script.

So there's something you're not showing us?

Also, in either of your examples but using
% . test junk* && test junk*
for reference, the "alias test=..." created in the script will NOT be
applied to the right-hand-side of the && when this is the first time
this script is sourced in any given shell.  Aliases have to be in
place before the command line is accepted.




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