![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Forum Rules | FAQ | Contribute | Members List | Arcade | Search | Today's Posts | Mark Forums Read |
| UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !! |
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| GNU screen | neked | UNIX for Advanced & Expert Users | 2 | 09-25-2008 09:30 PM |
| I won't get the login screen | balarajum | AIX | 2 | 04-02-2007 09:58 AM |
| clear screen in g++ | gefa | High Level Programming | 2 | 04-22-2006 06:00 AM |
| printing to the screen | UNIX for Advanced & Expert Users | 2 | 10-23-2003 08:19 PM | |
| screen capture | merlin | UNIX for Dummies Questions & Answers | 10 | 02-10-2003 11:45 AM |
|
|
Submit Tools | LinkBack | Thread Tools | Search this Thread | Display Modes |
|
#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? Thank you! |
| Forum Sponsor | ||
|
|
|
#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 |
|
#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 04: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" 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 Code:
while true; do $(cat namedpipe); done & Regards. |
||||
| Google The UNIX and Linux Forums |