Suppose you’re providing phone support to someone with little experience using the AIX command line. You ask them to enter a simple command such as “ls –l” and then tell you what displays. The message comes back: “ksh: ls-l: not found.”
You might find it frustrating that the person on the other end of the phone missed the space in the command, but spare a thought for that user. After all, it’s not a very user-friendly message, is it?
Perhaps it would be better if you could log in yourself and do the work, but for security or other reasons, that’s sometimes impossible. If your only option is to dictate AIX commands over the phone, here are a few pointers that will ease the pain for both you and the caller you're working with.
Tip 1: AIX is Case Sensitive
“Case sensitive” means that you can’t type an uppercase character (“G”) when you need a lowercase character (“g”). AIX is forgiving in some ways—for example, if you put too many spaces between the words and letters you’re supposed to type—but the words, letters, and symbols themselves have to be spot-on.
Let’s look at the command that recalls all the files in the current directory: ls -l. To spell it out, you'd say: “ls (all lowercase), then a space, then a hyphen followed immediately by the letter l (lowercase), and then Enter.” It’s sometimes helpful to spell out every single keystroke. Note that the command syntax is important in AIX, so:
- ls -l is correct
- LS -L is incorrect (it should be all lowercase)
- ls-l is incorrect (need a space between the ls and the hyphen)
Tip 2: Check Your PATH
Even if your colleague types in the correct command name, the command might not be in the correct path. The PATH environment variable contains a list of the directories to search for the command. So even if the command or script is in some directory, if that directory isn't in the PATH, you’ll either have to change the PATH variable or point explicitly to the correct path when you enter the command.
This is generally more of a problem with scripts, because the directories for standard AIX commands are already likely to be in your PATH.If you’re having trouble explaining to your phone buddy where to find the script, it’s usually best to change the directory to where the script is located and then run the script by entering ./ first, which means “run the version in this directory.”
For example, if a script is in /usr/local/bin and the script name is myscript.sh, use:
If you need to run the script from a different directory than the one you’re in, you can specify its absolute path by using:
Tip 3: Try Using cd One Directory at a Time
If your poor newbie just can’t find the way to the right directory using cd, try using a cd command on one directory at a time. So if this command doesn’t work:
ksh: /usr/lpp/diagnostic/bin: not found
try to break it up into different cd commands. After each cd command, run pwd to display the current directory:
ksh: diagnostic: not found
Aha! We found the problem: It’s “diagnostics” (with an “s” at the end), not “diagnostic.”
Tip 4: Watch Out For Weird Directories
I knew a customer who had one directory called /usr/local/bin and another directory called /usr/local/BIN. You can do that, because AIX is case-sensitive (see Tip #1), but that’s just asking for trouble.
If the user can’t find the right directory, first make sure you’re talking about the same directory. The same thing goes for script names, because scripts tend to have abbreviations in their names, such as “prt” instead of “print.”
As a general rule, it’s wise to avoid directory names that are easily confused. For example, on AIX there’s a temporary directory called /tmp, so it doesn’t help to have another directory called /temp.
Tip 5: Zero Is Not a Letter
Make sure to look out for characters that look like something else. For example, the lowercase letter l is not the number 1, and zero (0) is not an uppercase letter O. You should also take special note of punctuation and unusual characters. For example, in North America, # is called the pound key, but elsewhere, it’s usually known as the hash key. Be aware of these types of differences, particularly when you’re working with someone from a different country or region who might use different terminology.
There are plenty of other ways to simplify dictating keystrokes over the phone, but the most important things to remember are that AIX is case sensitive and syntax is crucial.
Find Out More
The IBM Information Center has information on the AIX PATH environment variable, which specifies which directories to search for a command.