J
John Carter
Without cheating (trying to run it) what will this pair of files do under Linux....
Here is a little script we want to be interpreted by the "flashbang" interpreter...
===/home/johnc/foo/hashbang===========================================
#!/home/johnc/foo/flashbang
puts ARGV[0]
======================================================================
So we expect
./hashbang "Hello World"
to be formally equivalent to running...
/home/johnc/foo/flashbang ./hashbang "Hello World"
Now assume....
===/home/johnc/foo/flashbang==========================================
#!/bin/sh
echo flashbanger
echo $0
echo "$@"
/usr/bin/ruby "$@"
======================================================================
Let's try...
/home/johnc/foo/flashbang -e 'puts "Hello World"'
On my system the result is....
flashbanger
/home/johnc/foo/flashbang
puts "Hello World"
Hello World
No surprise...
Now what do you think happens if you say...?
./hashbang "Hello World"
Now what do you think happens if you say....?
/home/johnc/foo/flashbang ./hashbang "Hello World"
Scroll down for the answers...
Here is a little script we want to be interpreted by the "flashbang" interpreter...
===/home/johnc/foo/hashbang===========================================
#!/home/johnc/foo/flashbang
puts ARGV[0]
======================================================================
So we expect
./hashbang "Hello World"
to be formally equivalent to running...
/home/johnc/foo/flashbang ./hashbang "Hello World"
Now assume....
===/home/johnc/foo/flashbang==========================================
#!/bin/sh
echo flashbanger
echo $0
echo "$@"
/usr/bin/ruby "$@"
======================================================================
Let's try...
/home/johnc/foo/flashbang -e 'puts "Hello World"'
On my system the result is....
flashbanger
/home/johnc/foo/flashbang
puts "Hello World"
Hello World
No surprise...
Now what do you think happens if you say...?
./hashbang "Hello World"
Now what do you think happens if you say....?
/home/johnc/foo/flashbang ./hashbang "Hello World"
Scroll down for the answers...