<?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: A fun little awk help. Legacy device getter. in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/a-fun-little-awk-help-legacy-device-getter/m-p/4774176#M640653</link>
    <description>Hi SEP:&lt;BR /&gt;&lt;BR /&gt;&amp;gt; ioscan -kfnCdisk | awk '/$pboot/ {getline;fcd=$pboot; print fcd,$2}'&lt;BR /&gt;&lt;BR /&gt;If you are attempting to pass 'pboot' as a variable, this isn't gong to work.  You should do something like:&lt;BR /&gt;&lt;BR /&gt;# ioscan -kfnCdisk | awk -v pboot=${pboot} '$0~pboot {getline print pboot,$2}'&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...</description>
    <pubDate>Tue, 05 Apr 2011 22:54:51 GMT</pubDate>
    <dc:creator>James R. Ferguson</dc:creator>
    <dc:date>2011-04-05T22:54:51Z</dc:date>
    <item>
      <title>A fun little awk help. Legacy device getter.</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/a-fun-little-awk-help-legacy-device-getter/m-p/4774175#M640652</link>
      <description>&lt;!--!*#--&gt;Ouptput:&lt;BR /&gt;&lt;BR /&gt;disk     29  0/6/2/0.151.15.23.0.0.4  sdisk    CLAIMED     DEVICE       IBM     2145&lt;BR /&gt;                            /dev/dsk/c19t0d4   /dev/rdsk/c19t0d4&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;That is standard 11.23 ioscan.&lt;BR /&gt;&lt;BR /&gt;I have the -H hardware device.&lt;BR /&gt;&lt;BR /&gt;0/0/1/1.15.0&lt;BR /&gt;&lt;BR /&gt;Which I got from setboot&lt;BR /&gt;&lt;BR /&gt;I am needing the legacy device. Can't use ioscan -m because that useful little tool does not exist.&lt;BR /&gt;&lt;BR /&gt;It will look kind of like:&lt;BR /&gt;&lt;BR /&gt;I can't get the awk working today. &lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;ioscan -kfnC fc | awk ‘/fcd/ {getline;fcd=$NF;print fcd,$2}’ | while read -r fdev&lt;BR /&gt;do&lt;BR /&gt;&lt;BR /&gt;fcmsutil ${fdev} | awk ‘/Hardware / {print $5};/World / { print $7}’&lt;BR /&gt;&lt;BR /&gt;done&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Something like:&lt;BR /&gt;ioscan -kfnCdisk | awk '/$pboot/ {getline;fcd=$pboot; print fcd,$2}'&lt;BR /&gt;&lt;BR /&gt;Except maybe something that works.&lt;BR /&gt;&lt;BR /&gt;SEP&lt;BR /&gt;&lt;BR /&gt;Was thinking:&lt;BR /&gt;</description>
      <pubDate>Tue, 05 Apr 2011 22:20:35 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/a-fun-little-awk-help-legacy-device-getter/m-p/4774175#M640652</guid>
      <dc:creator>Steven E. Protter</dc:creator>
      <dc:date>2011-04-05T22:20:35Z</dc:date>
    </item>
    <item>
      <title>Re: A fun little awk help. Legacy device getter.</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/a-fun-little-awk-help-legacy-device-getter/m-p/4774176#M640653</link>
      <description>Hi SEP:&lt;BR /&gt;&lt;BR /&gt;&amp;gt; ioscan -kfnCdisk | awk '/$pboot/ {getline;fcd=$pboot; print fcd,$2}'&lt;BR /&gt;&lt;BR /&gt;If you are attempting to pass 'pboot' as a variable, this isn't gong to work.  You should do something like:&lt;BR /&gt;&lt;BR /&gt;# ioscan -kfnCdisk | awk -v pboot=${pboot} '$0~pboot {getline print pboot,$2}'&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...</description>
      <pubDate>Tue, 05 Apr 2011 22:54:51 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/a-fun-little-awk-help-legacy-device-getter/m-p/4774176#M640653</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2011-04-05T22:54:51Z</dc:date>
    </item>
    <item>
      <title>Re: A fun little awk help. Legacy device getter.</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/a-fun-little-awk-help-legacy-device-getter/m-p/4774177#M640654</link>
      <description>&lt;!--!*#--&gt;&lt;BR /&gt;ioscan -kfnCdisk | awk -v pboot=${pboot} '$0~pboot {getline print pboot,$2}'&lt;BR /&gt;&lt;BR /&gt;I get the concept.&lt;BR /&gt;&lt;BR /&gt; awk: The statement cannot be correctly parsed.&lt;BR /&gt; The source line is 1.&lt;BR /&gt;&lt;BR /&gt;I'm hacking away here.&lt;BR /&gt;&lt;BR /&gt;This looks almost done.&lt;BR /&gt;&lt;BR /&gt;Steven</description>
      <pubDate>Wed, 06 Apr 2011 14:48:42 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/a-fun-little-awk-help-legacy-device-getter/m-p/4774177#M640654</guid>
      <dc:creator>Steven E. Protter</dc:creator>
      <dc:date>2011-04-06T14:48:42Z</dc:date>
    </item>
    <item>
      <title>Re: A fun little awk help. Legacy device getter.</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/a-fun-little-awk-help-legacy-device-getter/m-p/4774178#M640655</link>
      <description>Fixed it:&lt;BR /&gt;&lt;BR /&gt;ioscan -kfnCdisk | awk -v pboot=${pboot} '$0~pboot {getline;print pboot,$2}'&lt;BR /&gt;&lt;BR /&gt;Chime in JRF for full pointage.&lt;BR /&gt;&lt;BR /&gt;SEP</description>
      <pubDate>Wed, 06 Apr 2011 15:13:35 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/a-fun-little-awk-help-legacy-device-getter/m-p/4774178#M640655</guid>
      <dc:creator>Steven E. Protter</dc:creator>
      <dc:date>2011-04-06T15:13:35Z</dc:date>
    </item>
    <item>
      <title>Re: A fun little awk help. Legacy device getter.</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/a-fun-little-awk-help-legacy-device-getter/m-p/4774179#M640656</link>
      <description>Hi (again) SEP:&lt;BR /&gt;&lt;BR /&gt;Oops, i forgot the semicolon :-)  I meant:&lt;BR /&gt;&lt;BR /&gt;# ioscan -kfnCdisk | awk -v pboot=${pboot} '$0~pboot {getline; print pboot,$2}'&lt;BR /&gt;&lt;BR /&gt;...just as you deduced.&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...</description>
      <pubDate>Wed, 06 Apr 2011 15:34:34 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/a-fun-little-awk-help-legacy-device-getter/m-p/4774179#M640656</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2011-04-06T15:34:34Z</dc:date>
    </item>
    <item>
      <title>Re: A fun little awk help. Legacy device getter.</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/a-fun-little-awk-help-legacy-device-getter/m-p/4774180#M640657</link>
      <description>good to know how to import shell variables inside awk. I always used a much ugly way by alternating quotes and escape characters. :)&lt;BR /&gt;&lt;BR /&gt;# ioscan -kfnCdisk | awk '/'$pboot'/ {getline;fcd='$pboot'; print fcd,$2}'</description>
      <pubDate>Wed, 06 Apr 2011 18:22:03 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/a-fun-little-awk-help-legacy-device-getter/m-p/4774180#M640657</guid>
      <dc:creator>Viktor Balogh</dc:creator>
      <dc:date>2011-04-06T18:22:03Z</dc:date>
    </item>
    <item>
      <title>Re: A fun little awk help. Legacy device getter.</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/a-fun-little-awk-help-legacy-device-getter/m-p/4774181#M640658</link>
      <description>It was still kind of wrong.&lt;BR /&gt;&lt;BR /&gt;abootdisk=$(ioscan -kfnCdisk | awk -v aboot=${aboot} '/aboot/ $0~aboot {getline;print aboot,$2}' | awk '{ print $2 }');&lt;BR /&gt;&lt;BR /&gt;That is the final version.&lt;BR /&gt;&lt;BR /&gt;Done, assigning points.&lt;BR /&gt;&lt;BR /&gt;awk is awkful&lt;BR /&gt;awk is fun, more than enough for anyone.&lt;BR /&gt;&lt;BR /&gt;SEP</description>
      <pubDate>Wed, 06 Apr 2011 18:59:43 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/a-fun-little-awk-help-legacy-device-getter/m-p/4774181#M640658</guid>
      <dc:creator>Steven E. Protter</dc:creator>
      <dc:date>2011-04-06T18:59:43Z</dc:date>
    </item>
    <item>
      <title>Re: A fun little awk help. Legacy device getter.</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/a-fun-little-awk-help-legacy-device-getter/m-p/4774182#M640659</link>
      <description>I've got two things what's not so clear to me:&lt;BR /&gt;&lt;BR /&gt;why did you use both /aboot/ and $0~aboot ? both says "if the line contains the value of the variable aboot, do this..."&lt;BR /&gt;&lt;BR /&gt;and why did you give the output to a second awk statement? (which could be done inside the first awk) that seems to me a performance hog.&lt;BR /&gt;</description>
      <pubDate>Wed, 06 Apr 2011 19:21:58 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/a-fun-little-awk-help-legacy-device-getter/m-p/4774182#M640659</guid>
      <dc:creator>Viktor Balogh</dc:creator>
      <dc:date>2011-04-06T19:21:58Z</dc:date>
    </item>
    <item>
      <title>Re: A fun little awk help. Legacy device getter.</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/a-fun-little-awk-help-legacy-device-getter/m-p/4774183#M640660</link>
      <description>I stopped working on this when it worked.&lt;BR /&gt;&lt;BR /&gt;I will award points for working more efficient code.&lt;BR /&gt;&lt;BR /&gt;The statement executes twice as part of a process that chooses alternate boot disk to be broken out of a two disk root/boot mirror set as a target for a DRD clone.&lt;BR /&gt;&lt;BR /&gt;If it were executing hundreds of times, I would work harder on efficiency.&lt;BR /&gt;&lt;BR /&gt;Its not, so I stopped. I am not averse to a theoretical exercise to improve the code.&lt;BR /&gt;&lt;BR /&gt;The current code is the top new post at &lt;A href="http://hpux.ws" target="_blank"&gt;http://hpux.ws&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;I would love to tune it up and make it more awkful.&lt;BR /&gt;&lt;BR /&gt;SEP</description>
      <pubDate>Wed, 06 Apr 2011 19:25:07 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/a-fun-little-awk-help-legacy-device-getter/m-p/4774183#M640660</guid>
      <dc:creator>Steven E. Protter</dc:creator>
      <dc:date>2011-04-06T19:25:07Z</dc:date>
    </item>
    <item>
      <title>Re: A fun little awk help. Legacy device getter.</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/a-fun-little-awk-help-legacy-device-getter/m-p/4774184#M640661</link>
      <description>&amp;gt;Viktor: why did you use both /aboot/ and $0 ~ aboot?&lt;BR /&gt;&lt;BR /&gt;I'm not sure what both really do together?&lt;BR /&gt;&lt;BR /&gt;&amp;gt;both says "if the line contains the value of the variable aboot"&lt;BR /&gt;&lt;BR /&gt;No, /aboot/ says look for the constant RE containing "aboot", not the variable.  That's why JRF switched $0 ~ aboot&lt;BR /&gt;&lt;BR /&gt;&amp;gt;why did you give the output to a second awk statement?&lt;BR /&gt;&lt;BR /&gt;(I assumed the extra token was to make sure it worked?)&lt;BR /&gt;Not really done, just changed: :-)&lt;BR /&gt;... | awk -v aboot=${aboot} '$0 ~ aboot {getline; print $2}')&lt;BR /&gt;</description>
      <pubDate>Thu, 07 Apr 2011 04:14:08 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/a-fun-little-awk-help-legacy-device-getter/m-p/4774184#M640661</guid>
      <dc:creator>Dennis Handly</dc:creator>
      <dc:date>2011-04-07T04:14:08Z</dc:date>
    </item>
  </channel>
</rss>

