Ask a Question related to AIX, Design and Development.
-
Krishna #1
EXPECT Utility
Hi,
I am trying to pass a password which is having special characters like
$$.
If I pass a password like "test$$12" as a new password, the program
cannot able to set the password as "test$$12". How to nullify the
special meaning of "$$" while passing the argument. Here is my
program.
#!/usr/bin/expect -f
spawn /usr/bin/passwd
set oldpas [lindex $argv 0]
set newpas [lindex $argv 1]
expect "Old password:"
send "$oldpas\r"
expect "New password:"
send "$newpas\r"
expect "new password:"
send "$newpas\r"
expect eof
Thanks in advance for your help.
Best Regards
Siva.
Krishna Guest
-
Expect and rsh
Hello, I have an expect script that I use to telnet into a remote machine to execute unix commands. My question is not about using expect to do... -
[PHP-DEV] When can I expect changes to be applied
Hello, I requested some time ago that zend_parse_parameters() be altered to accept "Z" as a parameter type in order to be able to retrieve... -
Net::SCP::Expect
Would someone mind telling me what I am doing wrong here please. I am trying to tie the SCP Expect module into a backup script I put together, but it... -
Expect problem
The following Expect script works fine: #!/usr/local/bin/expect #exp_internal 1 #log_file "lon.txt" spawn telnet 199.169.71.190 2003 exec... -
@INC is not what I expect
I have this perl script running on solaris in korn: $ cat scriptb.sh #!/usr/bin/perl use strict; use DBI; these are my included library... -
Todd H. #2
Re: EXPECT Utility
[email]haisiva@yahoo.com[/email] (Krishna) writes:
I haven't used expect, but if it's like shell scripting, try ${oldpas}> Hi,
>
> I am trying to pass a password which is having special characters like
> $$.
>
> If I pass a password like "test$$12" as a new password, the program
> cannot able to set the password as "test$$12". How to nullify the
> special meaning of "$$" while passing the argument. Here is my
> program.
as the reference instead of $oldpas.
This avoids this very problem in the shell scripting world, and may
well work for you.
--> #!/usr/bin/expect -f
>
> spawn /usr/bin/passwd
>
> set oldpas [lindex $argv 0]
> set newpas [lindex $argv 1]
>
> expect "Old password:"
> send "$oldpas\r"
> expect "New password:"
> send "$newpas\r"
> expect "new password:"
> send "$newpas\r"
> expect eof
Todd H.
[url]http://www.toddh.net/[/url]
Todd H. Guest
-
RobH #3
Re: EXPECT Utility
"Krishna" <haisiva@yahoo.com> wrote in message
news:1d5a6364.0309291159.7adcea73@posting.google.c om...comp.lang.tcl is the NG best suited to this query as Expect uses> Hi,
>
> I am trying to pass a password which is having special characters like
> $$.
>
> If I pass a password like "test$$12" as a new password, the program
> cannot able to set the password as "test$$12". How to nullify the
> special meaning of "$$" while passing the argument. Here is my
> program.
>
> #!/usr/bin/expect -f
>
> spawn /usr/bin/passwd
>
> set oldpas [lindex $argv 0]
> set newpas [lindex $argv 1]
>
> expect "Old password:"
> send "$oldpas\r"
> expect "New password:"
> send "$newpas\r"
> expect "new password:"
> send "$newpas\r"
> expect eof
>
> Thanks in advance for your help.
>
embedded tcl.
Mr Libes hangs out there as well.
RobH
RobH Guest
-
at #4
Re: EXPECT Utility
On 29 Sep 2003 12:59:24 -0700, [email]haisiva@yahoo.com[/email] (Krishna) wrote:
When invoking the script and passing your password(s) preceed every>Hi,
>
>I am trying to pass a password which is having special characters like
>$$.
>
>If I pass a password like "test$$12" as a new password, the program
>cannot able to set the password as "test$$12". How to nullify the
>special meaning of "$$" while passing the argument. Here is my
>program.
>
>#!/usr/bin/expect -f
>
>spawn /usr/bin/passwd
>
>set oldpas [lindex $argv 0]
>set newpas [lindex $argv 1]
>
>expect "Old password:"
>send "$oldpas\r"
>expect "New password:"
>send "$newpas\r"
>expect "new password:"
>send "$newpas\r"
>expect eof
>
>Thanks in advance for your help.
>
>Best Regards
>Siva.
special character with a backslash "\". This will escape the special
characters and send them, intact, to the subscript.
Bob
at Guest



Reply With Quote

