John,
I'm a bit confused by all of this--why isn't "hashbang" just invoking
the ruby interpreter directly? I think you've lost something in
simplifying the example.
Any way, I had a play, and found that by modifying "flashbang" to copy
all but the first line of the first argument to a temporary file, I
could get it to work the way I *think* you want. I.e., using
===/home/johnc/foo/flashbang==========================================
#!/bin/sh
echo flashbanger
echo $0
tail +2 $1 > x
shift 1
/usr/bin/ruby x "$@"
======================================================================
I get:
$ ./flashbang ./hashbang "Hello World"
flashbanger
Hello World
$
Of course, this assumes the first argument to flashbang is a ruby script
with the first line invoking something other than ruby.
I also tried adding "ruby" at the end of the first line of "hashbang":
===/home/johnc/foo/hashbang===========================================
#!/home/johnc/foo/flashbang #ruby
puts ARGV[0]
======================================================================
That seemed to work as well, and is simpler.
Does any of this help? Or does it still require change to too many
places for your purposes?
Of course, you could build your own version of ruby (or bash), in true
open-source spirit!
--Mike
**********************************************************************
This electronic message together with any attachments is confidential. If
you receive it in error: (i) you must not use, disclose, copy or retain
it; (ii) please contact the sender immediately by reply email and then
delete the emails. Views expressed in this email may not be those of the
Airways Corporation of New Zealand Limited
**********************************************************************