Pass a value for an input prompt

9,078

I think you're looking for the yes command :

yes | unzip my.zip

It sends y to the output again and again. If you want to send something else, specify it as the argument:

yes n | unzip my.zip

You can also use echo if there's only one question:

echo no | unzip my.zip
Share:
9,078

Related videos on Youtube

lukas.pukenis
Author by

lukas.pukenis

main = print $ (drink . make) coffee

Updated on September 18, 2022

Comments

  • lukas.pukenis
    lukas.pukenis over 1 year

    I do unzip my.zip and if files already exists it asks replace myfile.ext [y]es, [n]o, [A]ll, [N]one, [r]ename:

    How can I force input for when the command prompts for input? I am aware unzip may have force flag but I am interested in passing an input.