【问题标题】:How do I find the result of a find, in this script for sending by email如何在此通过电子邮件发送的脚本中找到查找的结果
【发布时间】:2017-06-22 15:18:25
【问题描述】:

如何在这个通过电子邮件发送的脚本中找到查找结果??

我试过这种方法

如何将结果放入电子邮件中。 查找结果

mailx -s "result of find " support@systems.com

【问题讨论】:

标签: python linux bash shell unix


【解决方案1】:

你需要“管”它。

find /bin | mailx -s "result of find in /bin" support@systems.com

管道允许您将 shell 命令的输出转换为另一个命令的输入。它们在 linux/unix 系统中非常方便和广泛使用。 你应该调查一下。

【讨论】:

    【解决方案2】:

    这样的东西可以满足您的需求:

    find /path_to_examine -type f -print | mailx -s "Find Results" support@systems.com
    

    mailx 期望来自 STDIN 的输入;从启动终端读取(并以 control-D 序列终止);或重定向;或管道。选择的示例使用管道。您也可以重定向一个已经创建的文件,因此:

    mailx -s "Find Results" support@systems.com < myresults
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2011-09-11
      • 1970-01-01
      • 2018-03-03
      • 1970-01-01
      • 1970-01-01
      • 2011-02-12
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多