Grep -p in Linux redhat.


 
Thread Tools Search this Thread
Top Forums UNIX for Advanced & Expert Users Grep -p in Linux redhat.
# 1  
Old 02-21-2014
Grep -p in Linux redhat.

Hello colleagues,
In AIX there is the option -p in grep command , what is the equivalent in linux RedHat?

regards
# 2  
Old 02-21-2014
What does -p do in AIX? I stared at the manpage a while but couldn't make sense of it, and I don't have an AIX machine to test with.

It has something to do with paragraphs, that much I can tell. awk can be used in such a manner -- considering some pattern other than \n to be a record separator.
# 3  
Old 02-21-2014
Don't think linux version of grep has exact match for that option, but check out this info:
regex - How to find patterns across multiple lines using grep? - Stack Overflow
HowTo: grep Text Between Two Words in Unix / Linux
# 4  
Old 02-21-2014
This Funcionality is in AIX:
grep Command

p[Separator] Displays the entire paragraph containing matched lines. Paragraphs are delimited by paragraph separators, as specified by the Separator parameter, which are patterns in the same form as the search pattern. Lines containing the paragraph separators are used only as separators; they are never included in the output. The default paragraph separator is a blank line.

http://publib.boulder.ibm.com/infocenter/pseries/v5r3/index.jsp?topic=/com.ibm.aix.cmds/doc/aixcmds2/grep.htm

I need how to do the same in linux redaht.

Regards.
# 5  
Old 02-21-2014
Try:

Code:
awk -v RS="" '/regex/' inputfile

Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Red Hat

Difference Redhat Linux/RH Enterprise Linux

what is the difference between Redhat Linux and Redhat Enterprise Linux. whereas Redhat linux have Server installation options too. (2 Replies)
Discussion started by: hananabbas
2 Replies

2. Red Hat

Redhat Linux 4 crashed

Hi, I am having redhat enterprise linux 4 machine with kernel version 2.6.9-39.EL.Whenever I ran some java applications related to mechanical the system got crashed and powered off. last output is as shown below. reboot system boot 2.6.9-39.EL Fri Sep 24 15:23 (01:43)... (0 Replies)
Discussion started by: ktrimu
0 Replies

3. UNIX and Linux Applications

Redhat Linux 5

Can anyone help me outwith the post installation script.I'm newbie to scripting! i need to customize the post installation script using kickstart..here are the requirements to be set set permissions /etc/crontab =400 /etc/securetty=400 /etc/sysctl.conf=600 and following services to be set OFF... (1 Reply)
Discussion started by: bvkumar
1 Replies

4. Linux

Telnet in redhat linux

Hi, I just want to access linux machine from windows telnet client.What is the procedure?How do i start telnet server in Linux,where to check if it is installed. Please help (3 Replies)
Discussion started by: gkrishn
3 Replies

5. UNIX for Dummies Questions & Answers

Redhat Linux?

I seen a pool that said Linux was the most popular Unix download. I then seen Redhat Linux is the most popular Linux download. Is there a difference? Is it the better program/s? (6 Replies)
Discussion started by: Mr_Pinky
6 Replies

6. Slackware

Redhat Linux?

Hi, I use linux and it is a great OS, I use Redhat Linux 9 and I was wondering are they going to update 9 or they'll be leaving that to the fedora project? I would like a stable linux distro. Thanks -n (9 Replies)
Discussion started by: Insomniac
9 Replies

7. UNIX for Dummies Questions & Answers

Linux RedHat. Help please.

I from russia. install rus Linux RedHat. When i load linux it ask me for user name and pass... and up of ask form label: Welcome to localhost... dont remember... what i want write in it? (sorry, bad english..:( ).. (1 Reply)
Discussion started by: Sen
1 Replies

8. UNIX for Dummies Questions & Answers

booting up in Redhat Linux 7.1

When I created the redhat installation, I configured it to boot directly into GNOME, but now I want it to boot into the shell login screen. How can I change that? Thanks. (1 Reply)
Discussion started by: dangral
1 Replies

9. UNIX Desktop Questions & Answers

RedHat Linux Cd

I am wondering if anyone has copies (or can burn me a copy) of RedHat Linux. I will pay shipping charges... I don't have a CD burner and i dont want to run it off of my hard drive... please email me at: empireinfo623@yahoo.com or baldwitm@muc.edu (5 Replies)
Discussion started by: thedude623
5 Replies

10. UNIX for Dummies Questions & Answers

redhat linux 7.3

hi, just installed redhat linux 7.3 on my server, and put it in gnome gui. Does anyone know what software i need to run a web server??? and what software i need to set up a proxy to secure it? also, if these are free to download, can you give me the links. Thanx (2 Replies)
Discussion started by: matt2kjones
2 Replies
Login or Register to Ask a Question