I am writing a menu script and one of the options is to access a Command Prompt and return to the menu via CTRL-D. I have tried using a loop and echoing the PS1 value, then using read to assign whatever is entered into a variable, then executing the value of that variable as a command using
. $variable. it would look something like this and would work just fine except for one thing.....I have no idea how to put CTRL-D into the script. If i hit the CTRL button from within the vi editor it has its own special function. I've tried ^D, and whatever else i could think of but to no avail.
clear
do until [ $variable = CTRL-D ]
echo "`PS1`:"
read variable
. $variable
esac
thank you in advance