From: Jun Zhu (zhu_junca@yahoo.ca)
Date: Fri Aug 05 2005 - 21:38:35 EDT
Hello,
JULIAN, JOHN C (AIT) hit the nail on the head. That is
exact what I am looking for. Thank you very much!
$cat 1.txt | sed 's/.*\(hares.*\) from.*/\1/'
Cheers,
zhu
Hello all,
I am looking for a better way to do the work.
There is text file includes the following lines:
=====
2005/08/05 19:30:56 VCS INFO V-16-1-50135 User admin
fired command: hares -add u01_oradata_filesystem Mou
nt WSStag_SG from 1.1.1.1
2005/08/05 19:30:56 VCS NOTICE V-16-1-10016 Agent
/opt/VRTSvcs/bin/Mount/MountAgent for resource type
Mount succe
ssfully started at Fri Aug 5 19:30:56 2005
2005/08/05 19:30:57 VCS INFO V-16-1-50135 User admin
fired command: hares -modify u01_oradata_filesystem
Critical 0 from 1.1.1.1
2005/08/05 19:30:57 VCS INFO V-16-1-50135 User admin
fired command: hares -modify u01_oradata_filesystem
SnapUmount 0 from 1.1.1.1
2005/08/05 19:30:57 VCS INFO V-16-1-50135 User admin
fired command: hares -modify u01_oradata_filesystem
CkptUmount 1 from 1.1.1.1
2005/08/05 19:30:57 VCS INFO V-16-1-50135 User admin
fired command: hares -modify u01_oradata_filesystem
SecondLevelMonitor 0 from 1.1.1.1
=====
I need the fields "hares -modify
u01_oradata_filesystem
CkptUmount 1", which starts from "hares", ends before
"from".
I am using the following:
cat 1.txt | grep hares| cut -d: -f4 | cut -d\ -f1-5
1. Is there better way to do this? I am sure there
is.:-)
2. May I use word as delimiter,such as "from"? So I
can use:
%cut -d"from" -f1 ??
thanks & have a good weekend,
zhu
I will summarize!
__________________________________________________________
Find your next car at http://autos.yahoo.ca
_______________________________________________
sunmanagers mailing list
sunmanagers@sunmanagers.org
http://www.sunmanagers.org/mailman/listinfo/sunmanagers
This archive was generated by hypermail 2.1.7 : Wed Apr 09 2008 - 23:31:15 EDT