title: How to select a random item from an array in shell
body: <p>I'm creating a bot in Shell Script:</p>
  
  <pre><code># Array with expressions
  expressions=("Ploink Poink" "I Need Oil" "Some Bytes are Missing!" "Poink Poink" "Piiiip Beeeep!!" "Hello" "Whoops! I'm out of memmory!")
  
  # Seed random generator
  RANDOM=$$$(date +%s)
  
  # Loop loop loop loop loop loop ...
  while [ 1 ]
  do
      # Get random expression...
      selectedexpression=${expressions[$RANDOM % ${#RANDOM[*]}]}
  
      # Write to Shell
      echo $selectedexpression
  
  
      # Wait an half hour
      sleep 1 # It's one second for debugging, dear SOers
  done
  </code></pre>
  
  <p>I want that it prints a random item from the <code>expressions</code> every second. I tried this but it does not work. It only prints the first one (Ploink Poink) every time. Can anyone help me out?
  Thanks</p>