ksh.1 (2010 09)
k
ksh(1) ksh(1)
If you move the current directory or one above it,
pwd may not give the correct response. Use the cd
command with a full path name to correct this situation.
Some very old shell scripts contain a caret (
ˆ) as a synonym for the pipe character (|). Note however,
ksh does not recognize the caret as a pipe character.
If a command is piped into a shell command, all variables set in the shell command are lost when the
command completes.
Using the
fc built-in command within a compound command causes the entire command to disappear
from the history file.
The built-in command . file reads the entire file before any commands are executed. Therefore,
alias
and unalias commands in the file do not apply to any functions defined in the file.
Traps are not processed while the shell is waiting for a foreground job. Thus, a trap on
CHLD is not exe-
cuted until the foreground job terminates.
The
export built-in command does not handle arrays properly. Only the first element of an array is
exported to the environment .
Background processes started from a non-interactive shell cannot be accessed by using job control com-
mands.
In an international environment, character ordering is determined by the setting of
LC_COLLATE,rather
than by the binary ordering of character values in the machine collating sequence. This brings with it
certain attendant dangers, particularly when using range expressions in file name generation patterns.
For example, the command,
rm [a-z]*
might be expected to match all file names beginning with a lowercase alphabetic character. However, if
dictionary ordering is specified by
LC_COLLATE, it would also match file names beginning with an
uppercase character (as well as those beginning with accented letters). Conversely, it would fail to match
letters collated after z in languages such as Danish or Norwegian.
The correct (and safe) way to match specific character classes in an international environment is to use a
pattern of the form:
rm [[:lower:]]*
This uses LC_CTYPE to determine character classes and works predictably for all supported languages
and codesets. For shell scripts produced on non-internationalized systems (or without consideration for
the above dangers), it is recommended that they be executed in a non-NLS environment. This requires
that LANG, LC_COLLATE, etc., be set to "C" or not set at all.
Be aware that the value of the
IFS variable in the user’s environment affects the behavior of scripts.
ksh implements command substitution by creating a pipe between itself and the command. If the root
file system is full, the substituted command cannot write to the pipe. As a result, the shell receives no
input from the command, and the result of the substitution is null. In particular, using command substi-
tution for variable assignment under such circumstances results in the variable being silently assigned a
NULL value.
The contents of
here-documents are stored in temporary files named /tmp/shpid.number. After
their usage, an attempt to remove these temporary files occurs. However, because of design limitations,
some of these temporary files may not be removed.
AUTHOR
ksh was developed by AT&T.
FILES
/etc/passwd to find home directories
/etc/profile read to set up system environment
/etc/suid_profile security profile
$HOME/.profile read to set up user’s custom environment
/tmp/sh* for here-documents
SEE ALSO
cat(1), cd(1), echo(1), env(1), getopts(1), kill(1), pwd(1), read(1), test(1), time(1), umask(1), vi(1), dup(2),
exec(2), fork(2), gtty(2), pipe(2), stty(2), umask(2), ulimit(2), wait(2), rand(3C), a.out(4), profile(4),
24 Hewlett-Packard Company − 24 − HP-UX 11i Version 3: September 2010