Magic Shebang not cross platform compatible?
[email protected] Wed, 1 Oct 2003 10:21:37 -0400
| Newsgroups | gmane.comp.gnu.sh-utils.bugs |
|---|---|
| Message-ID | <OF366727B1.611D2C42-ON85256DB2.004D6B50-85256DB2.004EE21C@kennedytech.com> |
I've found that if bash scripts (or python and probably many more) use the magic shebang trick as in the following example: #!/usr/bin/env sh and the file is written in DOS format with CR/LF endings such is as very common with bash scripts under Cygwin or Python scripts that originated from the DOS world they don't work under the *nix world. It appears that the CR becomes part of the name for the interpreter to use as evidenced by this output from the attached script: $ ./test 2>&1 | od -c 0000000 / u s r / b i n / e n v : s h 0000020 \r : N o s u c h f i l e 0000040 o r d i r e c t o r y \n 0000055 While I certainly would not claim this is a bug, it does seem like it could be handled gracefully. -- John Florian Kennedy Technologies 517.646.6928 ext. 103