Skip to content

Instantly share code, notes, and snippets.

@judofyr
Created March 3, 2011 19:57
Show Gist options
  • Save judofyr/853394 to your computer and use it in GitHub Desktop.
Save judofyr/853394 to your computer and use it in GitHub Desktop.
#!/bin/sh
=begin 2>/dev/null
exec ${RUBY_BIN:-ruby} -e"\$0='$0'; load '$0'" -- $@
=end
#!/usr/bin/env ruby
puts 123
# Examples:
#
# Just run the script:
# $ ./script
# $ sh script
#
# Run the script with a specific interpreter:
# $ ruby script
# $ jruby script
#
# Always run the script with a specific interpreter (set this in your .bashrc):
# $ export RUBY_BIN=/usr/bin/ruby
# $ ./script
# $ ./script
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment