<?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: Positional characters in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/positional-characters/m-p/2533135#M25510</link>
    <description>Hi Sanjay:&lt;BR /&gt;&lt;BR /&gt;# getconf ARG_MAX&lt;BR /&gt;&lt;BR /&gt;will return the maximum number of characters allowed in a argument list.  Usually on 10.20 this is aboout 20,478.  On 11.x this limit is 2,048,000.  If you are are 10.x you can change the kernel parameter 'large_ncargs_enabled' to true to enable a similar limit as seen on 11.x.  To do so requires patch PHKL_10177 on 800-series servers.&lt;BR /&gt;&lt;BR /&gt;...JRF... &lt;BR /&gt;&lt;BR /&gt;</description>
    <pubDate>Fri, 25 May 2001 20:50:16 GMT</pubDate>
    <dc:creator>James R. Ferguson</dc:creator>
    <dc:date>2001-05-25T20:50:16Z</dc:date>
    <item>
      <title>Positional characters</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/positional-characters/m-p/2533130#M25505</link>
      <description>Hello,&lt;BR /&gt;Is there a limit to how many positional characters I can have for a script?  Where can I find that out?  Can I increase it?  I need to run a script that would have about 13000 positional characters!!!&lt;BR /&gt;&lt;BR /&gt;Thanks,&lt;BR /&gt;Sanjay</description>
      <pubDate>Fri, 25 May 2001 20:10:49 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/positional-characters/m-p/2533130#M25505</guid>
      <dc:creator>Sanjay Tailor</dc:creator>
      <dc:date>2001-05-25T20:10:49Z</dc:date>
    </item>
    <item>
      <title>Re: Positional characters</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/positional-characters/m-p/2533131#M25506</link>
      <description>Hi Sanjay,&lt;BR /&gt;&lt;BR /&gt;I can't tell exactly what you are trying to do.&lt;BR /&gt;If you are asking can the shell handle lines of 13000 character, then yes. Cut can also process lines that long. Awk cannot (I think the limit is about 3000 chars/lines depending upon implementation. If I were processing input records of that size, I think I would use&lt;BR /&gt;'gawk' from &lt;A href="http://hpux.cs.utah.edu." target="_blank"&gt;http://hpux.cs.utah.edu.&lt;/A&gt; Gnu's version of awk has options for specifying maximum input record size.&lt;BR /&gt;&lt;BR /&gt;Clay&lt;BR /&gt;</description>
      <pubDate>Fri, 25 May 2001 20:29:38 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/positional-characters/m-p/2533131#M25506</guid>
      <dc:creator>A. Clay Stephenson</dc:creator>
      <dc:date>2001-05-25T20:29:38Z</dc:date>
    </item>
    <item>
      <title>Re: Positional characters</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/positional-characters/m-p/2533132#M25507</link>
      <description>Clay,&lt;BR /&gt;&lt;BR /&gt;Thanks for your reply.  What I need to do is run a script like this:&lt;BR /&gt;scriptname 1 2 3 4 5 6 7 8 9 ... 13000 ...&lt;BR /&gt;&lt;BR /&gt;When I try to run this I get an error message saying parameter list too long.&lt;BR /&gt;&lt;BR /&gt;Unless there is a better way to do this?  My positional characters are stored in a file.  Is there a way to have my script read one line in the file, process and then loop back to the second line, process and so on until the EOF?  That would or might work better?&lt;BR /&gt;&lt;BR /&gt;Right now I am doing scriptname `cat filename` and I am getting the error.&lt;BR /&gt;&lt;BR /&gt;Thanks,&lt;BR /&gt;Sanjay</description>
      <pubDate>Fri, 25 May 2001 20:40:16 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/positional-characters/m-p/2533132#M25507</guid>
      <dc:creator>Sanjay Tailor</dc:creator>
      <dc:date>2001-05-25T20:40:16Z</dc:date>
    </item>
    <item>
      <title>Re: Positional characters</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/positional-characters/m-p/2533133#M25508</link>
      <description>Hi Sanjay&lt;BR /&gt;&lt;BR /&gt;I think what you are looking at is handling 13000 characters in aline , then your answer is yes. Please go ahead and use it.&lt;BR /&gt;&lt;BR /&gt;Manoj Srivastava</description>
      <pubDate>Fri, 25 May 2001 20:40:54 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/positional-characters/m-p/2533133#M25508</guid>
      <dc:creator>MANOJ SRIVASTAVA</dc:creator>
      <dc:date>2001-05-25T20:40:54Z</dc:date>
    </item>
    <item>
      <title>Re: Positional characters</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/positional-characters/m-p/2533134#M25509</link>
      <description>Sanjay,&lt;BR /&gt;&lt;BR /&gt;Try this:&lt;BR /&gt;&lt;BR /&gt;cat filename | while read -r line&lt;BR /&gt;do&lt;BR /&gt;       &lt;HERE do="" what="" you="" want="" with=""&gt;&lt;BR /&gt;done&lt;BR /&gt;&lt;BR /&gt;HTH&lt;/HERE&gt;</description>
      <pubDate>Fri, 25 May 2001 20:49:09 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/positional-characters/m-p/2533134#M25509</guid>
      <dc:creator>Mladen Despic</dc:creator>
      <dc:date>2001-05-25T20:49:09Z</dc:date>
    </item>
    <item>
      <title>Re: Positional characters</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/positional-characters/m-p/2533135#M25510</link>
      <description>Hi Sanjay:&lt;BR /&gt;&lt;BR /&gt;# getconf ARG_MAX&lt;BR /&gt;&lt;BR /&gt;will return the maximum number of characters allowed in a argument list.  Usually on 10.20 this is aboout 20,478.  On 11.x this limit is 2,048,000.  If you are are 10.x you can change the kernel parameter 'large_ncargs_enabled' to true to enable a similar limit as seen on 11.x.  To do so requires patch PHKL_10177 on 800-series servers.&lt;BR /&gt;&lt;BR /&gt;...JRF... &lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Fri, 25 May 2001 20:50:16 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/positional-characters/m-p/2533135#M25510</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2001-05-25T20:50:16Z</dc:date>
    </item>
    <item>
      <title>Re: Positional characters</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/positional-characters/m-p/2533136#M25511</link>
      <description>Hello,&lt;BR /&gt;&lt;BR /&gt;The cat filename | while read -r line&lt;BR /&gt;&lt;BR /&gt;seems to have worked.  I am testing it now.&lt;BR /&gt;&lt;BR /&gt;The ARG_MAX was also 20478 but I don't think I want to reconfigure my kernel for that!!!  Good to know for the future.&lt;BR /&gt;&lt;BR /&gt;Thanks,&lt;BR /&gt;Sanjay</description>
      <pubDate>Fri, 25 May 2001 21:05:00 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/positional-characters/m-p/2533136#M25511</guid>
      <dc:creator>Sanjay Tailor</dc:creator>
      <dc:date>2001-05-25T21:05:00Z</dc:date>
    </item>
    <item>
      <title>Re: Positional characters</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/positional-characters/m-p/2533137#M25512</link>
      <description>Hi Sanjay,&lt;BR /&gt;&lt;BR /&gt;Ok I see the problem. First, be aware that aside from arg list too long errors, you can only directly address $1 through $9. You can then do a shift 9 and address the next 9 positional vars as $1 - $9.&lt;BR /&gt;&lt;BR /&gt;You can make the shell read one line at a time. There are two basic techniques:&lt;BR /&gt;&lt;BR /&gt;F=/tmp/myfile&lt;BR /&gt;cat ${F} | while read X&lt;BR /&gt;  do&lt;BR /&gt;     echo "${X}"&lt;BR /&gt;  done&lt;BR /&gt;&lt;BR /&gt;Sometimes this doesn't work well because you are executing with a pipe. Method 2 uses file descriptor reads and occurs in the foreground.&lt;BR /&gt;It's a little obscure but it's the weapon of choice.&lt;BR /&gt;&lt;BR /&gt;F=/tmp/myfile&lt;BR /&gt;exec 9&amp;lt;$F&lt;BR /&gt;#avoid fdes 0,1,2 stdin,stdout,stderr - my &lt;BR /&gt;#convention is 9&lt;BR /&gt;X=`line &amp;lt;&amp;amp;9`&lt;BR /&gt;STAT=$?&lt;BR /&gt;while [ ${STAT} -eq 0 ]&lt;BR /&gt;  do&lt;BR /&gt;     echo "${X}"&lt;BR /&gt;     X=`line &amp;lt;&amp;amp;9`&lt;BR /&gt;     STAT=$?&lt;BR /&gt;  done&lt;BR /&gt;&lt;BR /&gt;Hope this helps, Clay&lt;BR /&gt;</description>
      <pubDate>Fri, 25 May 2001 21:12:19 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/positional-characters/m-p/2533137#M25512</guid>
      <dc:creator>A. Clay Stephenson</dc:creator>
      <dc:date>2001-05-25T21:12:19Z</dc:date>
    </item>
    <item>
      <title>Re: Positional characters</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/positional-characters/m-p/2533138#M25513</link>
      <description>&lt;BR /&gt;I cant understand why that abuse of piped cat:&lt;BR /&gt;&lt;BR /&gt;cat file | while read line&lt;BR /&gt;do &lt;BR /&gt;xx&lt;BR /&gt;done&lt;BR /&gt;&lt;BR /&gt;is similar to&lt;BR /&gt;&lt;BR /&gt;while read line&lt;BR /&gt;do&lt;BR /&gt;x&lt;BR /&gt;done &amp;lt; file&lt;BR /&gt;&lt;BR /&gt;but this syntax not use 2 process (with 3 standard open file) and  1 pipe to do exactly the same.&lt;BR /&gt;&lt;BR /&gt;About of 13000 parameters... and cat:&lt;BR /&gt;&lt;BR /&gt;think that sh must create a new process for `cat file` first, store in memory all data and then evaluate all parameters. It need lots of resources that can be avoided. &lt;BR /&gt;&lt;BR /&gt; &lt;BR /&gt;</description>
      <pubDate>Fri, 25 May 2001 23:55:23 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/positional-characters/m-p/2533138#M25513</guid>
      <dc:creator>Carlos Fernandez Riera</dc:creator>
      <dc:date>2001-05-25T23:55:23Z</dc:date>
    </item>
    <item>
      <title>Re: Positional characters</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/positional-characters/m-p/2533139#M25514</link>
      <description>Sanjay,&lt;BR /&gt;&lt;BR /&gt;If you ever need to reference positional parameters beyond $9, I think you can use {},&lt;BR /&gt;e.g, ${10} , ${11} , etc.&lt;BR /&gt;&lt;BR /&gt;Another useful command is 'shift' as Clay has mentioned.  &lt;BR /&gt;&lt;BR /&gt;Enjoy the scripting.  Regards,&lt;BR /&gt;&lt;BR /&gt;Mladen</description>
      <pubDate>Sat, 26 May 2001 04:56:29 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/positional-characters/m-p/2533139#M25514</guid>
      <dc:creator>Mladen Despic</dc:creator>
      <dc:date>2001-05-26T04:56:29Z</dc:date>
    </item>
  </channel>
</rss>

