13

How to return value from expect script?

view full story
linux-howto

http://www.unix.com – 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_out(buffer) send_user "$val" #expect eof EXPECTEND This does not works. When i commented out line before last, i saw required output, but script executed 10 secs longer, i guess &quot (HowTos)