awk filter & Auto gen Mail


 
Thread Tools Search this Thread
Operating Systems Linux awk filter & Auto gen Mail
# 8  
Old 01-31-2012
1) create a dummy file in /tmp ( count.txt )
2) insert value 0 to the count.txt
Code:
 
old_count=$(cat /tmp/count.txt)
current_count=$(grep -c "\"100\"" log.csv)
if [ $current_count > $old_count ]
then
 #send email -- grep the value from the log.csv
 echo $current_count > /tmp/count.txt
fi

Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

awk command with if & mail

Hi Experts, I want to check in table that if third column value is "bhu" & if it is greater than 500 it will send mail other wise there will be no mail. but as per my script mails are still coming even value is below 500 with one blank mail(without any content) with subject line"test mail". I... (12 Replies)
Discussion started by: dravi_laxmi
12 Replies

2. Shell Programming and Scripting

Need Script to ZIP/SAVE & then DELETE Log file & send a mail conformation for any error

ENVIROMENT Linux: RHEL 6.4 Log Path: /usr/iplanet/servers/https-company/logs Log Format: user.log.03-15-2015 I have log4j log rotation enabled rotating files on a daily basis. The rotated logs are NOT compressed & are taking up too much space. I need a script that will run daily that... (1 Reply)
Discussion started by: admin_job_admin
1 Replies

3. Shell Programming and Scripting

How to find & auto resize images?

I need a command or mini scripts that can find certain type of images file recursively from the current dir with files of minimum 736 width and resize them by "736 max width, relative height" and replace the source files. I currently have GD installed but can also install Imagemagick if needed, I'm... (5 Replies)
Discussion started by: Frozen77
5 Replies

4. Shell Programming and Scripting

Bash for multiple accounts with auto-gen passwords

Hello, I am studying few things on unux and scripting. I need a script to create bulk users in unux. I need some assistance from you for creating 100 or more User IDs using a bash script: Here's my requirements: 1. I need to create 100 or even more user ids of different naming... (1 Reply)
Discussion started by: Shelldorado
1 Replies

5. Shell Programming and Scripting

awk Help: Filter Multiple Entry & print in one line.

AWK Gurus, data: srvhcm01 AZSCI srvhcm01 AZSDB srvhcm01 BZSDB srvhcm01 E2QDI31 srvhcm01 YPDCI srvhcm01 YPDDB srvhcm01 UV2FSCR srvhcm01 UV2FSBI srvhcm01 UV2FSXI srvhcm01 UV2FSUC srvhcm01 UV2FSEP srvhcm01 UV2FSRE srvhcm01 NASCI srvhcm01 NASDB srvhcm01 UV2FSSL srvhcm01 UV2FSDI (7 Replies)
Discussion started by: rveri
7 Replies

6. UNIX for Dummies Questions & Answers

How to auto CC all outgoing e-mail?

I'm using Debian 5.0.4, exim4 and mutt. I would like all outgoing mail sent by any/all users CC (not BCC) to a specified e-mail account. (I do have it working for BCC using 'unseen'.) I have spent hours of searching/reading/testing how and have not been able to find out how. I have seen it... (0 Replies)
Discussion started by: mewbie
0 Replies

7. AIX

AIX auto delete old mail messages

We have had an issue where the mail file filled up. Is there a setting in sendmail.cf to automatically remove old emails? Say after 14 days. If not is there any way automatically to delete older mail files?? (1 Reply)
Discussion started by: daveisme
1 Replies

8. Solaris

auto mail

Hi All, I have solaris 8 on sparc machine, i need to know how i can let my system send to my e-mail any impacts or troubles.... how i can do that?! :confused: thx, (1 Reply)
Discussion started by: ahmad_one
1 Replies

9. UNIX for Advanced & Expert Users

Mail Filter

hai friends. How can i filter the incoming mails to an individual folder.. I am using sendmail. Thanks in advance Collins (4 Replies)
Discussion started by: collins
4 Replies

10. Shell Programming and Scripting

mail filter

Hi all: I have a problem with this simple script. It appears that it should work, but I am getting an error message. I am trying to pass a file through a filter to grep for "urgent" and forward the message to me. Here it is. #!/bin/ksh # if (`grep urgent /tmp/test.tmp| wc -l` -gt 0)... (13 Replies)
Discussion started by: Kelam_Magnus
13 Replies
Login or Register to Ask a Question
i-ls(1) 						      General Commands Manual							   i-ls(1)

NAME
i-ls - display file stat and checksum information for files SYNOPSIS
i-ls [-s] filename i-ls [-s] dirname Specify a filename for i-ls to examine, or specify a directory with dirname to examine all the files in the directory. -s Do not show/calculate checksums for all regular files. DESCRIPTION
The integrit system detects intrusion by detecting when trusted files have been altered. integrit records information about files in a database. i-ls allows the user to see that information for live files. The output syntax is the same as that of integrit. EXAMPLES
i-ls /tmp/foo.txt shows file stat attributes for the file, "/tmp/foo.txt". i-ls /tmp shows file stat attributes for all files in the directory, "/tmp". i-ls -s /tmp shows file stat attributes for all files in the directory, "/tmp", also including also checksums for all regular files. AUTHOR
Ed L Cashin <ecashin@users.sourceforge.net> See the integrit web site for up to date releases and information at http://integrit.sourceforge.net/ SEE ALSO
Integrit File Verification System Manual (info), lstat(2) Version 4.1 Jul 27, 2001 i-ls(1)