Thanks a lot in advance!<br><br>I got an idea: when the AWK program scans a report file and finds a data entry that exceeds a threshlod, and I want to send an email to inform someone about this (using mailx command), I wonder if I can do it. if can, how to do it?
cat report ¦ awk ‘$n > threshold {print $0}’ > result<br>if [ -s result ]<br>then<br>cat result ¦ mailx -s "MESSAGE” mail@address<br>else<br>echo “None exceeds threshold”<br>fi<br><br>Notes: - "-s" is the test in korn shell for file exists and is greater than zero. <p>Ged Jones<br><a href=mailto:gedejones@hotmail.com>gedejones@hotmail.com</a><br><a href= > </a><br>
I have found an answer for my own question. To run a system command from inside an awk program simply follow the syntax below where command is the system command being run.<br><br> system("command"<br><br> ~aithosn8
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.