I currently use expect to pass password to rsync to copy files across unix servers
test.sh
./expect.sh $password rsync -azvr $username@$host:$file ./$dir
expect.sh
#!/usr/bin/expect -f eval spawn [lrange $argv 1 end] #expect "(yes/no)?" #send "yes\r" expect "*?assword:*" send [lindex $argv 0] send \r interact
if server password got changed but not updated in script, I would like to receive a notification. however currently it would just hangs indefinitely. If I do the following in test.sh
output=`./expect.sh $password rsync -azvr $username@$host:$file ./$dir`
Now the script would hang indefintely so I would never get a chance to handle the output. how do I solve this issue?