HP-UX HB v13.00 Ch-11 - Software Development

HP-UX Handbook Rev 13.00 Page 45 (of 101)
Chapter 11 Software Development
October 29, 2013
There is a special version of the POSIX shell available on HP-UX, /sbin/sh. It differs from
/usr/bin/sh in the way it was linked. /sbin/sh is completely archive bound. It is strongly
recommended to use it as the login shell of the root user because it doesn't need shared libraries
for execution. If e.g. the file system /usr cannot be mounted, /sbin/sh is the only shell that will
still work.
To display special characters like German umlauts, the shell as well as the terminal that displays
the shell output must be prepared for this. When using a terminal emulation like hpterm, dtterm
or xterm, both terminal and shell must use the same character encoding. This can be achieved by
setting the LC_ALL environment variable appropriately before starting the terminal, e.g.
# export LC_ALL=de_DE.roman8
Then the terminal emulation will use the correct font and the shell will use the correct character
encoding. With real terminals, additional actions might be required to display special characters.
See the terminal’s manual.
In the statically linked /sbin/sh no umlauts can be displayed.
The POSIX shell is the default shell as of HP-UX 11i. All the HP-UX startup scripts use this
shell. Its manual page is ‘man sh-posix’.
Korn Shell
The Korn shell is a superset of the Bourne-shell, featuring history mechanism and job control
among other enhanced functions. Its functionality is very similar to the POSIX-shell.
Restricted Shell
This is in fact the POSIX shell, but when invoked as rsh, it will apply several restrictions to the
user’s capabilities, so that only a limited set of commands can be executed. rsh makes sense
only if specified in /etc/passwd as the user’s login shell, to prevent the user from escaping out
of rsh. Details about the restrictions of rsh can be found in the manpage of sh-posix(1) in the
section “rsh Restrictions”. There is also a restricted version of the korn shell available with the
name rksh(1).
C Shell
The C shell allows C-style scripts. This does not mean it can interpret C programs, but the syntax
of C shell commands and scripts is similar to C programs.
Key Shell