Expect Script - Pattern Matching Trouble

view story

http://www.unix.com – I am still learning expect, For the below script I always get This is True as the answer. Tried to debug and does not make sense to me. Not sure, where I am doing the mistake. Need Help! - Thanks Code: #!/usr/bin/expect -f set timeout 10 spawn -noecho bash expect { *$* } send "test -d /home/ron/pectd/ && export PS1=\"True>\" || export PS1=\"False>\"\r" send "\n" expect {     -exact "True>" {             send_user "This is True\n"       &nbsp (HowTos)