Script that Opens the Terminal and Executes Some Commands

Sometimes it is not enought to schedule some scripts in the background to run. In this article I will show you how to make a script to open a terminal, execute some commands and allows you to see the output.

This can be done with the virtual terminal you like the most. Add one of the following lines to a startup script. You can open 5 terminals which exec 5 different commands, by pasting one of this lines 5 times and replacing the /path/to/command with the path for your script)

gnome-terminal -e /path/to/command

or:

xterm /path/to/command

or:

konsole -e /path/to/command

If you want to keep your terminal opened after the task is finished, use –noclose for konsole and -hold for gnome-terminal (I don’t remember the flag for xterm right now, sorry.)

$ gnome-terminal -e /path/to/command -hold

$ konsole -e /path/to/command --noclose

Liked it? Take a second to support Geekster on Patreon!
Tagged with: , , , , ,
Posted in The Linux and Unix Articles!

Leave a Reply

Your email address will not be published. Required fields are marked *

*

Support LinuxG via Patreon
Support LinuxG.net on Patreon!
Subscribe

  

Subscribe to get the latest Linux news and how to guides directly on your e-mail!