Interactive Responses in CLI

Viewed 49

I am struggling to write a command using either python or a bash script that inputs responses to commands.

For example, I may install a program using a command and it responds with the Y/n prompt. I know there is a -y flag for the command sudo apt install.

However, I also want to be able to enter and retype passwords after doing the sudo passwd ubuntu command.

How do I address this in a program?

0 Answers
Related