The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com



Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
small script help ali560045 Shell Programming and Scripting 9 01-18-2008 10:18 AM
Very small Shell Script Help... marconi Shell Programming and Scripting 2 12-11-2007 05:44 AM
small script everurs789 Shell Programming and Scripting 3 11-06-2007 05:08 PM
small script help rkl1 Shell Programming and Scripting 1 12-06-2005 11:26 PM
Need help in a small script super_duper_guy Shell Programming and Scripting 2 10-24-2005 11:06 AM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 06-03-2008
appu1987 appu1987 is offline
Registered User
  
 

Join Date: Jun 2008
Posts: 6
Help in grep and awk

I need to write a small shell script which does the following :

I have a file : root/var/log/ocmp/ocmpclient.log

This is a log file which is continuosly getting updated . I have to keep looking into this file all the time. I have to look for four keywords, "File Detected", File Sending", "File Recieved", "Disconnecting"

Now whenever i find one of these keywords i have to print them on the screen, this process continues till the computer shuts down.

Pls help me, I am supposed to use grep and awk

Help me its urgent.

Last edited by appu1987; 06-03-2008 at 10:12 PM.. Reason: Title modification for quick response
  #2 (permalink)  
Old 06-03-2008
jim mcnamara jim mcnamara is offline Forum Staff  
...@...
  
 

Join Date: Feb 2004
Location: NM
Posts: 5,770
Do not double post.

start with this at boot up:
Code:
tail -f < root/var/log/ocmp/ocmpclient.log | grep -f /path/to/t.sed
t.sed:
Code:
File Detected
File Sending
File Recieved
Disconnecting
  #3 (permalink)  
Old 06-03-2008
appu1987 appu1987 is offline
Registered User
  
 

Join Date: Jun 2008
Posts: 6
path

what path is mentioned after grep should i copy the line as it is and where should t.sed be saved.
Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 09:32 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0