Passing arguments to an interactive program non-interactively

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

    For more complex tasks there is expect ( http://en.wikipedia.org/wiki/Expect ). It basically simulates a user, you can code a script how to react to specific program outputs and related stuff.

    This also works in cases like ssh that prohibits piping passwords to it.

提交回复
热议问题