Shuffle Array

Randomly shuffle the elements of an array.

Code

General
echo "$arr" | tr -d '[]"' | tr ',' '\n' | shuf | tr '\n' ' ' | sed 's/ $//'

Parameters

JSON array to shuffle

Server

More Bash Snippets