LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 10-01-2007, 01:08 AM   #1
anhtt
LQ Newbie
 
Registered: Jul 2007
Posts: 27

Rep: Reputation: 15
help use "cgrep" command


I have a command.

cgrep -F -w '10/01/07 12:08:11' -G +w 'OP:ALARM ALL COMPLETE' -E 'AC FAILURE|LOW VOLTAGE'

I want to get all the line have string "AC FAILURE" or "LOW VOLTAGE" which reside between '10/01/07 12:08:11' and 'OP:ALARM ALL COMPLETE'.

But it doesn't work.
 
Old 10-01-2007, 02:03 AM   #2
ghostdog74
Senior Member
 
Registered: Aug 2006
Posts: 2,697
Blog Entries: 5

Rep: Reputation: 244Reputation: 244Reputation: 244
show a sample of your input file
 
Old 10-01-2007, 09:13 AM   #3
anhtt
LQ Newbie
 
Registered: Jul 2007
Posts: 27

Original Poster
Rep: Reputation: 15
My input file is a log file so it run in real time.
Before running the cgrep command, I run the "date" command to get the time for the starting position to use cgrep.
 
Old 10-01-2007, 09:41 AM   #4
angel115
Member
 
Registered: Jul 2005
Location: France / Ireland
Distribution: Debian mainly, and Ubuntu
Posts: 542

Rep: Reputation: 79
Can you please show a sample of the input string and give us the output you want? It will make things easer if we can see.

Ex:
Input:
Code:
12/10/2009 blablabla error: 1960 this is my error
output that I want to have:
Code:
12/10/2009 this is my error error: 1960

Regards,
Angel.

Last edited by angel115; 10-01-2007 at 09:44 AM.
 
  


Reply



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



Similar Threads
Thread Thread Starter Forum Replies Last Post
script uses "cgrep" command anhtt Programming 3 09-29-2007 12:07 PM
Make "ls" command show colors without "--color=always" switch SharpyWarpy Linux - General 4 07-16-2007 11:00 PM
C Drive "/dev/hda1" accidently used in dd command at "of=" switch M D Linux - Software 4 04-26-2007 08:56 AM
Tiny Sofa 2.0 - I thought "halt", "reboot" were only root command ?? sorcerer Linux - Distributions 1 08-21-2004 03:28 PM
"segmentation error" when issuing "useradd" command through terminal with RH 9.0 kaihuang Linux - General 0 10-21-2003 11:47 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 06:35 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration