title: Replace hyphens with underscores in bash script
body: <p>Trying to write a bash script and in one part of it I need to take whatever parameter was passed to it and replace the hyphens with underscores if they exist.</p>
  
  <p>Tried to do the following</p>
  
  <pre><code>#!/usr/bin/env bash
  string=$1
  string=${string//-/_}
  echo $string;
  </code></pre>
  
  <p>It's telling me that this line <code>string=${string//-/_}</code> fails due to "Bad substitution" but it looks like it should do it? Am I missing something?</p>