After upgrading from AIX 5.2 to 6.1, a customer tried to run the lsof command (that's the command to list open files on the system) and came across this error:
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.
- Logged in via command line
- ... as a different user
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 aliases to save your fingers from typing in a whole command.