Solved

grep for regular expression in Solaris

Posted on 2010-08-26
8
966 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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
Get 15 Days FREE Full-Featured Trial

Benefit from a mission critical IT monitoring with Monitis Premium or get it FREE for your entry level monitoring needs.
-Over 200,000 users
-More than 300,000 websites monitored
-Used in 197 countries
-Recommended by 98% of users

 

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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

In tuning file systems on the Solaris Operating System, changing some parameters of a file system usually destroys the data on it. For instance, changing the cache segment block size in the volume of a T3 requires that you delete the existing volu…
I have been running these systems for a few years now and I am just very happy with them.   I just wanted to share the manual that I have created for upgrades and other things.  Oooh yes! FreeBSD makes me happy (as a server), no maintenance and I al…
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.
In a previous video, we went over how to export a DynamoDB table into Amazon S3.  In this video, we show how to load the export from S3 into a DynamoDB table.

717 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