title: How to escape strings for terminal in Ruby?
body: <p>I am attempting to start mplayer. My filename contains spaces and these should be escaped. 
  This is the code I am using:</p>
  
  <pre><code>@player_pid = fork do
     exec "/usr/bin/mplayer #{song.file}"
  end
  </code></pre>
  
  <p>where <code>#{song.file}</code> contains a path like <code>"/home/example/music/01 - a song.mp3"</code>. How can I escape this variable properly  (and possible other weird characters that the title may contain) so the terminal will accept my command?</p>