Talk:Shebang (Unix)

From Wikipedia, the free encyclopedia

Contents

[edit] #!/bin/cat Shebang Quine "Illegal?"

The page, with its #!/bin/cat shebang example, states parenthetically that the resulting quine is "illegal." Does anyone know what the author means by this? Jesuswaffle 19:00, 15 July 2006 (UTC)

Not sure. You'd have dig further into what is a quine and what methods are allowed. To me it looks perfectly valid, though it's perhaps an abuse of the unix interpreter mechanism - still, it only adds to it's hack value. Misza13 T C 15:47, 15 July 2006 (UTC)
I've done some more research, and I can't find any justification in the sources I've looked at for calling this quine "illegal." Apparently GreyCat was the one who inserted the note. I'm kind of new to this, so I'm not sure if there's a process for getting his attention. Jesuswaffle 19:17, 15 July 2006 (UTC)
I believe that it was User:Jleedev who added that line: http://en.wikipedia.org/w/index.php?title=Shebang_%28Unix%29&diff=61690762&oldid=61170953 . To my best knowledge, quine may be called "illegal" by some people if it accesses disk files to read itself. Running /bin/cat surely reads disk files. --GreyCat 11:06, 4 October 2006 (UTC)
A quine is a self-reproducing sentence (or program), which typically contains a copy of itself. The cat example is technically a "pure" quine, in that anything the user types to stdin will be duplicated to stdout. On the other hand, it's not really a quine program at all, since it contains no executable code (apart from invoking cat). — Loadmaster 15:48, 5 December 2006 (UTC)
The cat example is "illegal" because the text line following the shebang line is not data that is read by the cat program, but is a shell command line; since the cat program is invoked in place of the shell, the text line is never read (by either sh or cat). It's probably more correct just to say that any lines past the shebang of cat are ignored. — Loadmaster 15:55, 5 December 2006 (UTC)

It don't work :)

root@jurp5-server:~# cat test
#!/bin/cat
Any text can be placed below the shebang.
root@jurp5-server:~# chmod +x test 
root@jurp5-server:~# ./test
#!/bin/cat
Any text can be placed below the shebang.


[edit] Merge

I am redirecting "Pound bang" to this article. Mbarbier 05:47, 16 November 2006 (UTC)

[edit] /bin/ruby vs. /usr/bin/ruby

Why is the path to ruby specified as /bin/ruby? I have yet to see it installed there, rather in /usr/bin, nor can I see why it should be in /bin. Yselkowitz 03:23, 29 January 2007 (UTC)

[edit] sharp like shifting a tone

[Please comment and/or correct: The word "sharp" may also have been taken from music, where the same sign is used to indicate certain tone shifts, e.g. "F#" for "F sharp".]

-> unlikely, as the hash is the standard quote on uniq and the header of a program is a quote. —Preceding unsigned comment added by 193.29.186.1 (talk) 14:32, 4 September 2007 (UTC)

[edit] Sha-Bang

An other way of writing Shebang ? Sha-Bang