Passing arguments to an interactive program non-interactively

前端 未结 6 984
一生所求
一生所求 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:33

    anothe ralternative can be

    echo "something" | tee /path/to/file
    

    The tee command prints the input it receives to the screen and saves it to a file at the same time.

提交回复
热议问题