如何在电子邮件中随文件内容一起发送一些文本,不想将文件作为附件发送?是否可以通过mailx命令?
mailx -s "Email log file" abc@mail.com <$log_file;
Run Code Online (Sandbox Code Playgroud)
$log_file 内容通过电子邮件发送但下面不起作用
echo "Comment: log contains last month report" | mailx -s "Email log file" abc@mail.com < $log_file
Run Code Online (Sandbox Code Playgroud)
电子邮件中需要的输出:
Comment: Log contains last month report
<All contents of $LOG_FILE as text>
Run Code Online (Sandbox Code Playgroud) 我已经浏览了SO最后30分钟,但无法得到答案,所以决定发布问题.
我不能像某些答案中所建议的那样使用Time::Piece或Date::Parse模块.
我试图减去两次并在几秒钟内得到结果
use warnings;
use strict;
$tod = `date "+%H:%M:%S"`; chomp $tod; #record time of the day to variable
#Sample time 16:55:44
my startTime = $tod;
Insert records;
my endTime = $tod;
my totalTime = $startTime - $endTime;
Run Code Online (Sandbox Code Playgroud)
错误:Arguemnt"16:55:14"在减法中不是数字( - )
谢谢,