A message for Linux.com registered users: We are in the process of making changes to the Linux forums. Starting Monday, 8/13/18 at 6:00 PM PT, you will be unable to access the forums. They will re-launch as soon as possible on Wednesday, 8/15/18 with new features and improved functionality. Thank you for your patience and stay tuned for the new improved forums.

August 15, 2009

getting remote output with expect


I'm working some embedded boxes with limited functionality. They run Linux(busybox shell). Its not fullfledged. only some of our custom code..

I need to reboot the box at times or run commands like top on it.

I tried my hands at using expect using simple expect, send, send_user sequences.

However, although I can login to the box, I cannot issue any other command once in.

I've tried to expect " # " thinking that it will wait for the # in the bash prompt and then send a command\r But doesnot help.

Can any one guide where I'm going wrong?

Click Here!