Not quite.. It's the C system library that's generating the error message in this case. All your shell is doing is calling an exec() variant with the command you're trying to execute. The C library opens the script, sees that there's a shebang line at the top with an interpreter specified, and it tries to invoke the interpreter. Since the interpreter isn't found (because it has a trailing, spurious CR at the end of it in this case), the exec() call has to return with a "No such file or directory" error, which is what you see. It "might" be feasible for the shell to explore a little further into the cause of the error by testing to see if the file does indeed exist, and if it does, throw a more descriptive error message, but it doesn't. All bash knows is that the system told it ENOENT (No such file or directory) when the shell asked the system to execute your script.
execve("./test", 0x00053AA8, 0x00053AB0) Err#2 ENOENT
-
Are you posting in the right place? Check out Where do I post X? to know for sure.
-
Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
<code> <a> <b> <big>
<blockquote> <br /> <dd>
<dl> <dt> <em> <font>
<h1> <h2> <h3> <h4>
<h5> <h6> <hr /> <i>
<li> <nbsp> <ol> <p>
<small> <strike> <strong>
<sub> <sup> <table>
<td> <th> <tr> <tt>
<u> <ul>
-
Snippets of code should be wrapped in
<code> tags not
<pre> tags. In fact, <pre>
tags should generally be avoided. If they must
be used, extreme care should be
taken to ensure that their contents do not
have long lines (<70 chars), in order to prevent
horizontal scrolling (and possible janitor
intervention).
-
Want more info? How to link
or How to display code and escape characters
are good places to start.
|