The accepted answer is too inconsistent with the title of the question, although the details in the question are somewhat mixed. The question asks how to shuffle the elements of an array in BASH, and kurumi's answer shows how to manipulate the contents of the string.
kurumi nevertheless makes good use of the shuf command, and siegeX shows how to work with the array.
Putting the two together gives the real "easy way to shuffle the elements of the array in the BASH wrapper":
$ myarray=( 'a;' 'b;' 'c;' 'd;' 'e;' 'f;' ) $ myarray=( $(shuf -e "${myarray[@]}") ) $ printf "%s" "${myarray[@]}" d;b;e;a;c;f;
David mckinley
source share