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
a better way to grep until end of error message, although most seem to be 1 or 2 line VGR Shell Programming and Scripting 11 05-09-2009 03:41 PM
Is there a better way to grep until end of error message? VGR UNIX for Advanced & Expert Users 1 05-07-2009 10:52 AM
error in grep ragha81 Shell Programming and Scripting 6 12-27-2006 03:15 PM
grep error Dave724001 UNIX for Dummies Questions & Answers 2 11-07-2006 06:48 AM
grep error message gammaman UNIX for Dummies Questions & Answers 3 07-11-2005 12:58 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 05-09-2009
tushar_tus tushar_tus is offline
Registered User
  
 

Join Date: Aug 2008
Posts: 29
error in grep

hi!!


I am getting an error while grepping.

The error is like "grep: RE error 41: No remembered search string."

Can u please help with it?


Thanks in advance.........
  #2 (permalink)  
Old 05-09-2009
devtakh devtakh is offline
Registered User
  
 

Join Date: Oct 2007
Location: Bangalore
Posts: 514
Quote:
Originally Posted by tushar_tus View Post
hi!!


I am getting an error while grepping.

The error is like "grep: RE error 41: No remembered search string."

Can u please help with it?


Thanks in advance.........

What exactly rare you trying to grep. Can you paste it here?


cheers,
Devaraj Takhellambam
  #3 (permalink)  
Old 05-09-2009
tushar_tus tushar_tus is offline
Registered User
  
 

Join Date: Aug 2008
Posts: 29
An e.g

# # #20090508234729# # # # # # # # # #7#919855198983# #71# #1758#1613# # # #serv:pps7a;vers:1;pid:0;af:3;vid:1117980591288184;Dvl:0;serType:0;recType:1000;a
mt:0;costType:1#



I am trying to grep "1117980591288184" in the above string.

I have more then thousand different numbers to grep in a very large file.
I want to know when does this error occurs in particular, because the data i am getting after grep is correct but still the grep code is throwing an error......y is it so?

for reference below is the code:-

while IFS= read -r line
do
grep -h "$line" /user2/200905/20090508*.znf >>/home/yesterday.txt;
done < /home/hrn_20090508.txt
  #4 (permalink)  
Old 05-09-2009
devtakh devtakh is offline
Registered User
  
 

Join Date: Oct 2007
Location: Bangalore
Posts: 514
Probably, it is caused when trying to evaluate the grep string read from the file as a regular expression. Does the file have empty lines...

I suggest you use

Code:
egrep -h "$line" /user2/200905/20090508*.znf >>/home/yesterday.txt 2>/dev/null


cheers,
Devaraj Takhellambam
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 03:41 AM.


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