Expect and BigFix

Hello,

I have tried several times to get an expect script on to a server and to run it to set a password. It fails a couple of ways, you cant use { in a createfile, so to get around that, I download a file. But while the script seems to run, it does not effectively set the information.

This is linux running the script through Big fix.

@hansells – are you able to share your script here? Is your question related to this post?

Here are the commands in BigFix
wait chmod 700 __Download/tsmCache.exp

wait /bin/sh --login -c “/var/opt/BESClient/__BESData/actionsite/__Download/tsmCache.exp {parameter “TSMPassword” of action}”

I get the password from this;
action parameter query “TSMPassword” with description “Password for client to connect to tsm”

and this is the expect script which works on the command line.

#!/usr/bin/expect -d
log_file /tmp/logs.exp
set password [lindex $argv 0]

spawn /bin/dsmc q sched

expect ">: " {send “\r”}

expect ": " {send “$password\r”}

interact

Any advice would be great.

thanks

what about this way…

delete __createfile
action_t={parameter “action_par”}
action=echo $action_t|tr A-Z a-z
echo “set timeout -1” > /tmp/sox.exp
echo "spawn /usr/local/sox_verification.ksh $action " >> /tmp/sox.exp
echo “#sleep 15” >> /tmp/sox.exp
echo expect ‘"Do you want to continue (y/n)? "’>> /tmp/sox.exp
echo send – ‘“yr”’ >> /tmp/sox.exp
echo “#sleep 35” >> /tmp/sox.exp
echo expect ‘“root@”’ >> /tmp/sox.exp
END_OF_FILE
wait expect -f /tmp/sox.exp > /tmp/log
delete /tmp/sox.exp