gpt4 book ai didi

linux - 使用 mailx 和 uuencode 发送附件

转载 作者:塔克拉玛干 更新时间:2023-11-03 01:32:42 30 4
gpt4 key购买 nike

我正在尝试运行一个 ksh 脚本,该脚本通常位于 AIX 机器上的新主机 Linux 节点上。

我运行的代码如下所示:

 (uuencode $path/info.dat info.csv; uuencode $RESULTS results.log) | mail -s "Info" $MAIL_RECIPIENTS

这通常会发送主题为“信息”的电子邮件,并包含附件 info.csv 和 results.log。

但是在我的 Linux 机器上这并没有发生 - 它发送的电子邮件带有 uuencode 输出作为电子邮件的正文并且没有附件:

begin 775 info.csv

M+3`U+C`S+C4S+C(Q-#`W."(L(D%55$]314Y$("`B+")!551/4T5.1"`@(BPB
etc..
etc...
end

begin 775 results.log
M+3`U+C`S+C4S+C(Q-#`W."(L(D%55$]314Y$("`B+")!551/4T5.1"`@(BPB
etc...
etc...
end

我曾尝试将文件作为附件发送,而根本不使用 uuencode:

mail -a info.csv -a results.log -s "Info" $MAIL_RECIPIENTS

但是这是在脚本中间调用的,它只是挂起,除非我按 CTRL D。

这是我使用的 uuencode 版本:

uuencode (GNU sharutils) 4.7
Copyright (C) 1994, 1995, 1996, 2002, 2005, 2007 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

有没有人遇到过这种情况?恐怕 mutt 不是一个选项。

最佳答案

由于电子邮件的正文无论如何都是空的,所以我能够这样做来停止挂起等待 EOT 的邮件实用程序。

mail -a info.cvs -a results.log -s "Info" $MAIL_RECIPIENTS < /dev/null

关于linux - 使用 mailx 和 uuencode 发送附件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24303201/

30 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com