HP-UX Reference (11i v1 00/12) - 1 User Commands N-Z (vol 2)

__________________________________________________________________________________________________________________________________________________________________________________________________
__________________________________________________________________________________________________________________________________________________________________________________________________
STANDARD Printed by: Nora Chuang [nchuang] STANDARD
/build/1111/BRICK/man1/neqn.1
________________________________________________________________
___ ___
s
sh-posix(1) sh-posix(1)
Using the fc built-in command within a compound command will cause the entire command to disappear
from the history file.
The dot (.) special command, as in . file, reads the entire file before any commands are executed. There-
fore, alias and unalias commands in the file will 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 SIGCHLD is not
executed until the foreground job terminates.
The export special command does not handle arrays properly. Only the first element of an array is
exported to the environment.
Background processes started from a noninteractive shell cannot be accessed with job control commands.
The value of the IFS variable in the user’s environment affects the behavior of scripts.
Collating Order
In an international environment, character ordering is determined by the value of LC_COLLATE ,rather
than by the binary ordering of character values in the machine collating sequence. This brings with it cer-
tain 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 upper-
case character (as well as those beginning with accented letters). Conversely, it would fail to match letters
collated after z in languagessuch as Danish or Norwegian.
The correct (and safe) way to match specific character classes in an international environment is to use a
pattern (see regexp(5)) 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 noninternationalized 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, and so on, be set to C or not set at all.
The history le does not support mixing of locales in the same file. For users of multiple locales, you can
assign a unique history file for each locale by setting HISTFILE as:
HISTFILE=$HOME/.sh_hist_${LANG}
AUTHOR
sh was developed by AT&T, OSF, and HP.
FILES
$HOME/.profile Read to set up user’s custom environment
/etc/passwd To find home directories
/etc/profile Read to set up system environment
/etc/suid_profile
Security profile
/var/tmp/sh* For here-documents if
/var/tmp is accessible
/tmp/sh* For here-documents if
/var/tmp is not accessible
/usr/bin/sh Shell executable program location
SEE ALSO
cat(1), cd(1), command(1), echo(1), ed(1), env(1), getopts(1), kill(1), ln(1), login(1), newgrp(1), printf(1),
pwd(1), read(1), stty(1), test(1), time(1), umask(1), vi(1), dup(2), exec(2), fork(2), pipe(2), stty(2), ulimit(2),
umask(2), wait(2), rand(3C), a.out(4), profile(4), environ(5), lang(5), regexp(5), signal(5).
STANDARDS CONFORMANCE
sh: SVID2, SVID3, XPG2, XPG3, XPG4, POSIX.2
.: SVID2, SVID3, XPG2, XPG3, XPG4, POSIX.2
:: SVID2, SVID3, XPG2, XPG3, XPG4, POSIX.2
break: SVID2, SVID3, XPG2, XPG3, XPG4, POSIX.2
case: SVID2, SVID3, XPG2, XPG3, XPG4, POSIX.2
Section 1870 26 HP-UX Release 11i: December 2000
___
___