I have ran into a small issue and I am not sure how to fix it.
In one of our current scripts we have this line which does a grep to get the pid of the process.
However this is not returning anything due to the how long the value of $x is. Which a sample value is...
However as you can see a simple grep cuts this off...
I need to find a way to do a grep command like below only have it know off the _stdby contained within $x.
So that even though $x contains the value ot1p_stdby it should cutt off the _stdby and only by ot1p when it does the following command.,,,
I was not sure if there is a way to do this right in the command above.
Gave it a try but got this...
Here is how I am testing...
Changed the " to ' and that fixed the error...
But still no results. Seems like that would have worked. I see where you was going with it. It should have take the $x which has a value of entp_stdby and only did a grep for entp_std but it returned no results.
As you can see it should have returned results as this is running out there.
Hi, I'm not very familiar witrh sed or awk and hope the somebody can help me to solve my problem. I need to filter a text report using grep, sed or awk. I would like to cut out text lines with the pattern INFO and if exists the following lines of the pattern DETAILS. I need te keep the lines with... (4 Replies)
Hi,
How can I run the grep search in a script to only include compute, not bigcomputer in following search input?
" properties = local compute"
" properties = local bigcompute"
Thank you.
-j (6 Replies)
Hi,
I can write sh script for Linux platform
I run:
netstat -an | grep -P '\:'38''| grep ESTABLISHED
but result:
# netstat -an | grep -P '\:'38''| grep ESTABLISHED
tcp 0 0 172.16.1.107:383 172.16.1.81:49981 ESTABLISHED
tcp 0 0... (8 Replies)
I am running a grep query for searching a pattern, and the output is quite huge. I want only the last 200 lines to be displayed, and I am not sure if tail will do the trick (can tail read from std in/out instead of files?).
Please help me out. (1 Reply)
Hi
I need to to direct only the path and the name of the trace file to a new file. How do I use grep/awk/sed filter?
eg.
ABC.root>cat alert_omc_dg.log | grep trc
ORA-00060: Deadlock detected. More info in file /u01/oradata/omc/udump/omc_dg_ora_3555.trc.
ORA-00060: Deadlock detected. More... (8 Replies)
I am attempting to figure out how to only capture part of a grep command I am doing. So far no luck.
When I execute....
leviathan:/gfs/home/tivoli>ps -ef | /usr/ucb/ps -auxww | grep nco_p_syslog
The results are....
tivoli 10185 0.0 0.0 5888 5168 ? S Oct 23 0:26... (2 Replies)
Hi Folk,
Following is the command I used to get data related to the DataFlowEngine.
I wanted to know the % usage of cpu and memory.
ps avg | grep Data
This command will show the processes with its PID as :
PID TTY STAT TIME PGIN SIZE RSS LIM TSIZ TRS %CPU %MEM COMMAND
... (1 Reply)
Hi,
Wondering if anyone could help me with a simple script to filter out multiple things from a file.
Right now I just have long lines of grep -v remove file | greg -v etc etc
What I would like to do is have grep -v <run everything in a file> tofilter
If that makes sense. Basically a... (2 Replies)
ls -ltr | grep string
How can I use regular expressions to filter the results provided even more. I am using the above command as a reference. (1 Reply)