<?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: sequencing script in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/sequencing-script/m-p/3022750#M909397</link>
    <description>typeset -Z2 N &lt;BR /&gt;for F in $FILE_LIST &lt;BR /&gt;do &lt;BR /&gt;(( N=N+1 )) &lt;BR /&gt;&amp;gt;&amp;gt; &lt;BR /&gt;if [ "N" -gt 49]&lt;BR /&gt;    then&lt;BR /&gt;     N=0&lt;BR /&gt;   fi &lt;BR /&gt;&amp;lt;&amp;lt;&lt;BR /&gt;mv ${F} ${N}${F} &lt;BR /&gt;done &lt;BR /&gt;&lt;BR /&gt;or in perl :&lt;BR /&gt;&lt;BR /&gt;$n=0;&lt;BR /&gt;opendir(DIR, /my/dir);&lt;BR /&gt;@files = grep { /^\./ &amp;amp;&amp;amp; !/^\.\.?$/ } readdir(DIR);&lt;BR /&gt;closedir(DIR);&lt;BR /&gt;&lt;BR /&gt;foreach (@files) {&lt;BR /&gt; mv $_ ${n}$_;&lt;BR /&gt; $n = 0 if ( $n &amp;gt; 48 );&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;Regs David</description>
    <pubDate>Mon, 14 Jul 2003 12:13:27 GMT</pubDate>
    <dc:creator>David_246</dc:creator>
    <dc:date>2003-07-14T12:13:27Z</dc:date>
    <item>
      <title>sequencing script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/sequencing-script/m-p/3022748#M909395</link>
      <description>Hi all,&lt;BR /&gt;&lt;BR /&gt;I have the following script for sequencing files:&lt;BR /&gt;&lt;BR /&gt;typeset -Z2 N&lt;BR /&gt;for F in $FILE_LIST&lt;BR /&gt;do&lt;BR /&gt;(( N=N+1 ))&lt;BR /&gt;mv ${F} ${N}${F}&lt;BR /&gt;done&lt;BR /&gt;&lt;BR /&gt;I need to limit N to between 00 &amp;amp; 49. What's the most efficient way of doing this, or will I need to check each iteration and reset N to 00 once it hits 49?&lt;BR /&gt;&lt;BR /&gt;Many thanks,&lt;BR /&gt;&lt;BR /&gt;Vin.</description>
      <pubDate>Mon, 14 Jul 2003 11:49:01 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/sequencing-script/m-p/3022748#M909395</guid>
      <dc:creator>Vin_5</dc:creator>
      <dc:date>2003-07-14T11:49:01Z</dc:date>
    </item>
    <item>
      <title>Re: sequencing script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/sequencing-script/m-p/3022749#M909396</link>
      <description>you need use modulus function.&lt;BR /&gt;&lt;BR /&gt;you must use:&lt;BR /&gt;&lt;BR /&gt;(( N=(N+1)%50 ))&lt;BR /&gt;</description>
      <pubDate>Mon, 14 Jul 2003 12:04:05 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/sequencing-script/m-p/3022749#M909396</guid>
      <dc:creator>Jdamian</dc:creator>
      <dc:date>2003-07-14T12:04:05Z</dc:date>
    </item>
    <item>
      <title>Re: sequencing script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/sequencing-script/m-p/3022750#M909397</link>
      <description>typeset -Z2 N &lt;BR /&gt;for F in $FILE_LIST &lt;BR /&gt;do &lt;BR /&gt;(( N=N+1 )) &lt;BR /&gt;&amp;gt;&amp;gt; &lt;BR /&gt;if [ "N" -gt 49]&lt;BR /&gt;    then&lt;BR /&gt;     N=0&lt;BR /&gt;   fi &lt;BR /&gt;&amp;lt;&amp;lt;&lt;BR /&gt;mv ${F} ${N}${F} &lt;BR /&gt;done &lt;BR /&gt;&lt;BR /&gt;or in perl :&lt;BR /&gt;&lt;BR /&gt;$n=0;&lt;BR /&gt;opendir(DIR, /my/dir);&lt;BR /&gt;@files = grep { /^\./ &amp;amp;&amp;amp; !/^\.\.?$/ } readdir(DIR);&lt;BR /&gt;closedir(DIR);&lt;BR /&gt;&lt;BR /&gt;foreach (@files) {&lt;BR /&gt; mv $_ ${n}$_;&lt;BR /&gt; $n = 0 if ( $n &amp;gt; 48 );&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;Regs David</description>
      <pubDate>Mon, 14 Jul 2003 12:13:27 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/sequencing-script/m-p/3022750#M909397</guid>
      <dc:creator>David_246</dc:creator>
      <dc:date>2003-07-14T12:13:27Z</dc:date>
    </item>
    <item>
      <title>Re: sequencing script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/sequencing-script/m-p/3022751#M909398</link>
      <description>typeset -Z2 N &lt;BR /&gt;for F in $FILE_LIST &lt;BR /&gt;do &lt;BR /&gt;(( N=N+1 )) &lt;BR /&gt;&amp;gt;&amp;gt; &lt;BR /&gt;if [ "N" -gt 49]&lt;BR /&gt;    then&lt;BR /&gt;     N=0&lt;BR /&gt;   fi &lt;BR /&gt;&amp;lt;&amp;lt;&lt;BR /&gt;mv ${F} ${N}${F} &lt;BR /&gt;done &lt;BR /&gt;&lt;BR /&gt;or in perl :&lt;BR /&gt;&lt;BR /&gt;$n=0;&lt;BR /&gt;opendir(DIR, /my/dir);&lt;BR /&gt;@files = grep { /^\./ &amp;amp;&amp;amp; !/^\.\.?$/ } readdir(DIR);&lt;BR /&gt;closedir(DIR);&lt;BR /&gt;&lt;BR /&gt;foreach (@files) {&lt;BR /&gt; $n++;&lt;BR /&gt; mv $_ ${n}$_;&lt;BR /&gt; $n = 0 if ( $n &amp;gt; 48 );&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;Regs David</description>
      <pubDate>Mon, 14 Jul 2003 12:14:33 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/sequencing-script/m-p/3022751#M909398</guid>
      <dc:creator>David_246</dc:creator>
      <dc:date>2003-07-14T12:14:33Z</dc:date>
    </item>
    <item>
      <title>Re: sequencing script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/sequencing-script/m-p/3022752#M909399</link>
      <description>Define your list to be an array then use nested loops to automatically restart to zero.&lt;BR /&gt;&lt;BR /&gt;LIST=( 00, 01, 02.... 49 }&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;typeset -Z2 N &lt;BR /&gt;for F in $FILE_LIST &lt;BR /&gt;do &lt;BR /&gt;&lt;BR /&gt;for x in $LIST&lt;BR /&gt;do&lt;BR /&gt;&lt;BR /&gt;mv ${F} ${N}${F} &lt;BR /&gt;&lt;BR /&gt;done&lt;BR /&gt;(( N=N+1 )) &lt;BR /&gt;done &lt;BR /&gt;</description>
      <pubDate>Mon, 14 Jul 2003 12:22:46 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/sequencing-script/m-p/3022752#M909399</guid>
      <dc:creator>Michael Steele_2</dc:creator>
      <dc:date>2003-07-14T12:22:46Z</dc:date>
    </item>
    <item>
      <title>Re: sequencing script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/sequencing-script/m-p/3022753#M909400</link>
      <description>Sorted now!&lt;BR /&gt;&lt;BR /&gt;Many thanks for all the replies.</description>
      <pubDate>Mon, 14 Jul 2003 12:27:30 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/sequencing-script/m-p/3022753#M909400</guid>
      <dc:creator>Vin_5</dc:creator>
      <dc:date>2003-07-14T12:27:30Z</dc:date>
    </item>
  </channel>
</rss>

