in reply to Re^2: Controlling a terminal
in thread Controlling a terminal

After a lot of hunting around on the net I have found out how to do what i want to do; just have to work out whether i not i should be doing it this way in general...
use warnings; use strict; use constant TIOCSTI => 29719; my $fd; my $c="\n"; open($fd, ">>", "/dev/pts/30") || die "Could not open: $!"; my $val=ioctl($fd, TIOCSTI, $c); print "not ok\n" unless ($val);
which will send a RETURN into the pseudo terminal (when run as root, anyhow).

Thanks for your help.

Replies are listed 'Best First'.
Re^n: Controlling a terminal
by LAI (Hermit) on Jan 22, 2003 at 16:20 UTC

    I'd personally not feel comfortable writing directly to devices like that, but if it does what you need it to then great. I'm enough of a stubborn ass that I still say you ought to let Perl handle the remote connections, but TMTOWTDI.


    LAI
    :eof