pls help, file name with brackets


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers pls help, file name with brackets
# 8  
Old 02-17-2012
Quote it too.

Code:
egrep -F "R1_980302_105147(2)" namelist.txt

This User Gave Thanks to Corona688 For This Post:
# 9  
Old 02-17-2012
Quote:
Originally Posted by Corona688
Quote it too.

Code:
egrep -F "R1_980302_105147(2)" namelist.txt

it returns:

egrep: conflicting matchers specified

then, i tried

Code:
egrep "R1_980303_232712(2).tif" namelist.txt

no error messages out, but it fails to show me the line containing R1_980303_232712(2).tif which i'm pretty sure there is a line

any ideas? thanks!
# 10  
Old 02-17-2012
The -F is necessary. () are special characters to the shell and to grep. You must prevent the shell from expanding them with "", and grep from interpreting them with -F.

My version of egrep inexplicably does not recognize -F. Maybe yours doesn't either. Try plain grep with -F. Otherwise your system might have several different versions of grep and need one particular one to support -F. Solaris in particular is full of wackiness like that.
This User Gave Thanks to Corona688 For This Post:
# 11  
Old 02-17-2012
Quote:
Originally Posted by Corona688
The -F is necessary. () are special characters to the shell and to grep. You must prevent the shell from expanding them with "", and grep from interpreting them with -F.

My version of egrep inexplicably does not recognize -F. Maybe yours doesn't either. Try plain grep with -F. Otherwise your system might have several different versions of grep and need one particular one to support -F. Solaris in particular is full of wackiness like that.
grep works!

thank you very much for so many replies!
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

Sort a text file based on names in square brackets

Hi all, I have a text file similar to this: Text More text Etc Stuff That Is Needed Etc Etc This contains over 70 entries and each entry has several lines of text below the name in square brackets. (5 Replies)
Discussion started by: Scally
5 Replies

2. Shell Programming and Scripting

Compare the value in between square brackets in file

I wanted to compare the value inside the Squre bracket after Colon ( : ) based on any value(seperated by or operator | ) inside the variable Thread and if match found then wnated to store in output file Input file : 20140320 00:08:43.918 INO 35] - Corporate hub is 20140320 00:08:43.918... (2 Replies)
Discussion started by: nes
2 Replies

3. UNIX for Dummies Questions & Answers

Pls. help with sudoers file...

Hi, I was asked to create sudoers file for operation team so they can sudo as another user and run few commands. I have updated /etc/sudoers file. User_Alias LEVEL1 = JamesF, dennisW, juanC, steveS, Cmnd_Alias SU_PROD=/bin/su prod, /bin/su - prod Cmnd_Alias SU_NYOP=/bin/su... (2 Replies)
Discussion started by: samnyc
2 Replies

4. Shell Programming and Scripting

parsing characters and number from a big file with brackets

I have a big file with many brackets () in it from which I need to parse number characters and numbers. Below is an example of my file 14 (((A__0:0.02,B__1:0.3)0:0.04,C__0:0.025)2:0.01),(D__0:0.00978,E__2:0.01031)1:0.00362; 15... (1 Reply)
Discussion started by: Lucky Ali
1 Replies

5. Shell Programming and Scripting

Delete text between square brackets and also delete those square brackets using sed or awk

Hi All, I have a text file which looks like this: computer programming systems engineering I want to get rid of these square brackets and also the text that is inside these brackets. So that my final text file looks like this: computer programming systems engineering I am using... (3 Replies)
Discussion started by: shoaibjameel123
3 Replies

6. Shell Programming and Scripting

use awk to edit a file..pls help

hey i want to over write the fourth field of a ':' delimited file by first finding the required row by using grep. i have done the following cat file | grep no. | awk -F ':' { $4=count; print $1:$2:$3:$4;} the correct values are being printed but nothin is bein added to the file..please... (5 Replies)
Discussion started by: dhe.arora
5 Replies

7. Shell Programming and Scripting

How to echo Brackets from a file

I'm a beginner of c shell scripting. How I can echo a whole line from a file with bracket in it? Ex. Inside the file.txt abcd efghi This is what inside the c shell set IN_FILE = file.txt set GREP_KEY = 'abcd' set IN_LINE = `grep ${GREP_KEY} ${IN_FILE}` echo $IN_LINE After... (7 Replies)
Discussion started by: zeahr
7 Replies

8. UNIX for Dummies Questions & Answers

pls. help with appening a file

Hi, I wrote a script, but it's not working. Please advise. I want to add the text at the end of the file. Should I use sed or awk. Not sure any thing is fine with me. #!/usr/bin/ksh DATE=`/usr/bin/date '+%m%d%y'` cp -p /etc/inittab /etc/inittab_$DATE... (5 Replies)
Discussion started by: samnyc
5 Replies

9. Shell Programming and Scripting

compare 2 file and print difference in the third file URG PLS

Hi I have two files in unix. I need to compare two files and print the differed lines in other file Eg file1 1111 2222 3333 file2 1111 2222 3333 4444 5555 newfile 4444 5555 Thanks In advance (3 Replies)
Discussion started by: evvander
3 Replies

10. Programming

File I/O ERRORS.. PLS HELP..

Hi people, I am having a little problem with my client side of the concurrent programming, i have a makefile, serverside and clientside directories. makefile works well with serverside files. and now when i added the clientside files to the makefile and compiled... it gives me the follwong error.... (0 Replies)
Discussion started by: SwetaShah
0 Replies
Login or Register to Ask a Question