[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: binfmt_script and ^M
From: |
Pozsar Balazs |
Subject: |
Re: binfmt_script and ^M |
Date: |
Mon, 5 Mar 2001 19:58:52 +0100 (MET) |
On Mon, 5 Mar 2001, Paul Flinders wrote:
> Jeff Mcadams wrote:
>
> > Also sprach Rik van Riel
> > >On Mon, 5 Mar 2001, John Kodis wrote:
> > >> On Mon, Mar 05, 2001 at 08:40:22AM -0500, Richard B. Johnson wrote:
> > >> > Somebody must have missed the boat entirely. Unix does not, never
> > >> > has, and never will end a text line with '\r'.
> >
> > >> Unix does not, never has, and never will end a text line with ' ' (a
> > >> space character) or with \t (a tab character). Yet if I begin a
> > >> shell script with '#!/bin/sh ' or '#!/bin/sh\t', the training white
> > >> space is striped and /bin/sh gets exec'd. Since \r has no special
> > >> significance to Unix, I'd expect it to be treated the same as any
> > >> other whitespace character -- it should be striped, and /bin/sh
> > >> should get exec'd.
> >
> > >Makes sense, IMHO...
> >
> > That only makes sense if:
> > #!/bin/shasdf\n
> > would also exec /bin/sh.
>
> POSIX disagrees with you (accd to the manual page)
>
> $ man isspace
> ....
> isspace()
> checks for white-space characters. In the "C" and
> "POSIX" locales, these are: space, form-feed
> ('\f'), newline ('\n'), carriage return ('\r'),
> horizontal tab ('\t'), and vertical tab ('\v').
And what does POSIX say about "#!/bin/sh\r" ?
In other words: should the kernel look for the interpreter between the !
and the newline, or [the first space or newline] or the first whitespace?
IMHO, the first whitespace. Which means that "#!/bin/sh\r" should invoke
/bin/sh. (though it is junk).
--
- Re: binfmt_script and ^M, (continued)
- Re: binfmt_script and ^M, Richard B. Johnson, 2001/03/05
- Re: binfmt_script and ^M, John Kodis, 2001/03/05
- Re: binfmt_script and ^M, Rik van Riel, 2001/03/05
- Re: binfmt_script and ^M, Jeff Mcadams, 2001/03/05
- Re: binfmt_script and ^M, Paul Flinders, 2001/03/05
- Re: binfmt_script and ^M, Andreas Schwab, 2001/03/05
- Re: binfmt_script and ^M, Paul Flinders, 2001/03/05
- Re: binfmt_script and ^M, Paul Flinders, 2001/03/05
- Re: binfmt_script and ^M, Andreas Schwab, 2001/03/06
- Re: binfmt_script and ^M, Paul Flinders, 2001/03/06
- Re: binfmt_script and ^M,
Pozsar Balazs <=
- Re: binfmt_script and ^M, Robert Read, 2001/03/05
- Re: binfmt_script and ^M, Richard B. Johnson, 2001/03/05
- Re: binfmt_script and ^M, Richard B. Johnson, 2001/03/05
- Re: binfmt_script and ^M, Dr. Kelsey Hudson, 2001/03/05
- Re: binfmt_script and ^M, Peter Samuelson, 2001/03/06
- Re: binfmt_script and ^M, Dr. Kelsey Hudson, 2001/03/06
[PATCH]: print missing interpreter name [Was: Re: binfmt_script and ^M], Jan Nieuwenhuizen, 2001/03/05
Re: binfmt_script and ^M, Erik Hensema, 2001/03/05