Re: Strange diagnostic
"Nikita V. Youshchenko" <yoush@cs.msu.su> writes:
>
> And why error message when a user attempts to run it is so strange?
> Is that normal, or it should be filed as bug reports?
The error message is strange because Bash prints a strange error
message. Specifically, if the execve(2) system call fails, Bash
checks if the file starts with "#!". If it does, it
prints an error message of the form:
bash: <scriptname>: </name/of/interp>:
bad interpreter: <Text for the error>
instead of just:
bash: <scriptname>: <Text for the error>
The wording is bad. However, it's meant to remind the user that an
interpreter is involved and might be the source of the problem. I
imagine the most common mistake is to create a script with a mistyped
interpreter name, like:
#!/bin/sj
echo do something
Getting the message:
bash: myscript: No such file or directory
is baffling. But,
bash: myscript: /bin/sj: bad interpreter: No such file or directory
makes the source of the problem clearer.
A better error message might be:
bash: myscript (using interpreter /bin/sj): No such file or directory
You can try filing a bug on it if you'd like. It might find its way upstream.
--
Kevin <buhr@telus.net>
Reply to: