Re: EXPECT Utility
From: at (R.Mariotti)
Date: 09/30/03
- Previous message: Chris Graham [WarpSpeed]: "Re: AIX 4.3.3 System Restore Failure"
- In reply to: Krishna: "EXPECT Utility"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Mon, 29 Sep 2003 23:44:51 GMT
On 29 Sep 2003 12:59:24 -0700, haisiva@yahoo.com (Krishna) wrote:
>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.
When invoking the script and passing your password(s) preceed every
special character with a backslash "\". This will escape the special
characters and send them, intact, to the subscript.
Bob
- Previous message: Chris Graham [WarpSpeed]: "Re: AIX 4.3.3 System Restore Failure"
- In reply to: Krishna: "EXPECT Utility"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|