Hi,
I am in learning curve in the Tcl/expert language.
I am trying to build and expect script to log into multiple aix boxes and change password.
Hi there.
There is a shell script:
Code:
#!/bin/bash
ARGS=`(grep -i $1 old.txt || grep -i $1 new.txt) |awk 'BEGIN {FS=","}{print "\x27" $5 "\x27"}' | tr "\n" " "`
/usr/bin/expect -- << EXPECTEND
spawn -noecho myssh myhost.localnet
log_user 0
expect root
log_user 1
send "/home/one.pl $ARGS\r"
set val $expect_ou
Shell Scipt: temp.sh
<code>
su - <$username>
expect pass.exp
<code>
Expect script: pass.exp
#!/usr/bin/expect -f
# Login
#######################
expect "Password: " send "<$password>\r"
it comes up with Password: but doesnt take password passed throguh file.
Hi, I'm writing a shell script that calls a few commands that prompt the user for two simple yes/no questions. if the answers are consistent (the first is a yes, the second is a no), what would my expect script look like? Google is only giving me answers for scripts where I telnet or ssh.
Hi All,
I need help in making my script run perfectly as expected.
This is a snippet from my script. I am trying to read the ";" from the below output using the expect command, but the command is not detecting it.
I created a script wherein it will change password of a user
Quote:
#!/usr/bin/expect
spawn passwd [lindex $argv 0]
set password [lindex $argv 1]
expect "New UNIX password:"
send "$password\r"
expect "Retype new UNIX password:"
send "$password\r"
Hi.
Here is beginning of my script
Code:
#!/usr/local/bin/expect --
set timeout 15
spawn /usr/local/account.sh -n modify
expect "Password:" {send "mypassword\r"}
But due to some terminal control sequences (or something else, dunno exactly) my password prompt is looking like this:
Code:
[[61;157R-n Password:
and expect doesn't recognize it.
I have the following expect script sitting on a Linux box.
===
Code:
#!/usr/bin/expect -f
#
# backup.expect
#
# Expect script to backup a firewall via a SSH session
#
#
set firewall [ lrange $argv 0 0 ]
set username [ lrange $argv 1 1 ]
set password [ lrange $argv 2 2 ]
set prompt [ lrange $argv 3 3 ]
set filename &