You are not logged in.

#1 2010-10-16 15:12:40

b4283
Member
Registered: 2008-11-26
Posts: 123

Controlling Terminal Inputs

Hi,
I'm thinking about controlling one terminal from another, so I can use simple scripts to manipulate them, but is there a way to do it?

Tried to do it with:

echo "echo asdf" > /dev/pts/1

but only text had come out and not a command (not parsed by the shell).

I know TIOCSTI in <ioctl.h> could simulate fake keystroke, but it seems to work only on current tty.

Offline

#2 2010-10-17 09:04:37

keenerd
Package Maintainer (PM)
Registered: 2007-02-22
Posts: 647
Website

Re: Controlling Terminal Inputs

One way to do it is to wrap the terminal in screen.  Then it is as simple as "screen -X".  See http://rustyklophaus.com/articles/20100618-Pecho.html for a complete example.

Offline

Board footer

Powered by FluxBB