- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- PATH Variable Length
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-20-2002 11:06 AM
02-20-2002 11:06 AM
One of my clients asked me a question that I have not been able to find an answer to.
Is there a limit on the lenght that the PATH environment variable can be in HP-UX 10.20?
Thanks.
Tony
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-20-2002 11:34 AM
02-20-2002 11:34 AM
Re: PATH Variable Length
HTH
mark
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-20-2002 11:45 AM
02-20-2002 11:45 AM
Re: PATH Variable Length
PATH=$PATH:$PATH
echo $PATH|wc
live free or die
harry
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-20-2002 11:57 AM
02-20-2002 11:57 AM
Re: PATH Variable Length
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.
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-20-2002 12:18 PM
02-20-2002 12:18 PM
Re: PATH Variable Length
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...
HTH,
Wodisch
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-21-2002 07:52 AM
02-21-2002 07:52 AM
Re: PATH Variable Length
I checked the max length for the path variable and it is 1024 characters, so we
should be okay there. What error message gets reported back when it fails to
find the executable? What happens if you move the path to beginning of your
path variable? For example. at your command prompt type:
export PATH=/home/joe:$PATH
Note: Replace the "/home/joe" with the path name to the executable you want to
run.
Thanks to Joseph Tarr at HP for the answer.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-21-2002 08:04 AM
02-21-2002 08:04 AM
Re: PATH Variable Length
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:
sh: command_you_wanted_to_execute: not found
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.
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.
Allways stay on the bright side of life!
Peter
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-21-2002 08:11 AM
02-21-2002 08:11 AM
SolutionTo 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.
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:
PATH=$VAR1:$VAR2
and now you have a path variable that is 2048 characters long.
So maybe call the HP tech back and ask him to test it in a script versus just typing it at the command line.
HTH
mark