, , , ,

HP-UX tried using a different approach to loading packages and binaries to run. The traditional method uses /usr/local – the BSD variants use this directory to its fullest extent. The original idea behind /usr/local was that the system file system could be upgraded – or even replaced – and it would not affect added system programs. This extends to /home as well. If /home and /usr/local were separate file systems, then the operating system could be upgraded with impunity.

HP-UX adopted a newer version of this, the /opt directory (for optional). The way HP-UX adopted it (which seems to be not all that unusual) every added program stuffs all of its information under its own directory. For example, /opt/ldapux contains the etc files, lib files, man files, sbin files and so forth for HP-UX LDAP.

In addition to the “new” HP-UX standard (introduced about HP-UX 10) the /usr/local directories remain available and very occasionaly used – but most of what was not to go into /opt but into /usr/local actually wound up going into /usr/contrib/bin. This means that there were generally three locations for all HP-UX binaries:

  • /usr/local
  • /opt
  • /usr/contrib

What’s more, because of the layout of the /opt directories (with a great many /opt/*/bin and /opt/*/sbin directories – as well as a great many /opt/*/lib directories as well) the system PATH variable could be very long.

The actual system PATH is stored in /etc/PATH; each added program option was to update /etc/PATH (and other files in /etc such as SHLIBPATH) to match their directories. The easiest way to reset the path in HP-UX is to use this command:

export PATH=$(cat /etc/PATH)

Then add in any extra locations you want (separated by colons).