grep: RE error 41: No remembered search string.


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting grep: RE error 41: No remembered search string.
# 1  
Old 06-21-2006
Data 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? Smilie Smilie Smilie

Thanks guys
# 2  
Old 06-21-2006
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  
Old 06-22-2006
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
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

How to use a grep search to search for a specific string within multiple directories?

Lets say I have a massive directory which is filled with other directories all filled with different c++ scripts and I want a listing of all the scripts that contain the string: "this string". Is there a way to use a grep search for that? I tried: grep -lr "this string" * but I do not... (3 Replies)
Discussion started by: Circuits
3 Replies

2. Shell Programming and Scripting

Search string or words in logs without using Grep

I'm in need of some kind of script that will search for a string in each logfile in a directory but we don't want to use GREP. GREP seems to use up to much of our memory causing the server to use up a lot of swap space. Our log files are bigger than 500M on a daily basis. We lately started... (8 Replies)
Discussion started by: senormarquez
8 Replies

3. Shell Programming and Scripting

Grep string search

Hi All, I'm using aix flavour unix where im trying for the below kind of pattern to search in all the files in a directory. I tried with different possible combinations like grep -ir "out.*\transaction_ctry_code" * etc.... Pattern I'm trying for : out<any thing>country_cd Here i... (0 Replies)
Discussion started by: rmkganesh
0 Replies

4. Shell Programming and Scripting

Search text file, then grep next instance of string

I need to be able to search for a beginning line header, then use grep or something else to get the very next instance of a particular string, which will ALWAYS be in "Line5". What I have is some data that appears like this: Line1 Line2 Line3 Line4 Line5 Line6 Line7 Line1 Line2 ...... (4 Replies)
Discussion started by: Akilleez
4 Replies

5. UNIX for Dummies Questions & Answers

How to search for string A OR string B using Grep?

Hi, This is what I have done so far which is wrong for some reason: grep -h "stringA | stringB" filename Thank in advance! (5 Replies)
Discussion started by: jboy
5 Replies

6. AIX

grep not working when search string has a space in it

Hi, I am trying to grep a string which has two words separated by space. I used a script to grep the string by reading the string in to a variable command i used in the script is echo "enter your string" read str grep $str <file> it is working fine when the entered string is a single... (3 Replies)
Discussion started by: sekhar gajjala
3 Replies

7. Shell Programming and Scripting

How to search (grep?) filename for a string and if it contains this then...

Hi i want to write a script that will search a filename e.g. test06abc.txt for a string and if it contains this string then set a variable equal to something: something like: var1=0 search <filename> for 06 if it contains 06 then var1=1 else var1=0 end if but in unix script :) (4 Replies)
Discussion started by: tuathan
4 Replies

8. UNIX for Dummies Questions & Answers

grep exact string/ avoid substring search

Hi All, I have 2 programs running by the following names: a_testloop.sh testloop.sh I read these programs names from a file and store each of them into a variable called $program. On the completion of the above programs i should send an email. When i use grep with ps to see if any of... (3 Replies)
Discussion started by: albertashish
3 Replies

9. UNIX for Dummies Questions & Answers

grep for a search string

Hi, I want to grep one file for a search string and get the next 10 lines after the search string. for eg,in file tnsnames.ora,i have 100 entries.i want to search for one string and get the entry for that db. please help how to acheive this using awk or sed? Thanks. (11 Replies)
Discussion started by: raga
11 Replies

10. Shell Programming and Scripting

RE error 41: No remembered search string.

I found when i run this code #! /bin/ksh error_log="/tmp/log3.txt" while read line ; do show=`grep "$line" $error_log|tail -1` case $line in "Finished") msg="VOLUME_MGR_ERROR" echo $line ... (1 Reply)
Discussion started by: unitipon
1 Replies
Login or Register to Ask a Question