Open console from inside script

Formerly, under 13.2 I had a KDE Autostart item that ran in a console showing my appointments…

#!/usr/bin/env xdg-open[Desktop Entry]
Comment=
Exec=pal >/home/ion/TEMP/pal.out;cat /home/ion/TEMP/pal.out /home/ion/TEMP/addon >/home/ion/TEMP/result;more /home/ion/TEMP/result\s
GenericName=
Icon=
Name=Pal
Path=
StartupNotify=true
Terminal=1
TerminalOptions=
Type=Application
X-KDE-SubstituteUID=false
X-KDE-Username=

It opened a console and I could page through it until it closed.

Under 42.1 I added this script (calendar.sh) in my home bin directory to Settings>Configure Desktop>Startup and Shutdown>Autostart>Script File…

#! /bin/bash
konsole -e pal >/home/ion/TEMP/pal.out;cat /home/ion/TEMP/pal.out /home/ion/TEMP/addon >/home/ion/TEMP/result;more /home/ion/TEMP/result

But no console opens. What am I doing wrong?

Thanks in advance.

That’s a redirect fail (I think).

Try (this is not tested):


konsole -e bash -c "pal >/home/ion/TEMP/pal.out;cat /home/ion/TEMP/pal.out /home/ion/TEMP/addon >/home/ion/TEMP/result;more /home/ion/TEMP/result" &

Thank you for the suggestion, but it did not work. I will continue my research on it.

Sorry that it didn’t work.

Let me comment on what’s wrong with your own first try.

The first command (up to “;” ) runs pal in a konsole. But it redirects the output of “konsole” (hint -there probably isn’t any) rather than the output of pal. By the time that the second command runs, “konsole” has already gone away (perhaps too quickly to see anything).

Excellent analysis of the problem! Re-wrote it as…

#! /bin/bash
pal >/home/ion/TEMP/pal.out;cat /home/ion/TEMP/pal.out /home/ion/TEMP/addon >/home/ion/TEMP/result;konsole -e bash -c "more /home/ion/TEMP/result"

…and it works again. Many thanks o wise one.

Yes, much simpler and cleaner.