有一个交互式shell控制台,我可以进入它,在控制台内运行特定的一组命令并退出它。在shell脚本中避免交互模式
现在我想编写一个连接到交互式shell控制台的bash脚本,并以静默方式运行我的命令,最后退出时没有任何交互。这意味着我希望以非交互方式让所有内容自动化。任何想法我怎么能做到这一点?
我想类似的东西,比方说,布拉布拉shell是交互式控制台这里,它总是带给我的交互模式:(
/usr/bin/blabla shell << EOF
do A,
do B,
do C
quit
EOF
我可以找到这个问题的长/特定版本在这里 - > Configure flume in shell/bash script - avoid interactive flume shell console
感谢您的答复,在我的情况,应该是/ usr/bin中/布拉布拉壳<& - << EOF? – Shengjie
根据[documentation](http://archive.cloudera.com/cdh/3/flume/UserGuide/#_using_the_flume_command_shell),您可以通过'echo“命令将命令传递给shell localhost:35873 \ ngetconfigs \ nquit”| flume shell -q' – Stefan
如果关闭'stdin',shell是否可以读取here-doc? –