Find the answer to your Linux question:
Results 1 to 2 of 2
Hi everybody iam learning tcl/tk scripting language..... i wrote the code in my linux machime, it is showing exrror like this bash: ./p1.exp: /usr/bin/expect: bad interpreter: No such file or ...
  1. #1
    Linux Newbie
    Join Date
    Oct 2006
    Posts
    107

    Tcl/tk

    Hi everybody

    iam learning tcl/tk scripting language.....


    i wrote the code in my linux machime, it is showing exrror like this

    bash: ./p1.exp: /usr/bin/expect: bad interpreter: No such file or directory


    i start the code like this

    #! /usr/bin/expect -f


    some code here

    and save this file as p1.exp

    and last wen i type like ./p1.exp, it shows me like abv error

    Can any body tell me and give a simple example program......

    thnks in Advance

  2. #2
    Just Joined! Sivel's Avatar
    Join Date
    Jun 2005
    Location
    Maryland
    Posts
    20
    Here is a simple script that will change a password for a user. The username is given as a command line argument to the script. The password is hard coded.

    To use the script it would be something like ./password.tcl username

    I figured a few examples of setting variables would help as well.

    Code:
    #!/usr/bin/expect
    
    set user [lindex $argv 0]
    set pass "passw0rd"
    
    spawn /usr/bin/passwd $user
    expect "*password:"
    send "$pass\r"
    expect eof

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
...