Sponsored Content
Full Discussion: need to send only once
Top Forums Shell Programming and Scripting need to send only once Post 302283182 by borderblaster on Monday 2nd of February 2009 07:17:11 PM
Old 02-02-2009
need to send only once

Hi i have a monitoring script that send an email if grep returns 0 for some text. Problem is it sends two emails for both grep strings exist. How can i make it only ever send 1 email if either greps return?

#if grep returns 0 then send email
grep -q "still didn't respond" /root/latest.txt
if [[ $? -eq 0 ]] ;then /root/mailer2.pl
fi
grep -q "Possible issue" /root/latest.txt
if [[ $? -eq 0 ]] ;then /root/mailer2.pl
fi
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

send mail

Hi all, I am setting up mail function to send mail from a Solaris 8 machines but when I send a test mail out. it returns the following in my UNIX mail box Reporting-MTA: dns; unix.localdomain.com Arrival-Date: Tue, 14 Feb 2006 19:23:37 +0900 (KST) Final-Recipient: RFC822;... (3 Replies)
Discussion started by: stancwong
3 Replies

2. Shell Programming and Scripting

Send a mail

Hello All, I have written a scirpt that asks users to take action by xx:yy hours. Now I want to automate the sending of a reminder mail at xx:yy hours to remind the user that he needs to take action. How do you think I can go about that?? The only thing i can think of is to set up a cron job... (5 Replies)
Discussion started by: garric
5 Replies

3. UNIX for Dummies Questions & Answers

please send me how to do it

hi sirs/madams please send me how to do"shell script that determines the period for which a specified user is working on the system" i am unable to do it https://www.unix.com/images/misc/progress.gif (2 Replies)
Discussion started by: sankar_1209
2 Replies

4. UNIX for Advanced & Expert Users

send attachments using send mail in Solaris

Hi All, I have a requirement to send and email of body html with an attachment. concatinating uuencode output to the mail body with mailx command works, but as my Email body is of HTML type i use sendmail. my command to send HTML body is as below: export MAILTO="recipient@domain.com"... (1 Reply)
Discussion started by: mohan_kumarcs
1 Replies

5. Shell Programming and Scripting

send out to nohup.out

I get an error no such file or directory. Yet my permissions are 774. is there anything else I could check. thanks (2 Replies)
Discussion started by: TimHortons
2 Replies

6. Shell Programming and Scripting

send email help.

I want to send an email, however I like to subject line of the email to be different, depending on the content or body of the email, is this possible. Ok - lets say the body of the email will always have the word job name, and depending on the 4,5 and 6 position of the job name, in this case... (1 Reply)
Discussion started by: axdelg
1 Replies

7. Shell Programming and Scripting

Script to send email after comparing the folder permissions to a certain permission & send email

Hello , I am trying to write a unix shell script to compare folder permission to say drwxr-x-wx and then send an email to my id in case the folders don't have the drwxr-x-wx permissions set for them . I have been trying to come up with a script for few days now , pls help me:( (2 Replies)
Discussion started by: nairshar
2 Replies

8. UNIX for Dummies Questions & Answers

Send urgent

%%START CBLOADER CBLOADER BRBAI2 000090 01,011600033,011600033,110516,0834,2,90,,2/ 02,011600033,011103093,1,110317,0834,,2/ 03,105581,,015,+00000416418,,,901,+00000000148,,,922,+000000 00354,,/ 03,113806,,015,+00000559618,,,901,+00000000096,,,922,+000000 00621,,/... (1 Reply)
Discussion started by: sgoud
1 Replies

9. Ubuntu

Not able to send mail out of UbuntuBox in send mail

Hi Guys.. yesterday i purchased a VPS server and installed sendmail on ubuntu 12.4 with Webmin & Apache runing webserver problem is.. i can send mail via webmin user interface account to anybody to out side to any domain and able to recieve any mail from any domain.. Now main... (2 Replies)
Discussion started by: cmdman
2 Replies

10. Shell Programming and Scripting

Send mail

Hi all, I am trying to send a mail with attachment through this script. but its getting error email.sh: line 27: syntax error near unexpected token `newline' email.sh: line 27: `!' #!/bin/sh SUBJ="Send mail from Unix with file attachments" TO=xx@domain.com... (1 Reply)
Discussion started by: balaji23_d
1 Replies
ZGREP(1)						    BSD General Commands Manual 						  ZGREP(1)

NAME
zgrep, zegrep, zfgrep -- print lines matching a pattern in gzip-compressed files SYNOPSIS
zgrep [grep-flags] [--] pattern [files ...] zegrep [grep-flags] [--] pattern [file ...] zfgrep [grep-flags] [--] pattern [file ...] DESCRIPTION
zgrep runs grep(1) on files or stdin, if no files argument is given, after decompressing them with zcat(1). The grep-flags and pattern arguments are passed on to grep(1). If an -e flag is found in the grep-flags, zgrep will not look for a pattern argument. zegrep calls egrep(1), while zfgrep calls fgrep(1). EXIT STATUS
In case of missing arguments or missing pattern, 1 will be returned, otherwise 0. SEE ALSO
egrep(1), fgrep(1), grep(1), gzip(1), zcat(1) AUTHORS
Thomas Klausner <wiz@NetBSD.org> BSD
December 28, 2003 BSD
All times are GMT -4. The time now is 08:26 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy