<?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: ksh / awk to parse &amp;quot;syminq&amp;quot; output ? in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/ksh-awk-to-parse-quot-syminq-quot-output/m-p/3436156#M206629</link>
    <description>Victor and Rodney's way should work.&lt;BR /&gt;&lt;BR /&gt;Don't forget to assign points to everyone - &lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://forums1.itrc.hp.com/service/forums/helptips.do?#28" target="_blank"&gt;http://forums1.itrc.hp.com/service/forums/helptips.do?#28&lt;/A&gt;&lt;BR /&gt; &lt;BR /&gt;&lt;A href="http://forums1.itrc.hp.com/service/forums/pageList.do?userId=CA384034&amp;amp;listType=unassigned&amp;amp;forumId=1" target="_blank"&gt;http://forums1.itrc.hp.com/service/forums/pageList.do?userId=CA384034&amp;amp;listType=unassigned&amp;amp;forumId=1&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;Rgds...Geoff&lt;BR /&gt;&lt;BR /&gt;</description>
    <pubDate>Fri, 03 Dec 2004 13:43:07 GMT</pubDate>
    <dc:creator>Geoff Wild</dc:creator>
    <dc:date>2004-12-03T13:43:07Z</dc:date>
    <item>
      <title>ksh / awk to parse "syminq" output ?</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/ksh-awk-to-parse-quot-syminq-quot-output/m-p/3436147#M206620</link>
      <description>the output from EMC syminq looks like this:&lt;BR /&gt;&lt;BR /&gt;/dev/rdsk/c13t0d0........EMC..SYMMETRIX..5568..84000000.......7680&lt;BR /&gt;/dev/rdsk/c13t3d1..M(4)..EMC..SYMMETRIX..5568..840C1000...35354880&lt;BR /&gt;/dev/rdsk/c13t3d2..M(4)..EMC..SYMMETRIX..5568..840C5000...35354880&lt;BR /&gt;/dev/rdsk/c13t3d3..M(4)..EMC..SYMMETRIX..5568..840C9000...35354880&lt;BR /&gt;/dev/rdsk/c13t3d4..M(4)..EMC..SYMMETRIX..5568..840CD000...35354880&lt;BR /&gt;/dev/rdsk/c13t3d5..M(4)..EMC..SYMMETRIX..5568..840D1000...35354880&lt;BR /&gt;/dev/rdsk/c13t3d6..M(4)..EMC..SYMMETRIX..5568..840D5000...35354880&lt;BR /&gt;/dev/rdsk/c13t7d0........EMC..SYMMETRIX..5568..8437A000....8838720&lt;BR /&gt;/dev/rdsk/c15t0d0........EMC..SYMMETRIX..5568..84000000.......7680&lt;BR /&gt;&lt;BR /&gt;the 2nd field isn't always filled in.  I want to parse the line using ksh or awk (NO PERL) so that the "EMC" field is always the 3rd field; even when the "M(X)" isn't present.  &lt;BR /&gt;&lt;BR /&gt;Can anyone tell me how to do that in ksh or awk, please?</description>
      <pubDate>Fri, 03 Dec 2004 10:57:38 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/ksh-awk-to-parse-quot-syminq-quot-output/m-p/3436147#M206620</guid>
      <dc:creator>Stuart Abramson</dc:creator>
      <dc:date>2004-12-03T10:57:38Z</dc:date>
    </item>
    <item>
      <title>Re: ksh / awk to parse "syminq" output ?</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/ksh-awk-to-parse-quot-syminq-quot-output/m-p/3436148#M206621</link>
      <description>Do you want the lines, if thried filed is EMS, then do as follows.&lt;BR /&gt;&lt;BR /&gt;syminq output | awk -F ".." '{if($3==EMC)print}'&lt;BR /&gt;&lt;BR /&gt;Anil</description>
      <pubDate>Fri, 03 Dec 2004 11:01:59 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/ksh-awk-to-parse-quot-syminq-quot-output/m-p/3436148#M206621</guid>
      <dc:creator>RAC_1</dc:creator>
      <dc:date>2004-12-03T11:01:59Z</dc:date>
    </item>
    <item>
      <title>Re: ksh / awk to parse "syminq" output ?</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/ksh-awk-to-parse-quot-syminq-quot-output/m-p/3436149#M206622</link>
      <description>What are you trying to accomplish?&lt;BR /&gt;&lt;BR /&gt;That ius, what data are you looking to get out of the syminq?&lt;BR /&gt;&lt;BR /&gt;Rgds...Geoff</description>
      <pubDate>Fri, 03 Dec 2004 11:07:33 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/ksh-awk-to-parse-quot-syminq-quot-output/m-p/3436149#M206622</guid>
      <dc:creator>Geoff Wild</dc:creator>
      <dc:date>2004-12-03T11:07:33Z</dc:date>
    </item>
    <item>
      <title>Re: ksh / awk to parse "syminq" output ?</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/ksh-awk-to-parse-quot-syminq-quot-output/m-p/3436150#M206623</link>
      <description>By deleting the M(4) with sed, everything should line up correctly and you can use awk from then on.&lt;BR /&gt;&lt;BR /&gt;syminq output | sed -e 's/M(4)//' | awk -F ".." 'whatever you want to do'&lt;BR /&gt; &lt;BR /&gt;HTH&lt;BR /&gt; &lt;BR /&gt;-- Rod Hills&lt;BR /&gt;</description>
      <pubDate>Fri, 03 Dec 2004 11:51:29 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/ksh-awk-to-parse-quot-syminq-quot-output/m-p/3436150#M206623</guid>
      <dc:creator>Rodney Hills</dc:creator>
      <dc:date>2004-12-03T11:51:29Z</dc:date>
    </item>
    <item>
      <title>Re: ksh / awk to parse "syminq" output ?</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/ksh-awk-to-parse-quot-syminq-quot-output/m-p/3436151#M206624</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;You could use the 'cut' command in a ksh script, or you could use the 'substr' function in awk.&lt;BR /&gt;&lt;BR /&gt;JP&lt;BR /&gt;</description>
      <pubDate>Fri, 03 Dec 2004 11:51:51 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/ksh-awk-to-parse-quot-syminq-quot-output/m-p/3436151#M206624</guid>
      <dc:creator>John Poff</dc:creator>
      <dc:date>2004-12-03T11:51:51Z</dc:date>
    </item>
    <item>
      <title>Re: ksh / awk to parse "syminq" output ?</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/ksh-awk-to-parse-quot-syminq-quot-output/m-p/3436152#M206625</link>
      <description>Here is a sample of how to do it in a ksh script with cut:&lt;BR /&gt;&lt;BR /&gt;#!/usr/bin/ksh                                                                  &lt;BR /&gt;                                                                                &lt;BR /&gt;# syminq.sh                                                                     &lt;BR /&gt;                                                                                &lt;BR /&gt;while read LINE                                                                 &lt;BR /&gt;do                                                                              &lt;BR /&gt;    DISK=$(echo $LINE | cut -c1-17)                                             &lt;BR /&gt;    MVAL=$(echo $LINE | cut -c20-23)                                            &lt;BR /&gt;    EMC=$(echo $LINE | cut -c26-28)                                             &lt;BR /&gt;                                                                                &lt;BR /&gt;    echo "DISK is $DISK"                                                        &lt;BR /&gt;    echo "MVAL is $MVAL"                                                        &lt;BR /&gt;    echo "EMC is $EMC"                                                          &lt;BR /&gt;done &lt;SYMINQ.TXT&gt;&lt;/SYMINQ.TXT&gt;&lt;BR /&gt;(Assuming that your syminq output is in a file named syminq.txt).&lt;BR /&gt;&lt;BR /&gt;JP&lt;BR /&gt;</description>
      <pubDate>Fri, 03 Dec 2004 11:56:50 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/ksh-awk-to-parse-quot-syminq-quot-output/m-p/3436152#M206625</guid>
      <dc:creator>John Poff</dc:creator>
      <dc:date>2004-12-03T11:56:50Z</dc:date>
    </item>
    <item>
      <title>Re: ksh / awk to parse "syminq" output ?</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/ksh-awk-to-parse-quot-syminq-quot-output/m-p/3436153#M206626</link>
      <description>Let me clarify a little:&lt;BR /&gt;&lt;BR /&gt;1.  I put "..." in to signify spaces.  There are no "..." - there are spaces.&lt;BR /&gt;&lt;BR /&gt;2.  You can't use character positions because on differnet servers the field lengths are different.  Also, if you have short device file names (c9t1d0) the spacing is (slightly) different than for long names (c22t14d7).&lt;BR /&gt;&lt;BR /&gt;3.  What I want to get out of this is a table which shows me that Symm device 0CD on Symm 84 has three device files, c13t3d1, c15t3d1 and c19t3d1, and is of type "M(4)" or "R1" and has size 8.8 GB.</description>
      <pubDate>Fri, 03 Dec 2004 12:00:41 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/ksh-awk-to-parse-quot-syminq-quot-output/m-p/3436153#M206626</guid>
      <dc:creator>Stuart Abramson</dc:creator>
      <dc:date>2004-12-03T12:00:41Z</dc:date>
    </item>
    <item>
      <title>Re: ksh / awk to parse "syminq" output ?</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/ksh-awk-to-parse-quot-syminq-quot-output/m-p/3436154#M206627</link>
      <description>Don't get locked down into using field numbers. You can put the values into variables and make adjustments.&lt;BR /&gt; &lt;BR /&gt;For example here is an awk-&lt;BR /&gt;dev=$1; m4=$2; emc=$3; sym=$4; siz=$7&lt;BR /&gt;if (m4 == "EMC") {&lt;BR /&gt; m4=""; emc=$2; sym=$3; siz=$6&lt;BR /&gt;}&lt;BR /&gt; &lt;BR /&gt;Now the awk variables are adjusted depending on if M(4) exists and you can use them in your report.&lt;BR /&gt; &lt;BR /&gt;HTH&lt;BR /&gt; &lt;BR /&gt;-- Rod Hills</description>
      <pubDate>Fri, 03 Dec 2004 12:46:01 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/ksh-awk-to-parse-quot-syminq-quot-output/m-p/3436154#M206627</guid>
      <dc:creator>Rodney Hills</dc:creator>
      <dc:date>2004-12-03T12:46:01Z</dc:date>
    </item>
    <item>
      <title>Re: ksh / awk to parse "syminq" output ?</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/ksh-awk-to-parse-quot-syminq-quot-output/m-p/3436155#M206628</link>
      <description>Hi,&lt;BR /&gt;Let's assume that you have 10 fields in the records if the 2-nd field is OK and 9 fields if the field is empty.&lt;BR /&gt;&lt;BR /&gt;awk 'NF==10 {print; next}&lt;BR /&gt;NF==9 {print $1,"RRR",$2,$3,$4,%5,$6,$7,$8,$9;next}' FILE&lt;BR /&gt;&lt;BR /&gt;Instead of RRR you can use any replacement.&lt;BR /&gt;If NF is big, use "for" expression&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;HTH</description>
      <pubDate>Fri, 03 Dec 2004 12:55:45 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/ksh-awk-to-parse-quot-syminq-quot-output/m-p/3436155#M206628</guid>
      <dc:creator>Victor Fridyev</dc:creator>
      <dc:date>2004-12-03T12:55:45Z</dc:date>
    </item>
    <item>
      <title>Re: ksh / awk to parse "syminq" output ?</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/ksh-awk-to-parse-quot-syminq-quot-output/m-p/3436156#M206629</link>
      <description>Victor and Rodney's way should work.&lt;BR /&gt;&lt;BR /&gt;Don't forget to assign points to everyone - &lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://forums1.itrc.hp.com/service/forums/helptips.do?#28" target="_blank"&gt;http://forums1.itrc.hp.com/service/forums/helptips.do?#28&lt;/A&gt;&lt;BR /&gt; &lt;BR /&gt;&lt;A href="http://forums1.itrc.hp.com/service/forums/pageList.do?userId=CA384034&amp;amp;listType=unassigned&amp;amp;forumId=1" target="_blank"&gt;http://forums1.itrc.hp.com/service/forums/pageList.do?userId=CA384034&amp;amp;listType=unassigned&amp;amp;forumId=1&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;Rgds...Geoff&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Fri, 03 Dec 2004 13:43:07 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/ksh-awk-to-parse-quot-syminq-quot-output/m-p/3436156#M206629</guid>
      <dc:creator>Geoff Wild</dc:creator>
      <dc:date>2004-12-03T13:43:07Z</dc:date>
    </item>
    <item>
      <title>Re: ksh / awk to parse "syminq" output ?</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/ksh-awk-to-parse-quot-syminq-quot-output/m-p/3436157#M206630</link>
      <description>I used to do somthing similar with the 'inq' command, but the output from 'inq' had the fields separated by the colon ':' character, which made it easy to use awk with the -F: option to get the fields.&lt;BR /&gt;&lt;BR /&gt;I don't have the latest version of syminq anymore but maybe there is an option to get it to produce the output with some character that you can use as a field separator?&lt;BR /&gt;&lt;BR /&gt;JP&lt;BR /&gt;</description>
      <pubDate>Fri, 03 Dec 2004 14:03:55 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/ksh-awk-to-parse-quot-syminq-quot-output/m-p/3436157#M206630</guid>
      <dc:creator>John Poff</dc:creator>
      <dc:date>2004-12-03T14:03:55Z</dc:date>
    </item>
    <item>
      <title>Re: ksh / awk to parse "syminq" output ?</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/ksh-awk-to-parse-quot-syminq-quot-output/m-p/3436158#M206631</link>
      <description>You can access $1 as usual but use $(NF-1), $(NF-2), $(NF-3), etc to get the other data you need.  Suppose you want the /dev/dsk field, the LUN S/N, and LUN capacity, use:&lt;BR /&gt;&lt;BR /&gt;Use awk '/EMC/{printf("%s %s %s\n",$1,$(NF-2),$NF)}'.&lt;BR /&gt;&lt;BR /&gt;This would work whether or not the M(4) field exists or not.&lt;BR /&gt;</description>
      <pubDate>Fri, 03 Dec 2004 14:16:21 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/ksh-awk-to-parse-quot-syminq-quot-output/m-p/3436158#M206631</guid>
      <dc:creator>Tom Danzig</dc:creator>
      <dc:date>2004-12-03T14:16:21Z</dc:date>
    </item>
  </channel>
</rss>

