Re: EXPECT Utility

From: at (R.Mariotti)
Date: 09/30/03

  • Next message: News Reader: "Re: IBM AIX 5.1 routines"
    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


  • Next message: News Reader: "Re: IBM AIX 5.1 routines"

    Relevant Pages

    • Re: Form mailto and diacritical marks ?
      ... Some may not have their email software configured to send special characters such as the ones you mentioned. ... You need to 'POST' the form to a scrip on YOUR server so that you can deal with these special characters. ... That is a hidden field included in the form. ... But as you're not using a server side script to process form data this field is ignored. ...
      (alt.html)
    • [HPADM] SUMMARY: rename files with special characters
      ... Bill Hassell comments on leaving spaces in the names of the files: ... Well, leaving spaces in the name will cause many, many problems. ... As far as the last script, ... > Does any one have any scripts that can handle the special characters? ...
      (HP-UX-Admin)
    • Re: sed problem: variables countaining special symbols
      ... My script is falling over with a sed problem. ... The above sed command works fine when there are no "special characters" ... as substitute delimiters. ... If not, try a control char, ...
      (comp.unix.shell)
    • Re: Filename containing brackets
      ... I was fiddling around with some files containing special characters within a script. ... How do I tell my script to simply use the variable content as-is and not to interpret it? ... When using single quotes, ...
      (comp.unix.shell)
    • Re: Escape special characters in a string
      ... > I'm hurting my brain trying to find a way to escape special characters ... > The shell now waits since there is no closing quote on the echo. ... I assume your user is calling the script as: ...
      (comp.unix.shell)