I am running Solaris 9. All the programs are in ksh not /bin/sh.
I am also not trying to kill the process.
I have menu and one othe optoins calls a script that loops and pauses 5 seconds before repeating.
If we enter Ctrl d or break out we go back to the prompt and not the original menu.
I want to put a prompt at the end of the loop where it pauses (sleeps) for 5 seconds and prompt the user to quit (evaluate and quit) getting me back to the original menu.
I am not sure how ans=$(line) would work.