Scripts to respond to prompts
I have searched and was unsuccessful in finding a quick command or example to use.
I'm looking to automate an update process using command line in Debian.
Normally I'd use apt-get update|upgrade|dist-upgrade .
If apt-get finds a package to update it queries a Y/n response.
My objective is to have a script determine if this prompt is there, and if so to respond with 'Y'.
If not then it should not enter a response.
I know I'll need to use an IF/ELSE function, but what I'm having difficulties locating is to read the output of apt-get .
I know there's books and sites available, but they are all long and sometimes difficult to read or understand. And maybe my keywords are the right ones to use, as I'm not able to pinpoint a solution.
Thanks for your assistance.