Guy
Guy

Reputation: 14840

bash scripting with screen

I want to write a bash script that opens multiple screens and detaches them. So at the end you'll have a few screens open each running a different command.

Similar to ssh:

ssh DESTINATION "command 1; command 2;"

my idea was to write something like this:

screen -S name1 "command1"
screen -S name2 "command2"
...

But this doesn't work.

ideas?

Upvotes: 4

Views: 3733

Answers (1)

Ignacio Vazquez-Abrams
Ignacio Vazquez-Abrams

Reputation: 799490

Add -d -m to the screen command.

Upvotes: 10

Related Questions