You can subscribe to this list here.
2000 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
(1) |
Sep
(1) |
Oct
(1) |
Nov
(26) |
Dec
(7) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2001 |
Jan
(5) |
Feb
(3) |
Mar
(11) |
Apr
(10) |
May
(2) |
Jun
(5) |
Jul
(13) |
Aug
(2) |
Sep
(3) |
Oct
(10) |
Nov
(18) |
Dec
(29) |
2002 |
Jan
(12) |
Feb
(14) |
Mar
(73) |
Apr
(28) |
May
(21) |
Jun
(39) |
Jul
(40) |
Aug
(42) |
Sep
(20) |
Oct
(4) |
Nov
(9) |
Dec
(18) |
2003 |
Jan
(2) |
Feb
(8) |
Mar
(6) |
Apr
(24) |
May
(24) |
Jun
(14) |
Jul
(16) |
Aug
(36) |
Sep
(34) |
Oct
(23) |
Nov
(4) |
Dec
(15) |
2004 |
Jan
(6) |
Feb
(13) |
Mar
(7) |
Apr
(5) |
May
(11) |
Jun
(5) |
Jul
(4) |
Aug
|
Sep
(2) |
Oct
(16) |
Nov
(4) |
Dec
(9) |
2005 |
Jan
(2) |
Feb
(1) |
Mar
(3) |
Apr
(10) |
May
(5) |
Jun
(13) |
Jul
(3) |
Aug
|
Sep
(7) |
Oct
(5) |
Nov
(1) |
Dec
(9) |
2006 |
Jan
|
Feb
(10) |
Mar
(22) |
Apr
(14) |
May
(5) |
Jun
(4) |
Jul
(19) |
Aug
(7) |
Sep
(16) |
Oct
(4) |
Nov
(1) |
Dec
(16) |
2007 |
Jan
(17) |
Feb
|
Mar
(35) |
Apr
(5) |
May
(20) |
Jun
(11) |
Jul
(33) |
Aug
(3) |
Sep
(2) |
Oct
(11) |
Nov
(23) |
Dec
(5) |
2008 |
Jan
(10) |
Feb
(9) |
Mar
|
Apr
(6) |
May
(8) |
Jun
(7) |
Jul
|
Aug
(3) |
Sep
(2) |
Oct
(1) |
Nov
|
Dec
(20) |
2009 |
Jan
(8) |
Feb
(8) |
Mar
(3) |
Apr
(8) |
May
(2) |
Jun
(11) |
Jul
(2) |
Aug
|
Sep
(3) |
Oct
(1) |
Nov
(7) |
Dec
(4) |
2010 |
Jan
(2) |
Feb
(1) |
Mar
(3) |
Apr
|
May
(2) |
Jun
(2) |
Jul
(7) |
Aug
(3) |
Sep
(7) |
Oct
(2) |
Nov
(1) |
Dec
(4) |
2011 |
Jan
(4) |
Feb
(5) |
Mar
|
Apr
(3) |
May
(2) |
Jun
|
Jul
(6) |
Aug
|
Sep
|
Oct
(6) |
Nov
|
Dec
|
2012 |
Jan
|
Feb
(1) |
Mar
|
Apr
(3) |
May
|
Jun
|
Jul
(2) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2013 |
Jan
|
Feb
(1) |
Mar
|
Apr
|
May
|
Jun
(1) |
Jul
|
Aug
|
Sep
(5) |
Oct
|
Nov
|
Dec
|
2014 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
(2) |
Aug
(7) |
Sep
(2) |
Oct
|
Nov
|
Dec
|
2015 |
Jan
|
Feb
|
Mar
(30) |
Apr
(10) |
May
(1) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2017 |
Jan
|
Feb
|
Mar
(12) |
Apr
|
May
|
Jun
(1) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(1) |
Dec
(1) |
2018 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
(2) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2022 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(1) |
Dec
|
2024 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(1) |
From: Sowmya K. <skr...@bd...> - 2006-09-22 20:25:23
|
Hi, We are testing our product on RedHat Enterprise Linux 4 Update 4 and are experiencing problems with pty allocation. In our code we use Expect.pm. What happens is that after a few Expect sessions are created and destroyed, pty allocation fails. Once this occurs, I am not able to allocate Ptys for any other program - for e.g after this problem occurs, when I try to SSH to the machine, it would fail with "Server refused to allocate Pty".=20 I am using IO-Tty-1.07 and Expect-1.20.=20 After a few Expect sessions, this is the error I see: pty_allocate(nonfatal): getpt(): No such file or directory at .../IO/Pty.pm line 24. pty_allocate(nonfatal): openpty(): No such file or directory at .../IO/Pty.pm line 24. pty_allocate(nonfatal): open(/dev/ptmx): Input/output error at .../IO/Pty.pm line 24. Cannot open a pty at ... Actually, someone else has also seen exactly the same problem on RedHat Enterprise Linux 4.=20 http://sourceforge.net/mailarchive/forum.php?thread_id=3D7450783&forum_id= =3D 6382 But I don't see any responses to his posting. P.S We have not seen this problem on RedHat Enterprise Linux 3 with IO-Tty-1.02 and Expect-1.15. With these versions of IO::Tty and Expect.pm, I saw the same issue as stated above on RedHat Enterprise Linux 4, hence thought if I update to the most recent (IO-Tty-1.07 and Expect-1.20), the problem would go away, but unfortunately, I still see the same issue. I would greatly appreciate your help in this regard. Thanks in advance -Sowmya=20 =20 -------------------------------------------------------- This email and any files transmitted with it are confidential and are = intended solely for the use of the individual or entity to whom they are = addressed. This communication may contain material protected by the = attorney-client privilege. If you are not the intended recipient, be = advised that any use, dissemination, forwarding, printing or copying is = strictly prohibited. If you have received this email in error, please = contact the sender and delete all copies. |
From: Roland G. <rgi...@cp...> - 2006-09-14 10:02:11
|
You need to install IO::Tty beforehand, it's a separate module. And you can only install and use it under cygwin and with the perl provided by cygwin. Be sure to read the FAQ, you don't need Expect to automate ssh logins... Hope this helps, Roland On 9/14/06, sarab9 <sa...@ya...> wrote: > Hi All, > > I am trying to use the Expect.pm bundle in windows environment, but getting > stuck. Could really use your suggestions/comments. > > I have a "use Expect.pm" that calls "use IO::Pty" which calls "IO::Tty", and > IO::Tty fails to find loadable object. I dont know which one it is looking > for. The same codebase works fine in Linux environment and all loadable > files exist in the same locations in the codebase. > > What do i need to change to get Expect.pm to work on Windows? > > The error looks like this: > > Can't locate loadable object for module IO::Tty in @INC (@INC contains: > E:\star/ > lib/common E:\star/lib/user E:\star/harness/web E:/Perl/site/lib E:/Perl/lib > .) > at E:\star/lib/common/IO/Tty.pm line 28 > Compilation failed in require at E:\star/lib/common/IO/Pty.pm line 7. > BEGIN failed--compilation aborted at E:\star/lib/common/IO/Pty.pm line 7. > Compilation failed in require at E:\star/lib/common/Expect.pm line 22. > BEGIN failed--compilation aborted at E:\star/lib/common/Expect.pm line 22. > > Line 28 of IO/Tty.pm contains: > > do { > defined(&bootstrap) > ? \&bootstrap > : \&DynaLoader::bootstrap > }->(__PACKAGE__); > } > > I even tried it from a cygwin terminal and got the same errors, even though > it says that IO:Tty is supported from cygwin terminals. > > Thanks in advance for your comments/suggestions. > > Sarabjeet > > > ________________________________ > Do you Yahoo!? > Get on board. You're invited to try the new Yahoo! Mail. > > > ------------------------------------------------------------------------- > Using Tomcat but need to do more? Need to support web services, security? > Get stuff done quickly with pre-integrated technology to make your job > easier > Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo > http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642 > > _______________________________________________ > Expectperl-discuss mailing list > Exp...@li... > https://lists.sourceforge.net/lists/listinfo/expectperl-discuss > > > |
From: Austin S. <te...@of...> - 2006-09-14 00:04:39
|
On Wed, Sep 13, 2006 at 04:30:41PM -0700, sarab9 wrote: > at E:\star/lib/common/IO/Tty.pm line 28 > Compilation failed in require at E:\star/lib/common/IO/Pty.pm line 7. > BEGIN failed--compilation aborted at E:\star/lib/common/IO/Pty.pm line 7. > Compilation failed in require at E:\star/lib/common/Expect.pm line 22. > BEGIN failed--compilation aborted at E:\star/lib/common/Expect.pm line 22. > > Line 28 of IO/Tty.pm contains: > > do { > defined(&bootstrap) > ? \&bootstrap > : \&DynaLoader::bootstrap > }->(__PACKAGE__); > } > > I even tried it from a cygwin terminal and got the same errors, even though it says that IO:Tty is supported from cygwin terminals. > I'm able to successfully install Expect from the cygwin environment. However, the paths from perl -V in the cygwin shell are normal unix-like /usr/lib type paths. You are doing something weird, not sure what. If you do perl -MCPAN -eshell from the cygwin shell and run 'install Expect' there it should work if your cygwin environment is properly set up. Austin |
From: sarab9 <sa...@ya...> - 2006-09-13 23:30:48
|
Hi All, I am trying to use the Expect.pm bundle in windows environment, but getting stuck. Could really use your suggestions/comments. I have a "use Expect.pm" that calls "use IO::Pty" which calls "IO::Tty", and IO::Tty fails to find loadable object. I dont know which one it is looking for. The same codebase works fine in Linux environment and all loadable files exist in the same locations in the codebase. What do i need to change to get Expect.pm to work on Windows? The error looks like this: Can't locate loadable object for module IO::Tty in @INC (@INC contains: E:\star/ lib/common E:\star/lib/user E:\star/harness/web E:/Perl/site/lib E:/Perl/lib .) at E:\star/lib/common/IO/Tty.pm line 28 Compilation failed in require at E:\star/lib/common/IO/Pty.pm line 7. BEGIN failed--compilation aborted at E:\star/lib/common/IO/Pty.pm line 7. Compilation failed in require at E:\star/lib/common/Expect.pm line 22. BEGIN failed--compilation aborted at E:\star/lib/common/Expect.pm line 22. Line 28 of IO/Tty.pm contains: do { defined(&bootstrap) ? \&bootstrap : \&DynaLoader::bootstrap }->(__PACKAGE__); } I even tried it from a cygwin terminal and got the same errors, even though it says that IO:Tty is supported from cygwin terminals. Thanks in advance for your comments/suggestions. Sarabjeet --------------------------------- Do you Yahoo!? Get on board. You're invited to try the new Yahoo! Mail. |
From: Austin S. <te...@of...> - 2006-09-07 17:30:45
|
On Thu, Sep 07, 2006 at 09:05:07AM +0200, Roland Giersig wrote: > Hmm, I only test if the MASTER pty gets an EOF if the child closes > stdout, this is the reverse case. But I could imagine that there are > systems that have this problem... > > Another possibility that comes to mind is to send a SIGHUP to the > child process. But this probably doesn't work in this case. > Well there are many cases where a child process will look for the eof. If you send it a signal you induce a race condition where data before the eof could conceivably be stuck in a buffer when the signal is received. I wonder what the system designers had in mind here. Bryan: what system is this you were using this on? Would you mind posting your perl -V output, please? > But why not simply pass everything via the command-line? openssl > offers several possibilities how the pass-phrase can be passed. No > need for Expect here... > No, not in this case. Austin |
From: Rahul S <sr...@gm...> - 2006-09-07 11:48:42
|
Passing it through stdin worked. I don't have to use expect after all :) Thanks, -Rahul S. On 9/7/06, Roland Giersig <rgi...@cp...> wrote: > You can also pass it via stdin or a file (named pipe) or an > environment variable etc. ... > > Just do a 'man openssl' and look for 'PASS PHRASE ARGUMENTS'. > > Hope this helps, Roland > > On 9/7/06, Rahul S <sr...@gm...> wrote: > > On 9/7/06, Roland Giersig <rgi...@cp...> wrote: > > > But why not simply pass everything via the command-line? openssl > > > offers several possibilities how the pass-phrase can be passed. No > > > need for Expect here... > > > > I don't want to pass the password on the commandline because it will > > be visible through utilities like 'ps'. |
From: Michael M. <mic...@ya...> - 2006-09-07 11:18:21
|
Roland, I never got the keys to work going from a PC to a HP-UX system. I use keys from my Unix workstation to my Unix servers. I had started this for other reasons as well. Also I explicitly stated that storing the password in the script is not a good idea and that prompting for it was preferred.. I just haven't gotten to that point as I was stuck with just getting it all to work. Michael Roland Giersig <rgi...@cp...> wrote: How about just properly configuring ssh (authorized_keys) and sudo (:NOPASSWD) and directly doing a "ssh user@remotehost sudo command" ?! You see, no need for expect here, and especially no need for storing passwords in the clear inside some scripts... Regards, Roland Check on my new web site. Be kind as I'm working to add and update it as I go: http://www.grundyec.net/~mrmonteith/ --------------------------------- Yahoo! Messenger with Voice. Make PC-to-Phone Calls to the US (and 30+ countries) for 2¢/min or less. |
From: Roland G. <rgi...@cp...> - 2006-09-07 10:06:16
|
You can also pass it via stdin or a file (named pipe) or an environment variable etc. ... Just do a 'man openssl' and look for 'PASS PHRASE ARGUMENTS'. Hope this helps, Roland On 9/7/06, Rahul S <sr...@gm...> wrote: > On 9/7/06, Roland Giersig <rgi...@cp...> wrote: > > But why not simply pass everything via the command-line? openssl > > offers several possibilities how the pass-phrase can be passed. No > > need for Expect here... > > I don't want to pass the password on the commandline because it will > be visible through utilities like 'ps'. > > Regards, > > -Rahul S. > > ------------------------------------------------------------------------- > Using Tomcat but need to do more? Need to support web services, security? > Get stuff done quickly with pre-integrated technology to make your job easier > Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo > http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642 > _______________________________________________ > Expectperl-discuss mailing list > Exp...@li... > https://lists.sourceforge.net/lists/listinfo/expectperl-discuss > |
From: Rahul S <sr...@gm...> - 2006-09-07 07:58:20
|
On 9/7/06, Roland Giersig <rgi...@cp...> wrote: > But why not simply pass everything via the command-line? openssl > offers several possibilities how the pass-phrase can be passed. No > need for Expect here... I don't want to pass the password on the commandline because it will be visible through utilities like 'ps'. Regards, -Rahul S. |
From: Roland G. <rgi...@cp...> - 2006-09-07 07:05:13
|
Hmm, I only test if the MASTER pty gets an EOF if the child closes stdout, this is the reverse case. But I could imagine that there are systems that have this problem... Another possibility that comes to mind is to send a SIGHUP to the child process. But this probably doesn't work in this case. But why not simply pass everything via the command-line? openssl offers several possibilities how the pass-phrase can be passed. No need for Expect here... Regards, Roland On 9/3/06, Austin Schutz <te...@of...> wrote: > > > 'openssl' to encrypt/decrypt files. But it is not working. The > > > following is the code using expect: > > > > > > <START> > > > > > > $command = Expect->spawn ("/usr/bin/openssl", 'enc', '-e', '-cast', > > > '-out', 'file.enc'); > > > $command->expect (10, "enter cast5-cbc encryption password:"); > > > print $command "somepassword\r"; > > > $command->expect (10, "Verifying - enter cast5-cbc encryption password:"); > > > print $command "somepassword\r"; > > > > > > print $command "This is the text to be encrypted\r"; > > > > You havnt finished the openssl command, normally you would send a > > control-D to terminate the typing. Make this your next command: > > > > $command->send("\cD"); > > > > Then soft_close() should work. > > soft_close should work anyway - it should close the tty and the > child process should receive an eof. > It's possible this is one of the platforms which closing the tty > doesn't create an eof at the child. I originally wasn't aware there were > such platforms. But.. even if this is the case it should still get an eof > when $self->close() is run. The tty lib should make sure this is the case. > Roland: do you agree? > > But your suggestion of sending \cD is a good one, as a workaround. > > Austin > > ------------------------------------------------------------------------- > Using Tomcat but need to do more? Need to support web services, security? > Get stuff done quickly with pre-integrated technology to make your job easier > Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo > http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642 > _______________________________________________ > Expectperl-discuss mailing list > Exp...@li... > https://lists.sourceforge.net/lists/listinfo/expectperl-discuss > |
From: Roland G. <rgi...@cp...> - 2006-09-07 06:55:11
|
How about just properly configuring ssh (authorized_keys) and sudo (:NOPASSWD) and directly doing a "ssh user@remotehost sudo command" ?! You see, no need for expect here, and especially no need for storing passwords in the clear inside some scripts... Regards, Roland On 9/6/06, Michael Monteith <mic...@ya...> wrote: > > I fought for the longest time getting this to work. Between working on i= t > and getting work done. I wanted to be able to ssh to a box, sudo to root= , > and execute commands. Mainly for my purposes have it fire off a patch > upgrade. But could be used for making changes to multiple boxes quickly.= I > haven't worked on the code to read in the password so forgive the section > for hard-coded pw. But thought I'd share it with others. > > I'm running Cygwin on my pc which has Expect and OpenSSH installed with = it. > I'm ssh/sudo into HP-UX systems. > > #!/usr/local/bin/expect > # > # ssh.exp - script to read through hostfile and ssh to that host] > # it will also use sudo to get to root to run specific commands > # This was done on a pc using Cygwin w/Expect and openssh to a > # HP-UX system. > # Author - Michael R. Monteith > # Created - 09/06/06 - working code > # nonproduction is just a text file with one hostname to a line > set Hostnames [open "nonproduction"] > exp_internal 0 > match_max 100000 > set timeout 20 > set force_conservative 1 ;# set to 1 to force conservative mode > # it would be better to prompt for a password than hard-coding it in here > # but I will as time goes > while {[gets $Hostnames line] !=3D -1} { > send_user "\n Spawning SSH\r" > spawn -noecho ssh -l myid $line /systools/sudo/bin/sudo su - > expect "ord:" { send "mypasswd\r" } > # send_user "\r\n Expect out string =3D <$expect_out(0,string)>" > expect { > "ord:" { send "mypasswd\r" } > "myid" { send "/usr/bin/date > /tmp/1.out\r\exit\rexit\r" } > "SUPERUSER" { send "/usr/bin/date > /tmp/2.out\rexit\rexit\r" } > } > sleep 2 > } > exit 0 > > > Check on my new web site. Be kind as I'm working to add and update it as = I > go: > http://www.grundyec.net/~mrmonteith/ > > ________________________________ > Talk is cheap. Use Yahoo! Messenger to make PC-to-Phone calls. Great rate= s > starting at 1=A2/min. > > > > ------------------------------------------------------------------------- > Using Tomcat but need to do more? Need to support web services, security? > Get stuff done quickly with pre-integrated technology to make your job > easier > Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronim= o > http://sel.as-us.falkag.net/sel?cmd=3Dlnk&kid=3D120709&bid=3D263057&dat= =3D121642 > > _______________________________________________ > Expectperl-discuss mailing list > Exp...@li... > https://lists.sourceforge.net/lists/listinfo/expectperl-discuss > > > |
From: Austin S. <te...@of...> - 2006-09-06 19:45:26
|
On Wed, Sep 06, 2006 at 12:26:47PM -0700, Michael Monteith wrote: > I fought for the longest time getting this to work. Between working on it and getting work done. I wanted to be able to ssh to a box, sudo to root, and execute commands. Mainly for my purposes have it fire off a patch upgrade. But could be used for making changes to multiple boxes quickly. I haven't worked on the code to read in the password so forgive the section for hard-coded pw. But thought I'd share it with others. > > I'm running Cygwin on my pc which has Expect and OpenSSH installed with it. I'm ssh/sudo into HP-UX systems. > > #!/usr/local/bin/expect This is an expect PERL mailing list, which is probably not what you were hoping for. Austin |
From: Michael M. <mic...@ya...> - 2006-09-06 19:26:55
|
I fought for the longest time getting this to work. Between working on it and getting work done. I wanted to be able to ssh to a box, sudo to root, and execute commands. Mainly for my purposes have it fire off a patch upgrade. But could be used for making changes to multiple boxes quickly. I haven't worked on the code to read in the password so forgive the section for hard-coded pw. But thought I'd share it with others. I'm running Cygwin on my pc which has Expect and OpenSSH installed with it. I'm ssh/sudo into HP-UX systems. #!/usr/local/bin/expect # # ssh.exp - script to read through hostfile and ssh to that host] # it will also use sudo to get to root to run specific commands # This was done on a pc using Cygwin w/Expect and openssh to a # HP-UX system. # Author - Michael R. Monteith # Created - 09/06/06 - working code # nonproduction is just a text file with one hostname to a line set Hostnames [open "nonproduction"] exp_internal 0 match_max 100000 set timeout 20 set force_conservative 1 ;# set to 1 to force conservative mode # it would be better to prompt for a password than hard-coding it in here # but I will as time goes while {[gets $Hostnames line] != -1} { send_user "\n Spawning SSH\r" spawn -noecho ssh -l myid $line /systools/sudo/bin/sudo su - expect "ord:" { send "mypasswd\r" } # send_user "\r\n Expect out string = <$expect_out(0,string)>" expect { "ord:" { send "mypasswd\r" } "myid" { send "/usr/bin/date > /tmp/1.out\r\exit\rexit\r" } "SUPERUSER" { send "/usr/bin/date > /tmp/2.out\rexit\rexit\r" } } sleep 2 } exit 0 Check on my new web site. Be kind as I'm working to add and update it as I go: http://www.grundyec.net/~mrmonteith/ --------------------------------- Talk is cheap. Use Yahoo! Messenger to make PC-to-Phone calls. Great rates starting at 1¢/min. |
From: Austin S. <te...@of...> - 2006-09-03 02:36:36
|
> > 'openssl' to encrypt/decrypt files. But it is not working. The > > following is the code using expect: > > > > <START> > > > > $command = Expect->spawn ("/usr/bin/openssl", 'enc', '-e', '-cast', > > '-out', 'file.enc'); > > $command->expect (10, "enter cast5-cbc encryption password:"); > > print $command "somepassword\r"; > > $command->expect (10, "Verifying - enter cast5-cbc encryption password:"); > > print $command "somepassword\r"; > > > > print $command "This is the text to be encrypted\r"; > > You havnt finished the openssl command, normally you would send a > control-D to terminate the typing. Make this your next command: > > $command->send("\cD"); > > Then soft_close() should work. soft_close should work anyway - it should close the tty and the child process should receive an eof. It's possible this is one of the platforms which closing the tty doesn't create an eof at the child. I originally wasn't aware there were such platforms. But.. even if this is the case it should still get an eof when $self->close() is run. The tty lib should make sure this is the case. Roland: do you agree? But your suggestion of sending \cD is a good one, as a workaround. Austin |
From: Bryan B. <br...@bu...> - 2006-09-02 19:13:20
|
> Hi, > I am new to expect. I am using expect in my program to invoke > 'openssl' to encrypt/decrypt files. But it is not working. The > following is the code using expect: > > <START> > > $command = Expect->spawn ("/usr/bin/openssl", 'enc', '-e', '-cast', > '-out', 'file.enc'); > $command->expect (10, "enter cast5-cbc encryption password:"); > print $command "somepassword\r"; > $command->expect (10, "Verifying - enter cast5-cbc encryption password:"); > print $command "somepassword\r"; > > print $command "This is the text to be encrypted\r"; You havnt finished the openssl command, normally you would send a control-D to terminate the typing. Make this your next command: $command->send("\cD"); Then soft_close() should work. Bryan http://www.sourceforge.net/projects/rover |
From: Rahul S <sr...@gm...> - 2006-09-02 10:08:12
|
Hi, I am new to expect. I am using expect in my program to invoke 'openssl' to encrypt/decrypt files. But it is not working. The following is the code using expect: <START> $command = Expect->spawn ("/usr/bin/openssl", 'enc', '-e', '-cast', '-out', 'file.enc'); $command->expect (10, "enter cast5-cbc encryption password:"); print $command "somepassword\r"; $command->expect (10, "Verifying - enter cast5-cbc encryption password:"); print $command "somepassword\r"; print $command "This is the text to be encrypted\r"; $command->soft_close(); <STOP> The command hangs at the 'soft_close' call. Using strace I found that 'openssl' is still reading from STDIN after I called 'soft_close'. What am I doing wrong here ? Regards, -Rahul S. |
From: Bharath J. <bha...@gm...> - 2006-08-16 10:53:13
|
Q3JlYXRpbmcgVXNlcnMgLi4uDQoNCkNyZWF0aW5nIHVzZXJ1c2VyYWRkOiB1c2VyIHRzYXV0aG9y IGV4aXN0cw0KU3Bhd25lZCAnL3Vzci9iaW4vcGFzc3dkIHRzYXV0aG9yJw0KICAgICAgICBzcGF3 biBpZCgzKQ0KICAgICAgICBQaWQ6IDQzMjQNCiAgICAgICAgVHR5OiAvZGV2L3B0cy8zDQogICAg ICAgIEV4cGVjdDo6c3Bhd24oJ0V4cGVjdCcsJy91c3IvYmluL3Bhc3N3ZCB0c2F1dGhvcicpIGNh bGxlZCBhdCBSZWFkRGF0YV9uZXcucGwgbGluZSAxOTcNCiAgICAgICAgbWFpbjo6Q3JlYXRlVXNl cigndHNhdXRob3InLCdmYWxzZScsJ1RTJykgY2FsbGVkIGF0IFJlYWREYXRhX25ldy5wbCBsaW5l IDQ4DQpTdGFydGluZyBFWFBFQ1QgcGF0dGVybiBtYXRjaGluZy4uLg0KICAgICAgICBFeHBlY3Q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TmV3IFVOSVggcGFzc3dv cmQ6DQpzcGF3biBpZCgzKTogRG9lcyBgQ2hhbmdpbmcgcGFzc3dvcmQgZm9yIHVzZXIgcHJvdXNl cjEuXHJcbk5ldyBVTklYIHBhc3N3b3JkOiAnDQptYXRjaDoNCiAgcGF0dGVybiAjMTogLXJlIGBD aGFuZ2luZyBwYXNzd29yZCBmb3IgdXNlciBwcm91c2VyMS5cclxuTmV3IFVOSVggcGFzc3dvcmQ6 ICc/IFlFUyEhDQogICAgQmVmb3JlIG1hdGNoIHN0cmluZzogYCcNCiAgICBNYXRjaCBzdHJpbmc6 IGBDaGFuZ2luZyBwYXNzd29yZCBmb3IgdXNlciBwcm91c2VyMS5cclxuTmV3IFVOSVggcGFzc3dv cmQ6ICcNCiAgICBBZnRlciBtYXRjaCBzdHJpbmc6IGAnDQogICAgTWF0Y2hsaXN0OiAoKQ0KUmV0 dXJuaW5nIGZyb20gZXhwZWN0IHN1Y2Nlc3NmdWxseS4NCiAgc3Bhd24gaWQoMyk6IGFjY3VtdWxh dG9yOiBgJw0K |
From: Roland G. <RGi...@cp...> - 2006-08-16 09:58:09
|
how about doing a $exp->send("version\r"); ?? PS: BTW, what is Nabble.com?! On 8/15/06, fastaero <raj...@gm...> wrote: > > my $exp = Expect->spawn("telnet 1.2.3.4"); > > my $timeout = 10; > my $username = 'lab'; > my $password = 'test1'; > > my $spawn_ok; > $exp->expect($timeout, > [ > qr'login:', > sub { > $spawn_ok = 1; > my $fh = shift; > $fh->send("$username\n"); > exp_continue; > } > ], > [ > qr'Password:', > sub { > my $fh = shift; > $fh->send("$password\n"); > exp_continue; > } > ], > eof => > sub { > if ($spawn_ok) { > die "ERROR: premature EOF in login.\n"; > } else { > die "ERROR: could not spawn telnet.\n"; > } > } > ], > [ > timeout => > sub { > die "No login.\n"; > } > ], > '-re',qr'>', #' wait for shell prompt, then exit expect > > ); > > my $exp1 = Expect->spawn("load"); > print "$exp1\n"; > > > how do I execute commands on the telneted machine using the above scripts? > login and password works fine, I want to execute "version" and get the > version number of the machine. How can I do that with using about sub? > > > my $telnet = new Net::Telnet ("1.2.3.4") > or die "Cannot telnet to remotehost: $!\n"; > #my $exp = Expect->exp_init($telnet); > > This is not working for some reason? Any ideas on why? > > Thanks > -- > View this message in context: http://www.nabble.com/need-help-with-expect%28%29-tf2107189.html#a5808510 > Sent from the Perl - Expectperl-Discuss forum at Nabble.com. > > > ------------------------------------------------------------------------- > Using Tomcat but need to do more? Need to support web services, security? > Get stuff done quickly with pre-integrated technology to make your job easier > Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo > http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642 > _______________________________________________ > Expectperl-discuss mailing list > Exp...@li... > https://lists.sourceforge.net/lists/listinfo/expectperl-discuss > -- RGi...@cp... |
From: Bryan B. <br...@bu...> - 2006-08-15 14:49:47
|
> > my $telnet = new Net::Telnet ("1.2.3.4") > or die "Cannot telnet to remotehost: $!\n"; > #my $exp = Expect->exp_init($telnet); > > This is not working for some reason? Any ideas on why? > > Thanks > -- Try this: my $telnet = new Net::Telnet(Timeout => 10, Prompt => '\$ '); eval { $telnet->open("1.2.3.4"); $telnet->login($user, $pass); }; if ( $@ ) { die "Cannot telnet to remote: $@\n"; } my $exp = Expect->exp_init($telnet); Hope that helps. Bryan http://www.sourceforge.net/projects/rover |
From: fastaero <raj...@gm...> - 2006-08-15 03:56:40
|
my $exp = Expect->spawn("telnet 1.2.3.4"); my $timeout = 10; my $username = 'lab'; my $password = 'test1'; my $spawn_ok; $exp->expect($timeout, [ qr'login:', sub { $spawn_ok = 1; my $fh = shift; $fh->send("$username\n"); exp_continue; } ], [ qr'Password:', sub { my $fh = shift; $fh->send("$password\n"); exp_continue; } ], eof => sub { if ($spawn_ok) { die "ERROR: premature EOF in login.\n"; } else { die "ERROR: could not spawn telnet.\n"; } } ], [ timeout => sub { die "No login.\n"; } ], '-re',qr'>', #' wait for shell prompt, then exit expect ); my $exp1 = Expect->spawn("load"); print "$exp1\n"; how do I execute commands on the telneted machine using the above scripts? login and password works fine, I want to execute "version" and get the version number of the machine. How can I do that with using about sub? my $telnet = new Net::Telnet ("1.2.3.4") or die "Cannot telnet to remotehost: $!\n"; #my $exp = Expect->exp_init($telnet); This is not working for some reason? Any ideas on why? Thanks -- View this message in context: http://www.nabble.com/need-help-with-expect%28%29-tf2107189.html#a5808510 Sent from the Perl - Expectperl-Discuss forum at Nabble.com. |
From: Chris S. <cas...@pe...> - 2006-08-04 17:32:07
|
Try escaping the dollar sign, or using single quotes? Quoting SolHai Haile <so...@ms...>: >=20 > I have a script that is broken when my appliance prompt changed from # = to $=20 > (Linux OS). >=20 > This is what works: >=20 > $prompt =3D "test_0:~#"; >=20 > do some test here >=20 > $exp->expect ($timeout, $prompt); >=20 > This is broken: >=20 > $prompt =3D "test_0:~$"; >=20 > do some test here >=20 > $exp->expect ($timeout, $prompt); >=20 > It times out here. It has some thing to do with $ sign but I can't figu= re=20 > out how to over come this. > Please help. >=20 > SH >=20 >=20 >=20 > -----------------------------------------------------------------------= -- > Take Surveys. Earn Cash. Influence the Future of IT > Join SourceForge.net's Techsay panel and you'll get the chance to share= your > opinions on IT & business topics through brief surveys -- and earn cash > http://www.techsay.com/default.php?page=3Djoin.php&p=3Dsourceforge&CID=3D= DEVDEV > _______________________________________________ > Expectperl-discuss mailing list > Exp...@li... > https://lists.sourceforge.net/lists/listinfo/expectperl-discuss >=20 |
From: SolHai H. <so...@ms...> - 2006-08-04 17:07:43
|
I have a script that is broken when my appliance prompt changed from # to $ (Linux OS). This is what works: $prompt = "test_0:~#"; do some test here $exp->expect ($timeout, $prompt); This is broken: $prompt = "test_0:~$"; do some test here $exp->expect ($timeout, $prompt); It times out here. It has some thing to do with $ sign but I can't figure out how to over come this. Please help. SH |
From: mohammad y. <aky...@ya...> - 2006-08-03 11:05:57
|
Hi Roland, As i updated in my last mail below sub testcase of test.pl is failing Checking if EOF on pty slave is correctly reported to master... (this fails on about 50% of the supported systems, so don't panic! Expect will work anyway!) TIMEOUT Sorry, you may not notice if the spawned process closes the pty. not ok 43 # Test failed at test.pl line 356. Passed 42 of 43 tests. Please scroll back and check which test(s) failed and what comments were given. Expect probably is still completely usable!! By reading the comments, it seems like this will fail on most of the system. My question is whether this needs to be fixed or we can live with it assuming that it will not affect ? Thanks & Regards Yaseen --------------------------------- Do you Yahoo!? Get on board. You're invited to try the new Yahoo! Mail Beta. |
From: mohammad y. <aky...@ya...> - 2006-07-31 09:39:24
|
I have tested the latest release of Expect on z/OS. The gmake test has one failure as below .. ... ... Expect_test_pid: 50397578 CEE5205S The signal SIGTERM was received. soft_close: 0x8F00 ok 41 ok 42 Checking if EOF on pty slave is correctly reported to master... (this fails on about 50% of the supported systems, so don't panic! Expect will work anyway!) TIMEOUT Sorry, you may not notice if the spawned process closes the pty. not ok 43 # Test failed at test.pl line 356. Passed 42 of 43 tests. Please scroll back and check which test(s) failed and what comments were given. Expect probably is still completely usable!! Roland Giersig <RGi...@cp...> wrote: Bug-Fix-Release, recommended. + added early return to send and send_slow if filehandle was closed + added test for send_slow ! fixed bug in expect() param handling (exact pattern "0" was ignored) ! fixed bug in _make_readable() + now included example ssh.pl in MANIFEST so it gets packaged :-( -- RGi...@cp... ------------------------------------------------------------------------- Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys -- and earn cash http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV _______________________________________________ Expectperl-discuss mailing list Exp...@li... https://lists.sourceforge.net/lists/listinfo/expectperl-discuss --------------------------------- Do you Yahoo!? Next-gen email? Have it all with the all-new Yahoo! Mail Beta. |
From: Eric T. <zi...@gm...> - 2006-07-28 21:41:02
|
The issue was discovered, On the distant end of my connection there was some interaction with psh and perl expect was sending a window size of (0, 0) and libedit, which is used by psh, did not like that. A workaround was to set the clone_winsize_from to STDIN. $exp->slave->clone_winsize_from(\*STDIN); Just for reference in case anyone else ever has this issue... On 7/25/06, Eric Thompson <zi...@gm...> wrote: > > In the following debug statement: > spawn id(5): Does `sys hard\r\n' > > match: > pattern #1: -ex `/# '? No. > > It shows that expect is reading back a \r\n (CR and a LF) when it is only > sent with a \n (LF). Is there some sort of terminal translation that may be > adding this extra bit on? \r\n as far as I know is only used by Windows > based platforms. On Linux and BSD only thr LF is used (\n). > > I am assuming that it is some sort of tty or pty issue, could you offer > some guidance in that area? Plus the "Connection was closed" message is > returned to the client when the connection is lost. It does not really > denote which side initiated it. I do know that sysread is failing to read > from the socket which is causing $nread to be null which is causing $nread > to be set to 0 which is causing the hard_close to be called. How can this > not be an expect issue if all this is already known? > > Plus the fact that tcl expect and python expect as well as a manual ssh > session via cli all work as they are suppose to, to me means that it has to > be something in perl expect. > > On 7/25/06, Roland Giersig <RGi...@cp...> wrote: > > > Hi Eric, > > > > there must be some other reason, it's definitively not Expect: > > > > > spawn id(5): Does `sys hard\r\nConnection to batista closed.\r\r\n' > > > > This clearly indicates that the ssh connection was lost on its own and > > Expect got the EOF as a result of that. > > > > But I have no idea where that could come from, sorry... > > [a hunch: maybe some issue with "\r" versus "\n", try send("sys > > hard\r")] > > > > Regards, Roland > > -- > > RGi...@cp... > > > > |