Re: [LIP] Executing commands on other terminals (ptys).

"Logu" <[email protected]>
Newsgroups gmane.user-groups.linux.india.programmers
Message-ID <041b01c74a6c$2353b400$140110ac@LOGUCO>
>>> We have test scripts which should be executed on 3 clients and 2
>>> server. Usually we login to each of these machines using ssh and
>>> issue the commands on each session. Is it possible to send the
>>> commands (as root user) to these terminal sessions from another
>>> terminal.
>>>
>> Not clear what precisely you need here, but you could try any of:
>>
>> 1. Use screen, so you only need one physical console to manage
>> multiple terminals, or
>>
>> 2. Give the commands on the SSH command-line itself, as in:
>>
>>   ssh user@host 'command1 ; command2' > cmd.out 2>&1
>>
> Or you can copy all your scripts on one of your local workstation
> (assuming your workstation is a *nix flavor machine with open ssh client
> installed) and then execute them remotely as:
>
> cat script.sh | ssh root@target-host
>
> and if there are multiple machines then you can also do:
>
> for host in 'host 1 host 2 host3';do cat script.sh | ssh user@$host;done
>
> One thing to keep in mind though, since the commands will actually be
> executed on the remote hosts, if the script(s) are dependent on anything
> then that should be present on target server.
>

thanks for your reply and sorry for confusing.

My requirement is quite different and crazy.
In a very simple sense, say I have two ssh terminals opened on /dev/pts/0 
and /dev/pts/1 . Now I have to to push a command from pts/0 to pts/1 and 
execute on it and then control the program from pts/1 as usual.

Thanks
-logu 



-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier.
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.