<?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: Script help required... in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/script-help-required/m-p/2659534#M928868</link>
    <description>Hi Duncan,&lt;BR /&gt;&lt;BR /&gt;How about:&lt;BR /&gt;&lt;BR /&gt;==================&lt;BR /&gt;awk '&lt;BR /&gt;BEGIN{a=1}&lt;BR /&gt;{l=$0;getline&lt;BR /&gt;if (a==1){print l;print}&lt;BR /&gt;else&lt;BR /&gt;{print;print l}&lt;BR /&gt;a*=-1}' file&lt;BR /&gt;==================&lt;BR /&gt;&lt;BR /&gt;Rgds, Robin</description>
    <pubDate>Wed, 06 Feb 2002 11:04:30 GMT</pubDate>
    <dc:creator>Robin Wakefield</dc:creator>
    <dc:date>2002-02-06T11:04:30Z</dc:date>
    <item>
      <title>Script help required...</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-help-required/m-p/2659531#M928865</link>
      <description>Hi folks,&lt;BR /&gt;&lt;BR /&gt;I am trying to automate a process around doing a vgimport on a host... I have my map file, and a list of disks to go in the vg - the list of disks is generated in the order:&lt;BR /&gt;&lt;BR /&gt;c1t0d0&lt;BR /&gt;c2t0d0 (alt link)&lt;BR /&gt;c1t1d0&lt;BR /&gt;c2t1d0 (alt link)&lt;BR /&gt;c1t2d0&lt;BR /&gt;c2t2d0 (alt link)&lt;BR /&gt;c1t3d0&lt;BR /&gt;c2t3d0 (alt link)&lt;BR /&gt;&lt;BR /&gt;etc...&lt;BR /&gt;&lt;BR /&gt;However I want the volume group to be created with load balancing down the channels, so when the vgimport occurs, I want the order to be:&lt;BR /&gt;&lt;BR /&gt;c1t0d0&lt;BR /&gt;c2t0d0 (alt link)&lt;BR /&gt;c2t1d0&lt;BR /&gt;c1t1d0 (alt link)&lt;BR /&gt;c1t2d0&lt;BR /&gt;c2t2d0 (alt link)&lt;BR /&gt;c2t3d0&lt;BR /&gt;c1t3d0 (alt link)&lt;BR /&gt;&lt;BR /&gt;Now I know the algorithm to do this is - &lt;BR /&gt;&lt;BR /&gt;start&lt;BR /&gt;read two lines - write two lines&lt;BR /&gt;read two lines - swap order of lines and write&lt;BR /&gt;goto start until complete&lt;BR /&gt;&lt;BR /&gt;But I'm struggling to turn this into a shell or awk script...&lt;BR /&gt;&lt;BR /&gt;Any ideas will earn points&lt;BR /&gt;&lt;BR /&gt;Thanks&lt;BR /&gt;&lt;BR /&gt;Duncan</description>
      <pubDate>Wed, 06 Feb 2002 10:30:34 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-help-required/m-p/2659531#M928865</guid>
      <dc:creator>Duncan Edmonstone</dc:creator>
      <dc:date>2002-02-06T10:30:34Z</dc:date>
    </item>
    <item>
      <title>Re: Script help required...</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-help-required/m-p/2659532#M928866</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;Try using sort:&lt;BR /&gt;&lt;BR /&gt;sort -t"t" -k2 filename&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;&lt;BR /&gt;Justo.</description>
      <pubDate>Wed, 06 Feb 2002 10:40:35 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-help-required/m-p/2659532#M928866</guid>
      <dc:creator>Justo Exposito</dc:creator>
      <dc:date>2002-02-06T10:40:35Z</dc:date>
    </item>
    <item>
      <title>Re: Script help required...</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-help-required/m-p/2659533#M928867</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;try this one:&lt;BR /&gt;&lt;BR /&gt;awk 'BEGIN{p="";s=0;}{&lt;BR /&gt;if(p=="")&lt;BR /&gt;{&lt;BR /&gt;  p=$0;&lt;BR /&gt;}&lt;BR /&gt;else&lt;BR /&gt;{&lt;BR /&gt;  if(s==0)&lt;BR /&gt;  {&lt;BR /&gt;    print p;&lt;BR /&gt;    print $0;&lt;BR /&gt;    s=1;&lt;BR /&gt;  }&lt;BR /&gt;  else&lt;BR /&gt;  {&lt;BR /&gt;    print $0;&lt;BR /&gt;    print p;&lt;BR /&gt;    s=0;&lt;BR /&gt;  }&lt;BR /&gt;  p="";&lt;BR /&gt;}&lt;BR /&gt;}' &lt;FILE&gt;&lt;BR /&gt;&lt;BR /&gt;Regards&lt;/FILE&gt;</description>
      <pubDate>Wed, 06 Feb 2002 10:50:50 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-help-required/m-p/2659533#M928867</guid>
      <dc:creator>Andreas Voss</dc:creator>
      <dc:date>2002-02-06T10:50:50Z</dc:date>
    </item>
    <item>
      <title>Re: Script help required...</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-help-required/m-p/2659534#M928868</link>
      <description>Hi Duncan,&lt;BR /&gt;&lt;BR /&gt;How about:&lt;BR /&gt;&lt;BR /&gt;==================&lt;BR /&gt;awk '&lt;BR /&gt;BEGIN{a=1}&lt;BR /&gt;{l=$0;getline&lt;BR /&gt;if (a==1){print l;print}&lt;BR /&gt;else&lt;BR /&gt;{print;print l}&lt;BR /&gt;a*=-1}' file&lt;BR /&gt;==================&lt;BR /&gt;&lt;BR /&gt;Rgds, Robin</description>
      <pubDate>Wed, 06 Feb 2002 11:04:30 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-help-required/m-p/2659534#M928868</guid>
      <dc:creator>Robin Wakefield</dc:creator>
      <dc:date>2002-02-06T11:04:30Z</dc:date>
    </item>
    <item>
      <title>Re: Script help required...</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-help-required/m-p/2659535#M928869</link>
      <description>If you wanted a shell script to do it then...&lt;BR /&gt;&lt;BR /&gt;#!/usr/bin/sh&lt;BR /&gt;&lt;BR /&gt;let FLAG=0&lt;BR /&gt;&lt;BR /&gt;&lt;PRINT your="" list="" of="" disks="" here=""&gt; | {&lt;BR /&gt;&lt;BR /&gt;while read DISK&lt;BR /&gt;do&lt;BR /&gt; read ALTDISK&lt;BR /&gt;&lt;BR /&gt; if     (( FLAG &amp;amp; 1 ));&lt;BR /&gt; then   print "${ALTDISK}"&lt;BR /&gt;        print "${DISK}"&lt;BR /&gt; else   print "${DISK}"&lt;BR /&gt;        print "${ALTDISK}"&lt;BR /&gt; fi&lt;BR /&gt; let FLAG=FLAG+1&lt;BR /&gt;done&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;John&lt;/PRINT&gt;</description>
      <pubDate>Wed, 06 Feb 2002 11:15:47 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-help-required/m-p/2659535#M928869</guid>
      <dc:creator>John Palmer</dc:creator>
      <dc:date>2002-02-06T11:15:47Z</dc:date>
    </item>
  </channel>
</rss>

