Bash-script – doesn't work in a launcher
gurus.knugum at gmail.com
Sat Dec 31 17:00:21 UTC 2011
I made a bash script that I want to run by clicking an icon on my
upper panel in Ubuntu 10.10. The script runs perfectly in a terminal,
but it doesn't do much if I start it by clicking the icon in my panel.
I added the icon by creating a launcher the usual way.
So I changed the launcher from ”program” to ”program in terminal” to
be able to see what happens, if anything. I then found that it
produces error messages at every ”let” and ”[[”, which I guess are
bash specific, so it seems like sh is trying to run my script, not
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:
# Continuation of comment
# Another comment
# More comments
The script, including some bash specific things like ”let a=b*c” and
”if [[ something ]]; then”.
As I said, the script works perfectly from a terminal, no problems at all.
When launching it from a launcher, it seems like all bash specific
commands suddenly are unknown to the system, why is that? I guess I am
missing something, but what?
More information about the ubuntu-users