Chapter 6: Bash Features

96

39. When the set builtin is invoked without options, it does not display shell function names and definitions.

40. When the set builtin is invoked without options, it displays variable values without quotes, unless they contain shell metacharacters, even if the result contains nonprinting characters.

41. When the cd builtin is invoked in logical mode, and the pathname constructed from

$PWD and the directory name supplied as an argument does not refer to an existing directory, cd will fail instead of falling back to physical mode.

42. The pwd builtin verifies that the value it prints is the same as the current directory, even if it is not asked to check the file system with the -P option.

43. When listing the history, the fc builtin does not include an indication of whether or not a history entry has been modified.

44. The default editor used by fc is ed.

45. The type and command builtins will not report a non-executable file as having been found, though the shell will attempt to execute such a file if it is the only so-named file found in $PATH.

46. The vi editing mode will invoke the vi editor directly when the ā€˜v’ command is run, instead of checking $VISUAL and $EDITOR.

47. When the xpg_echo option is enabled, Bash does not attempt to interpret any ar- guments to echo as options. Each argument is displayed, after escape characters are converted.

48. The ulimit builtin uses a block size of 512 bytes for the -c and -f options.

49. The arrival of SIGCHLD when a trap is set on SIGCHLD does not interrupt the wait builtin and cause it to return immediately. The trap command is run once for each child that exits.

50. The read builtin may be interrupted by a signal for which a trap has been set. If Bash receives a trapped signal while executing read, the trap handler executes and read returns an exit status greater than 128.

There is other posix behavior that Bash does not implement by default even when in posix mode. Specifically:

1. The fc builtin checks $EDITOR as a program to edit history entries if FCEDIT is unset, rather than defaulting directly to ed. fc uses ed if EDITOR is unset.

2. As noted above, Bash requires the xpg_echo option to be enabled for the echo builtin to be fully conformant.

Bash can be configured to be posix-conformant by default, by specifying the --enable- strict-posix-default to configure when building (see Section 10.8 [Optional Features], page 140).