0

I have lots of servers written in Python. I want to run them, one script per one terminal tab. I'm using Xubuntu 16.04.

I know how to open the terminal tab in Xubuntu inside the bash script:

#!/bin/bash
xfce4-terminal --tab

Also, I know how to run python script in bash script:

#!/bin/bash
python server_1.py

But how can I open a new tab, and run the script in this new, opened tab?

1 Answer 1

1

There are the -x and -e options, have you tried them?

-x, --execute
    Execute the remainder of the command line inside the terminal
-e, --command=command
    Execute command inside the terminal

Ie. something like:

xfce4-terminal --tab --execute python server_1.py

If there is a problem with the skript path, you can specify the working directory with:

--working-directory=directory
1
  • I have weird errors when trying the --working-directory=directory (terminal has closed immediately) but the -x option works. Thank you for help.
    – mirx
    Mar 31, 2017 at 10:34

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .