ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/rxvt-unicode/doc/pty-fd
(Generate patch)

Comparing rxvt-unicode/doc/pty-fd (file contents):
Revision 1.1 by root, Thu Feb 17 15:07:48 2005 UTC vs.
Revision 1.3 by root, Thu Feb 17 15:19:03 2005 UTC

1#!/usr/bin/perl 1#!/usr/bin/perl
2
3# sample script to illustrate the -pty-fd option
2 4
3use IO::Pty; 5use IO::Pty;
4use Fcntl; 6use Fcntl;
5 7
6my $pty = new IO::Pty; 8my $pty = new IO::Pty;
7fcntl $pty, F_SETFD, 0; # clear close-on-exec 9fcntl $pty, F_SETFD, 0; # clear close-on-exec
8 10
9system "rxvt -pty-fd " . (fileno $pty) . "&"; 11system "rxvt -pty-fd " . (fileno $pty) . "&";
12close $pty;
10 13
11# now communicate with rxvt 14# now communicate with rxvt
12my $slave = $pty->slave; 15my $slave = $pty->slave;
13 16
14print $slave "hi! please enter something and press return (ctrl-d to exit):\n"; 17print $slave "hi! please enter something and press return (ctrl-d to exit):\n";

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines