http://www.unix.com – Code: expect { -re "(.*)NEXT PAGE(.*)" { send "\r\n" } exp_continue Quote: i just want to put for loop in this code i.e. till the time i am getting reply like NEXT PAGE i want to send "\r\n" but i don't know how to do that and i want to get this output into a text file present condition is that the script is executing properly (without for loop) but its not showing any output in text file Thanks in advance friends a (HowTos)