egrep syntax error


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting egrep syntax error
# 1  
Old 09-29-2011
egrep syntax error

I have a script that has been running fine for about a month - now all of a sudden I am getting a syntax error using the egrep command. The command I am using is comparing two files and printing only the unique lines from Second_File to Third_File. Any idea why I am getting the syntax error??


Code:
egrep -v -f Reference_File Second_File | sort -u > Third_File

Moderator's Comments:
Mod Comment Video tutorial on how to use code tags in The UNIX and Linux Forums.

Last edited by radoulov; 09-29-2011 at 04:13 PM..
# 2  
Old 09-29-2011
What is the error message?
# 3  
Old 09-29-2011
Code:
egrep: syntax error


Last edited by radoulov; 09-29-2011 at 05:37 PM.. Reason: Code tags!
# 4  
Old 09-29-2011
It must be the "Reference_File".

If it is not too long, display it here.
# 5  
Old 09-29-2011
That made me check the Reference_File - someone had added lines that contained a special character - I removed the lines and now the 'egrep' is working as designed. Thanks!
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

IF section problem. syntax error: unexpected end of file error

Hello, I have another problem with my script. Please accept my apologies, but I am really nooby in sh scripts. I am writing it for first time. My script: returned=`tail -50 SapLogs.log | grep -i "Error"` echo $returned if ; then echo "There is no errors in the logs" fi And after... (10 Replies)
Discussion started by: jedzio
10 Replies

2. Linux

Ambiguous redirect error and syntax error when using on multiple files

Hi, I need help on following linux bash script. When I linux commands for loop or while loop on individual file it runs great. but now I want the script to run on N number of files so it gives me ambiguous redirect error on line 12 and syntax error on line 22 : (pls help ); #!/bin/bash #... (16 Replies)
Discussion started by: Madhusudan Das
16 Replies

3. Shell Programming and Scripting

Receiving error: ./ang.ksh[35]: 0403-057 Syntax error at line 116 : `done' is not expected.

Hi All I am quite new to Unix. Following is a shell script that i have written and getting the subject mentioned error. #!/bin/ksh #------------------------------------------------------------------------- # File: ang_stdnld.ksh # # Desc: UNIX shell script to extract Store information.... (3 Replies)
Discussion started by: amitsinha
3 Replies

4. UNIX for Dummies Questions & Answers

search ")" with egrep - egrep: syntax error

Hi Guys, we have a shell script which basically query the Database which retrieves huge data and use the data with "egrep" . Now there is some data which contains characters like "abc)" and the same is used like below : "egrep (.+\|GDPRAB16\|GDPR/11702 96 abc)\|$ temp.txt" now while... (7 Replies)
Discussion started by: sagarjani
7 Replies

5. AIX

nim mksysb error :/usr/bin/savevg[33]: 1016,07: syntax error

-------------------------------------------------------------------------------- Hello, help me please. I am trying to create a mksysb bakup using nim. I am geting this error, how to correct it ? : Command : failed stdout: yes stderr: no... (9 Replies)
Discussion started by: astjen
9 Replies

6. UNIX for Dummies Questions & Answers

egrep: can't open file error

Hello folks, I have got the following line in my script: searchstring=".*_1234</MessageTag>" count=`find /home/mydir/* -name "$1" | xargs egrep -hc -e $searchstring "$1" | awk '{sum+=$1};END{print sum}'` where $1 is the name of some file that I am passing at run time. The problem is that... (6 Replies)
Discussion started by: Rajat
6 Replies

7. UNIX for Dummies Questions & Answers

awk Shell Script error : "Syntax Error : `Split' unexpected

hi there i write one awk script file in shell programing the code is related to dd/mm/yy to month, day year format but i get an error please can anybody help me out in this problem ?????? i give my code here including error awk ` # date-month -- convert mm/dd/yy to month day,... (2 Replies)
Discussion started by: Herry
2 Replies

8. UNIX for Dummies Questions & Answers

Egrep cheat sheet anywhere? Looking for meaning of egrep -c

Hi I've been searching google and have not found what egrep -c means. Does anyone know where I can get a cheat sheet or what that -c means? thanks, Linda (2 Replies)
Discussion started by: leelm
2 Replies

9. UNIX for Dummies Questions & Answers

help with egrep syntax

This may seem like a stupid question to anyone but a novice , but I need help with the following .... can anyone tell me how to change the following command to an "&" rather then an "or" egrep "GMED|S26" fileForfiltering > newfilteredFile i need it to contain both strings (on the same... (3 Replies)
Discussion started by: Gerry405
3 Replies
Login or Register to Ask a Question