title: Using "$RANDOM" to generate a random string in Bash
body: <p>I am trying to use the Bash variable <code>$RANDOM</code> to create a random string that consists of 8 characters from a variable that contains integer and alphanumeric digits, e.g., <code>var=&quot;abcd1234ABCD&quot;</code>.</p>
  <p>How can I do that?</p>