Search Results

Search: Posts Made By: geetap
7,922
Posted By geetap
How do we use multiple commands with AWK
Hi,
I have a scenario where in, I have a file named abc.txt.
I extract the file names from it using.


awk '/dbf$/{print $NF}' abc.txt
/u01/oradata/omc/systab/omcdef.dbf...
2,953
Posted By geetap
Thank you Franklin, it worked ok for two lines...
Thank you Franklin, it worked ok for two lines below the search string...
For my information ... if I need two lines above the search string ...what would be the code?
2,953
Posted By geetap
Thanks Anchal, OS is SunOS. ---------- Post...
Thanks Anchal, OS is SunOS.

---------- Post updated at 02:48 PM ---------- Previous update was at 02:45 PM ----------

Anchal,

the grep -A2 does not work on Sun OS.


about awk option, it...
2,953
Posted By geetap
Extract two lines before and after the 'search text'
Hi Guys,
I have a situation wherein I need to extract two lines from below the search string.

Eg.

Current:


$ grep "$(date +'%a %b %e')" alert.log
Mon Apr 12 03:58:10 2010
Mon Apr 12...
5,916
Posted By geetap
Bingo !!! it works.. Thank you very much... I'll...
Bingo !!! it works.. Thank you very much... I'll explore how the filter works.. new to Unix filters but am loving it... :-)
5,916
Posted By geetap
Thank you Zaxxon, I tried sed...
Thank you Zaxxon,
I tried
sed 's/.*file.\(.*\.trc\)/\1/' alert_omc_dg.log > newfile.txt

But the newfile.txt has all the details of alert_omc_dg.log.

Thanks Pludi,
It worked but it has . and...
5,916
Posted By geetap
Need to build a grep/sed/awk filter
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....
Showing results 1 to 7 of 7

 
All times are GMT -4. The time now is 06:59 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy