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

Johnny Rosenberg gurus.knugum at
Sat Dec 31 17:39:03 UTC 2011

2011/12/31 Steve Flynn <anothermindbomb at>:
> On 31 December 2011 17:00, Johnny Rosenberg <gurus.knugum at> wrote:
>> Of course the first line of the script is #! /bin/bash. Well, except a
>> few comment lines above it, but that shouldn't matter, should it?
>> So it's basically something like this:
>> # Comment
>> # Continuation of comment
>> # Another comment
>> # More comments
>> #!/bin/bash
> The hash-bang line needs to be the first line in the script. Move that
> to the top of the script, stick in a "set -x" if you want to see
> what's happening under the covers.
> --
> Steve

Thanks, and also thanks to ”J” who wrote a similar reply. Yes, I moved
it to the top and now it seems to work. It still doesn't work on my
wife's computer though, I'm not sure why… She runs Ubuntu 10.04, so
maybe there are some differences there, like older bash version or
something like that. I'll take a closer look at it now.

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?

Kind regards

Johnny Rosenberg

More information about the ubuntu-users mailing list