簡體   English   中英

僅當awk找不到大於的數字時才執行腳本

[英]script is executed only if awk didn't find any number greater than

我有以下命令:

program script.sh >/dev/null 2>&1 &

僅當“程序”中的一個條件為真時,“程序”才執行“ script.sh”。 我想用awk或sed在“ script.sh”中添加另一個條件。
例如: if in the output of "program" is only one number greather than 60 do not send email if not send email ,則該程序的輸出如下所示:
program.log
peak: -5.19dB (not silent) peak: -74.75dB (X seconds of silence) **SILENCE** 59 seconds left in grace period.

而且我不想將“程序”的輸出寫入磁盤(僅在可能的情況下)

謝謝!

我認為在您的script.sh內部,您script.sh在郵寄之前進行測試...

awk -F '[ (]+' '$7 > 90 { exit 1 }'

答案可能涉及使用命名管道,三通+流程替代,三通+ FD或...

https://unix.stackexchange.com/questions/28503/how-can-i-send-stdout-to-multiple-commands

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM