sh-posix.1 (2010 09)
s
sh-posix(1) sh-posix(1)
^M Execute the current line, regardless of mode (return).
# Insert a # at the beginning of the current line and after each embedded newline,
and execute the line. Useful for inserting the current command line in the history
list without executing it.
= List the file names that match the current word if an asterisk were appended to it.
@letter Search your alias list for an alias with the name
_letter (underscore letter). If an
alias of this name is defined, its value is executed as a command sequence on the
current line. This provides a simple macro capability.
EXTERNAL INFLUENCES
For information about the UNIX Standard environment, see standards (5).
Environment Variables
LC_COLLATE determines the collating sequence used in evaluating pattern matching notation for file
name generation. If it is not defined or is empty, it defaults to the value of
LANG.
LC_CTYPE determines the classification of characters as letters, and the characters matched by charac-
ter class expressions in pattern matching notation. If it is not defined or is empty, it defaults to the value
of LANG.
If
LANG is not defined or is empty, it defaults to C (see lang(5)).
If any internationalization variable contains an invalid value, they all default to
C (see environ (5)).
International Code Set Support
Single- and multibyte character code sets are supported.
RETURN VALUE
Errors detected by the shell, such as syntax errors, cause the shell to return a nonzero exit status. Other-
wise, the shell returns the exit status of the last command executed. See also the
exit
special command.
If the shell is being used noninteractively, the execution of the shell file is abandoned. Runtime errors
detected by the shell are reported by printing the command or function name and the error condition. If
the line number on which the error occurred is greater than one, the line number is also printed in brack-
ets (
[]) after the command or function name.
WARNINGS
Some file descriptors are used internally by the POSIX shell. For HP-UX releases 10.10 and beyond, file
descriptors 24 through 30 are reserved. HP-UX releases 10.00 and 10.01 reserve descriptors 54 through
60. Applications using these and forking a subshell should not depend upon them surviving in the sub-
shell or its descendants.
If a command that is a tracked alias is executed, and a command with the same name is installed in a
directory in the search path before the directory where the original command was found, the shell will
continue to load and execute the original command. Use the -t option of the alias command to correct
this situation.
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 use a caret (
ˆ) as a synonym for the pipe character (|). sh 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 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.
Therefore, 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.
26 Hewlett-Packard Company − 26 − HP-UX 11i Version 3: September 2010