ฉันมีคำสั่งนี้:
program script.sh >/dev/null 2>&1 &
"โปรแกรม" ดำเนินการ "script.sh" เฉพาะเมื่อมีเงื่อนไขเดียวจาก "โปรแกรม" เป็นจริง และฉันต้องการเพิ่มเงื่อนไขอื่นใน "script.sh" ด้วย awk หรือ sed
เช่น :
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.
และฉันไม่ต้องการเขียนเอาต์พุตจาก "โปรแกรม" ลงบนดิสก์ (เฉพาะในกรณีที่เป็นไปได้)
ขอบคุณ!