0
|
1 |
#!/usr/local/bin/perl
|
|
2 |
#======================================================================
|
|
3 |
# S E N D _ B R E A K
|
|
4 |
# doc: Tue Aug 8 13:58:51 2006
|
|
5 |
# dlm: Tue Aug 8 19:41:01 2006
|
|
6 |
# (c) 2006 turbulence@
|
|
7 |
# uE-Info: 30 19 NIL 0 0 72 10 2 8 NIL ofnI
|
|
8 |
#======================================================================
|
|
9 |
|
|
10 |
# read from tty, write to stdout
|
|
11 |
|
|
12 |
# HISTORY:
|
|
13 |
# Aug 8, 2006: - created from [bbabble] on DYNAMUCK cruise
|
|
14 |
|
|
15 |
use POSIX ();
|
|
16 |
|
|
17 |
$USAGE = "Usage: $0 <tty device>\n";
|
|
18 |
die($USAGE) unless (@ARGV == 1);
|
|
19 |
$TTY = $ARGV[0];
|
|
20 |
|
|
21 |
print(STDERR "Opening $TTY...");
|
|
22 |
my($sfd);
|
|
23 |
open(TTY,$TTY) || die(" $!\n");
|
|
24 |
$sfd = fileno(TTY);
|
|
25 |
print(STDERR "\n");
|
|
26 |
|
|
27 |
print(STDERR "Sending BREAK...");
|
|
28 |
die(" tcsendbreak: $!\n")
|
|
29 |
unless defined(POSIX::tcsendbreak($sfd,0));
|
|
30 |
print(STDERR "\n");
|
|
31 |
|
|
32 |
exit(0);
|
|
33 |
|
|
34 |
|