Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
使用 mailx 命令跟踪 html 邮件在 shell 终端中工作,但相同的命令在 shell 脚本中不工作。
mailx -s "$(echo -e "${sub} TRP OF ${system} \nContent-Type: text/html")" example@gmail.com < TRP.html
我猜这是一些小的转义字符错误,但不确定它是什么。
有人可以在这里帮忙吗?
也许您的 vars sub / system 仅在您当前的环境中是已知的。
当您的 sript 称为 mymail 时,请尝试
. mymail
(以点开头),或首先导出您的变量。
当这些建议失败时,调试:使用 set -x 或临时在你的行前放置一个“echo -e”。