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

Re: permission denied

On Fri, Apr 21, 2023 at 7:42 AM Ray Andrews <rayandrews@xxxxxxxxxxx> wrote:
> On 2023-04-21 07:12, Peter Stephenson wrote:
> >
> > Yes, you can do ${(Q)${(z)1}} which does the splitting, then removes the
> > quotes (without any more splitting).

That's probably not what you actually want to do, though.  When I gave
you the (z) solution, there was no expectation that you'd directly
execute $chain -- it's not going to do the right thing if it actually
is a chain of two or more commands, or has redirections, or any other
complexity; instead it will just run the first command with all the
separators and subsequent tokens and commands as part of the argument

In this circumstance using eval would be much closer to correct.  But
--- why are you even bothering to split it at all if the intention is
to run it?  I thought the point was to put it in the history or some
other editable place as separate commands.

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