I have written a little bash script that reads commands (one per line), in a text file. At the moment, the script (shown below), is executing the commands in a sequential order (i.e. in the same order entered in the file).
I would like help to modify the script below, so that it reads the commands into an array, then randomizes that array (i.e. list) before iterating though the randomized list.
This is what I have so far:
while read -r -a array
do
python make_move.py "${array[@]}"
done < game_commands.dat
I am running bash 4.1.5 on Ubuntu 10.0.4 LTS
[[Edit]]
I need to execute ALL of the commands in the list, with each command being executed ONLY ONCE.