Solved

grep for regular expression in Solaris

Posted on 2010-08-26
8
955 Views
Last Modified: 2013-12-28
Hello,

I want to regursively grep for a regular expression in SunOS 5.8 but couldn't do that. There is no equivalent option as --perl-regexp in Solaris 5.8

can anyone help me on that

Thanks,
0
Comment
Question by:nlrreddy
8 Comments
 
LVL 6

Expert Comment

by:DalHorinek
ID: 33537835
What about using this?

http://www.pcre.org/
0
 
LVL 84

Expert Comment

by:ozo
ID: 33537837
does egrep work?  what is the expression?
can you use a perl command instead?
0
 
LVL 40

Expert Comment

by:omarfarid
ID: 33537968
can you elaborate on what you want to do? can you give example?
0
Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

 

Author Comment

by:nlrreddy
ID: 33539258
below is the regular expression that I want to grep in all files recursively

abc[a-zA-Z0-9]{10}_[a-zA-Z0-9]{4}

with the above regular expression, can I find files with the above tag?
0
 
LVL 84

Accepted Solution

by:
ozo earned 167 total points
ID: 33539313
egrep -R 'abc[a-zA-Z0-9]{10}_[a-zA-Z0-9]{4}' .
0
 
LVL 5

Assisted Solution

by:shajithchandran
shajithchandran earned 167 total points
ID: 33544856
you can use simple grep with -R option too
0
 
LVL 2

Assisted Solution

by:Mohan Shivaiah
Mohan Shivaiah earned 166 total points
ID: 33547433
sed -n '/abc\[a-zA-Z0-9\]{10}_\[a-zA-Z0-9\]{4}/,$ p' file_name > output_file.out
0
 

Author Closing Comment

by:nlrreddy
ID: 33563697
Although the solution is not complete it helped me get ideas on this
0

Featured Post

Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This tech tip describes how to install the Solaris Operating System from a tape backup that was created using the Solaris flash archive utility. I have used this procedure on the Solaris 8 and 9 OS, and it shoudl also work well on the Solaris 10 rel…
I promised to write further about my project, and here I am.  First, I needed to setup the Primary Server.  You can read how in this article: Setup FreeBSD Server with full HDD encryption (http://www.experts-exchange.com/OS/Unix/BSD/FreeBSD/A_3660-S…
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:

774 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question