Can't invoke bash script from desktop with KDE4 not any more

I wrote a bash script which is used by a lot of Linux beginners. Most of them manage to open a console and call it. Just for their convenience I added some code so they also can invoke the bash script from the desktop with a mouse click. That worked fined with KDE3 - but fails now with KDE4.

The code I use for KDE3 is

tty -s;
if  $? -ne 0 ]; then
  konsole --noclose -T "collectNWData.sh" --vt_sz 132x25 -e "$0";
fi

Seems the sysntax has changed for the konsole call. So I used ‘konsole --help’ and figured out


tty -s;
if  $? -ne 0 ]; then
  konsole --nofork -e "$0"
fi

which unfortunately doesn’t open a konsole and invokes the script :frowning:

Any idea how to get this done for KDE4 ? Would be even better to have ONE code for KDE3 and KDE4.

Do you have execute permission on the script?

Yes, that’s the first instruction for the Linux beginners - set the executable flag for the script. It worked for KDE3 - but not for KDE4 :-(. It’s from my point of view a coding problem because the semantic of the ‘konsole’ command has changed and I don’t get the point of the change.

Why don’t you run the script from a terminal and see what output it gives you?

To get konsole in KDE4 to open and run a script file the syntax would be:

konsole -e command

When the command completes, konsole will then close.

Thank You,

Thx for your reply. I just changed the script accordingly and it starts successfully.

Hey, nothing like just in time help.lol! I happen to run across your question here and knew the answer. Normally it should not take five months to get help unless no one has any idea about the problem, or more likely, it just fell through the cracks. Any way, thanks for hanging in there for so long.

Thank You,