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

Re: extra arguments inserted by glob thinger e:: get sorted afterwards



Hello Mikael,

Mikael Magnusson <mikachu@xxxxxxxxx> wrote:
> Hi, someone just asked on irc how to give a globbed list of files to a
> program with a -f inserted before each argument, so I told him
> *(e:'reply=(-f $REPLY)':), that doesn't work however, as the arguments
> are resorted afterwards, which seems like the less useful way to do
> it. Of course one can add oN, but it would be nicer if you could both
> sort files and add extra arguments. Stuff like oa doesn't make sense
> on the inserted arguments anyway.
>
> % print -- *.sh(oNe:'reply=(-f $REPLY)':)
> -f zmpc.sh -f ifs.sh -f test.sh -f script_pandora.sh

Why not use $^?

% print -- -f\ ${(f)^"$(print -l /bin/ls*)"}
-f /bin/ls -f /bin/lsmod

Bye, JÃrg.
-- 
> Definiere âDemokratieâ â
â eine Mehrheit beweist einer Minderheit, dass Widerstand zwecklos ist.



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