我在bash脚本中input了以下内容。
echo "Please see attached file" | mailx -S smtp=$smtpServer -s "Subject of the mail" -a $logfile -r "[email protected]" [email protected] [email protected]
它的工作正常,如果没有错误发送邮件。 但有时如果出现错误,mailx将显示错误信息并等待用户input回车键(回车)。 我想避免这一点。 它不应该等待用户input回车键。 如何在bash脚本中做到这一点?