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

Re: Would this (o) be very difficult to add?

    Hi Bart :)

 * Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx> dixit:
> }     array=(${(f)...})
> If you're storing in an array, you should skip the $(print -lP ...) part
> (which requires forking a subshell) and do this instead:
>     array=( *(e:'REPLY="%0(l..$RANDOM)$REPLY"':) )
>     array=( ${(%)array} )

    Oh, I forgot the (%) flag and I stuck with the '-P' for
interpreting %0. BTW, how works exactly the %0(l..$RANDOM)
construction? I know that the (l..) is for padding with a random
number, and I suppose the %0 is there for avoiding printing it, but I
don't know how it exactly works... If you're tired of this feel free
to ignore me ;) For me, %0 can only be a job specification, because I
don't know about any prompt escape that fits just %NUMBER :?

> }     Can this be done directly in the command line for the 'command',
> } or I'd better stuck with the array and the redirection?
> I'm not entirely sure, but I suspect you mean something like this:
>     command ${(f)"$(print -lP ... >&1 > file.list)"}

    Yes, it will do. I just didn't know where should I do the
redirection (or if it was possible at all...). Thanks a lot for
showing :))

    Raúl Núñez de Arenas Coronado

Linux Registered User 88736
http://www.pleyades.net & http://raul.pleyades.net/

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