What (potential) errors does the addition of the '--' prevent?
On systems that do depend on the shebang to find the executable, a stray carriage return (as so often happens when transferring files from Windows to Unix) can break that magic. Adding -- in such cases ensures that the trailing ^M never interferes with the binary name. Then again, adding ANY switch seems to accomplishes the same...
$ cat -e cM.pl #!/usr/bin/perl^M$ ^M$ print "Hello, World!";^M$ $ ./cM.pl : bad interpreter: No such file or directory $ cat -e cM--.pl #!/usr/bin/perl --^M$ ^M$ print "Hello, World!";^M$ $ ./cM--.pl Hello, World!
--k.
In reply to Re: Re: Using -- to terminate switch processing
by Kanji
in thread Using -- to terminate switch processing
by thelenm
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |