Re: Bash-script – doesn't work in a launcher
gurus.knugum at gmail.com
Sat Dec 31 18:21:57 UTC 2011
2011/12/31 Avi Greenbury <lists at avi.co>:
> Johnny Rosenberg wrote:
>> Still I wonder why it worked with the #!/bin/bash line not at the top
>> when I ran it from a terminal, should it really…? Maybe because bash
>> is default in a terminal?
> Exactly. When you don't specify an interpreter to use, generally the
> current shell is used, which is probably bash.
> A line beginning #! anywhere other than the top of the script is simply
> a comment; there's nothing parsing it to work out what to do.
That's very good to know. I thought it would recognise it wherever it
was, as long as nothing was done above it, but now I know better.
More information about the ubuntu-users