08-14-07 06:13 AM
Lew Pitcher wrote:
> Dave Murray wrote:
>
> Because, you got the line wrong :-)
>
> The line /should/ read
> #!/bin/bash
>
> That's
> hash (#)
> bang (!)
> /bin/bash
>
> The hash (#) introduces a comment, making the rest of the line 'null' as f
ar
> as bash is concerned
>
> OTOH, what you wrote
> bang (!)
> hash (#)
> /bin/bash
>
> started with a bang (!), which is a unary not operator for an expression.
The
> unary not /must/ be followed by an expression, which (in it's simplest for
m)
> is the name of an executable.
>
> ! someprogram
> would run
> someprogram
> and evaluate to a value of 0 if someprogram returned a non-zero value.
>
> With your starting line, the shell tried to run the executable called
> "#/bin/bash" (in order to logically NOT its resultcode) and could not find
> that program. So, it reported back to you that there was no such file or
> directory as "#/bin/bash"
Duh! Dyslexia strikes again. Thanks,
Dave
[ Post a follow-up to this message ]
|