REDROOM
PHP 7.4.33
Path:
Logout
Edit File
Size: 1.79 KB
Close
/home/godevadmin/public_html/upload_images/home/000~ROOT~000/usr/share/doc/perl-Expect/tutorial/6.B.modem-init
Text
Base64
#!/usr/bin/perl # This is a very brief script that demonstrates send_slow(). This #command is chiefly for talking to modems and the like where if you send #it stuff too fast it can get mad at you. # Also demonstrated is how to talk to a bidirectional device #handle. # # This example has been changed in 1.05 so that it actually works. :-) use Expect; $device="/dev/modem" unless $device = shift(@ARGV); # open the device open(DEVICE,"+>$device") || die "Couldn't open $device, $!\n"; # Expectize it. note the \* which we do because we didn't use the OO # method of opening the device. $modem=Expect->exp_init(\*DEVICE); # Let's watch the output. Once again, output isn't automatically # watched since it was an initialized handlde and not a process. $modem->log_stdout(1); # Put it in raw mode w/ no echoing so it will operate as expected. $modem->exp_stty('raw','-echo'); # Send it an ATZH0\r to reset its state. print "Initializing modem\n"; $modem->send_slow(.5,"ATZH0\r"); # How about we look for an OK? $modem->expect(30,'-re','^OK\r?$')|| warn "Never got OK from modem\n"; print "Modem initialized.\n"; # Now let's interact with it so the user can talk to it, dial it out, # whatever. This is basically a poor man's term program. # When you interact() with a handle it puts STDIN in raw mode so # you are assured of interacting cleanly, no escape chars, etc. # This is usually what you want. Here however it's nice to be able to # escape from the session without doing any extra work. So let's make # an escape character of ^W. print "Beginning interaction, escape character is ^W.\n"; $modem->interact(\*STDIN,"\027"); # Done? Reset the modem, close the handle. print $modem "+++"; sleep 3; print $modem "ATZH0\r"; sleep 1; # Grab any output ready on the handle, toss it. $modem->expect(0); $modem->hard_close();
Save
Close
Exit & Reset
Text mode: syntax highlighting auto-detects file type.
Directory Contents
Dirs: 0 × Files: 10
Delete Selected
Select All
Select None
Sort:
Name
Size
Modified
Enable drag-to-move
Name
Size
Perms
Modified
Actions
1.A.Intro
2.37 KB
lrw-r--r--
2017-05-15 15:55:28
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
2.A.ftp
3.01 KB
lrw-r--r--
2019-08-23 14:02:45
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
2.B.rlogin
3.95 KB
lrw-r--r--
2019-08-23 14:02:45
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
3.A.debugging
1.93 KB
lrw-r--r--
2019-08-23 14:02:45
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
4.A.top
928 B
lrw-r--r--
2019-08-23 14:02:45
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
5.A.top
1.11 KB
lrw-r--r--
2019-08-23 14:02:45
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
5.B.top
2.39 KB
lrw-r--r--
2019-08-23 14:02:45
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
6.A.smtp-verify
3.18 KB
lrw-r--r--
2019-08-23 14:02:45
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
6.B.modem-init
1.79 KB
lrw-r--r--
2019-08-23 14:02:45
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
README
644 B
lrw-r--r--
2017-05-15 15:55:28
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
Zip Selected
If ZipArchive is unavailable, a
.tar
will be created (no compression).