Escaping strings in Bash using !:q
If only more languages supported quote operators like Perl.  They really do make certain things like this so much easier.<p>Non interpolating quotes:<p><pre><code>  q/I wasn't surprised when he said "boo" and game me $5/;
  q@I wasn't surprised when he said "boo" and game me $5@;
  q!I wasn't surprised when he said "boo" and game me $5!;
  q(I wasn't surprised when he said "boo" and game me $5);
  q[I wasn't surprised when he said "boo" and game me $5];
</code></pre>
Interpolating quotes:<p><pre><code>  qq/Hello, $name!/;
  qq!Hello, $name\!!;
  qq@Hello, $name!@;
  qq(Hello, $name!);
  qq[Hello, $name!];
  qq'Hello, $name!';
</code></pre>
Rule of thumb, single q for single quote string (non-interpolating normally), and two q's for a double quote string (normally interpolates).