Skip to content
Advertisement

How to auto answer linux terminal

My code is

import os
os.popen("yaourt -S git",'w').write(mypass)

But after question is “do you want install [y/n]”. How can I automaticaly answer to question? I want Whenever the terminal asks a question, my answer is be “y”.

Advertisement

Answer

Just add following to your command:

yaourt -S git --noconfirm    

It makes sure that confirmation is avoided.

User contributions licensed under: CC BY-SA
7 People found this is helpful
Advertisement