Passing arguments to an interactive program non-interactively

前端 未结 6 921
一生所求
一生所求 2020-11-22 05:06

I have a bash script that employs the read command to read arguments to commands interactively, for example yes/no options. Is there a way to call this script i

6条回答
  •  难免孤独
    2020-11-22 05:57

    Just want to add one more way. Found it elsewhere, and is quite simple. Say I want to pass yes for all the prompts at command line for a command "execute_command", Then I would simply pipe yes to it.

    yes | execute_command
    

    This will use yes as the answer to all yes/no prompts.

提交回复
热议问题