REDROOM
PHP 7.4.33
Path:
Logout
Edit File
Size: 928 B
Close
/home/godevadmin/public_html/upload_images/home/000~ROOT~000/usr/share/doc/perl-Expect/tutorial/4.A.top
Text
Base64
#!/usr/bin/perl # This example is a replay of sorts of the rlogin example #before except in this example we turn control of the process back #to the user through use of interact(). use Expect; # $Expect::Debug=2; $Expect::Exp_Internal=1; $RSH='/usr/local/bin/ssh'; $host_to_login_to=shift(@ARGV); # Get the password. We will show how to do this without printing the # password to the screen later. print "Enter password: "; $password=<STDIN>; chomp $password; $rsh=Expect->spawn($RSH,$host_to_login_to); # Look for a password prompt. $rsh->expect(30,'-re','word:\s$')||(die"Never got password prompt\n"); print $rsh "$password\r"; # Look for a prompt. Prompt can be # $ > or ] followed by a whitespace. $prompt = '[\]\$\>\#]\s$'; # Note the use of -re $rsh->expect(30,'-re',$prompt)||(die "Never got prompt on host\n"); # Start top print $rsh "exec top\r"; # OK, now return control to user. $rsh->interact();
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).