i'm having problems capturing the output from a spawned command. the command is spawned and returns a filesize. the filesize is returned when i use interact in the script. is there anyway i can assign that return to a variable. or since i'm using interact, is the value stored in interact_out? any help would be appreicated....or if anyone who could point me to a site or board that has help for expect scripters. below is my script thus far.
spawn ssh backup@
www.bob.com du -sk /Volumes/extdrive1/serverBackups/backup.$HOSTNAME.$DATE.tar|cut -f1|tr -d A-Z " "
expect -re "password:"
send "****\r"
interact -re
set SIZE2 $interact_out(spawn_id) #ERROR HERE
p.s. i also wonder if there was a way to have all output redirected to a file.....having problems getting that working too.