小编hom*_*mer的帖子

如何使用mailx以文本形式发送文件并向电子邮件正文添加额外文本?

如何在电子邮件中随文件内容一起发送一些文本,不想将文件作为附件发送?是否可以通过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)

shell ksh mailx

5
推荐指数
1
解决办法
2万
查看次数

perl减去时间并以秒为单位显示

我已经浏览了SO最后30分钟,但无法得到答案,所以决定发布问题.

我不能像某些答案中所建议的那样使用Time::PieceDate::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"在减法中不是数字( - )

谢谢,

perl

0
推荐指数
1
解决办法
480
查看次数

标签 统计

ksh ×1

mailx ×1

perl ×1

shell ×1