I'm trying to write a couple of Bash scripts which use utility programs that take keyboard input (eg update-alternatives --config xxx needs a choice from the keyboard.
I want to automate it from a parameter passed when the script is used. At the moment my best effort writes a file using the input parameter, runs update-alternatives redirecting input from the newly created file, then deletes the file.
There must be a better way I'm sure. How can you pass a parameter rather than use keyboard input without writing it to a file first?
Tony