hi
i am writing an expect script to automate su command, my script goes like this...
#!/usr/local/bin/expect --
set password [lindex $argv 0]
set env_var [lindex $argv 1]
spawn su UNAME [lindex $argv 0]
expect "password:"
send "$password\r"
expect "env"
send "setenv PATHVAR $env_ver\r"
expect "env"
send "echo \$PATHVAR"
expect eof
arguments i am passing is password and $PATH variable. as PATH variable will be very long in length expect is not executing properly, its failing at "send "setenv PATHVAR $env_ver\r"" and not going forward..
any help on this will be appreciated..