<?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: PATH Variable Length in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/path-variable-length/m-p/2668479#M50271</link>
    <description>I just tested both 10.20 and 11.x and I got up to 64K before I quit - boring.&lt;BR /&gt;&lt;BR /&gt;PATH=$PATH:$PATH&lt;BR /&gt;echo $PATH|wc&lt;BR /&gt;&lt;BR /&gt;&lt;SOAPBOX&gt;Of course the big QUESTION is why would anyone care? If you have that many "BIN" directories, then you need to rethink your application interface.&lt;/SOAPBOX&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;live free or die&lt;BR /&gt;harry</description>
    <pubDate>Wed, 20 Feb 2002 19:45:53 GMT</pubDate>
    <dc:creator>harry d brown jr</dc:creator>
    <dc:date>2002-02-20T19:45:53Z</dc:date>
    <item>
      <title>PATH Variable Length</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/path-variable-length/m-p/2668477#M50269</link>
      <description>Hello fellow admins&lt;BR /&gt;&lt;BR /&gt;One of my clients asked me a question that I have not been able to find an answer to.&lt;BR /&gt;&lt;BR /&gt;Is there a limit on the lenght that the PATH environment variable can be in HP-UX 10.20?&lt;BR /&gt;&lt;BR /&gt;Thanks.&lt;BR /&gt;&lt;BR /&gt;Tony</description>
      <pubDate>Wed, 20 Feb 2002 19:06:40 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/path-variable-length/m-p/2668477#M50269</guid>
      <dc:creator>Walter Bezdek</dc:creator>
      <dc:date>2002-02-20T19:06:40Z</dc:date>
    </item>
    <item>
      <title>Re: PATH Variable Length</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/path-variable-length/m-p/2668478#M50270</link>
      <description>It depends on the shell you are using, and the OS and hardware.  The c-shell is the only one with true limits: max of 18 characters for a variable name, and 500-something characters in the contents.  The other shells, AFAIK, are limited only by the kernel parameters, which of course are a function of the hardware--chiefly 32 vs 64 bit architecture.  So if you are not careful (and are really sloppy), you can consume your memory and/or swap with a script that uses variables with large contents.&lt;BR /&gt;&lt;BR /&gt;HTH&lt;BR /&gt;mark</description>
      <pubDate>Wed, 20 Feb 2002 19:34:56 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/path-variable-length/m-p/2668478#M50270</guid>
      <dc:creator>Mark Greene_1</dc:creator>
      <dc:date>2002-02-20T19:34:56Z</dc:date>
    </item>
    <item>
      <title>Re: PATH Variable Length</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/path-variable-length/m-p/2668479#M50271</link>
      <description>I just tested both 10.20 and 11.x and I got up to 64K before I quit - boring.&lt;BR /&gt;&lt;BR /&gt;PATH=$PATH:$PATH&lt;BR /&gt;echo $PATH|wc&lt;BR /&gt;&lt;BR /&gt;&lt;SOAPBOX&gt;Of course the big QUESTION is why would anyone care? If you have that many "BIN" directories, then you need to rethink your application interface.&lt;/SOAPBOX&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;live free or die&lt;BR /&gt;harry</description>
      <pubDate>Wed, 20 Feb 2002 19:45:53 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/path-variable-length/m-p/2668479#M50271</guid>
      <dc:creator>harry d brown jr</dc:creator>
      <dc:date>2002-02-20T19:45:53Z</dc:date>
    </item>
    <item>
      <title>Re: PATH Variable Length</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/path-variable-length/m-p/2668480#M50272</link>
      <description>Hi:&lt;BR /&gt;&lt;BR /&gt;In 10.20 there is no inherent limit to PATH as such BUT there is a limit to the total size of the environment variables (of which PATH is but one) and the command line args passed to the exec() system call. Since processes fork() and exec() this becomes the effective limit. &lt;BR /&gt;&lt;BR /&gt;This can be changed by building a new kernel but the total space is fould in a define NCARGS in /usr/include/sys/param.h. The default value is 20480.&lt;BR /&gt;</description>
      <pubDate>Wed, 20 Feb 2002 19:57:01 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/path-variable-length/m-p/2668480#M50272</guid>
      <dc:creator>A. Clay Stephenson</dc:creator>
      <dc:date>2002-02-20T19:57:01Z</dc:date>
    </item>
    <item>
      <title>Re: PATH Variable Length</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/path-variable-length/m-p/2668481#M50273</link>
      <description>Hello,&lt;BR /&gt;&lt;BR /&gt;basically not, if you set it from within a program. But there is a limit to the length of a command line, which restricts the length of your PATH, in case you try to set from command line...&lt;BR /&gt;&lt;BR /&gt;HTH,&lt;BR /&gt;Wodisch</description>
      <pubDate>Wed, 20 Feb 2002 20:18:35 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/path-variable-length/m-p/2668481#M50273</guid>
      <dc:creator>Wodisch</dc:creator>
      <dc:date>2002-02-20T20:18:35Z</dc:date>
    </item>
    <item>
      <title>Re: PATH Variable Length</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/path-variable-length/m-p/2668482#M50274</link>
      <description>The answers were mixed, so I put a call in with HP.  I received the following response from HP:&lt;BR /&gt;&lt;BR /&gt;I checked the max length for the path variable and it is 1024 characters, so we&lt;BR /&gt;should be okay there.  What error message gets reported back when it fails to&lt;BR /&gt;find the executable?  What happens if you move the path to beginning of your&lt;BR /&gt;path variable?  For example. at your command prompt type:&lt;BR /&gt;&lt;BR /&gt;export PATH=/home/joe:$PATH&lt;BR /&gt;&lt;BR /&gt;Note: Replace the "/home/joe" with the path name to the executable you want to&lt;BR /&gt;run.&lt;BR /&gt;&lt;BR /&gt;Thanks to Joseph Tarr at HP for the answer.</description>
      <pubDate>Thu, 21 Feb 2002 15:52:29 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/path-variable-length/m-p/2668482#M50274</guid>
      <dc:creator>Walter Bezdek</dc:creator>
      <dc:date>2002-02-21T15:52:29Z</dc:date>
    </item>
    <item>
      <title>Re: PATH Variable Length</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/path-variable-length/m-p/2668483#M50275</link>
      <description>Hi Anthony,&lt;BR /&gt;&lt;BR /&gt;if you execute a command and the shell tries to find the executable, she reads the PATH-variable from the beginning to the end and looks in each specified directory and seeks the command in it. If the executable is not found, the next directory is checked. If all specified directories are checked, and the command is still not found, the error message:&lt;BR /&gt;&lt;BR /&gt;sh: command_you_wanted_to_execute:   not found&lt;BR /&gt;&lt;BR /&gt;is given. If your PATH-variable is too long, the too_much_directories won't be read and the same error should occur. If you put the directory to the beginning of PATH like descripted, the directory will be checked and the command will be found and executed. &lt;BR /&gt;&lt;BR /&gt;Please remember, when editing the /etc/PATH- file, it has to be only one line, so begin adding directories with "A" out of command mode.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Allways stay on the bright side of life!&lt;BR /&gt;&lt;BR /&gt;Peter</description>
      <pubDate>Thu, 21 Feb 2002 16:04:57 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/path-variable-length/m-p/2668483#M50275</guid>
      <dc:creator>Peter Kloetgen</dc:creator>
      <dc:date>2002-02-21T16:04:57Z</dc:date>
    </item>
    <item>
      <title>Re: PATH Variable Length</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/path-variable-length/m-p/2668484#M50276</link>
      <description>The first 4 replies you got all answered your question, just not the way you wanted.&lt;BR /&gt;&lt;BR /&gt;To recap: The limit is shell and hardware and OS dependant the only shell with an explicit limit is the C-shell, 512 characters on the PATH variable.  All the other shells are limited by the kernel parameters, which are a function of the system being 32 or 64 bit.&lt;BR /&gt;&lt;BR /&gt;The 1024 limit you were told is simply the command line limit, as Wodisch mentioned.  You can exceed this in a script, as Harry demonstrated.  Simply setup a script with two 1024 character long directory paths into variables, and then do:&lt;BR /&gt;&lt;BR /&gt;PATH=$VAR1:$VAR2&lt;BR /&gt;&lt;BR /&gt;and now you have a path variable that is 2048 characters long.&lt;BR /&gt;&lt;BR /&gt;So maybe call the HP tech back and ask him to test it in a script versus just typing it at the command line.&lt;BR /&gt;&lt;BR /&gt;HTH&lt;BR /&gt;mark</description>
      <pubDate>Thu, 21 Feb 2002 16:11:01 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/path-variable-length/m-p/2668484#M50276</guid>
      <dc:creator>Mark Greene_1</dc:creator>
      <dc:date>2002-02-21T16:11:01Z</dc:date>
    </item>
  </channel>
</rss>

