Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

How to run commands in new terminal windows?

I need to run a part of a script in other terminal windows. For example:

# first echo run in terminal window 1
echo "This echo command print in window 1"
# first echo run in terminal window 2
echo "This echo command print in window 2"
# first echo run in terminal window 3
echo "This echo command print in window 3"

Please answer with example code.

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

>Solution :

xterm -e 'echo "This echo command print in window 1"'

will start an Xterm window and tell it to execute that command.

Replace xterm with the actual terminal program you’re using (e.g. gnome-terminal). It may also use different syntax for providing a command to execute, so check its documentation for the correct syntax.

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading