Help with screen


 
Thread Tools Search this Thread
# 1  
Help with screen

Hello everyone!

I'm trying to figure out how to send commands from one screen to another.
For example i wish to send a simple "ls -all" from screen #1 to screen #2,
can it be done, and how? Smilie

Thank you!
# 2  
what is meant by sending commands from one screen to another?
# 3  
Well this is the deal:
i am in screen #1 and i wish to send a command to screen #2.

The thing is that using screen -x i can have 2 terminals open and monitor 2 screens. I wish to be able to control both screens from either of them.
So if i have two windows open on my desktop, and i work in a window with screen #1, i wish to be able to send commands to a screen #2 that is open in another window on my desktop.

I need this to have several automated processes, for example: feed in screen #1 triggers events in screen #2.
# 4  
I think you are talking about the screen utility, right?
What I do not know is what you mean when you say "send commands". I can think of two possibilities:
- You want to send commands that run on the other screen (shell). For now, I'm not aware of any way to do this.
- You want to display the o/p of the commands you execute in one screen on the other. In this case, you need to know the terminal asociated to the screen session and redirect the output there:

Code:
screen 1                                     screen 2
--------                                     --------
$ tty                                        $ tty
/dev/pts/3                                   /dev/pts/4
$ echo Helo | tee -a /dev/pts/4 
Helo                                         Helo

Regards
# 5  
Thank you for your reply Grial, however this just sends the output from
/dev/pts/3 to /dev/pts/4.

I wish to do the following from /dev/pts/3:

<funcname> /dev/pts/4 echo hello

where <funcname> is the program that enables me to send a command to /dev/pts/4 so the command executes on /dev/pts/4.

Thank you!

Last edited by Gurth; 12-20-2006 at 07:46 AM..
# 6  
I have been able to come close using "screen" utility.
If i enter the command prompt of the "screen" i can then do:

Code:
at 1# "ls -al"

The problem is that i can't get an escape char from the shell. I need to type
ctrl-a-: to get to the command prompt of the screen utility.

Can i perhaps prefix the

at 1# "ls -al"

with some char sequence to emulate the escape char?
# 7  
What about something like this?

In one screen:
Code:
mkfifo namedpipe
export COMMAND=ls
$COMMAND; echo $COMMAND > namedpipe

In the other screen:
Code:
while true; do $(cat namedpipe); done &

(bash+linux)
Regards.
 

Previous Thread | Next Thread
Thread Tools Search this Thread
Search this Thread:
Advanced Search

Test Your Knowledge in Science: Gadgets
Difficulty: Easy
The communication protocol NFC stands for Near-Field Control.
True or False?

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

O/P same as on screen

#Random Scripts 4 #Desc: clear echo "1. To see all processes currently running on the system" echo "2. To kill any given process" echo "Choose between the two" read x case $x in "1")print `ps aux`;; "2") echo "Choose a process to be killed" read y check=`ps ax | grep... (1 Reply)
Discussion started by: targetshell
1 Replies

2. Linux

Screen command

Hey Guys, Linux screen command is not working . listing shows it is attached and i pressed some ctrl keys and went out of control. i believe i locked it . when i try to reattach and press ctrl keys , it get typed in the screen without responding to it. Please tell how to unlock the... (2 Replies)
Discussion started by: mdsaleemj
2 Replies

3. UNIX for Dummies Questions & Answers

Accidentally made a screen within a screen - how to move it up one level?

I made a screen within a screen. Is there a way to move the inner screen up one level so that it is at the same level as the first screen running from the shell? (2 Replies)
Discussion started by: phpchick
2 Replies

4. Red Hat

Black Screen

I am using Intel HD 400 Graphics on a laptop. When I logout, I get a black screen with no cursor or anything. I have to hard reboot the system to get into linux again. Working on RHEL 6 (gnome) (1 Reply)
Discussion started by: sunveer
1 Replies

5. Red Hat

command line tool to disable screen lock and/or screen saver

Hi, I have a simple question : how to disable screen lock and/or sreen saver with command line with RHEL5.4 ? (1 Reply)
Discussion started by: albator1932
1 Replies

6. HP-UX

GNU screen on HP-UX 11.23

I compiled GNU screen on HP-UX 11.23 and following the compile, I get the following error when I try to run screen Cannot find terminfo entry for 'vt100' By default the TERMINFO is not set, I found a reference that setting it might help. I tried the following but I still receive the same... (2 Replies)
Discussion started by: scotbuff
2 Replies

7. OS X (Apple)

Virtual screen accessed by Screen Sharing

Hi, I'm trying to create a virtual screen, (maybe xvfb? or any other virtual screen buffer) and be able to use Screen Sharing to connect to it. The setup is that I have a Mac Mini connected to the TV. But when my girlfriend is using Front Row, I can't use Screen Sharing at the same time from... (0 Replies)
Discussion started by: linge
0 Replies

8. Shell Programming and Scripting

Screen output

Is it possible to split the screen and show, lets say a local directory listing on the left and a remote directory listing on the right with shell scripting? I know it's usually done with curses/ncurses, but I'd really like to keep it simple as possible. I guess 'dialog' command could do it... (1 Reply)
Discussion started by: lochraven
1 Replies

9. UNIX for Dummies Questions & Answers

reading from a screen

Hi There is a program running which displays output on the screen I have to grep a particular string from that screen how do i do this My problem is i'm running this program from a script which executes after every fifteen mins but sometimes it's happen that there is an error in the program... (4 Replies)
Discussion started by: satyanarayang
4 Replies

10. UNIX for Advanced & Expert Users

printing to the screen

HPUX 11.0.X / Korn Shell Hope this makes sense. I have a little function to place things on the screen using the column and row parameters. Question is, how can I be sure of where the current cursor postion is so that if I print something to the upper right hand corner of the screen, I can... (2 Replies)
Discussion started by: google
2 Replies

Featured Tech Videos