Sponsored Content
Top Forums Shell Programming and Scripting Need help on unix scripting. I am at hello world level. Your help would be greatly appreciated. Post 302687247 by zaxxon on Thursday 16th of August 2012 08:52:12 AM
Old 08-16-2012
See elixir_sinari's solution including the date command. You can also leave out the count with -c and just check the return status of grep with $? or go this way, checking if the variable $VAR is not empty (to not invoke grep twice:

A tad more elegant:
Code:
VAR="$(grep -i "Invalid Transaction" ULOG.$(date +%m%d%y) 2> /dev/null)"
[ -n "$VAR" ] && \
mail -s "tuxedo info" a@bla.net b@bla.net c@bla.net


Last edited by zaxxon; 08-16-2012 at 10:01 AM.. Reason: adding code
This User Gave Thanks to zaxxon For This Post:
 

6 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

new to unix world

Need a lot of help, need to find information on unix and how to use it, Has anybody ues the learnkey videos on unix teaching. (5 Replies)
Discussion started by: winter
5 Replies

2. UNIX for Dummies Questions & Answers

Click here for the best unix in the world!!!!

To anyone who asks which Unix is the best... or which one I should use... Probably the best timeline I have ever seen. Read this link... http://www.levenez.com/unix/history.html#08 (0 Replies)
Discussion started by: Kelam_Magnus
0 Replies

3. UNIX for Dummies Questions & Answers

Unix in the banking world

Hi I have recently joined a bank as a tester. Initially I will be working on some test scripts and then I will be testing their data warehouse using SQL and Unix. I do have a very basic knowledge and understanding of both unix and sql. I am not sure how I will be using Unix to test their ... (2 Replies)
Discussion started by: kartikkumar84@g
2 Replies

4. UNIX for Dummies Questions & Answers

Had this idea for years, any help at all would be greatly appreciated!

Hello everyone, For a while now ive been wanting to create a way for me to access my home pc and have it perform remote tasks (Namely file downloading, archiving, torrenting) without needing to keep the PC continuously powered. Having seen the power of Linux and ssh at the hands of... (1 Reply)
Discussion started by: spliffinz
1 Replies

5. Homework & Coursework Questions

Help would be appreciated

If anyone could possibly help me to do this following question? Print a long listing of the files in the login directory for a specific month. The user is prompted to enter the first 3 letters of a month name, starting with a capital, and the program will display a long list of all files that... (1 Reply)
Discussion started by: Zunifx
1 Replies

6. What is on Your Mind?

Mad World Remix of Moby Video (Are You Lost In The World Like Me)

This is an excellent video comment on modern society and the remix is good too: https://www.youtube.com/watch?v=5DU1B_XkyIk 5DU1B_XkyIk Watch the video above and post your comments. (3 Replies)
Discussion started by: Neo
3 Replies
ZGREP(1)						      General Commands Manual							  ZGREP(1)

NAME
zgrep - search possibly compressed files for a regular expression SYNOPSIS
zgrep [ grep_options ] [ -e ] pattern filename... DESCRIPTION
Zgrep invokes grep on compressed or gzipped files. These grep options will cause zgrep to terminate with an error code: (-[drRzZ]|--di*|--exc*|--inc*|--rec*|--nu*). All other options specified are passed directly to grep. If no file is specified, then the standard input is decompressed if necessary and fed to grep. Otherwise the given files are uncompressed if necessary and fed to grep. If the GREP environment variable is set, zgrep uses it as the grep program to be invoked. EXIT CODE
2 - An option that is not supported was specified. AUTHOR
Charles Levert (charles@comm.polymtl.ca) SEE ALSO
grep(1), gzexe(1), gzip(1), zdiff(1), zforce(1), zmore(1), znew(1) ZGREP(1)
All times are GMT -4. The time now is 06:38 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy