<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: awk help ? in Operating System - Linux</title>
    <link>https://community.hpe.com/t5/operating-system-linux/awk-help/m-p/4941489#M102804</link>
    <description>Those are all great pieces of advice that will work well but I personally think the simplest way to do it would be to add one line to your desired output and use &lt;BR /&gt;&lt;BR /&gt;Device lists:&lt;BR /&gt;&lt;BR /&gt;As your start string and&lt;BR /&gt;&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;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.&lt;BR /&gt;&lt;BR /&gt;Howard</description>
    <pubDate>Mon, 21 Nov 2005 10:15:49 GMT</pubDate>
    <dc:creator>Howard Marshall</dc:creator>
    <dc:date>2005-11-21T10:15:49Z</dc:date>
    <item>
      <title>awk help ?</title>
      <link>https://community.hpe.com/t5/operating-system-linux/awk-help/m-p/4941481#M102796</link>
      <description>I want to extract the following sequence:&lt;BR /&gt;&lt;BR /&gt; ---------------------------------------------------&lt;BR /&gt;                Local                      Remote&lt;BR /&gt;      --------------------------  -----------------------&lt;BR /&gt;      Symmetrix ID RA  STD  R1/B  Symmetrix ID   R2  BCV&lt;BR /&gt;      ------------ --  ---- ----  ------------  ---- ----&lt;BR /&gt;      000185700973  1   1E8  52B  000185702367   9A2  436&lt;BR /&gt;                        1F0  533                 9AA  50D&lt;BR /&gt;                        1F8  53B                 9B2  515&lt;BR /&gt;                        2FF  57B                 0DD  532&lt;BR /&gt;                        303  57F                 0E1  536&lt;BR /&gt;      ---------------------------------------------------&lt;BR /&gt;&lt;BR /&gt;from the following command output:&lt;BR /&gt;&lt;BR /&gt;# symreplicate -g fsproddg show&lt;BR /&gt;&lt;BR /&gt;   Group name: fsproddg&lt;BR /&gt;   Host  name: ohibks05&lt;BR /&gt;&lt;BR /&gt;   Device lists:&lt;BR /&gt;      {&lt;BR /&gt;      ---------------------------------------------------&lt;BR /&gt;                Local                      Remote&lt;BR /&gt;      --------------------------  -----------------------&lt;BR /&gt;      Symmetrix ID RA  STD  R1/B  Symmetrix ID   R2  BCV&lt;BR /&gt;      ------------ --  ---- ----  ------------  ---- ----&lt;BR /&gt;      000185700973  1   1E8  52B  000185702367   9A2  436&lt;BR /&gt;                        1F0  533                 9AA  50D&lt;BR /&gt;                        1F8  53B                 9B2  515&lt;BR /&gt;                        2FF  57B                 0DD  532&lt;BR /&gt;                        303  57F                 0E1  536&lt;BR /&gt;      ---------------------------------------------------&lt;BR /&gt;      }&lt;BR /&gt;&lt;BR /&gt;   Command line arguments:&lt;BR /&gt;      {&lt;BR /&gt;      Group type                : Device Group&lt;BR /&gt;&lt;BR /&gt;      Scripts:&lt;BR /&gt;         {&lt;BR /&gt;         preaction              : Not specified&lt;BR /&gt;         postaction             : Not specified&lt;BR /&gt;         postcycle              : /usr/emc/scripts/postcycle.sh&lt;BR /&gt;         steperror              : /usr/emc/scripts/error.sh&lt;BR /&gt;         }&lt;BR /&gt;&lt;BR /&gt;      -consistent               : True&lt;BR /&gt;      -rdb                      : Not specified&lt;BR /&gt;      -vxfs                     : Not specified&lt;BR /&gt;      -ppath                    : Not specified&lt;BR /&gt;      }&lt;BR /&gt;&lt;BR /&gt;   Options file settings:&lt;BR /&gt;      {&lt;BR /&gt;      Replicate hop type        : Single hop&lt;BR /&gt;&lt;BR /&gt;      Maximum cycles            : 1&lt;BR /&gt;      Cycle overflow method     : Next&lt;BR /&gt;      Cycle delay (hh:mm)       : 00:30&lt;BR /&gt;&lt;BR /&gt;      Use final BCV             : True&lt;BR /&gt;      Log Step                  : False&lt;BR /&gt;&lt;BR /&gt;      Protection                : 0   - CLI_C_REPLICATE_PROTECT_DEFAULT&lt;BR /&gt;&lt;BR /&gt;      Timers:&lt;BR /&gt;         {&lt;BR /&gt;         ---------------------------------------------------------&lt;BR /&gt;         Type   Time Limit   Sleep Time    Max Sleep    Calc. Max&lt;BR /&gt;                (hh:mm:ss)   (hh:mm:ss)   Time Factor   Sleep Time&lt;BR /&gt;         ----   ----------   ----------   -----------   ----------&lt;BR /&gt;         GEN      00:30:00     00:00:10             1     00:00:10&lt;BR /&gt;         RDF      04:00:00     00:00:15             4     00:01:00&lt;BR /&gt;         BCV      02:00:00     00:00:10             3     00:00:30&lt;BR /&gt;         ---------------------------------------------------------&lt;BR /&gt;         }&lt;BR /&gt;      }&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;I tried the following:&lt;BR /&gt;&lt;BR /&gt;# symreplicate -g fsproddg show | awk '/\{/, /\}/ {print $0}'&lt;BR /&gt;&lt;BR /&gt;But I got too much output.  You'll note that there are several sequences delimited with { }.  I only want the first...&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Thu, 17 Nov 2005 14:24:40 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/awk-help/m-p/4941481#M102796</guid>
      <dc:creator>Stuart Abramson</dc:creator>
      <dc:date>2005-11-17T14:24:40Z</dc:date>
    </item>
    <item>
      <title>Re: awk help ?</title>
      <link>https://community.hpe.com/t5/operating-system-linux/awk-help/m-p/4941482#M102797</link>
      <description>How about giving sed a try?&lt;BR /&gt;&lt;BR /&gt;# symreplicate -g fsproddg show | sed '/}/q'&lt;BR /&gt;&lt;BR /&gt;cheers!</description>
      <pubDate>Thu, 17 Nov 2005 14:50:30 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/awk-help/m-p/4941482#M102797</guid>
      <dc:creator>Sandman!</dc:creator>
      <dc:date>2005-11-17T14:50:30Z</dc:date>
    </item>
    <item>
      <title>Re: awk help ?</title>
      <link>https://community.hpe.com/t5/operating-system-linux/awk-help/m-p/4941483#M102798</link>
      <description>Hi Stuart:&lt;BR /&gt;&lt;BR /&gt;# awk '{if ($0~/\{/) {print;while ($0!~/\}/) {getline;print};exit}}' filename&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...</description>
      <pubDate>Thu, 17 Nov 2005 14:53:31 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/awk-help/m-p/4941483#M102798</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2005-11-17T14:53:31Z</dc:date>
    </item>
    <item>
      <title>Re: awk help ?</title>
      <link>https://community.hpe.com/t5/operating-system-linux/awk-help/m-p/4941484#M102799</link>
      <description>Here'a a way to do it in perl.&lt;BR /&gt;&lt;BR /&gt;#!/usr/bin/perl&lt;BR /&gt;&lt;BR /&gt;open (CMD,"symreplicate -g fsproddg show"|) or die;&lt;BR /&gt;while (&lt;CMD&gt;) {&lt;BR /&gt;        last if (/}/);&lt;BR /&gt;        print if $found_first_stanza;&lt;BR /&gt;        if (/{/) {&lt;BR /&gt;                $found_first_stanza=1;&lt;BR /&gt;        }&lt;BR /&gt;}&lt;BR /&gt;close (CMD);&lt;BR /&gt;exit;&lt;BR /&gt;&lt;/CMD&gt;</description>
      <pubDate>Thu, 17 Nov 2005 14:55:37 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/awk-help/m-p/4941484#M102799</guid>
      <dc:creator>Jason Cannon</dc:creator>
      <dc:date>2005-11-17T14:55:37Z</dc:date>
    </item>
    <item>
      <title>Re: awk help ?</title>
      <link>https://community.hpe.com/t5/operating-system-linux/awk-help/m-p/4941485#M102800</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;Try something like this :&lt;BR /&gt;&lt;BR /&gt;awk 'BEGIN {f=0}&lt;BR /&gt;/\{/ {f=1; next}&lt;BR /&gt;/\}/ {exit}&lt;BR /&gt;{if(f==1)print}'&lt;BR /&gt;&lt;BR /&gt;HTH</description>
      <pubDate>Thu, 17 Nov 2005 14:56:26 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/awk-help/m-p/4941485#M102800</guid>
      <dc:creator>Victor Fridyev</dc:creator>
      <dc:date>2005-11-17T14:56:26Z</dc:date>
    </item>
    <item>
      <title>Re: awk help ?</title>
      <link>https://community.hpe.com/t5/operating-system-linux/awk-help/m-p/4941486#M102801</link>
      <description>pipe the output to-&lt;BR /&gt;sed -e '1,/^{/d' -e '/^}/,$d'&lt;BR /&gt; &lt;BR /&gt;This deletes from the first line to the first {, then deletes from a } to the end.&lt;BR /&gt; &lt;BR /&gt;HTH&lt;BR /&gt; &lt;BR /&gt;-- Rod Hills</description>
      <pubDate>Thu, 17 Nov 2005 14:57:16 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/awk-help/m-p/4941486#M102801</guid>
      <dc:creator>Rodney Hills</dc:creator>
      <dc:date>2005-11-17T14:57:16Z</dc:date>
    </item>
    <item>
      <title>Re: awk help ?</title>
      <link>https://community.hpe.com/t5/operating-system-linux/awk-help/m-p/4941487#M102802</link>
      <description># symreplicate -g fsproddg show | perl -ane 'INIT{$f=0};if(m/{/){$f++};if($f==1){print "@F\n"}; if(m/}/){$f++}'&lt;BR /&gt;&lt;BR /&gt;# symreplicate -g fsproddg show | awk 'BEGIN{f=0};/\{/{f=f+1};{if (f==1) {print $0}}; /\}/{f=f+1}'&lt;BR /&gt;&lt;BR /&gt;take your pick... they are structurally the same...&lt;BR /&gt;&lt;BR /&gt;Tim</description>
      <pubDate>Thu, 17 Nov 2005 19:59:03 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/awk-help/m-p/4941487#M102802</guid>
      <dc:creator>Tim D Fulford</dc:creator>
      <dc:date>2005-11-17T19:59:03Z</dc:date>
    </item>
    <item>
      <title>Re: awk help ?</title>
      <link>https://community.hpe.com/t5/operating-system-linux/awk-help/m-p/4941488#M102803</link>
      <description>Thanks all!</description>
      <pubDate>Fri, 18 Nov 2005 11:00:13 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/awk-help/m-p/4941488#M102803</guid>
      <dc:creator>Stuart Abramson</dc:creator>
      <dc:date>2005-11-18T11:00:13Z</dc:date>
    </item>
    <item>
      <title>Re: awk help ?</title>
      <link>https://community.hpe.com/t5/operating-system-linux/awk-help/m-p/4941489#M102804</link>
      <description>Those are all great pieces of advice that will work well but I personally think the simplest way to do it would be to add one line to your desired output and use &lt;BR /&gt;&lt;BR /&gt;Device lists:&lt;BR /&gt;&lt;BR /&gt;As your start string and&lt;BR /&gt;&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;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.&lt;BR /&gt;&lt;BR /&gt;Howard</description>
      <pubDate>Mon, 21 Nov 2005 10:15:49 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/awk-help/m-p/4941489#M102804</guid>
      <dc:creator>Howard Marshall</dc:creator>
      <dc:date>2005-11-21T10:15:49Z</dc:date>
    </item>
  </channel>
</rss>

