Re: binfmt_script and ^M

From: Andreas Schwab (schwab@suse.de)
Date: Mon Mar 05 2001 - 08:37:09 EST


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
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Wed Mar 07 2001 - 21:00:16 EST