title: Prevent pwgen -y generating backticks or quotes? (or otherwise sanitize output)
body: <p>I'm using pwgen in a bash script. For security, we have to use the <code>-y</code> flag to include at least one special character. However, this frequently returns passwords with one or more of ` or " which break the surrounding script. </p>
  
  <p><strong>Can I prevent these characters being generated?</strong> If not, what's the cleanest way to remove, replace or otherwise sanitize pwgen's output to exclude these characters?</p>
  
  <p>My current pwgen is;</p>
  
  <pre><code>intPW=$(pwgen -c -n -y -B -1 15)
  </code></pre>
  
  <p>which means intPW's value could be something like; </p>
  
  <pre><code>iqui`c:ee4so4Ch
  hph7eew"ohr9Ee
  </code></pre>
  
  <p>I need to guarantee that every password has a symbol in it, just not one of the problematic symbols.</p>
  
  <p>Anything I can think of in terms of replacement, from an if loop to a sed, breaks because I'm trying to target a backtick. </p>