LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   executing shell script in terminal directly with a double click (https://www.linuxquestions.org/questions/programming-9/executing-shell-script-in-terminal-directly-with-a-double-click-370091/)

Schlammsuhler 11-26-2012 02:32 PM

running in gnome-terminal solved
 
Quote:

I put this at the top of my bash scripts:-
Code:

tty -s; if [ $? -ne 0 ]; then konsole -e "$0"; exit; fi
If the script is not running in a terminal then it restarts itself in Konsole.
For Gnome-Terminal you run it like this:
Code:

tty -s; if [ $? -ne 0 ]; then gnome-terminal -x "$0"; exit; fi


All times are GMT -5. The time now is 11:46 PM.