How to call a new terminal from a shell script?

4

I would like to know how to call a new terminal / xterm from within a command in the shell script, so that the shell script that called the other script continues running non-stop.

Does anyone have any suggestions?

    
asked by anonymous 16.01.2015 / 18:30

3 answers

2

If you are using GNOME as the interface, you can call a new terminal by calling gnome-terminal , see an example:

 
#!/bin/bash

readonly OUTRO_SCRIPT="hello1.sh"; # O script a ser executado

chmod +x $OUTRO_SCRIPT;
gnome-terminal -x bash -c "./$OUTRO_SCRIPT; exec $SHELL";

#Continua a execução do script

echo "Foo... ";
echo "....Bar";

To call Terminal Emulator - xterm :

xterm

Or:

x-terminal-emulator

If you are using XFCE as the interface, you can call the terminal by running xfce4-terminal :

xfce4-terminal

If you are using KDE as the interface, you can call the terminal by running Konsole :

Konsole

If you are using LXDE as the interface, you can call the terminal by running LXTerminal :

lxterminal

Here you can find some information regarding Terminal which may be useful.

    
16.01.2015 / 18:39
1

To call a command in the background (continue running non-stop), you use the command nohup [command] & to call the program or script.

 nohup [./script.sh] &

In this case, the program outputs will continue to be displayed on the terminal you called. In order for this to happen, you should redirect it to / dev / null.

nohup [./scrip.sh] > /dev/null &

Or maybe you want to redirect to a log file.

nohup [./script.sh] > ./saida.log &

I hope I have helped.

    
08.08.2017 / 08:12
-1

Headers

Simple, enter the command line below:

gnome-terminal - ./example.sh

Or if your script is in a specific location enter the path:

gnome-terminal - Desktop /./ example.sh

Legend:

"gnome-terminal" - > call a new terminal

"-" - > command to run the program or script

"Desktop / .example.sh -> path where script or program is

    
16.02.2018 / 03:06