Solved

grep for regular expression in Solaris

Posted on 2010-08-26
8
949 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
Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

 
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

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

Suggested Solutions

Attention: This article will no longer be maintained. If you have any questions, please feel free to mail me. jgh@FreeBSD.org Please see http://www.freebsd.org/doc/en_US.ISO8859-1/articles/freebsd-update-server/ for the updated article. It is avail…
When you do backups in the Solaris Operating System, the file system must be inactive. Otherwise, the output may be inconsistent. A file system is inactive when it's unmounted or it's write-locked by the operating system. Although the fssnap utility…
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.

744 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

11 Experts available now in Live!

Get 1:1 Help Now