Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
BOOK: Beginning Shell Scripting ISBN: 0-7645-8320-4
This is the forum to discuss the Wrox book Beginning Shell Scripting by Eric Foster-Johnson, John C. Welch, Micah Anderson; ISBN: 9780764583209
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Beginning Shell Scripting ISBN: 0-7645-8320-4 section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developersí questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Thread Tools Display Modes
  #1 (permalink)  
Old November 26th, 2007, 12:00 AM
Registered User
Join Date: Nov 2007
Location: Bangalore, Karnataka, India.
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default search a logfile for strings

Hi experts..

I am trying to write a shell script which will scan a log file for three strings ie success image1, success image2, success image3.
My shell is tcsh

If all the 3 strings are found then insert the 3 strings to a file1 and send mail to developers with file1

If all 3 are note found copy the strings to a file2 and send file2 to developers.

Similarly, if string image1 & image2 are found and image3 missing...then insert the string image1 & image2 to file-1 and insert the string image3 to file-2 and send a mail attaching both file1 & file2 to developer.

I tried with "if - else" but that is making the scrip longer,

Could anyone please tell me different way (ideally,using fgrep\grep\sed\awk..or other)


Reply With Quote

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Search button doesn't search Access DB cbones Visual Studio 2008 1 October 27th, 2008 08:36 PM
create server side logfile from javascript senthilkumar Javascript 1 March 22nd, 2006 02:50 PM
Need Help Building a Logfile erehdogmai Excel VBA 1 May 5th, 2004 11:56 AM
FSO Logfile Problem acdsky Classic ASP Basics 2 April 11th, 2004 11:27 PM
Search engine that search through local drive! wenzation Classic ASP Basics 0 August 26th, 2003 10:15 PM

All times are GMT -4. The time now is 06:44 AM.

Powered by vBulletin®
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.