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 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 03: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 11:21 AM
grep for a search string raga UNIX for Dummies Questions & Answers 11 03-12-2008 04:38 AM
Perl: Search for string on line then search and replace text Crypto Shell Programming and Scripting 4 01-04-2008 06:24 AM
RE error 41: No remembered search string. unitipon Shell Programming and Scripting 1 06-18-2007 09:46 PM

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 06-21-2006
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
Reply With Quote
Forum Sponsor
  #2 (permalink)  
Old 06-21-2006
Registered User
 

Join Date: Aug 2005
Location: Saskatchewan
Posts: 923
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.
Reply With Quote
  #3 (permalink)  
Old 06-21-2006
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
Reply With Quote
Google UNIX.COM
Reply

Thread Tools
Display Modes




All times are GMT -7. The time now is 04:04 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008 The CEP Blog All Rights Reserved -Ad Management by RedTyger Visit The Global Fact Book

Content Relevant URLs by vBSEO 3.2.0