Taking the wrong PATH to the right command
AnthonyEnglish 270000RKFN Visits (5618)
After upgrading from AIX 5.2 to 6.1, a customer tried to run the lsof
The lsof was compiled for AIX 5.2.
The customer tried to run this lsof command from an application GUI.
The solution's obvious, right? Upgrade the lsof command to the version for AIX 6.1. You'll find the links to do that in the article at the end of the page.
However, that lsof upgrade already had been done, and when I logged in via the command line as a different user, I was able to confirm I had the right version of lsof, with no mysterious errors.
The same command gave different results, depending on whether it was run from the GUI or from the command line. Weird, huh?
Actually, if you're a bit of a detective, you will have noted two clues which answer this mystery.
In fact, the reason the same command - lsof - was producing different output was quite simple: it wasn't the same command. When connecting via a GUI, the user was also inheriting all the environmental variables ... including the PATH. The lsof command that turned up first in the user's PATH was, in fact, the old version. When connecting via the command line ... and via a different user, the correct version for AIX 6.1 was being used.
If you want to find out more about the AIX PATH environmental variable, and how to avoid common UNIX/AIX errors, see this article.
There are some free tools for Linux, apps and development when you're on AIX. You'll find more details here.
Incidentally, while you're looking at the PATH for commands, you may be interested in how to use