Imported from ../bash-1.14.7.tar.gz.
[platform/upstream/bash.git] / CWRU / POSIX.NOTES
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.
5
6 The following list is what's changed when `posixly_correct' is enabled:
7
8 1.  When a command in the hash table no longer exists, bash will re-search
9     $PATH to find the new location.
10
11 2.  The >& redirection does not redirect stdout and stderr.
12
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)'.
15
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.
18
19 5.  Reserved words may not be aliased.
20
21 6.  The Posix.2 PS1 and PS2 expansions of `!' -> history number and `!!' -> `!'
22     are enabled.
23
24 7.  Interactive comments are enabled by default.  (Note that this version has
25     them on by default anyway.)
26
27 8.  The Posix.2 startup files are executed ($ENV) rather than the normal bash
28     files.
29
30 9.  Tilde expansion is only performed on assignments preceding a command name,
31     rather than on all assignment statements on the line.
32
33 10. The default history file is ~/.sh_history (default value of $HISTFILE).
34
35 11. The output of `kill -l' prints all the signal names on a single line,
36     separated by spaces.
37
38 12. Non-interactive shells exit if `file' in `. file' is not found.
39
40 13. Redirection operators do not perform pathname expansion on the word
41     in the redirection unless the shell is interactive
42
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
46
47 There is other Posix.2 behavior that bash does not implement.  Specifically:
48
49 1.  There are no `special builtins' and `regular builtins'.  All builtins
50     are equivalent.  This means that:
51
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
55           builtins complete
56         o Functions are found before Posix.2 special builtins
57         o The shell does not exit upon errors while executing Posix.2
58           special builtins
59
60 2.  $LINENO does not represent the line number of a command within a function
61
62 3.  The arithmetic evaluator does not implement the `e ? e1 : e2' conditional
63     expression