Re: Bash-script – doesn't work in a launcher

Johnny Rosenberg gurus.knugum at
Sat Dec 31 18:21:57 UTC 2011

2011/12/31 Avi Greenbury <lists at>:
> 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.

Kind regards

Johnny Rosenberg

> --
> Avi

More information about the ubuntu-users mailing list