如何将input从一个脚本传递到另一个使用bash
我正在编写一个脚本,我想要启动mysql_secure_installation脚本并在每个提示符处提供相应的答案。 我尝试使用这样的回声: echo -e "\n\n$db_pass\n$db_pass\n\n\n\n\n" | /usr/bin/mysql_secure_installation 它不完全工作。 它似乎正确回答了最后5个问题,但它没有正确回答前3个(这是在CentOS 6.5框中)。 这是输出: In order to log into MySQL to secure it, we'll need the current password for the root user. If you've just installed MySQL, and you haven't set the root password yet, the password will be blank, so you should just press enter here. stty: […]