Solved

grep for regular expression in Solaris

Posted on 2010-08-26
8
952 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
 

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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Let's say you need to move the data of a file system from one partition to another. This generally involves dismounting the file system, backing it up to tapes, and restoring it to a new partition. You may also copy the file system from one place to…
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…
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.

863 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

Need Help in Real-Time?

Connect with top rated Experts

26 Experts available now in Live!

Get 1:1 Help Now