screen-users
[Top][All Lists]
Advanced

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

How to create a set a screen windows from a shell script


From: Bob Bawn
Subject: How to create a set a screen windows from a shell script
Date: Fri, 1 Jun 2007 16:08:47 -0600

Hello,
 
I have a distributed system simulation that runs a set of processes. Each process logs interesting information to stderr. I have a another script that generates a file with the command lines for each process in the simulation.
 
I have a script that creates an xterm(1) for each line in a file:
 
#!/bin/sh
# run_xterm - start an xterm(1) to run each line in stdin
xargs -l1 -t -i sh -c "xterm -e {} &"
 
I run it like this:
 
$ run_xterm < file_of_commands
 
 
I would like to use screen instead of xterm but screen always seems to want to be attached to a terminal. I think the following illustrates my problem:
 
address@hidden cluster]$ screen
..
address@hidden cluster]$ cat > cmds
less /etc/inittab
less /etc/fstab
address@hidden cluster]$ xargs -l1 -t screen < cmds
screen less /etc/inittab
Must be connected to a terminal.
screen less /etc/fstab
Must be connected to a terminal.
address@hidden cluster]$
 
Should I be using expect or something that talks to ptys?
 
Is there a better way to start a set of processes, one per screen window?
 
Thanks,
Bob Bawn
 

reply via email to

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