0

I would like to run a python script multiple times in a new terminal each time so I am making a bash script to do this.

#!/bin/bash

alias bot_1="cd ../Folder1"
alias bot_2="cd ../Folder2"

gnome-terminal
bot_1
python3 bot_one.py

gnome-terminal
bot_2
python3 bot_two.py

I would like to run a python script multiple times in a new terminal each time so I am making a bash script to do this.

With my script I have a new terminal which opens but the following commands are executed in the old and not the new

1
  • gnome-terminal opens a new terminal with its own shell; the execution of the current shell does not transfer to the new terminal window. (Also, alias expansion is not enabled by default in a non-interactive shell.) Commented Jun 24, 2022 at 19:26

1 Answer 1

2

gnome-terminal has the ability to execute a command other than the default interactive shell.

gnome-terminal --working-directory ../Folder1 -- python3 bot_one.py
gnome-terminal --working-directory ../Folder2 -- python3 bot_two.py
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.