title: ruby execute bash command with variables
body: <p>I need to execute a Bash command in a Ruby script. There are about 6 ways to do this according to <a href="http://tech.natemurray.com/2007/03/ruby-shell-commands.html" rel="noreferrer">"6 Ways to Run Shell Commands in Ruby" by Nate Murray</a> and a few other googled sources.</p>
  
  <pre><code>print "enter myid: "
  myID = gets
  myID = myID.downcase
  myID = myID.chomp 
  print "enter host: "
  host = gets
  host = host.downcase
  host = host.chomp 
  print "winexe to host: ",host,"\n"
  command = "winexe -U domain\\\\",ID," //",host," \"cmd\""
  exec command 
  </code></pre>