After su-ing to root and running directly from the command line apt upgrade, some packages upgrades result in a dialog -- white on blue text, with red block highlight for option selected with tab key) -- which after using tab to select the apporopriate option and then enter, continues with the exection of the process.Now if the apt upgrade command is put into an executable Bourne shell script (along with other commands eg apt-file update, apt update before the apt upgrade) and the apt upgrade processs invokes dialog to get user input (keep old modified config version, replace config with new version etc) then keyboard input is ignored -- characters echo on terminal but are not seen by the dialog process.The only thing that can be done is to go to another X terminal, kill the apt process, remove a lock file,  run dpkg --configure -a, run apt-get -f upgrade etcI suspect that the problem is possibly due to redirection of stdin and/or the tty mode being changed to raw mode when dialog is invoked.So can apt be run from a shell script with some necessary setting so input is not lost when dialog is invoked by apt?This problem is common to Debian, Ubuntu, and Linux Mint.
When apt-get upgrade or apt upgrade is run from shell script and dialog is invoked, input hangs
shell script;apt;bourne shell