title: Writing an script interpreter in bash
body: <p>I wrote a bash wrapper to ruby that goes through various setup steps.</p>
  
  <p>The most basic version is,</p>
  
  <pre><code>   #!/bin/bash 
     #   ruby_wrapper.sh
     ruby
  </code></pre>
  
  <p>Now I want to be able to use this wrapper just like regular ruby! Specifically, I want to create a .rb file that uses this "interpreter".</p>
  
  <pre><code>   #!/path/to/ruby_wrapper.sh
     #  my_file.rb
     puts "hello world"
  </code></pre>
  
  <p>So I want to be able to do <code>$ ./my_file.rb</code> instead of <code>$ ruby_wrapper.sh my_file.rb</code></p>
  
  <p>Is this possible?</p>
  
  <p>The <a href="http://netbsd.gw.com/cgi-bin/man-cgi?script+7+NetBSD-current" rel="nofollow">documentation</a> claims it isn't. </p>
  
  <blockquote>
    <p>Note that the interpreter may not itself be an interpreter script.</p>
  </blockquote>
  
  <p>But I don't see why not. Does anyone have any ideas to get around this?</p>