help-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Help-bash] return to menu after stopping an interactive program


From: Bruce Hohl
Subject: [Help-bash] return to menu after stopping an interactive program
Date: Fri, 26 Apr 2019 08:21:11 -0400

I have a simple 'menu' script used to start programs:
while : ; do
cat <<'END'
MENU
 ls   -> list home directory
 lynx -> lynx web browser
 top  -> top process monitor
 q    -> quit this menu
END

read -p "Enter choice " choice
echo
case $choice in
 (ls)   ls; echo; read -p 'enter for menu';;
 (lynx) exec lynx;;
 (top)  exec top;;
 (q|Q)  break
 (*)
esac
done
exit 0

The programs are started as child processes of the 'menu'
script.  If lynx is selected/started, then Ctrl-Z is used
to stop lynx, it is reported that 'menu' has been stopped:
[1]+  Stopped                 menu

What I really want is to stop the selected item (lynx)
and be returned to the (running) menu. Is there a way
to do this with interactive programs?


reply via email to

[Prev in Thread] Current Thread [Next in Thread]