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
search excat string in another string (grep "fails") bora99 UNIX for Dummies Questions & Answers 0 06-05-2008 07:41 AM
problem with grep on search string in a txt file over multiple files m00 UNIX for Dummies Questions & Answers 2 05-18-2008 03:21 PM
grep for a search string raga UNIX for Dummies Questions & Answers 11 03-12-2008 08:38 AM
Perl: Search for string on line then search and replace text Crypto Shell Programming and Scripting 4 01-04-2008 10:24 AM
RE error 41: No remembered search string. unitipon Shell Programming and Scripting 1 06-19-2007 01:46 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-21-2006
fkaba81 fkaba81 is offline
Registered User
  
 

Join Date: Jun 2006
Posts: 9
Unhappy grep: RE error 41: No remembered search string.

Hi guys,

I am currently facing a problem with my current script, the script basically monitor a list of process on the Unix system. If a process is down it will send a notification e-mail to me.

Currently I am facing an error when running the script grep: RE error 41: No remembered search string, I never seen message before. I've checked Google and it state that you need to remove all grep -q, but I do not have grep -q in my script I only have grep.

Can anyone help me please about this message?

Thanks guys
  #2 (permalink)  
Old 06-21-2006
Corona688 Corona688 is offline
Registered User
  
 

Join Date: Aug 2005
Location: Saskatchewan
Posts: 1,960
Since you've posted no code there's no way to tell but psychic powers, but I'm guessing that it's complaining about not having a search string. It would be really nice to see the code.
  #3 (permalink)  
Old 06-22-2006
fkaba81 fkaba81 is offline
Registered User
  
 

Join Date: Jun 2006
Posts: 9
Quote:
Originally Posted by Corona688
Since you've posted no code there's no way to tell but psychic powers, but I'm guessing that it's complaining about not having a search string. It would be really nice to see the code.
Basically there are two funtion that I am using, this function will check for the current process.


checkProcess ()
{
PROCESS=$1
PROC_NOT_RUN=`$PS -ef | $GREP -i "$PROCESS" | $GREP -v "grep" | $WC -l` #determine how many times are the process is running
echo "Process Not Run $PROC_NOT_RUN"
return $PROC_NOT_RUN
}

This is my main funtion, I still not able to find out what was wrong, I have a feeling that when using grep and awk in one line it might cause the problem


$CAT $CONF_DEAMON | $AWK '{print $1}' | $GREP -v "^\#" | \
while read SERVICES
do
SERVICES_PATH=`$CAT $CONF_DEAMON | $GREP -v "^#[[:space:]]" | $GREP "^$SERVICES" | $AWK '{print $2}'`

# 1. Check for the process
checkProcess $SERVICES

if [ $? -eq $SUCCESS ]
then
echo $?
#addErrMSG "$SERVICES is currently not running please review the process under the path of $SERVICES_PATH"
#Send_Email

fi
done


Thanks for your help
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 12:31 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