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

Re: shuffle array



>> You could do things like:
>>
>> array=("${(0@)$(printf '%s\0' "$array[@]" | shuf -z)[1,-2]}")
>
> It seems I always get the same shuffle
> for that?
>
> (1 2 3 a b c) -> (c 1 a 3 b 2)
>
> and
>
> (x y z 1 2 3) -> (3 x 1 z 2 y)
>
> - the same.

Sorry, I had a typo, as for the shuffling, it
works fine.

-- 
underground experts united
http://user.it.uu.se/~embe8573
https://dataswamp.org/~incal



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