Re: binfmt_script and ^M

Andreas Schwab
2001-03-05T13:37:37Z

Jan Nieuwenhuizen <janneke@gnu.org> writes:

|> Pavel Machek <pavel@suse.cz> writes:
|>
|> > > $ head -1 testscript
|> > > #!/bin/sh
|> > > $ ./testscript
|> > > bash: ./testscript: No such file or directory
^^^^^^^^^^^^^^^^^^^^^^^^^
|> >
|> > What kernel wants to say is "/usr/bin/perl\r: no such file". Saying ENOEXEC
|> > would be even more confusing.
|>
|> So, why don't we make bash say that, then? As I guess that we've all
|> been bitten by this before.
|>
|> What are the chances for something like this to be included?

Very low, because it would not change anything.

|> @@ -3155,7 +3191,12 @@
|>
|> if (command == 0)
|> {
|> - internal_error ("%s: command not found", pathname);
^^^^^^^^^^^^^^^^^
|> + char buf[80];
|> + char *interpreter = extract_hash_bang_interpreter (pathname, buf);
|> +
|> + internal_error ("%s: command not found: `%s'", pathname,
|> + interpreter);
|> +
|> exit (EX_NOTFOUND); /* Posix.2 says the exit status is 127 */
|> }

Andreas.

--
Andreas Schwab "And now for something
SuSE Labs completely different."
Andreas.Schwab@suse.de
SuSE GmbH, Schanzäckerstr. 10, D-90443 Nürnberg
Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5