[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Start multiple screen-sessions per script

From: Frank Röhm
Subject: Start multiple screen-sessions per script
Date: Mon, 2 Mar 2015 10:59:44 +0100


is it possible to start multiple screen sessions with each session with an own 
command which is immediately started in one script?
I want to start only one screen, and in this screen I need many sessions 
(normally started with ^A,C for create), but each session should directly start 
a command.

When I am in a screen, I can run this script “":



which starts two new sessions (as if pressed Control+A then C two times) and 
ran program1 in the first, program2 in the second. This works.
But I want to do this more automatically, because like this, I would need 50 
script files (, program2, … 
I only  want to use 2 scripts with all commands in the scripts.

I tried this script "”: 


screen ./ $1 myparam1
screen ./ $1 myparam2

and “” is:


cd /to/scripts/path
command1 $1
command2 $1

So I started my script like this: myparam0

But now in my script “” the second command is only started, if 
the first were finished. This is not what I want. All screen-sessions should 
open directly and start immediately their commands.

Maybe I explain it less abstract by what I want to use it for: 
I want to scrape (download) the Wikipedia (different ones) with a special tool 
(“mwscrape”) but as the wikipedia is so huge, I need to start many “scrapes” at 
the same time, each beginning from another letter.
At the moment, I do it with manual start of many sessions (Control+A, C, all my 
commands, next session with Control+A, C etc.), which is a long run.
As I re-scrape the Wikipedia from time to time, it would be nice if I had only 
two scripts, starting them with one command, which I can start each month 
automatically through cron.

Is this possible?



reply via email to

[Prev in Thread] Current Thread [Next in Thread]