Given an array of elements (servers), how do I shuffle the array to obtain a random new array ?
inarray=("serverA" "serverB" "serverC")
outarray=($(randomize_func ${inarray[@]})
echo ${outarray[@]}
serverB serverC serverA
There is a command shuf (man page) but it does not exist on every linux.
This is my first attempt to post a self-answered question stackoverflow, if you have a better solution, please post it.