Skip to contentSkip to conversation

binfmt_script and ^M

DISCUSSION [email protected] 1 participant 1 message Mar 5, 2001

lore
Share & tools
lore
#0 lore raw
Quoted 1 line

And what does POSIX say about "#!/bin/sh\r" ?

Nothing at all. The #! construction is not part of any standard right now. The implementation is messy - different operating systems do vaguely similar things, but all details differ.
Linux can do whatever it wants.
Of course it helps portability if we stay close to what other OSs do.

There is some discussion at
http://www.cwi.nl/~aeb/std/hashexclam-1.html
Additions and corrections welcome.

In this particular case I have no strong opinion,
but would not object to removing the '\r'.

The standard defines whitespace in the POSIX locale, as one or more <blank>s (<space>s and <tab>s), <newline>s, <carriage-return>s, <form-feed>s, and <vertical-tab>s.
Some systems strip the #! line for trailing whitespace, some don't.

Andries