Grep filtering issue


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers Grep filtering issue
# 1  
Old 05-28-2012
Question Grep filtering issue

Hi,

I am on

Code:
uname -a
HP-UX mymachine B.11.31 U ia64 3223107173 unlimited-user license

Code:
ps -exx| grep java | grep -i "GrafiteEventsInterfaces*"
19955 ?        55:22 /opt/app/app1/jdk150_07/bin/IA64N/java -server -Xms1024m -Xmx1024m -XX:PermSize=256m -XX:MaxPermSize=512m -XX:NewSize=512m -XX:MaxNewSize=512m -XX:SurvivorRatio=8 -Xnoclassgc -XX:+DisableExplicitGC -verbose:gc -XX:+UseParNewGC -XX:+CMSParallelRemarkEnabled -XX:+UseConcMarkSweepGC -XX:+PrintGCDetails -XX:+PrintGCTimeStamps -da -Dplatform.home=/opt/app/app1/bea/weblogic92 -Dwls.home=/opt/app/app1/bea/weblogic92/server -Dwli.home=/opt/app/app1/bea/weblogic92/integration -Dweblogic.management.discover=false -Dweblogic.management.server=t1grn1a1:7001 -Dwlw.iterativeDev=false -Dwlw.testConsole=false -Dwlw.logErrorsToConsole= -Dweblogic.ext.dirs=/appl/bea/patch_weblogic922/profiles/default/sysext_manifest_classpath -Dxng.log.server=GrafiteEventsInterfaces_hht011h2A_UAT -javaagent:/usr/local/opt/introscope/R8230/wily/Agent.jar -Dintroscope.agent.agentName=GrafiteEventsI

while the below does not yield any results

Code:
==> ps -exx| grep java | grep -i "*Interfaces*"

Why so ?
# 2  
Old 05-28-2012
This is the wrong syntax for grep. Try:
Code:
grep -i interfaces

Otherwise, what are you trying to achieve?
This User Gave Thanks to Scrutinizer For This Post:
# 3  
Old 05-28-2012
Quote:
Originally Posted by Scrutinizer
This is the wrong syntax for grep. Try:
Code:
grep -i interfaces

Otherwise, what are you trying to achieve?
I am just trying to grep with a generic term and not the whole server name as i remember not.

Anyways, your suggestion works.
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Issue with Grep

Hi guys, Hope someone can help me with this - I'm sure it's fairly simple but it's driving me mad! (forgive the coding - still new on scripting - come from Windows) I have the following coding for checking whether I want to include a line in a file:- EXTRACT_Date=$(date --date="${PERIOD}"... (6 Replies)
Discussion started by: NickF
6 Replies

2. Shell Programming and Scripting

Issue with grep

Hello, I have an input file that looks like so: LDLR LDLRAD4 VLDLR when I grep "LDLR" I get an output of: LDLR LDLRAD4 VLDLR Since all names have "LDLR" included within them, but all I want the output to be is LDLR I know it can work if I surround the words with pipes for... (5 Replies)
Discussion started by: Rabu
5 Replies

3. Shell Programming and Scripting

Issue with grep

Hi there, I need to grep out 1 line of a changing file. Any help would be much appreciated. code: xterm -hold -e tail -f /var/lib/dhcp3/dhcpd.leases | grep client-hostname &>/dev/null & The trouble is it shows the contents of the entire lease file. I just want to show the line... (5 Replies)
Discussion started by: digitalviking
5 Replies

4. Shell Programming and Scripting

filtering awk not using grep

hallow all i have question about awk i want indexing last key (in BOLD number) ex: input.txt 1 252468812 52468812 1281268819 1252468812 1252468923 468812 1252468812 so output will like this output text 1:252468812 2:52468812 4:1252468812 6:468812 7:1252468812 output get... (8 Replies)
Discussion started by: zvtral
8 Replies

5. Shell Programming and Scripting

grep issue

The below command is not working stackmem="$(pmap $1 | grep -i '' | awk '{print $2}'| tr -d ' K')" I need to grep strictly for ----> Regards, Mohtashim (2 Replies)
Discussion started by: mohtashims
2 Replies

6. Shell Programming and Scripting

Help with filtering trace file through grep

Hi, I am using NS2 and i need to filter a trace file (part of which is shown below): - 33.91576 2 3 tcp 1040 ------- 1 0.0 4.0 1115 2258 r 33.918907 4 3 ack 40 ------- 1 4.0 0.0 1107 2272 + 33.918907 3 2 ack 40 ------- 1 4.0 0.0 1107 2272 - 33.918907 3 2 ... (5 Replies)
Discussion started by: saqibshah
5 Replies

7. Shell Programming and Scripting

grep filtering problem

I'm working on writing a shell script that logs out whenever I have a firefox process running during certain times of the day (1 am - 8 am). I'll put it in crontab when it runs properly unless someone knows of a different and better way to do this. Here it is so far. if ps ax | grep... (4 Replies)
Discussion started by: cokedude
4 Replies

8. Shell Programming and Scripting

Issue Filtering Tail

Hi Folks, I have a log that contains data as shown below: 11:59:43,144 (1,850) Signal : .... 11:59:44,109 (1850) Bps : ..... I wish to remove "" from all lines and it is on the start of every line. I have achieved that successfully using the command: tail -f imp.log | sed 's/\... (4 Replies)
Discussion started by: umairrahman
4 Replies

9. Shell Programming and Scripting

Report filtering - Weird issue and interesting - UrgentPlease

Hi, Could any one help me to extract data from a report. I would like to get the two lines which are just below the separations I have a report like this -------------------------------------------------------------------------- Pid Command Inuse Pin Pgsp Virtual... (2 Replies)
Discussion started by: ajilesh
2 Replies

10. Shell Programming and Scripting

Sed filtering issue

The problem I have is that I have 23,000 records I need to sort through to pull out LEN: XXXX XX XX XX XX and NCOS: XXX entries from so I can insert them into a database. But some of my records include TYPE: ISDN, THE DN IS UNASSIGNED, or INVALID entries in between some records and I would like... (2 Replies)
Discussion started by: roachmmflhyr
2 Replies
Login or Register to Ask a Question