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

Re: Sorting file names randomly

    Hi Bart :)

 * Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx> dixit:
> When using +h, the constraints imposed by the predefined type of each
> parameter will apply.  For example, you can't turn RANDOM into a float
> or an array, and specifying zero-padding for USERNAME will instead pad
> with spaces because you can't change the string to an integer.

    OK, that makes perfect sense.
> } > Fourth, you've eventually got to do this ...
> } > }     reply=(${reply/#????? /})
> }     Here I assumed that the array was processed one element at a time
> } so I didn't consider that the memory usage doubled. Cool :)))
> The ${reply/#????? /} part is processed one element at a time, but the
> entire right-side of the assignment expression has to be assembled from
> the results of the substitution before the actual assignment is done.

    That looks logical, too, because zsh is not smart enough (yet) to
know that the source and destination is the same array.
> }     Bart, thanks a lot for your examples, but LOT'S of thanks for
> } your explanations.
> Por nada.  Just keep asking interesting questions.

    The correct sentence for "you're welcome" is "de nada", BTW, but
thanks for answering in spanish :) And since I'm always getting into
problems I cannot solve by myself, I'm sure that I'll find my way
into many 'interesting' (read: buggering) problems ;) Thanks a lot,

    Raúl Núñez de Arenas Coronado

Linux Registered User 88736 | http://www.dervishd.net
http://www.pleyades.net & http://www.gotesdelluna.net
It's my PC and I'll cry if I want to...

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