1 Starting bash with the `-posix' command-line option or setting the variable
2 POSIXLY_CORRECT while bash is running will cause bash to conform more
3 closely to the Posix.2 standard by changing the behavior to match that
4 specified by Posix.2 in areas where the bash default differs.
6 The following list is what's changed when `posixly_correct' is enabled:
8 1. When a command in the hash table no longer exists, bash will re-search
9 $PATH to find the new location.
11 2. The >& redirection does not redirect stdout and stderr.
13 3. The message printed by the job control code and builtins when a job
14 exits with a non-zero status is `Done(status)'.
16 4. The <> redirection does not open a file for both stdin and stdout, but
17 rather opens it for read-write on fd 0.
19 5. Reserved words may not be aliased.
21 6. The Posix.2 PS1 and PS2 expansions of `!' -> history number and `!!' -> `!'
24 7. Interactive comments are enabled by default. (Note that this version has
25 them on by default anyway.)
27 8. The Posix.2 startup files are executed ($ENV) rather than the normal bash
30 9. Tilde expansion is only performed on assignments preceding a command name,
31 rather than on all assignment statements on the line.
33 10. The default history file is ~/.sh_history (default value of $HISTFILE).
35 11. The output of `kill -l' prints all the signal names on a single line,
38 12. Non-interactive shells exit if `file' in `. file' is not found.
40 13. Redirection operators do not perform pathname expansion on the word
41 in the redirection unless the shell is interactive
43 14. Function names must be valid shell identifiers. That is, they may not
44 contain characters other than letters, digits, and underscores, and
45 may not start with a digit
47 There is other Posix.2 behavior that bash does not implement. Specifically:
49 1. There are no `special builtins' and `regular builtins'. All builtins
50 are equivalent. This means that:
52 o assignment statements affect the execution environment of all
53 builtins, not just special ones
54 o temporary assignments do not persist after Posix.2 special
56 o Functions are found before Posix.2 special builtins
57 o The shell does not exit upon errors while executing Posix.2
60 2. $LINENO does not represent the line number of a command within a function
62 3. The arithmetic evaluator does not implement the `e ? e1 : e2' conditional