[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: binfmt_script and ^M
From: |
Paul Flinders |
Subject: |
Re: binfmt_script and ^M |
Date: |
Mon, 05 Mar 2001 19:54:08 +0000 |
Andreas Schwab wrote:
> This [isspace('\r') == 1] has no significance here. The right thing to
> look at is $IFS, which does not contain \r by default. The shell only splits
> words by "IFS whitespace", and the kernel should be consistent with it:
>
> $ echo -e 'ls foo\r' | sh
> ls: foo: No such file or directory
The problem with that argument is that #!<interpreter> can be applied
to more than just shells which understand $IFS, so which environment
variable does the kernel pick?
It's a difficult one - logically white space should terminate the interpreter
name but the definition of what is, or isn't, white space is quite definately
a user space issue. Unfortunately if you do use the user's locale to decide
you then open the possibility that whether a scipt works or not depends
on the locale - and that, surely, is equally unacceptable and deferring
to a user-space "script launcher" app is going to open yet more problems.
In the end I suspect that the only practical way out _is_ to say that the kernel
uses space (0x20) and tab (0x8) as white space and no other character.
This does miss the point though - whatever the rules are used to parse
the interpreter name it is still confusing when the error reported by the
shell is "No such file or directory". Especially when the file is sitting
in front of you. Would it be so bad to add an ENOINTERP error?
- Re: binfmt_script and ^M, Jan Nieuwenhuizen, 2001/03/05
- Re: binfmt_script and ^M, Alan Cox, 2001/03/05
- Re: binfmt_script and ^M, Andreas Schwab, 2001/03/05
- 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 <=
- 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, 2001/03/05
- 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