Sorry for modifications.
Yes expect is installed. The problem was bash was executing it.
Now I'm executing by ./a.sh.
Problem is solved. Thanks a lot.