- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - Linux
- >
- Re: awk help ?
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Forums
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-17-2005 06:24 AM
тАО11-17-2005 06:24 AM
---------------------------------------------------
Local Remote
-------------------------- -----------------------
Symmetrix ID RA STD R1/B Symmetrix ID R2 BCV
------------ -- ---- ---- ------------ ---- ----
000185700973 1 1E8 52B 000185702367 9A2 436
1F0 533 9AA 50D
1F8 53B 9B2 515
2FF 57B 0DD 532
303 57F 0E1 536
---------------------------------------------------
from the following command output:
# symreplicate -g fsproddg show
Group name: fsproddg
Host name: ohibks05
Device lists:
{
---------------------------------------------------
Local Remote
-------------------------- -----------------------
Symmetrix ID RA STD R1/B Symmetrix ID R2 BCV
------------ -- ---- ---- ------------ ---- ----
000185700973 1 1E8 52B 000185702367 9A2 436
1F0 533 9AA 50D
1F8 53B 9B2 515
2FF 57B 0DD 532
303 57F 0E1 536
---------------------------------------------------
}
Command line arguments:
{
Group type : Device Group
Scripts:
{
preaction : Not specified
postaction : Not specified
postcycle : /usr/emc/scripts/postcycle.sh
steperror : /usr/emc/scripts/error.sh
}
-consistent : True
-rdb : Not specified
-vxfs : Not specified
-ppath : Not specified
}
Options file settings:
{
Replicate hop type : Single hop
Maximum cycles : 1
Cycle overflow method : Next
Cycle delay (hh:mm) : 00:30
Use final BCV : True
Log Step : False
Protection : 0 - CLI_C_REPLICATE_PROTECT_DEFAULT
Timers:
{
---------------------------------------------------------
Type Time Limit Sleep Time Max Sleep Calc. Max
(hh:mm:ss) (hh:mm:ss) Time Factor Sleep Time
---- ---------- ---------- ----------- ----------
GEN 00:30:00 00:00:10 1 00:00:10
RDF 04:00:00 00:00:15 4 00:01:00
BCV 02:00:00 00:00:10 3 00:00:30
---------------------------------------------------------
}
}
I tried the following:
# symreplicate -g fsproddg show | awk '/\{/, /\}/ {print $0}'
But I got too much output. You'll note that there are several sequences delimited with { }. I only want the first...
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-17-2005 06:50 AM
- Tags:
- sed
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-17-2005 06:53 AM
тАО11-17-2005 06:53 AM
Re: awk help ?
# awk '{if ($0~/\{/) {print;while ($0!~/\}/) {getline;print};exit}}' filename
Regards!
...JRF...
- Tags:
- awk
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-17-2005 06:55 AM
тАО11-17-2005 06:55 AM
Re: awk help ?
#!/usr/bin/perl
open (CMD,"symreplicate -g fsproddg show"|) or die;
while (
last if (/}/);
print if $found_first_stanza;
if (/{/) {
$found_first_stanza=1;
}
}
close (CMD);
exit;
- Tags:
- Perl
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-17-2005 06:56 AM
тАО11-17-2005 06:56 AM
Re: awk help ?
Try something like this :
awk 'BEGIN {f=0}
/\{/ {f=1; next}
/\}/ {exit}
{if(f==1)print}'
HTH
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-17-2005 06:57 AM
тАО11-17-2005 06:57 AM
Re: awk help ?
sed -e '1,/^{/d' -e '/^}/,$d'
This deletes from the first line to the first {, then deletes from a } to the end.
HTH
-- Rod Hills
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-17-2005 11:59 AM
тАО11-17-2005 11:59 AM
Re: awk help ?
# symreplicate -g fsproddg show | awk 'BEGIN{f=0};/\{/{f=f+1};{if (f==1) {print $0}}; /\}/{f=f+1}'
take your pick... they are structurally the same...
Tim
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-18-2005 03:00 AM
тАО11-18-2005 03:00 AM
Re: awk help ?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-21-2005 02:15 AM
тАО11-21-2005 02:15 AM
Re: awk help ?
Device lists:
As your start string and
}
as your stop string on your awk search. Then, if you really must have only the stuff between the brackets grep out the Device lists: line and there you are.
Howard