From a shell script, how can I launch a bash sub-shell for the user & wait for the user to type exit at the bash sub-shell prompt?
I tried bash -c expect -c 'expect "exit" {send "Exiting\n"}'; but it is not working. Please help.
Thanks
I don't understand what you expect "expect" to be:
$ type -a expect bash: type: expect: not found
Here a simple example that might give clues:
$ bash -c 'echo "Hi, I am alive." ; read -p "Press ENTER to exit> " ans ; echo "You typed $ans"' Hi, I am alive. Press ENTER to exit> exit You typed exit
man bash, help read and the Bash guides at http://www.tldp.org/guides.html might be of help.