diff -Nrc2 bash-2.01.1/CHANGES bash-2.02/CHANGES *** bash-2.01.1/CHANGES Mon Sep 22 12:53:08 1997 --- bash-2.02/CHANGES Wed Apr 15 10:26:03 1998 *************** *** 1,2 **** --- 1,385 ---- + This document details the changes between this version, bash-2.02-beta2, + and the previous version, bash-2.02-beta1. + + 1. Changes to Bash + + a. A bug was fixed that caused the terminal process group to be set + incorrectly when performing command substitution of builtins in a + pipeline. + + ------------------------------------------------------------------------------ + This document details the changes between this version, bash-2.02-beta2, + and the previous version, bash-2.02-beta1. + + 1. Changes to Bash + + a. Attempting to `wait' for stopped jobs now generates a warning message. + + b. Pipelines which exit due to SIGPIPE in non-interactive shells are now + not reported if the shell is compiled -DDONT_REPORT_SIGPIPE. + + c. Some changes were made to builtins/psize.sh and support/bashbug.sh to + attempt to avoid some /tmp file races and surreptitious file + substitutions. + + d. Fixed a bug that caused the shell not to compile if configured with + dparen arithmetic but without aliases. + + e. Fixed a bug that caused the input stream to be switched when assigning + empty arrays with `bash -c'. + + f. A bug was fixed in the readline expansion glue code that caused bash to + dump core when expanding lines with an unclosed single quote. + + g. A fix was made to the `cd' builtin so that using a non-empty directory + from $CDPATH results in an absolute pathname of the new current working + directory to be displayed after the current directory is changed. + + h. Fixed a bug in the variable assignment code that caused the shell to + dump core when referencing an unset variable with `set -u' enabled in + an assignment statement preceding a command. + + i. Fixed a bug in the exit trap code that caused reserved words to not be + recognized under certain circumstances. + + j. Fixed a bug in the parameter pattern substitution code so that quote + removal is performed. + + k. The shell should now configure correctly on Apple Rhapsody systems. + + l. The `kill' builtin now prints a usage message if it is not passed any + arguments. + + ------------------------------------------------------------------------------ + This document details the changes between this version, bash-2.02-beta1, + and the previous version, bash-2.02-alpha1. + + 1. Changes to Bash + + a. A few compilation bugs were fixed in the new extended globbing code. + + b. Executing arithmetic commands now sets the command name to `((' so + error messages look right. + + c. Fixed some build problems with various configuration options. + + d. The `printf' builtin now aborts immediately if an illegal format + character is encountered. + + e. The code that creates here-documents now behaves better if the file it's + trying to create already exists for some reason. + + f. Fixed a problem with the extended globbing code that made patterns like + `x+*' expand incorrectly. + + g. The prompt string expansion code no longer quotes tildes with backslashes. + + h. The bash getcwd() implementation in lib/sh/getcwd.c now behaves better in + the presence of lstat(2) failures. + + i. Fixed a bug with strsub() that caused core dumps when executing `fc -s'. + + j. The mail checking code now ensures that it has a valid default mailpath. + + k. A bug was fixed that caused local variables to be unset inappropriately + when sourcing a script from within another sourced script. + + l. A bug was fixed in the history saving code so that functions are saved + in the history list correctly if `cmdhist' is enabled, but `lithist' + is not. + + m. A bug was fixed that caused printf overflows when displaying error + messages. + + n. It should be easier to build the loadble builtins in examples/loadables, + though some manual editing of the generated Makefile is still required. + + o. The user's primary group is now always ${GROUPS[0]}. + + p. Some updates were made to support/config.guess from the GNU master copy. + + q. Some changes were made to the autoconf support for Solaris 2.6 large + files. + + r. The `command' builtins now does the right thing when confstr(3) cannot + find a value for _CS_PATH. + + s. Extended globbing expressions like `*.!(c)' are not history expanded if + `extglob' is enabled. + + t. Using the `-P' option to `cd' will force the value that is assigned to + PWD to not contain any symbolic links. + + 2. Changes to Readline + + a. The code that prints completion listings now behaves better if one or + more of the filenames contains non-printable characters. + + b. The time delay when showing matching parentheses is now 0.5 seconds. + + ------------------------------------------------------------------------------ + This document details the changes between this version, bash-2.02-alpha1, + and the previous version, bash-2.01.1-release. + + 1. Changes to Bash + + a. OS-specific configuration changes for: BSD/OS 3.x, Minix 2.x, + Solaris 2.6, SINIX SVR4. + + b. Changes were made to the generated `info' files so that `install-info' + works correctly. + + c. PWD is now auto-exported. + + d. A fix was made to the pipeline code to make sure that the shell forks + to execute simple commands consisting solely of assignment statements. + + e. Changes to the test suite for systems with 14-character filenames. + + f. The default sizes of some internal hash tables have been made smaller + to reduce the shell's memory footprint. + + g. The `((...))' arithmetic command is now executed directly instead of + being translated into `let "..."'. + + h. Fixes were made to the expansion code so that "$*", "$@", "${array[@]}", + and "${array[@]}" expand correctly when IFS does not contain a space + character, is unset, or is set to NULL. + + i. The indirect expansion code (${!var}) was changed so that the only + valid values of `var' are variable names, positional parameters, `#', + `@', and `*'. + + j. An arithmetic expression error in a $((...)) expansion now causes a + non-interactive shell running in posix mode to exit. + + k. Compound array assignment now splits the words within the parentheses + on shell metacharacters like the parser would before expansing them + and performing the assignment. This is for compatibility with ksh-93. + + l. The internal shell backslash-quoting code (used in the output of `set' + and completion) now quotes tildes if they appear at the start of the + string or after a `=' or `:'. + + m. A couple of bugs with `shopt -o' were fixed. + + n. `bash +o' now displays the same output as `set +o' before starting an + interactive shell. + + o. A bug that caused command substitution and the `eval' builtin to + occasionally free memory twice when an error was encountered was fixed. + + p. The filename globbing code no longer requires read permission for a + directory when the filename to be matched does not contain any globbing + characters, as POSIX.2 specifies. + + q. A bug was fixed so that the job containing the last asynchronous + process is not removed from the job table until a `wait' is executed + for that process or another asynchronous process is started. This + satisfies a POSIX.2 requirement. + + r. A `select' bug was fixed so that a non-numeric user response is treated + the same as a numeric response that is out of range. + + s. The shell no longer parses the value of SHELLOPTS from the environment + if it is restricted, running setuid, or running in `privileged mode'. + + t. Fixes were made to enable large file support on systems such as + Solaris 2.6, where the size of a file may be larger than can be held + in an `int'. + + u. The filename hashing code was fixed to not add `./' to the beginning of + filenames which already begin with `./'. + + v. The configure script was changed so that the GNU termcap library is not + compiled in if `prefer-curses' has been specified. + + w. HISTCONTROL and HISTIGNORE are no longer applied to the second and + subsequent lines of a multi-line command. + + x. A fix was made to `disown' so that it does a better job of catching + out-of-range jobs. + + y. Non-interactive shells no longer report the status of processes terminated + due to SIGINT, even if the standard output is a terminal. + + z. A bug that caused the output of `jobs' to have extra carriage returns + was fixed. + + aa. A bug that caused PIPESTATUS to not be set when builtins or shell + functions were executed in the foreground was fixed. + + bb. Bash now attempts to detect when it is being run by sshd, and treats + that case identically to being run by rshd. + + cc. A bug that caused `set -a' to export SHELLOPTS when one of the shell + options was changed was fixed. + + dd. The `kill' builtin now disallows empty or missing process id arguments + instead of treating them as identical to `0', which means the current + process. + + ee. `var=value declare -x var' now behaves identically to + `var=value export var'. Similarly for `var=value declare -r var' and + `var=value readonly var'. + + ff. A few memory leaks were fixed. + + gg. `alias' and `unalias' now print error messages when passed an argument + that is not an alias for printing or deletion, even when the shell is + not interactive, as POSIX.2 specifies. + + hh. `alias' and `alias -p' now return a status of 0 when no aliases are + defined, as POSIX.2 specifes. + + ii. `cd -' now prints the pathname of the new working directory if the shell + is interactive. + + jj. A fix was made so that the code that binds $PWD now copes with getcwd() + returning NULL. + + kk. `unset' now checks whether or not a function name it's trying to unset + is a valid shell identifier only when the shell is running in posix mode. + + ll. A change was made to the code that generates filenames for here documents + to make them less prone to name collisions. + + mm. The parser was changed so that `time' is recognized as a reserved word + only at the beginning of a pipeline. + + nn. The pathname canonicalization code was changed so that `//' is converted + into `/', but all other pathnames beginning with `//' are left alone, as + POSIX.2 specifies. + + oo. The `logout' builtin will no longer exit a non-interactive non-login + shell. + + 2. Changes to Readline + + a. Fixed a problem in the readline test program rltest.c that caused a core + dump. + + b. The code that handles parser directives in inputrc files now displays + more error messages. + + c. The history expansion code was fixed so that the appearance of the + history comment character at the beginning of a word inhibits history + expansion for that word and the rest of the input line. + + 3. New Features in Bash + + a. A new version of malloc, based on the older GNU malloc, that has many + changes, is more page-based, is more conservative with memory usage, + and does not `orphan' large blocks when they are freed. + + b. A new version of gmalloc, based on the old GLIBC malloc, with many + changes and range checking included by default. + + c. A new implementation of fnmatch(3) that includes full POSIX.2 Basic + Regular Expression matching, including character classes, collating + symbols, equivalence classes, and support for case-insensitive pattern + matching. + + d. ksh-88 egrep-style extended pattern matching ([@+*?!](patlist)) has been + implemented, controlled by a new `shopt' option, `extglob'. + + e. There is a new ksh-like `[[' compound command, which implements + extended `test' functionality. + + f. There is a new `printf' builtin, implemented according to the POSIX.2 + specification. + + g. There is a new feature for command substitution: $(< filename) now expands + to the contents of `filename', with any trailing newlines removed + (equivalent to $(cat filename)). + + h. There are new tilde prefixes which expand to directories from the + directory stack. + + i. There is a new `**' arithmetic operator to do exponentiation. + + j. There are new configuration options to control how bash is linked: + `--enable-profiling', to allow bash to be profiled with gprof, and + `--enable-static-link', to allow bash to be linked statically. + + k. There is a new configuration option, `--enable-cond-command', which + controls whether or not the `[[' command is included. It is on by + default. + + l. There is a new configuration option, `--enable-extended-glob', which + controls whether or not the ksh extended globbing feature is included. + It is enabled by default. + + m. There is a new configuration #define in config.h.top that, when enabled, + will cause all login shells to source /etc/profile and one of the user- + specific login shell startup files, whether or not the shell is + interactive. + + n. There is a new invocation option, `--dump-po-strings', to dump + a shell script's translatable strings ($"...") in GNU `po' format. + + o. There is a new `shopt' option, `nocaseglob', to enable case-insensitive + pattern matching when globbing filenames and using the `case' construct. + + p. There is a new `shopt' option, `huponexit', which, when enabled, causes + the shell to send SIGHUP to all jobs when an interactive login shell + exits. + + q. `bind' has a new `-u' option, which takes a readline function name as an + argument and unbinds all key sequences bound to that function in a + specified keymap. + + r. `disown' now has `-a' and `-r' options, to limit operation to all jobs + and running jobs, respectively. + + s. The `shopt' `-p' option now causes output to be displayed in a reusable + format. + + t. `test' has a new `-N' option, which returns true if the filename argument + has been modified since it was last accessed. + + u. `umask' now has a `-p' option to print output in a reusable format. + + v. A new escape sequence, `\xNNN', has been added to the `echo -e' and $'...' + translation code. It expands to the character whose ascii code is NNN + in hexadecimal. + + w. The prompt string expansion code has a new `\r' escape sequence. + + x. The shell may now be cross-compiled for the CYGWIN32 environment on + a Unix machine. + + 4. New Features in Readline + + a. There is now an option for `iterative' yank-last-arg handline, so a user + can keep entering `M-.', yanking the last argument of successive history + lines. + + b. New variable, `print-completions-horizontally', which causes completion + matches to be displayed across the screen (like `ls -x') rather than up + and down the screen (like `ls'). + + c. New variable, `completion-ignore-case', which causes filename completion + and matching to be performed case-insensitively. + + d. There is a new bindable command, `magic-space', which causes history + expansion to be performed on the current readline buffer and a space to + be inserted into the result. + + e. There is a new bindable command, `menu-complete', which enables tcsh-like + menu completion (successive executions of menu-complete insert a single + completion match, cycling through the list of possible completions). + + f. There is a new bindable command, `paste-from-clipboard', for use on Win32 + systems, to insert the text from the Win32 clipboard into the editing + buffer. + + g. The key sequence translation code now understands printf-style backslash + escape sequences, including \NNN octal escapes. These escape sequences + may be used in key sequence definitions or macro values. + + h. An `$include' inputrc file parser directive has been added. + + ------------------------------------------------------------------------------ This document details the changes between this version, bash-2.01.1-release, and the previous version, bash-2.01-release. diff -Nrc2 bash-2.01.1/COMPAT bash-2.02/COMPAT *** bash-2.01.1/COMPAT Fri Apr 11 16:58:48 1997 --- bash-2.02/COMPAT Mon Jul 28 13:36:52 1997 *************** *** 102,103 **** --- 102,117 ---- alias ulimit="ulimit -S" + 9. Bash-2.01 uses a new quoting syntax, $'...' to do ANSI-C string + translation. Backslash-escaped characters in ... are expanded and + replaced as specified by the ANSI C standard. + + 10. The sourcing of startup files has changed somewhat. This is explained + more completely in the INVOCATION section of the manual page. + + A non-interactive shell not named `sh' and not in posix mode reads + and executes commands from the file named by $BASH_ENV. A + non-interactive shell started by `su' and not in posix mode will read + startup files. No other non-interactive shells read any startup files. + + An interactive shell started in posix mode reads and executes commands + from the file named by $ENV. diff -Nrc2 bash-2.01.1/COPYING bash-2.02/COPYING *** bash-2.01.1/COPYING Tue Jun 18 11:55:38 1996 --- bash-2.02/COPYING Mon Jul 7 17:03:17 1997 *************** *** 3,7 **** Copyright (C) 1989, 1991 Free Software Foundation, Inc. ! 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. --- 3,7 ---- Copyright (C) 1989, 1991 Free Software Foundation, Inc. ! 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. diff -Nrc2 bash-2.01.1/CWRU/PLATFORMS bash-2.02/CWRU/PLATFORMS *** bash-2.01.1/CWRU/PLATFORMS Tue Mar 11 13:52:20 1997 --- bash-2.02/CWRU/PLATFORMS Wed Jun 4 11:02:58 1997 *************** *** 7,11 **** SunOS 5.5 BSDI BSD/OS 2.1 ! FreeBSD 2.1.7 NetBSD 1.2 AIX 4.2 --- 7,11 ---- SunOS 5.5 BSDI BSD/OS 2.1 ! FreeBSD 2.2 NetBSD 1.2 AIX 4.2 diff -Nrc2 bash-2.01.1/CWRU/POSIX.NOTES bash-2.02/CWRU/POSIX.NOTES *** bash-2.01.1/CWRU/POSIX.NOTES Tue Mar 25 11:39:25 1997 --- bash-2.02/CWRU/POSIX.NOTES Tue Sep 23 13:39:25 1997 *************** *** 22,27 **** 5. The POSIX.2 `PS1' and `PS2' expansions of `!' to the history number and `!!' to `!' are enabled, and parameter expansion is ! performed on the value regardless of the setting of the ! `promptvars' option. 6. Interactive comments are enabled by default. (Note that Bash has --- 22,27 ---- 5. The POSIX.2 `PS1' and `PS2' expansions of `!' to the history number and `!!' to `!' are enabled, and parameter expansion is ! performed on the values of `PS1' and `PS2' regardless of the ! setting of the `promptvars' option. 6. Interactive comments are enabled by default. (Note that Bash has *************** *** 43,58 **** found. ! 12. Redirection operators do not perform filename expansion on the word in the redirection unless the shell is interactive. ! 13. Function names must be valid shell `name's. That is, they may not contain characters other than letters, digits, and underscores, and ! may not start with a digit. Declaring a function with an illegal name causes a fatal syntax error in non-interactive shells. ! 14. POSIX.2 `special' builtins are found before shell functions during command lookup. ! 15. If a POSIX.2 special builtin returns an error status, a non-interactive shell exits. The fatal errors are those listed in the POSIX.2 standard, and include things like passing incorrect --- 43,61 ---- found. ! 12. Non-interactive shells exit if a syntax error in an arithmetic ! expansion results in an invalid expression. ! ! 13. Redirection operators do not perform filename expansion on the word in the redirection unless the shell is interactive. ! 14. Function names must be valid shell `name's. That is, they may not contain characters other than letters, digits, and underscores, and ! may not start with a digit. Declaring a function with an invalid name causes a fatal syntax error in non-interactive shells. ! 15. POSIX.2 `special' builtins are found before shell functions during command lookup. ! 16. If a POSIX.2 special builtin returns an error status, a non-interactive shell exits. The fatal errors are those listed in the POSIX.2 standard, and include things like passing incorrect *************** *** 60,82 **** assignments preceding the command name, and so on. ! 16. If the `cd' builtin finds a directory to change to using `$CDPATH', the value it assigns to the `PWD' variable does not contain any symbolic links, as if `cd -P' had been executed. ! 17. A non-interactive shell exits with an error status if a variable assignment error occurs when no command name follows the assignment statements. A variable assignment error occurs, for example, when ! trying to assign a value to a read-only variable. ! 18. A non-interactive shell exits with an error status if the iteration variable in a `for' statement or the selection variable in a ! `select' statement is a read-only variable. ! 19. Process substitution is not available. ! 20. Assignment statements preceding POSIX.2 `special' builtins persist in the shell environment after the builtin completes. ! 21. The `export' and `readonly' builtin commands display their output in the format required by POSIX.2. --- 63,91 ---- assignments preceding the command name, and so on. ! 17. If the `cd' builtin finds a directory to change to using `$CDPATH', the value it assigns to the `PWD' variable does not contain any symbolic links, as if `cd -P' had been executed. ! 18. If `$CDPATH' is set, the `cd' builtin will not implicitly append ! the current directory to it. This means that `cd' will fail if no ! valid directory name can be constructed from any of the entries in ! `$CDPATH', even if the a directory with the same name as the name ! given as an argument to `cd' exists in the current directory. ! ! 19. A non-interactive shell exits with an error status if a variable assignment error occurs when no command name follows the assignment statements. A variable assignment error occurs, for example, when ! trying to assign a value to a readonly variable. ! 20. A non-interactive shell exits with an error status if the iteration variable in a `for' statement or the selection variable in a ! `select' statement is a readonly variable. ! 21. Process substitution is not available. ! 22. Assignment statements preceding POSIX.2 special builtins persist in the shell environment after the builtin completes. ! 23. The `export' and `readonly' builtin commands display their output in the format required by POSIX.2. diff -Nrc2 bash-2.01.1/CWRU/changelog bash-2.02/CWRU/changelog *** bash-2.01.1/CWRU/changelog Tue Jun 3 11:27:48 1997 --- bash-2.02/CWRU/changelog Wed Apr 15 10:26:18 1998 *************** *** 1718,1719 **** --- 1718,3734 ---- [bash-2.01-release frozen] + + 6/6 + --- + configure.in + - force shlicc2 and libc malloc for BSD/OS 3.0 + + 6/9 + --- + doc/Makefile.in + - don't create ${man3dir}, since we're not installing the readline + manual page + + lib/readline/readline.h + - rl_dispatching should be declared `extern' + [in bash-2.01.1] + + 6/10 + ---- + lib/malloc/Makefile.in + - make sure ${ALLOCA_SOURCE} is preceded by ${srcdir} so that things + work when building in a directory other than the source directory + [in bash-2.01.1] + + 6/30 + ---- + lib/readline/examples/rltest.c + - don't free the value returned by history_list() + + lib/readline/histfile.c + - open the history file for writing with mode 0600 for better + security + [in bash-2.01.1] + + execute_cmd.c + - select_query now uses legal_number to decide whether the user's + selection is a valid number, and just executes the loop again if + invalid input is entered + [in bash-2.01.1] + + 7/1 + --- + builtins/evalstring.c + - fix to parse_and_execute so `bash -c 'time [-p] zzz'' works right + [in bash-2.01.1] + + execute_cmd.c + - fix to execute_command_internal so that `bash -c time [-p] (zzz)'' + works right + [in bash-2.01.1] + - print_formatted_time should pass a long as the fourth parameter + to mkfmt + [in bash-2.01.1] + + externs.h, shell.c + - `exit_shell' is now a void function + + hashlib.c + - print_table_stats is now a void function + + mailcheck.c + - made add_mail_file check for the filename in the mail file list + using the expanded filename, since that is what it puts into + the list + [in bash-2.01.1] + + variables.c + - for the time being, PWD will be auto-exported, since some systems + seem to expect it + + doc/bashref.texi, lib/readline/doc/{hist,rlman}.texinfo + - added necessary `dircategory' and `direntry' commands to make + `install-info' work correctly + + Makefile.in + - move $(LDFLAGS) after $(BUILTINS_LDFLAGS) and $(LIBRARY_LDFLAGS) on + the line that links bash + + doc/texinfo.tex + - upgraded to version 2.185 from the texinfo-3.9 distribution + + lib/tilde/tilde.c + - fixed a bug in tilde_expand so that enough space is allocated for + the string and terminating null byte if a `~' does not appear. + This was masked before by the bash malloc() + [in bash-2.01.1] + + 7/3 + --- + aclocal.m4 + - new test, BASH_TYPE_INT32_T, to check which builtin C type is + 32 bits wide + - new test, BASH_TYPE_PTRDIFF_T, to check which builtin C type is + appropriate for pointer arithmetic + + configure.in + - check sizes of int and long, and for the existence of an int32_t + basic system type. Call BASH_TYPE_INT32_T if int32_t is not + defined anywhere in the system header files + - check size of (char *), and for the existence of a ptrdiff_t + basic system type. Call BASH_TYPE_PTRDIFF_T if ptrdiff_t is not + defined anywhere in the system header files + - added a check for + + config.h.in + - add lines for SIZEOF_INT, SIZEOF_LONG, SIZEOF_CHAR_P, int32_t, + u_int32_t, and ptrdiff_t + - added line for HAVE_STDDEF_H + + lib/malloc/malloc.c + - new version, with many changes and much better memory usage; old + (bash-2.01) version is lib/malloc/omalloc.c + + lib/malloc/gmalloc.c + - new version, with a number of changes and range checking included + by default; old (bash-2.01) version is lib/malloc/ogmalloc.c + + execute_cmd.c + - applied patch from 5/27 to make execute_simple_command fork early + if it's part of a pipeline. This keeps assignment statements or + other commands that don't require a builtin, function, or disk + command to be executed from modifying the shell's environment + + tests/exec?.sub + - renamed from tests/execscript.sub? because those filenames are + too long for System V 14-char filename systems + + tests/source?.sub + - renamed from tests/source.sub? because those filenames are bad + for DOS/Windows + + tests/getopts?.sub + - renamed from tests/getopts.sub? because those filenames are bad + for DOS/Windows + + tests/histexp.{tests,right} + - renamed from histexpand.{tests,right} because those filenames are + too long for System V 14-char filename systems + + tests/trap1.sub + - renamed from trap.sub1 because that filename was bad for DOS/Windows + + tests/ifs-[123].right + - renamed from ifs.[123].right because those filenames were bad for + DOS/Windows + + tests/ifs-[123].test + - renamed from ifs-test-[123].sh because those filenames were bad + for DOS/Windows + + examples/startup-files/Bashrc.bfox + - renamed from examples/startup-files/Bashrc because that filename + conflicts with examples/startup-files/bashrc on case-insensitive + file systems + + tests/exec.right + - renamed from execscript.right because that filename is too long + for System V 14-char filename systems + + tests/run-set-e + - renamed from run-set-e-test + + tests/misc/perftest + - renamed from tests/misc/haertel.perftest because that filename is + too long for System V 14-char filename systems + + lib/glob/fnmatch.c + - new version with full POSIX.2 BRE matching (character classes, + collating symbols, equivalence classes), full support for + strcoll(3), and case-insensitive pattern matching + + lib/glob/fnmatch.h + - new version, with necessary symbols for the new fnmatch.c + + tests/posixpat.{tests,right}, tests/run-posixpat + - test suite for the POSIX.2 BRE pattern matching code + + variables.c + - make sure that array assignment using the compound syntax empties + the array before doing the assignment + [in bash-2.01.1] + + trap.c + - new function, trap_to_sighandler(sig), which returns the correct + trap handler for SIG depending on the information in sigmodes[sig] + [in bash-2.01.1] + + sig.h + - extern declarations for trap_handler and trap_to_sighandler + [in bash-2.01.1] + + jobs.c + - if we get an interrupt while waiting for a command to complete, + and there was a trap set on SIGINT that resets the handler to + SIG_DFL, the value that waitchld uses for old_trap_handler will + be wrong (it will be trap_handler, but trap_handler no longer + knows anything about SIGINT). If old_signal_handler is trap_handler, + but signal_is_trapped(SIGINT) returns 0, we need to call + trap_to_sighandler to decide what to do + [in bash-2.01.1] + + 7/7 + --- + locale.c + - fix to set_locale_var to handle an assignment to LC_ALL (e.g., as + the result of `unset LANG') when default_locale is null + [in bash-2.01.1] + + 7/8 + --- + builtins/umask.def, doc/{bash.{1,html},bashref.texi} + - added `-p' option for umask to print output in a reusable form + + 7/9 + --- + doc/{bash.{1,html},bashref.texi} + - removed descriptions of `-type', `-path', and `-all' options to + the `type' builtin in preparation for removing them in the next + release + + builtins/type.def + - removed mention of `-type', `-path', and `-all' options from the + long help description + + error.c, error.h + - new function: internal_warning, for warning messages + + variables.c + - changed a call to internal_error to use internal_warning + - modified change of 7/3 so that arrays are not emptied until + just before the shell is about to assign the new values, so + the old value can be used to generate the rhs of the assignment, + if necessary. This is how `normal' shell variables work + [in bash-2.01.1] + + jobs.c, jobs.h + - delete_job now takes a second int argument and prints a warning + message when deleting a stopped job if the second argument is + non-zero + + jobs.c, builtins/jobs.def + - changed all calls to delete_job to provide a proper second arg + + lib/readline/bind.c + - broke rl_read_init_file into an `upper' and `lower' half in + preparation for adding file inclusion capability to inputrc + parsing + - handle_parser_directive now displays an error message if an + unknown directive is encountered + - parser_endif now prints an error message if an $endif without + a matching $if is found + - added `$include' parser directive to read bindings and commands + from another file at that point + + lib/readline/doc/rluser.texinfo, doc/{bash.{1,html},readline.3} + - documented new readline `$include' parser directive + + shell.c, parse.y + - added a new invocation option, --dump-po-strings, and code to + make it dump translatable strings ($"...") in GNU gettext + `po' format + + doc/{bash.{1,html},bashref.texi} + - documented new `--dump-po-strings' invocation option + + lib/readline/{{kill,funmap}.c,readline.h} + - added `rl_paste_from_clipboard()', bound to `paste-from-clipboard' + for CYGWIN32 users + + lib/readline/kill.c + - incorporated bfox's patches for `iterative' yank-last-arg handling. + This means that one can keep pressing M-. and move backwards in + the history, yanking the last argument of successive history lines + + lib/readline/rlwinsize.h + - new file, encapsulates various locations of the definition for + `struct winsize' + + aclocal.m4 + - augmented BASH_STRUCT_WINSIZE to look in termios.h as well as + sys/ioctl.h for definition of `struct winsize' + + lib/readline/rltty.h + - include "rlwinsize.h" after including tty-driver-specific header + file + + 7/10 + ---- + support/config.guess + - add better support for SunOS on M68K (old Sun3 machines) + + parse.y + - check for compound array assignment in read_token_word only if + there are characters before the `=' (which would make it a legal + assignment statement). This fixes the problem with defining a + function named `=' with `=() { echo foo; }' + [in bash-2.01.1] + + jobs.c, jobs.h + - nohup_all_jobs and delete_all_jobs now take a parameter which + says whether or not to restrict their operation to only running + jobs + + jobs.c + - changed all calls to delete_all_jobs + + builtins/jobs.def + - added `-a' (all jobs) and `-r' (running jobs only) options to + `disown' + + doc/{bash.{1,html},bashref.texi} + - documented new `-a' and `-r' options to `disown' + + findcmd.c, findcmd.h + - new files with command searching code from execute_cmd.c and + function declarations from execute_cmd.h + + Makefile.in, builtins/Makefile.in + - updated dependencies to account for new findcmd.[ch] + - updated dependencies to account for new redir.[ch] + + redir.c, redir.h + - new files with code that sets up lists and performs redirections + from execute_cmd.c and execute_cmd.h + + execute_cmd.c + - include new findcmd.h, redir.h + + 7/11 + ---- + Makefile.in, configure.in + - PROFILE_FLAGS is now substituted into the Makefile by configure + + 7/14 + ---- + print_cmd.c + - make sure single_quote is called from xtrace_print_word_list + to correctly quote each word of trace output, especially those + with embedded quotes + [in bash-2.01.1] + + aclocal.m4 + - extended BASH_CHECK_GETPW_FUNCS so that it checks that getpwuid + and getpwnam can also be declared, as well as getpwent + [in bash-2.01.1] + - in BASH_FUNC_PRINTF, cast printf to type `_bashfunc' before trying + to assign it to `pf' to avoid any prototype problems in the + declaration + [in bash-2.01.1] + + trap.c + - include before any of the bash-specific header files, + but after config.h + [in bash-2.01.1] + + test.c + - include and declare `extern int errno' before including + any of the bash-specific include files, but after + [in bash-2.01.1] + + builtins/Makefile.in + - PROFILE_FLAGS is now substituted into the Makefile by configure + + configure.in + - new options, --enable-profiling and --enable-static-link, to turn + on profiling with gprof and link bash statically (if using gcc) + for use as a root shell. The former implies the latter. If + we're linking statically, dynamic loading of new builtins is not + available + + doc/bashref.texi + - documented new --enable-profiling and --enable-static-link + options in installation section; regenerated INSTALL + + lib/glob/glob.[ch] + - new global variable, glob_ignore_case, turns on case-insensitive + filename matching in fnmatch() using the FNM_CASEFOLD flag + + doc/{bash.{1,html},bashref.texi} + - documented new shopt `nocaseglob' option + + 7/15 + ---- + bashline.c + - when glob_complete_word is called with state == 0, make sure we + set rl_filename_completion_desired so that proper quoting of + the resultant filenames is performed + [in bash-2.01.1] + + 7/16 + ---- + externs.h, oslib.c + - strcasecmp and strncasecmp replacements should have `const char *' + as the first two arguments, to match OS definitions + [in bash-2.01.1] + + 7/17 + ---- + (many files) + - changes for minix-2.0, mostly just adding #ifndef _MINIX around + include files that minix doesn't provide, like and + + + lib/readline/terminal.c + - removed `outchar' function; use _rl_output_character_function in + its place + + support/config.guess + - changes to recognize HP_ARCH of `hppa2.0' + + test.c + - new `-N' option: `test -N file' returns true if FILE exists and + has been modified since it was last accessed + + doc/{bash.{1,html},bashref.texi} + - documented new `test -N' option + + 7/22 + ---- + aclocal.m4 + - prefer /var/spool/mail to /usr/spool/mail in BASH_DEFAULT_MAIL_DIR + [in bash-2.01.1] + + lib/readline/{complete,bind}.c + - new readline variable, print-completions-horizontally, which causes + matches to be printed across the screen (like `ls -x') rather than + up-and-down (like `ls') + - new readline variable, completion-ignore-case, which causes filename + completion and matching to be performed case-insensitively + + doc/{bash.{1,html},readline.3}, lib/readline/doc/rluser.texinfo + - documented new print-completions-horizontally variable + - documented new completion-ignore-case variable + + _distribution, Makefile.in + - bumped the version number up to 2.02-alpha1 + + bracecomp.c + - fixes so that the braces are not quoted by the filename quoting + function when complete-into-braces is executed with M-{. The + brace completion functions do filename quoting themselves + [in bash-2.01.1] + + pathexp.c + - changed quote_string_for_globbing so that it takes a flags word + as its second argument + + pathexp.h + - defines for flags passed to quote_string_for_globbing + + subst.c,execute_cmd.c + - changed calls to quote_string_for_globbing to pass the correct + flag arguments + + expr.c + - added a `**' binary operator to do exponentiation (2**16 == 65536). + precedence is lower than arithmetic operators, higher than unary + operators (2**16-1 == 65535) + + doc/{bash.{1,html},bashref.texi} + - documented new `**' arithmetic binary operator + + 7/24 + ---- + shell.c + - added new (currently undocumented) `--wordexp' option to do the + job required by POSIX.2 wordexp(). If -n is supplied along with + --wordexp, command substitution is disallowed and the shell + exits with a status of 125 if one is attempted. If there is an + expansion error, the shell exits with a status of 127. If there + is a shell parsing error, the shell exits with a status of 126. + Otherwise, the exit status is 0. The current output is + + number of words\n + number of bytes\n + expanded words, one per line, separated by newlines + + This will have to be changed when an interface to glibc is coded + + 7/28 + ---- + hashcmd.h + - reduced the default size of the filename hash table from 631 + to 107 + + sig.c + - don't call initialize_siglist if HAVE_UNDER_SYS_SIGLIST is defined + [in bash-2.01.1] + + siglist.c + - don't compile this file if HAVE_UNDER_SYS_SIGLIST is defined + [in bash-2.01.1] + + variables.c + - fix to make $RANDOM work better in subshells + [in bash-2.01.1] + + aclocal.m4 + - new macro, BASH_DECL_UNDER_SYS_SIGLIST, looks for _sys_siglist in + and , defines UNDER_SYS_SIGLIST_DECLARED if + found + [in bash-2.01.1] + - change BASH_UNDER_SYS_SIGLIST to require BASH_DECL_UNDER_SYS_SIGLIST, + like BASH_SYS_SIGLIST requires AC_DECL_SYS_SIGLIST + [in bash-2.01.1] + + config.h.in + - add a line for UNDER_SYS_SIGLIST_DECLARED + [in bash-2.01.1] + + configure.in + - make sure that SVR4_2 is defined for machines that have $host_os + sysv4.2* (e.g., sysv4.2MP) as well as $host == sysv4.2 + [in bash-2.01.1] + + 7/29 + ---- + command.h + - new command type, ARITH_COM, used to create and execute a ((...)) + command without translating it into let "..." + + parse.y + - changes to the grammar and lexer so that ((...)) is parsed as a + command of type ARITH_CMD. An ARITH_CMD is a WORD_LIST, for + future expansion, even though only the first word is used + + make_cmd.c, make_cmd.h + - definition and declaration of a function to build an arithmetic + command + + dispose_cmd.c + - added code to dispose of arithmetic commands + + print_cmd.c + - added code to print arithmetic commands, both `regularly' and + when they're being traced with `set -x' + + externs.h + - extern declaration for xtrace_print_arith_cmd + + copy_cmd.c + - added code to copy arithmetic commands + + execute_cmd.c + - added code to directly execute arithmetic commands -- they are + a shell_control_structure, so just about everything like + redirections and piping is taken care of by the boilerplate code. + All that's needed is to expand the expression (which is within + double quotes -- added by parse.y:parse_arith_cmd()), print it + if tracing is enabled, call the expression evaluator, and return + an appropriate result + + 7/30 + ---- + input.c + - new function, set_buffered_stream(fd, bp), sets the buffered stream + associated with FD to BP and returns the old buffered stream + + input.h + - extern declaration for set_buffered_stream + + parse.y + - call set_buffered_stream rather than manipulating the BUFFERS array + directly + + shell.c + - unset_bash_input now takes an argument, CHECK_ZERO. This tells it + whether to check whether default_buffered_input is >= 0 or just > 0 + + externs.h + - changed extern declaration for unset_bash_input + + execute_cmd.c, jobs.c, nojobs.c + - changed calls to unset_bash_input to add appropriate argument + + input.h + - #undef B_* before defining them as flag values for b_flags. Some + systems, like SVR4, have a B_ERROR define in a file included by + jobs.c and nojobs.c, and it causes a warning + + 7/31 + ---- + fnmatch.c + - rewrote most of fnmatch(), so that it now implements ksh-88 style + pattern matching (`[@+*?!](patlist)') if the FNM_EXTMATCH flag + is set + + fnmatch.h + - added a define for FNM_EXTMATCH + + 8/4 + --- + lib/readline/display.c + - fixed _rl_redisplay_after_sigwinch () so that it really redisplays + only the portion after the final newline of a multi-line prompt + [in bash-2.01.1] + + bashline.c + - attempt_shell_completion no longer returns matches if a glob pattern + matches more than one filename -- it caused too many problems + [in bash-2.01.1] + + 8/5 + --- + lib/glob/glob.c + - updated glob_pattern_p so that the extended matching operators + are recognized + + pathexp.c + - udpated unquoted_glob_pattern_p so that the extended matching + operators are recognized + - udpated quote_globbing_chars so that the extended matching + operators are recognized and quoted appropriately + + subst.c + - updated match_pattern_char so that the extended matching operators + are recognized + + parse.y + - updated read_token_word so that it parses an extended matching + pattern as a single word + + jobs.c + - if a job is suspended with SIGTSTP, and the user has set + checkwinsize with `shopt', update the window size + [in bash-2.01.1] + + pathexp.c, pathexp.h + - new global variable, extended_glob, controls whether the extended + pattern matching features are enabled + + pathexp.h + - new define, FNMATCH_EXTFLAG, to be OR'd with other values for + flags argument to fnmatch to enable the extended pattern matching + features if extended_glob is set + + {pathexp,execute_cmd,bashhist,subst,test}.c, builtins/help.def + - changed calls to fnmatch to add FNMATCH_EXTFLAG to the flags arg if + extended_glob is non-zero + + lib/glob/glob.c + - changed flags arg passed to fnmatch to include FNM_EXTMATCH if + extended_glob is non-zero (#ifdef SHELL) + + 8/6 + --- + builtins/shopt.def + - added a new `extglob' shell option, controls the value of + extended_glob + + 8/7 + --- + doc/{bash.{1,html},bashref.texi} + - documented new extended pattern matching operators and the `extglob' + shell option + + tests/{extglob.{tests,right},run-extglob} + - test suite for the new extended globbing features + + 8/8 + --- + parse.y, pathexp.h, lib/glob/fnmatch.c + - made the extended globbing code #ifdef EXTENDED_GLOB + + config.h.in + - added a line for EXTENDED_GLOB, controlled by configure + + configure.in + - new option, --enable-extended-glob, controls defining of + EXTENDED_GLOB (on by default) + + doc/bashref.texi + - documented new `configure' `--enable-extended-glob' option + + 8/11 + ---- + builtins/printf.def + - new `printf' builtin, implemented according to POSIX.2 spec + for printf(1) + + Makefile.in,builtins/Makefile.in + - added necessary stuff for new printf builtin + + 8/12 + ---- + lib/readline/isearch.c + - change to make ^G interrupt the incremental search correctly + [in bash-2.01.1] + + configure.in, config.h.in + - configure now checks for the availability of strtoul(3) + + builtins/printf.def + - use strtoul for the `%o', `%u', `%x', and `%X' formats if it + is available + + 8/13 + ---- + tests/{printf.{right,tests},run-printf} + - extensive test suite for the new `printf' builtin + + builtins/Makefile.in + - change so that `builtext.h' is not recreated every time the source + file for a builtin is changed if the contents are the same. This + keeps many files from being recompiled + + 8/14 + ---- + subst.c + - changed verify_substring_values so that it returns -1 for substring + range errors, 0 for expression errors, and 1 for success + [in bash-2.01.1] + - changed parameter_brace_substring to return an error if + verify_substring_values returns 0, and a null string if it returns + -1. This matches the ksh93 behavior + [in bash-2.01.1] + + trap.c + - changed decode_signal so that it makes sure the first three + characters of a signal name are `SIG' before allowing the `SIG' + prefix to be omitted. This is so a signal spec of `T' does not + match `EXIT', for instance + [in bash-2.01.1] + + builtins/trap.def + - make sure that showtrap() displays traps for signals with unknown + names using the signal number + [in bash-2.01.1] + shell.c + - make sure that `bash -r' doesn't turn on the restricted mode until + after the startup files are executed + [in bash-2.01.1] + + doc/{bash.{1,html},bashref.texi} + - documented printf builtin + + 8/15 + ---- + general.c + - added \xNNN escape to ansicstr -- NNN are up to three hex digits. + This affects $'...', `echo -e', and printf + + builtins/printf.def + - added \xNNN escape to bexpand -- NNN are up to three hex digits. + This affects printf's `%b' conversion specifier + + doc/{bash.{1,html},bashref.texi} + - documented new \xNNN escape sequence for echo, $'...', and printf + + builtins/setattr.def + - make sure that a variable found in the temp environment does not + cause a null string to be assigned by bind_variable (e.g., + foo="" export foo + ) + [in bash-2.01.1] + + 8/18 + ---- + subst.c + - fixed a bug that sometimes caused bad memory (pointer into an + allocated block) to be passed to free when doing arithmetic + substitution. Bug report from stevet@myofb.org + [in bash-2.01.1] + + 8/19 + ---- + subst.c + - considerable changes: moved the code that expands a single + $... parameter expansion into a separate function: param_expand() + This function returns a string, which may contain characters + quoted with CTLESC or CTLNUL without doing word splitting + - changed expand_word_internal to not remove the expansion of "$*" + if the number of positional parameters is > 0 + - changed the '"' case of expand_word_internal to remove quoted + nulls from the resultant word if the expansion was not "$@", and + the word is not a quoted null string ([] == CTLNUL, [1] == '\0') + + subst.c, variables.c + - moved the code that handles special variables from subst.c to + variables.c + + 8/20 + ---- + subst.c + - rearranged the source a bit to group functions with similar + operation together + - fixed parameter_brace_expand so that it no longer allows + indirect expansion of `special' variables + - fixed parameter_brace_expand so taking the length of some of + the shell's special parameters works again + - moved all of the code that computes the length of a shell + parameter (the ${#xxx} expansion) into parameter_brace_expand_length. + Previously, the code that handled the lengths of the shell's + special parameters was in parameter_brace_expand_word + - valid indirect expansions are now only variable names or positional + parameters + + 8/21 + ---- + subst.c + - fixed param_expand to raise an expansion error if $! is being + expanded and no asynchronous processes have been created + - an expression error in a $((...)) arithmetic expansion now causes + a non-interactive shell running in POSIX mode to exit + - relaxed change of 8/20 to allow indirect references to $#, $@, $* + + builtins/bashref.texi + - documented new posix-mode exit on invalid expressions in $((...)) + + lib/readline/complete.c + - don't call rl_strpbrk unless rl_filename_quote_characters is not + NULL -- strpbrk requires non-NULL arguments + [in bash-2.01.1] + + 8/22 + ---- + bashline.c + - don't make `history-expand-line' a bindable command unless + BANG_HISTORY is defined, and don't compile the code for that + command in unless BANG_HISTORY is defined + - make history_expand_line(), tcsh_magic_space(), alias_expand_line(), + and history_and_alias_expand_line() int-returning functions that + return 0 for success and non-zero on error. This allows + tcsh_magic_space() to just call history_expand_line() and insert + a space if that returns successfully + - `magic-space' is now a bindable readline command + + doc/bash.{1,html}, lib/readline/doc/rluser.texinfo + - documented new `magic-space' bindable readline command + + 8/25 + ---- + parse.y + - fixed decode_prompt_string so that values of $PWD longer than + PATH_MAX don't cause buffer overruns (char t_string[PATH_MAX]) + [in bash-2.01.1] + + general.c + - fixed polite_directory_format so that values of $HOME longer + than PATH_MAX don't cause buffer overruns (char tdir[PATH_MAX]) + [in bash-2.01.1] + + subst.c + - fix to expansion of $* so that the positional parameters are + separated by the first character of $IFS, even when the expansion + is not within double quotes, so the correct split is still + performed even when IFS does not contain a space. Works for + ${*}, too + - fix to expansion of $@ so that the positional parameters are + separated by the first character of $IFS, even when the expansion + is not within double quotes, so the correct split is still + performed even when IFS does not contain a space. Works for + ${@}, too + - new function, string_list_dollar_at(), which is to $@ as + string_list_dollar_star is to $* + - fixed expansion of $@ so that splitting is still done even if + IFS is unset or NULL, as POSIX.2 specifies (section 3.5.2) + - fixed expansion of $* so that it expands to multiple words if there + is more than one positional parameter, just like $@, even if + IFS is unset or NULL + - new function list_quote_escapes, quotes (with CTLESC) all + CTLESC and CTLNUL characters in each member of the list + + tests/dollar-{at,star}.sh + - combined into dollar-at-star, changed run-dollars accordingly + + 8/26 + ---- + Makefile.in + - make the `tests' target use $(SHELL) instead of hardcoding `sh' + + 8/29 + ---- + subst.c + - expand_word_list_internal now takes a flags word as the second + argument, telling which expansions to perform on the WORD_LIST + - broke expand_word_list_internal into several functions: one + each to do brace expansion, glob expansion, and the `normal' + shell expansions + - new extern function: expand_words_shellexp() to perform the + `normal' shell expansions on a WORD_LIST + + subst.h + - extern declaration for expand_words_shellexp + + bashline.c + - fixed a problem with attempt_shell_completion where it attempted + to refer to rl_line_buffer[-1] (completion at the start of the + line, which means that ti == -1, which means that the test for + rl_line_buffer[ti] at line 715 was an array bounds error + [in bash-2.01.1] + + eval.c + - new function, parse_string_to_word_list(), which takes a string + and runs it through the parser, returning the resultant word + list + + externs.h + - new extern declaration for parse_string_to_word_list() + + variables.c + - change assign_array_var_from_string to first split the string + between the parens on whitespace, then expand the resultant + list of words with all the shell expansions before doing the + assignment + + 9/4 + --- + redir.c, redir.h + - redirection_error is no longer a static function + + builtins/evalstring.c + - changes to handle $( < filename ) (equivalent to $(cat filename)) + as in ksh + + lib/readline/bind.c + - added two new functions: rl_unbind_function_in_map(func, map), + which unbinds all keys that execute FUNC in MAP; and + rl_unbind_command_in_map(command, map), which unbinds all keys + bound to COMMAND in MAP + + lib/readline/readline.h + - extern declarations for rl_unbind_{function,command}_in_map + + lib/readline/doc/rltech.texi + - documented rl_unbind_{function,command}_in_map + + builtins/bind.def + - added a new option, -u FUNCNAME, which unbinds all key sequences + bound to FUNCNAME in the specified (or current) keymap + + doc/{bash.{1,html},bashref.texi} + - documented new $( < filename ) command substitution + - documented new bind -u FUNCNAME option + + 9/5 + --- + shell.c + - send SIGHUP to all jobs when an interactive login shell exits if + the variable `hup_on_exit' is non-zero + - modified run_startup_files so that if `NON_INTERACTIVE_LOGIN_SHELLS' + is #define'd (perhaps in config.h.top, though there is nothing there + for it), all login shells (interactive and non-interactive) run + /etc/profile and one of the per-user login shell startup files + + builtins/shopt.def + - new shopt option `huponexit' to control the value of hup_on_exit + + doc/{bash.{1,html},bashref.texi} + - documented new `huponexit' shell option + + 9/8 + --- + builtins/common.c + - changed contains_shell_metas to return 1 if a tilde appears at the + start of a string or after a `=' or `:' + - changed backslash_quote to quote a tilde if it appears at the start + of a string or after a `=' or `:' + + lib/readline/complete.c + - moved rl_tilde_expand to util.c; it doesn't really have anything + to do with completion + - moved insert_text to readline.c, renamed it _rl_replace_text (since + that's really what it does), changed callers + - moved code that postprocesses the list of completion matches into + a new function: postprocess_matches + - new implementation of tcsh-like menu completion in a single new + function: rl_menu_complete + + lib/readline/{funmap.c,readline.h} + - necessary declarations for binding rl_menu_complete to the + new `menu-complete' command + + doc/{bash.{1,html},readline.3}, lib/readline/doc/rluser.texinfo + - documented new `menu-complete' bindable readline command + + 9/9 + --- + jobs.c + - delete_job should print a warning only if subshell_environment + is 0, so we don't print bogus warnings when shell scripts without + a leading #! are executed + + 9/10 + ---- + builtins/read.def + - fixed the code so that the `read' is automatically restarted when + it returns -1 with errno == EINTR. SIGINT is handled by the + interrupt handler, since interrupt_immediately is set to 1, so + this handles things like SIGCHLD + [in bash-2.01.1] + + 9/11 + ---- + test.c + - reorganized the code slightly to make it easier to add the ksh-like + [[...]] compound command + + test.h + - new file, with extern declarations for functions available in test.c + + externs.h + - moved declaration of test_command to test.h + + builtins/test.def + - include `test.h' + + 9/16 + ---- + {command,make_cmd,dispose_cmd,externs,subst}.h + parse.y, subst.c + {make,dispose,copy,print,execute}_cmd.c + - changes to add the new ksh-93 compatible [[...]] conditional command + + configure.in + - new enable option, --enable-cond-command, to compile in the [[...]] + command code + + config.h.in + - new #define, COND_COMMAND, to compile in the [[...]] command code + + tests/{run-cond,cond.{tests,right}} + - test suite for the new [[...]] command + + {builtins,lib/{readline,glob,tilde}}/Makefile.in + - explicit dependencies for .o files on .c files for losing makes + like Solaris + + doc/{bash.{1,html},bashref.texi} + - documented the new `[[' compound command + - documented the test/[ builtin behavior based on the number of + arguments in the description of the builtin + - made a new section for conditional expressions that just lists + the available primaries -- the connectives and other operators + are listed in the description of the [[ command and the test/[ + builtin + + 9/18 + ---- + builtins/set.def + - minus_o_option_commands is now a global function so the shopt + code can use it + - minus_o_option_commands now takes an argument telling it which + options to print, just like list_minus_o_options + - new function, print_minus_o_option, which prints the value of + a `set -o' option either in the traditional format or in the + format used by `set +o' + - changed list_minus_o_opts and minus_o_option_commands to call + print_minus_o_option + + builtins/shopt.def + - `shopt -p' now causes output to be printed in a format reusable + as input (the format is a series of shopt commands, like the + output of `set +o') + - fixed a bug that made `shopt -so' and `shopt -uo' not work + - fixed list_shopt_o_options so that `shopt -op' acts like `set +o' + - fixed list_shopt_o_options to that `shopt -op optname' prints the + value of optname in a reusable format + - fixed list_some_o_options so that `shopt -ops' and `shopt -opu' + work and display output in a reusable format + + 9/19 + ---- + doc/{bash.{1,html},bashref.texi} + - documented new `shopt -p' behavior + + shell.c + - made `bash +o' display the same output as `set +o' and then + start an interactive shell (previously `bash -o' and `bash +o' + displayed the same thing) + + builtins/common.h + - added prototypes to the extern function declarations + + 9/22 + ---- + builtins/evalstring.c + - fixed the DISCARD case of the jump_to_top_level so that it + doesn't try to call dispose_command(command) after the + `pe_dispose' unwind frame gets run, since that disposes the + command + + 9/23 + ---- + test.[ch] + - test_eaccess is now a global function so that globbing code can + use it + + lib/glob/glob.c + - rewrote glob_vector to be slightly more efficient and to not + read the directory if the filename pattern does not contain + any globbing chars. This satisfies the POSIX requirement that + read permission is not required for a directory when the + pathname component does not contain a pattern character (bug + reported by jsm28@cam.ac.uk) + + subst.c + - fixed parameter_brace_expand so that ${array[@]} and ${array[*]} + behave correctly when IFS is unset or set to something that does + not contain a space (they should result in separate words, just + like $@ and $*) + + tests/{run-array2,array-at-star,array2.right} + - tests for the expansions of ${array[@]} and ${array[*]}, derived + from the tests in dollar-at-star + + 9/24 + ---- + jobs.c + - fixed cleanup_dead_jobs so that it doesn't remove the job + containing last_asynchronous_pid from the job table. This + fixes the POSIX.2 `wait' requirement problem + + 9/25 + ---- + parse.y + - added `\r' escape sequence to the prompt expansion code + + lib/readline/chardefs.h + - added defines for ISOCTAL, OCTVALUE, isxdigit (if not defined), + and HEXVALUE + + lib/readline/bind.c + - added `normal' echo/printf-like backslash escapes to the + key sequence translation code, with the addition that \d + expands to RUBOUT. This means that key sequence definitions + (before the `:') and macro values may contain these special + backslash-escape sequences + - now that we can translate octal escape sequences in key bindings, + change _rl_get_keyname so that it turns characters with values + 128-159 inclusive into octal escape sequences (\200-\237), since + those characters are not ASCII or ISO Latin 1 + + doc/{bash.{1,html},readline.3}, lib/readline/doc/rluser.texinfo + - documented new backslash escapes for readline key sequence and + macro translation + + builtins/pushd.def + - new function, get_dirstack_from_string(char *string), returns an + element from the directory stack or null, treating the argument + exactly as `dirs string' would, with the exception that if + the first character of `string' is not `+' or `-', a `+' is + assumed + + builtins/common.h + - new extern declaration for get_dirstack_from_string + + general.c + - added code to bash_special_tilde_expansions to get the expansion + using get_dirstack_from_string() if the first character of the + tilde-prefix is a digit or the first character is a `+' or `-' + and the second is a digit + + tests/dstack.{tests,right} + - renamed from dirstack.{tests,right} + + tests/dtack2.{tests,right} + - new tests for the directory stack tilde expansion code + + tests/run-dirstack + - now runs both dstack and dstack2 + + 10/3 + ---- + trap.c + - reordered header file inclusion for irix 4 + + execute_cmd.c + - fixed select_query so that a reply that is not a number is treated + the same as a numeric reply that is out of range + + lib/readline/util.c + - added a backwards-compatibility definition of _rl_savestring() + + builtins/set.def + - initialize_shell_options now takes an argument saying whether or + not we should parse $SHELLOPTS from the environment. The shell + does not parse the value if it's restricted, running setuid, or + running in `privileged mode' + + shell.c + - change call to initialize_shell_options to add the correct argument + + builtins/common.h + - changed extern declaration for initialize_shell_options + + doc/{bash.{1,html},bashref.texi} + - added note that the shell ignores $SHELLOPTS in the environment at + startup if running in privileged mode + - added note that the restricted shell does not parse $SHELLOPTS from + the environment at startup + + 10/6 + ---- + aclocal.m4 + - change BASH_RLIMIT_TYPE so that it looks for rlim_t in + as well as , for Solaris 2.6 + - new macro, BASH_LARGE_FILE_SUPPORT, to enable special compilation + options for large files on Solaris 2.6 (from eggert@twinsun.com) + + mailcheck.c + - the `file_size' member of the FILEINFO struct should be of + type `off_t' + - the `size' variable in file_has_grown should be of type `off_t' + - the RESET_MAIL_FILE macro should initialize file_size to 0, not 0L + + builtins/Makefile.in + - LDFLAGS and LOCAL_LDFLAGS are now set by configure + - `mkbuiltins' is now created from `mkbuiltins.o' instead of directly + from the source to the executable + + builtins/evalfile.c + - fixed _evalfile so that it handles large files correctly on + systems where the st_size member of `struct stat' will not fit + into an `int' + + builtins/mkbuiltins.c + - don't assume that st_size fits into an int + + input.[ch] + - the `b_size' member of a struct BSTREAM is now of type `size_t' + - changed third argument to make_buffered_stream to size_t; changed + caller + - changed `size' variable in fd_to_buffered_stream to type `size_t' + + general.h + - include if HAVE_SYS_RESOURCE_H and RLIMTYPE are + both defined, for possible necessary definition of RLIMTYPE + (e.g., on Solaris 2.6) + + {execute_cmd,jobs}.c, builtins/times.def + - don't include explicitly if RLIMTYPE is defined, + since general.h will include it in that case + + lib/readline/bind.c + - new function, char *_rl_read_file(filename, sizep), which reads + FILENAME into a malloced buffer, returning the buffer and the + size of the buffer in *SIZEP + + lib/readline/histfile.c + - changed read_history_range and history_truncate_file to handle + large files + + hashcmd.c + - find_hashed_filename should not add `./' to the front of a pathname + that already begins with `./' + + 10/8 + ---- + support/config.sub + - recognize `hppa2.0' as a valid machine architecture + + aclocal.m4 + - changed BASH_CHECK_LIB_TERMCAP so that `gnutermcap' is not chosen + if `$prefer_curses' is set to something + + bashhist.c + - don't use HISTCONTROL or HISTIGNORE to remove lines from the + second and subsequent lines of a multi-line command + (current_command_line_count > 1). Old code did this only when + command-oriented-history was enabled + + doc/{bash.{1,html},bashref.texi} + - changed descriptions of HISTCONTROL and HISTIGNORE to state that + these variables are not applied to the second and subsequent + lines of a multi-line command + + builtins/hash.def, {copy,dispose}_cmd.c + - include "bashtypes.h" -- cray machines need it because of their + oddball definition of `word' + + configure.in + - changed check of ${host_cpu} to check for `*cray*' and `*Cray*' + when deciding whether to include the GNU malloc, since it + seems that ${host_cpu} gets set to `CrayYMP' + + 10/9 + ---- + configure.in + - look for strtod and strtol in libc + - make lib/sh directory in build directory if not there + - create lib/sh/Makefile + + config.h.in + - added HAVE_STRTOD and HAVE_STRTOL + + Makefile.in + - changes for lib/sh/libsh.a (shell library) + + builtins/printf.def + - took out the `#ifdef STRTOUL' code, since strtoul is in libsh.a, + and will be resolved from there if it's not in libc + + variables.c + - call strtol() instead of string_to_long() + + general.c, general.h + - removed string_to_long + - changed legal_number to use strtol so it correctly sets errno + to ERANGE on overflow + - moved bash_getcwd_errstr here from lib/sh/oslib.c + + externs.h + - moved extern declarations for functions defined in libsh to a + separate section of the file, added extern declarations for + other functions in libsh + + builtins/ulimit.def + - changed macro definition for string_to_rlimtype to call strtol + directly instead of string_to_long + + lib/sh/clktck.c + - moved get_clock_tck to its own file, since it's compiled in + unconditionally + + 10/10 + ----- + lib/sh/getenv.c + - moved getenv() and __getenv() here from lib/sh/oslib.c + + lib/sh/{setlinebuf,strerror,strcasecmp}.c + - moved {setlinebuf,strerror,strcasecmp}() from oslib.c to + individual files + + lib/sh/Makefile.in, Makefile.in + - changes for new files in lib/sh + + aclocal.m4 + - new macro BASH_SYS_RESTARTABLE_SYSCALLS, which does what + AC_SYS_RESTARTABLE_SYSCALLS does, but using posix sigaction() + + configure.in + - call BASH_SYS_RESTARTABLE_SYSCALLS if ac_cv_sys_restartable_syscalls + is `no' + + 10/13 + ----- + builtins/jobs.def + - catch out-of-range jobs better in disown_builtin + + configure.in + - don't build with GNU malloc on cygwin32 + + trap.c + - change signal_name to handle the case where signal_names[sig] is + NULL, which can happen on cygwin32 + + execute_cmd.c + - changes to do_piping to make pipes text mode (O_TEXT) on cygwin32 + + cross-build + - new directory with cache files and other stuff for cross-compiling + bash (currently only for building for cygwin32 on a Unix machine) + + cross-build/cygwin32.cache + - new file containing configuration variable assignments for + cygwin32 that would otherwise require a default case for AC_TRY_RUN + + configure.in + - source ${srcdir}/cross-build/cygwin32.cache on CYGWIN32 systems + if we're cross-compiling on a unix machine + - set $CC_FOR_BUILD for cygwin32 cross-compiling environment + + Makefile.in + - CC_FOR_BUILD is now a variable set by configure + + builtins/mkbuiltins.c + - only check for read(2) returning <= 0 in extract_info() (error + and exit on < 0, warning and return on == 0) + + builtins/evalfile.c + - only check for read(2) returning <= 0 in _evalfile() (error and + and failure return on < 0, success on == 0 while short-circuting + rest of operation) + + 10/14 + ----- + + vprint.c + - moved to lib/sh/vprint.c + + lib/sh/Makefile.in + - added entries for vprint.[co] in the appropriate places + + cross-build/win32sig.h + - a version of signames.h for cross-compiling for the CYGWIN32 + environment on a Unix machine (from noer@cygnus.com) + + aclocal.m4 + - made all cases of AC_TRY_RUN and AC_TRY_COMPILE have reasonable + default cases for cross-compiling, and tell the user what they are + + Makefile.in + - removed vprint.c from shell sources and vprint.o from shell + objects + - added a level of indirection for signames.h -- the variable + SIGNAMES_H is set by configure to either `lsignames.h' or + a file for a cross-compilation environment (currently only + the cygwin32 stuff is supported). Then that file is copied + to `signames.h'. `lsignames.h' is created by `mksignames' as + was previously used to create signames.h directly + + configure.in + - set SIGNAMES_H to either `$(srcdir)/cross-build/win32sig.h' or + `lsignames.h' as appropriate, substitute into Makefile + + 10/15 + ----- + builtins/Makefile.in + - CC_FOR_BUILD is now set by configure and used to build mkbuiltins + and psize.aux + + variables.h + - new variable attribute `att_tempvar', set if the SHELL_VAR * was + constructed on the fly from the temporary environment + + variables.c + - find_name_in_env_array now sets the `att_tempvar' attribute on + the SHELL_VAR it creates + + findcmd.c + - search_for_command now disposes the SHELL_VAR created by searching + the temporary environment for $PATH, if it is found there + - _find_user_command_internal also disposes of the SHELL_VAR if it + has the `att_tempvar' attribute set + + builtins/setattr.c + - show_name_attributes looks in the temporary environemnt, so it needs + to dispose the SHELL_VAR if it has the att_tempvar attribute set + + subst.c + - parameter_brace_expand_word now disposes of the SHELL_VAR returned + by find_variable if it has the att_tempvar attribute set + - ditto for param_expand and word_split + + builtins/kill.def + - disallow null pid arguments instead of treating them as 0 + - display a usage message and return failure if no pid or job + arguments are supplied + + 10/16 + ----- + builtins/declare.def + - make `var=value declare -x var' behave the same as + `var=value export var' and `var=value declare -r var' behave the + same as `var=value readonly var', now that we have the `tempvar' + attribute + + 10/22 + ----- + jobs.c + - non-interactive shells shouldn't report jobs killed by a SIGINT, + even if the standard output is to a terminal + - pretty_print_job should add a CR at the end of its output if the + shell is interactive and asynchronous notification is being + performed. This fixes the problem with extra CRs in the output + of $(jobs) + + general.c + - changed canonicalize_pathname to change `//' into `/', but leave + other pathnames starting with two consecutive slashes alone + + 10/27 + ----- + + lib/readline/histexpand.c + - fixed history_expand so that the appearance of the history + comment character at the beginning of a word inhibits history + expansion for the rest of the line + + 10/29 + ----- + jobs.c,variables.c + - moved set_pipestatus_array to variables.c + + variables.c + - new function, set_pipestatus_from_exit(int), which sets the + PIPESTATUS variable from a command's exit status + + variables.h + - extern declarations for set_pipestatus_from_exit and + set_pipestatus_array + + execute_cmd.c + - fixed execute_simple_command to call set_pipestatus_from_exit + if a foreground builtin or function, or a foreground null + command is executed + + 10/31 + ----- + shell.c + - fixed run_startup_files to detect being run by sshd, and treat + that case as equivalent to being run by rshd + + 11/3 + ---- + builtins/set.def + - make sure `set -a' doesn't cause SHELLOPTS to be exported when + a change is made to one of the shell options + + 11/4 + ---- + pathexp.c + - fix to shell_glob_filename in the code that uses a POSIX glob + library + + 11/5 + ---- + jobs.c + - fix cleanup_dead_jobs to hang onto the job corresponding to + last_asynchronous_pid only if the shell is not interactive + (this still has the problem that until a new async process + is started, the job will stay in the jobs table) + + configure.in,aclocal.m4 + - added a new macro, BASH_TYPE_U_INT32_T, to check for u_int32_t + separately from int32_t, since there are systems (HP-UX 10.20) + that have a define for the latter but not the former + + 11/6 + ---- + jobs.c + - cleanup_dead_jobs no longer checks whether the job it is deleting + corresponds to last_asynchronous_pid + - notify_of_job_status and mark_dead_jobs_as_notified now will not + mark the job corresponding to last_asynchronous_pid as notified + if the shell is not interactive + - wait_for_single_pid, if told to wait for last_asynchronous_pid, + or the job of which it is a member, will take care of marking + the job as notified after calling wait_for and collecting the + status. This means that two successive `wait' calls for $! will + succeed the first time and fail the second, as POSIX.2 specifies + (take this code out if it causes problems) + + 11/7 + ---- + jobs.c + - wait_for_job, if told to wait for the job corresponding to the + last async pid, will mark the job as notified after waiting for + it and collecting the status + + general.h + - fixed MEMBER macro to avoid reading past end of S (it used to + test s[1] before s[0], which is an error if s == "") + + subst.c + - expand_word_internal should free ISTRING before returning if + param_expand returns an error + - parameter_brace_expand_word should free the memory it allocates + and passes to param_expand + + execute_cmd.c + - execute_arith_command should call dispose_words on the list + returned by expand_words + + parse.y + - after calling parse_arith_command, read_token needs to free the + string value that parse_arith_command fills in, since make_word + makes a copy of the string it's passed + + 11/10 + ----- + subst.c + - cond_expand_word needs to free the value returned by string_list + after it is run through quote_string_for_globbing + + parse.y + - make sure cond_term frees yylval.word if it is just a `!' and + it's parsed as a term negation operator + + variables.c + - assign_array_var_from_string needs to free the word list returned + by parse_string_to_word_list after calling expand_words_shellexp + on it + + execute_cmd.c + - changed execute_simple_command to avoid saving the_printed_command + into command_line until just before it's needed. This should save + time and prevent memory leaks on errors, but it must be watched + closely to make sure that the_printed_command doesn't change out + from under execute_simple_command before we copy it + + 11/12 + ----- + builtins/alias.def + - alias and unalias should print error messages when passed an + argument that is not an alias for printing or deletion, + respectively, even if the shell is not interactive + + builtins/exit.def + - `logout' will no longer exit a non-login non-interactive shell + + 11/17 + ----- + lib/readline/nls.c + - add `koi8-r' as a legal LANG value + + builtins/alias.def + - if `alias' or `alias -p' is executed when no aliases are defined, + the return status should be 0, according to POSIX.2 + + 11/18 + ----- + subst.c + - changed a couple of calls to make_word_list (make_word(z), ...) + to add_string_to_list (z, ...) + + execute_cmd.c + - execute_cond_command now sets this_command_name to `[[' + + 11/21 + ----- + variables.c + - all_visible_{function,variable}s and the functions they call + should be compiled in only if READLINE is defined + + 11/24 + ----- + aclocal.m4 + - remove some leading whitespace before preprocessor statements in + BASH_KERNEL_RLIMIT_CHECK + + general.[ch] + - fix declarations for group_member so the extern declaration in + general.h agrees with the definition in general.c (fix from + Andreas Schwab ) + + builtins/cd.def + - print the new working directory if the shell is interactive + and `cd -' succeeds + - don't print the new working directory if it's found in $CDPATH + if the shell is not interactive + + 11/25 + ----- + builtins/cd.def + - fixes to bindpwd so that it copes with get_working_directory + returning NULL (bug from schwab@issan.informatik.uni-dortmund.de) + + 12/2 + ---- + support/config.guess + - add support for new OS name for SINIX SVR4 systems + + 12/3 + ---- + + builtins/set.def + - `unset' should check that a function it's trying to unset is a + legal identifier only when in POSIX mode + + redir.c + - changed here_document_to_fd to try and make sure the filename + used for the here document is `more unique', since the old + version would fail if two here documents were created in less + than a second + + 12/4 + ---- + builtins/cd.def + - POSIX.2 says that if CDPATH is used to find the new directory, + and it's not relative to the current directory, the new directory + name should be displayed on stdout even if the shell is not + interactive + + 12/5 + ---- + parse.y + - changes so that `time' is recognized as a reserved word only at + the beginning of a pipeline (the last read token is one of 0, + `;', `\n', `&&', `||', or `&'): + + o add clause to special_case_tokens that does the check + and returns TIME if the conditions are met + o take check for `TIME' out of CHECK_FOR_RESERVED_WORD, but + leave it in the word_token_alist so that `type' still + reports it as a `keyword' + o new function, time_command_acceptable(), encapsulates the + necessary conditions for `time' to be returned as a + reserved word + + [bash-2.02-alpha1 frozen] + + 1/6/98 + ------ + lib/glob/fnmatch.c + - fix define for isgraph so that it does not return success for space + - fix strcompare() so that the call to strcoll is surrounded by + #ifdef HAVE_STRCOLL + + 1/7 + --- + lib/glob/fnmatch.c + - the `test' argument to brackmatch() should be of type `unsigned char' + + 1/11 + ---- + execute_cmd.c + - make sure execute_arith_command sets this_command_name to `((' + + 1/29 + ---- + parse.y + - make sure the code for pushing and popping strings is compiled in + if either ALIAS or DPAREN_ARITHMETIC is defined, because the (( + code uses push_string in the case of a nested subshell + - fix cond_skip_newlines so it resets the prompt to $PS2 while + parsing an unfinished conditional command + + dispose_cmd.c, copy_cmd.c, builtins/hash.def + - fixes to not use `word' as a variable name or the name of a + function parameter to get around stuff in the Cray Unix include + files + + builtins/printf.def + - return failure immediately if an illegal format character is + encountered + + redir.c + - make the code that creates here-documents behave better if the + file it's trying to create already exists for some reason + + lib/readline/complete.c + - changed print_filename to return the number of characters it + outputs; changed callers to use that value. This makes columns + line up when printing completion listings with filenames + containing control characters + + doc/bash.{1,html} + - fixed a typo in the quote removal section + + 1/30 + ---- + parse.y + - free_string_list() needs to check that t->expander is not NULL + before trying to dereference it + - reset_parser() doesn't need to set pushed_string_list to NULL + after calling free_string_list(), since free_string_list does it + + configure.in,cross-build/cygwin32.cache + - fixes from Geoff Noer for better cygwin32 cross-compilation + + tests/printf.{tests,right} + - removed test for integer overflow, since error messages differ + across systems + + pathexp.c + - fixed a problem with unquoted_glob_pattern_p that made things + like `x+*' not expand correctly + + lib/glob/glob.c + - fixed a problem with glob_pattern_p that made things like `x+*' + not expand correctly + + builtins/cd.def + - if `cd -P' is executed, or `set -o physical' has been executed, + the value of $PWD after a successful cd will not contain any + symlinks, regardless of whether or not the shell is in posix mode + + 2/3 + --- + lib/readline/shell.c + - include or as appropriate + + 2/4 + --- + builtins/common.c + - take out the code in backslash_quote() that looks for tildes to + quote, for the time being + - if getcwd() fails, get_working_directory now prints the error + message corresponding to errno in addition to the rest of the + information -- TENTATIVE CHANGE + + lib/sh/getcwd.c + - fix from Paul Smith to make getcwd() behave better in the presence + of lstat(2) failures + + stringlib.c + - when copying the replacement string into the output string being + constructed, strsub() needs to make sure enough space for the + replacement string is allocated, not the length of the pattern + (use REPLEN, not PATLEN) + + mailcheck.c + - make sure make_default_mailpath() has a valid current_user struct + before trying to construct the default mailpath + + 2/5 + --- + execute_cmd.c + - execute_builtin needs to call run_unwind_frame if the builtin is + `source' or `eval' and we're not in a subshell rather than just + calling dispose_builtin_env, because not all invocations copy + the temporary_env to builtin_env, and nested calls to `.' require + that the temporary env given to the first persist until that first + call to `.' finishes + + parse.y + - fix to history_delimiting_chars so that function definitions like + + function xyz + { + echo a + } + + are saved to the history correctly when command_oriented_history + is enabled, but literal_history is not + + bashhist.c + - when calling internal_error from pre_process_line, use "%s" as + the format with history_value as the argument to avoid the + problem with the failed history event containing printf escape + sequences + + 2/13 + ---- + shell.c + - if shell_initialized is non-zero, don't line-buffer stderr and + stdout in shell_initialize on SunOS5 -- see if this fixes the + crashing problems for scripts without a leading `#! /bin/sh' + + 2/17 + ---- + bashline.c + - added diffs to _ignore_completion_names from Andreas Schwab to + complete names that would otherwise be ignored with FIGNORE if + they are the only possible completions. Define NO_FORCE_FIGNORE + if you want this; it is not defined by default + + 2/19 + ---- + support/bashbug.sh + - changed the bug-bash address to bug-bash@gnu.org + + examples/loadables/Makefile.in + - converted from `Makefile' with some boilerplate configure variables + to find the source and build directories -- still requires some + hand-editing to get the right CFLAGS and LDFLAGS for shared object + creation + + Makefile.in + - create examples/loadables/Makefile with `make makefiles' + + configure.in + - create examples/loadables directory so `make makefiles' can write a + makefile there + + general.c + - make sure initialize_groups_array always sets things up so that + ${GROUPS[0]} is the user's primary group (current_user.gid) + + 2/20 + ---- + lib/readline/parens.c + - change the time delay when showing matching parens from 1.5 sec to + 0.5 sec + + 2/23 + ---- + shell.c + - isnetconn() should call getpeername(fd,...) instead of using 0 + (though fileno(stdin) should always be 0) + + support/config.guess + - updates from master FSF copy + + 2/24 + ---- + support/man2html.c + - modified version of man2html to convert bash.1 into bash.html + + support/Makefile.in + - simple Makefile to create man2html + + configure.in + - make sure support/Makefile is created + + Makefile.in + - make sure support/Makefile is created and cleaned + + doc/Makefile.in + - changes to suffix rules to say how to make .html from .1 + - `bash.html' is now a makefile target, created by man2html from + bash.1 rather than being hand-modified + + lib/sh/itos.c, general.c + - new file, itos() from general.c. This is here because the + implementation of strerror in lib/sh/strerror.c uses itos() + + Makefile.in, lib/sh/Makefile.in + - changes to add itos.c in libsh.a + + externs.h, general.h + - moved extern declaration of itos() from general.h to externs.h + + aclocal.m4 + - changes to BASH_LARGE_FILE_SUPPORT for the LFS64_* variables in + Solaris 2.6 + + Makefile.in + - make sure configure sets CPPFLAGS in this file + + 2/27 + ---- + + builtins/command.def + - make sure get_standard_path returns the value of + STANDARD_UTILS_PATH if _CS_PATH is defined, but confstr(3) + returns 0, indicating that _CS_PATH does not have a defined + value + + bashhist.c + - fixed bash_history_inhibit_expansion() so that extended globbing + expressions like *.!(c) are not history expanded if extended_glob + is non-zero (shopt -s extglob has been executed) + + 3/2 + --- + Makefile.in + - changed release status to `beta1' + + [bash-2.02-beta1 frozen] + + 3/17 + ---- + lib/readline/vi_mode.c + - make sure _rl_vi_save_insert() gets a non-null UNDO_LIST pointer + before trying to do anything with it + + jobs.c + - add a call to internal_warning from wait_for_job if the job is + stopped + - changed notify_of_job_status to not report pipelines exiting due to + SIGPIPE in non-interactive shells if the shell is compiled with + -DDONT_REPORT_SIGPIPE + + builtins/psize.sh + - some fixes to try to avoid /tmp file races and surreptitious + substitutions + + version.c + - changed the extended version info to show 1998 as the copyright year + + parse.y + - fixes from Andreas Schwab + for compilation errors when the shell is configured --disable-alias + but with dparen arithmetic enabled + + eval.c + - fixes from Andreas Schwab to + make sure the input stream is popped correctly when performing an + array assignment in the command argument to `bash -c', e.g., + `bash -c 'A=()'' + + builtins/kill.def + - make `kill' with no arguments print a usage message and return a + failure status + + alias.c + - fix so that rd_token doesn't dump core when trying to do alias + expansion on a line containing an unclosed single quote (fix from + Vasco Pedro ) + + builtins/cd.def + - fix so that using a non-empty directory from CDPATH to construct + the name of the directory to change to results in an absolute + pathname of the new current working directory being displayed, + as POSIX.2 specifies + + support/bashbug.sh + - a couple of small fixes to minimize /tmp file races -- the script + is still raceable, the window is just smaller + + 3/24 + ---- + variables.c + - make sure assign_in_env passes a malloc'd string to + expand_string_unsplit, because some of the error code assumes that + it is malloc'd and frees it (bug reported by Marko.Makela@HUT.FI) + + 3/25 + ---- + doc/bashref.texi + - changed the email addresses to use the @email texinfo tag + + trap.c + - call reset_parser from the exit trap code before calling + parse_and_execute, so reserved words are parsed correctly + + subst.c + - make sure parameter_brace_patsub expands the pattern string as if + the expression were not in double quotes, even if the entire + expansion is enclosed in double quotes, so that quote removal + on embedded double quotes is performed correctly (bug report from + schwab@issan.informatik.uni-dortmund.de) + + 3/27 + ---- + support/config.guess + - changes to allow Power PCs running Apple's Rhapsody to configure + + 3/31 + ---- + + Makefile.in + - changed release status to `beta2' + + [bash-2.02-beta2 frozen] + + 4/6 + --- + subst.c + - make sure command_substitute does not try to set the terminal's + process group to a background job + + [bash-2.02 frozen] diff -Nrc2 bash-2.01.1/INSTALL bash-2.02/INSTALL *** bash-2.01.1/INSTALL Fri Apr 25 14:16:16 1997 --- bash-2.02/INSTALL Thu Sep 18 15:44:39 1997 *************** *** 198,203 **** `--with-glibc-malloc' Use the GNU libc version of `malloc' in `lib/malloc/gmalloc.c'. ! This is somewhat slower than the default `malloc', but wastes ! considerably less space. `--with-gnu-malloc' --- 198,206 ---- `--with-glibc-malloc' Use the GNU libc version of `malloc' in `lib/malloc/gmalloc.c'. ! This is not the version of `malloc' that appears in glibc version ! 2, but a modified version of the `malloc' from glibc version 1. ! This is somewhat slower than the default `malloc', but wastes less ! space on a per-allocation basis, and will return memory to the ! operating system under some circumstances. `--with-gnu-malloc' *************** *** 205,212 **** not the same `malloc' that appears in GNU libc, but an older version derived from the 4.2 BSD `malloc'. This `malloc' is very ! fast, but wastes a lot of space. This option is enabled by ! default. The `NOTES' file contains a list of systems for which ! this should be turned off, and `configure' disables this option ! automatically for a number of systems. `--with-purify' --- 208,215 ---- not the same `malloc' that appears in GNU libc, but an older version derived from the 4.2 BSD `malloc'. This `malloc' is very ! fast, but wastes some space on each allocation. This option is ! enabled by default. The `NOTES' file contains a list of systems ! for which this should be turned off, and `configure' disables this ! option automatically for a number of systems. `--with-purify' *************** *** 218,221 **** --- 221,235 ---- historical Bourne shell. + There are several `--enable-' options that alter how Bash is compiled + and linked, rather than changing run-time features. + + `--enable-profiling' + This builds a Bash binary that produces profiling information to be + processed by `gprof' each time it is executed. + + `--enable-static-link' + This causes Bash to be linked statically, if `gcc' is being used. + This could be used to build a version to use as root's shell. + The `minimal-config' option can be used to disable all of the following options, but it is processed first, so individual options may be *************** *** 245,248 **** --- 259,265 ---- be timed. + `--enable-cond-command' + Include support for the `[[' conditional command. + `--enable-directory-stack' Include support for a `csh'-like directory stack and the `pushd', *************** *** 257,260 **** --- 274,281 ---- `--enable-dparen-arithmetic' Include support for the `ksh' `((...))' command. + + `--enable-extended-glob' + Include support for the extended pattern matching features + described above under *Note Pattern Matching::. `--enable-help-builtin' diff -Nrc2 bash-2.01.1/MANIFEST bash-2.02/MANIFEST *** bash-2.01.1/MANIFEST Mon Jun 2 16:35:37 1997 --- bash-2.02/MANIFEST Tue Mar 3 15:03:27 1998 *************** *** 8,11 **** --- 8,12 ---- CWRU/misc d builtins d + cross-build d doc d examples d *************** *** 26,29 **** --- 27,31 ---- lib/readline/doc d lib/readline/examples d + lib/sh d lib/termcap d lib/termcap/grot d *************** *** 56,60 **** locale.c f stringlib.c f - oslib.c f variables.c f make_cmd.c f --- 58,61 ---- *************** *** 62,66 **** unwind_prot.c f dispose_cmd.c f - getcwd.c f bashhist.c f hashcmd.c f --- 63,66 ---- *************** *** 82,90 **** alias.c f execute_cmd.c f bashline.c f braces.c f bracecomp.c f nojobs.c f - vprint.c f error.c f xmalloc.c f --- 82,91 ---- alias.c f execute_cmd.c f + findcmd.c f + redir.c f bashline.c f braces.c f bracecomp.c f nojobs.c f error.c f xmalloc.c f *************** *** 98,101 **** --- 99,103 ---- maxpath.h f filecntl.h f + findcmd.h f hashlib.h f quit.h f *************** *** 105,108 **** --- 107,111 ---- parser.h f sig.h f + test.h f trap.h f general.h f *************** *** 122,125 **** --- 125,129 ---- make_cmd.h f execute_cmd.h f + redir.h f bashtypes.h f mailcheck.h f *************** *** 166,169 **** --- 170,174 ---- builtins/kill.def f builtins/mkbuiltins.c f + builtins/printf.def f builtins/pushd.def f builtins/read.def f *************** *** 189,192 **** --- 194,199 ---- builtins/common.h f builtins/bashgetopt.h f + cross-build/cygwin32.cache f + cross-build/win32sig.h f lib/glob/ChangeLog f lib/glob/Makefile.in f *************** *** 195,198 **** --- 202,206 ---- lib/glob/glob.c f lib/glob/glob.h f + lib/glob/collsyms.h f lib/glob/doc/Makefile f lib/glob/doc/glob.texi f *************** *** 204,207 **** --- 212,217 ---- lib/malloc/gmalloc.c f lib/malloc/xmalloc.c f + lib/malloc/ogmalloc.c f + lib/malloc/omalloc.c f lib/malloc/stub.c f lib/malloc/i386-alloca.s f *************** *** 252,255 **** --- 262,266 ---- lib/readline/rlconf.h f lib/readline/rltty.h f + lib/readline/rlwinsize.h f lib/readline/readline.h f lib/readline/tcap.h f *************** *** 276,279 **** --- 287,303 ---- lib/readline/examples/rl.c f lib/readline/examples/Inputrc f + lib/sh/Makefile.in f + lib/sh/clktck.c f + lib/sh/getcwd.c f + lib/sh/getenv.c f + lib/sh/itos.c f + lib/sh/oslib.c f + lib/sh/setlinebuf.c f + lib/sh/strcasecmp.c f + lib/sh/strerror.c f + lib/sh/strtod.c f + lib/sh/strtol.c f + lib/sh/strtoul.c f + lib/sh/vprint.c f lib/termcap/Makefile.in f lib/termcap/termcap.c f *************** *** 325,328 **** --- 349,354 ---- doc/builtins.1 f doc/article.ms f + doc/htmlpost.sh f 755 + support/Makefile.in f support/config.guess f support/config.sub f *************** *** 336,339 **** --- 362,366 ---- support/mksignames.c f support/bashbug.sh f + support/man2html.c f support/recho.c f support/zecho.c f *************** *** 350,357 **** examples/bashdb/bashdb.pre f examples/loadables/README f ! examples/loadables/Makefile f examples/loadables/necho.c f examples/loadables/hello.c f - examples/loadables/printf.c f examples/loadables/print.c f examples/loadables/sprintf.c f --- 377,383 ---- examples/bashdb/bashdb.pre f examples/loadables/README f ! examples/loadables/Makefile.in f examples/loadables/necho.c f examples/loadables/hello.c f examples/loadables/print.c f examples/loadables/sprintf.c f *************** *** 370,415 **** examples/loadables/rmdir.c f examples/loadables/head.c f - examples/functions/substr f - examples/functions/kshenv f examples/functions/autoload f examples/functions/autoload.v2 f examples/functions/csh-compat f - examples/functions/shcat f - examples/functions/substr2 f - examples/functions/term f - examples/functions/whatis f - examples/functions/whence f - examples/functions/func f - examples/functions/dirname f examples/functions/dirfuncs f ! examples/functions/basename f examples/functions/exitstat f examples/functions/external f examples/functions/fact f - examples/functions/manpage f examples/functions/fstty f ! examples/functions/jj.bash f ! examples/functions/notify.bash f examples/functions/inpath f ! examples/functions/login f examples/functions/keep f ! examples/functions/seq f examples/functions/mhfold f examples/functions/repeat2 f ! examples/functions/lowercase f examples/functions/xalias.bash f - examples/scripts/shprompt f examples/scripts/adventure.sh f - examples/scripts/precedence f examples/scripts/bcsh.sh f examples/scripts/inpath f examples/scripts/nohup.bash f ! examples/scripts/vtree2 f ! examples/scripts/vtree3 f examples/scripts/scrollbar f examples/scripts/spin.bash f examples/scripts/zprintf f examples/startup-files/README f ! examples/startup-files/Bashrc f examples/startup-files/Bash_aliases f examples/startup-files/Bash_profile f --- 396,456 ---- examples/loadables/rmdir.c f examples/loadables/head.c f examples/functions/autoload f examples/functions/autoload.v2 f + examples/functions/basename f + examples/functions/basename2 f examples/functions/csh-compat f examples/functions/dirfuncs f ! examples/functions/dirname f examples/functions/exitstat f examples/functions/external f examples/functions/fact f examples/functions/fstty f ! examples/functions/func f ! examples/functions/getoptx.bash f ! examples/functions/inetaddr f examples/functions/inpath f ! examples/functions/isnum.bash f ! examples/functions/isnum2 f ! examples/functions/jdate.bash f ! examples/functions/jj.bash f examples/functions/keep f ! examples/functions/kshenv f ! examples/functions/login f ! examples/functions/lowercase f ! examples/functions/manpage f examples/functions/mhfold f + examples/functions/notify.bash f + examples/functions/pathfuncs f examples/functions/repeat2 f ! examples/functions/seq f ! examples/functions/shcat f ! examples/functions/shcat2 f ! examples/functions/substr f ! examples/functions/substr2 f ! examples/functions/term f ! examples/functions/whatis f ! examples/functions/whence f examples/functions/xalias.bash f examples/scripts/adventure.sh f examples/scripts/bcsh.sh f + examples/scripts/fixfiles.bash f + examples/scripts/hanoi.bash f examples/scripts/inpath f + examples/scripts/krand.bash f examples/scripts/nohup.bash f ! examples/scripts/precedence f ! examples/scripts/randomcard.bash f examples/scripts/scrollbar f + examples/scripts/scrollbar2 f + examples/scripts/showperm.bash f + examples/scripts/shprompt f examples/scripts/spin.bash f + examples/scripts/timeout f + examples/scripts/vtree2 f + examples/scripts/vtree3 f examples/scripts/zprintf f examples/startup-files/README f ! examples/startup-files/Bashrc.bfox f examples/startup-files/Bash_aliases f examples/startup-files/Bash_profile f *************** *** 417,422 **** examples/startup-files/bashrc f examples/misc/suncmd.termcap f ! examples/misc/alias-conv.sh f ! examples/misc/alias-conv.bash f examples/misc/cshtobash f tests/README f --- 458,463 ---- examples/startup-files/bashrc f examples/misc/suncmd.termcap f ! examples/misc/aliasconv.sh f ! examples/misc/aliasconv.bash f examples/misc/cshtobash f tests/README f *************** *** 425,428 **** --- 466,471 ---- tests/array.tests f tests/array.right f + tests/array-at-star f + tests/array2.right f tests/braces-tests f tests/braces.right f *************** *** 430,487 **** tests/builtins.right f tests/builtins.sub1 f ! tests/source.sub1 f ! tests/source.sub2 f ! tests/source.sub3 f ! tests/source.sub4 f ! tests/dirstack.tests f ! tests/dirstack.right f ! tests/dollar-at.sh f ! tests/dollar-star.sh f tests/dollar.right f tests/errors.tests f tests/errors.right f tests/execscript f ! tests/execscript.right f ! tests/execscript.sub f 755 ! tests/execscript.sub2 f ! tests/execscript.sub3 f ! tests/execscript.sub4 f tests/exp-tests f tests/exp.right f tests/func.tests f tests/func.right f tests/getopts.tests f tests/getopts.right f ! tests/getopts.sub1 f ! tests/getopts.sub2 f ! tests/getopts.sub3 f ! tests/getopts.sub4 f ! tests/getopts.sub5 f ! tests/getopts.sub6 f ! tests/getopts.sub7 f tests/glob-test f tests/glob.right f tests/heredoc.tests f tests/heredoc.right f ! tests/histexpand.tests f ! tests/histexpand.right f tests/history.tests f tests/history.right f tests/history.list f ! tests/ifs-test-1.sh f ! tests/ifs-test-2.sh f ! tests/ifs-test-3.sh f ! tests/ifs.1.right f ! tests/ifs.2.right f ! tests/ifs.3.right f tests/input-line.sh f tests/input-line.sub f tests/input.right f tests/jobs.tests f tests/jobs.right f tests/more-exp.tests f tests/more-exp.right f tests/new-exp.tests f ! tests/new-exp.sub1 f tests/new-exp.right f tests/nquote.tests f --- 473,541 ---- tests/builtins.right f tests/builtins.sub1 f ! tests/source1.sub f ! tests/source2.sub f ! tests/source3.sub f ! tests/source4.sub f ! tests/source5.sub f ! tests/cond.tests f ! tests/cond.right f ! tests/dollar-at-star f tests/dollar.right f + tests/dstack.tests f + tests/dstack.right f + tests/dstack2.tests f + tests/dstack2.right f tests/errors.tests f tests/errors.right f tests/execscript f ! tests/exec.right f ! tests/exec1.sub f 755 ! tests/exec2.sub f ! tests/exec3.sub f ! tests/exec4.sub f ! tests/exec5.sub f tests/exp-tests f tests/exp.right f + tests/extglob.tests f + tests/extglob.right f tests/func.tests f tests/func.right f tests/getopts.tests f tests/getopts.right f ! tests/getopts1.sub f ! tests/getopts2.sub f ! tests/getopts3.sub f ! tests/getopts4.sub f ! tests/getopts5.sub f ! tests/getopts6.sub f ! tests/getopts7.sub f tests/glob-test f + tests/glob1.sub f tests/glob.right f tests/heredoc.tests f tests/heredoc.right f ! tests/histexp.tests f ! tests/histexp.right f tests/history.tests f tests/history.right f tests/history.list f ! tests/ifs-1.test f ! tests/ifs-2.test f ! tests/ifs-3.test f ! tests/ifs-1.right f ! tests/ifs-2.right f ! tests/ifs-3.right f tests/input-line.sh f tests/input-line.sub f tests/input.right f tests/jobs.tests f + tests/jobs1.sub f + tests/jobs2.sub f tests/jobs.right f tests/more-exp.tests f tests/more-exp.right f tests/new-exp.tests f ! tests/new-exp1.sub f ! tests/new-exp2.sub f tests/new-exp.right f tests/nquote.tests f *************** *** 489,494 **** --- 543,552 ---- tests/posix2.tests f tests/posix2.right f + tests/posixpat.tests f + tests/posixpat.right f tests/prec.right f tests/precedence f + tests/printf.tests f + tests/printf.right f tests/quote.tests f tests/quote.right f *************** *** 512,517 **** --- 570,577 ---- tests/run-arith f tests/run-array f + tests/run-array2 f tests/run-braces f tests/run-builtins f + tests/run-cond f tests/run-dirstack f tests/run-dollars f *************** *** 519,522 **** --- 579,583 ---- tests/run-execscript f tests/run-exp-tests f + tests/run-extglob f tests/run-func f tests/run-getopts f *************** *** 532,536 **** --- 593,599 ---- tests/run-nquote f tests/run-posix2 f + tests/run-posixpat f tests/run-precedence f + tests/run-printf f tests/run-quote f tests/run-read f *************** *** 538,542 **** tests/run-rhs-exp f tests/run-rsh f ! tests/run-set-e-test f tests/run-strip f tests/run-test f --- 601,606 ---- tests/run-rhs-exp f tests/run-rsh f ! tests/run-set-e f ! tests/run-shopt f tests/run-strip f tests/run-test f *************** *** 547,550 **** --- 611,616 ---- tests/set-e-test f tests/set-e.right f + tests/shopt.tests f + tests/shopt.right f tests/strip.tests f tests/strip.right f *************** *** 555,559 **** tests/trap.tests f tests/trap.right f ! tests/trap.sub1 f 755 tests/type.tests f tests/type.right f --- 621,625 ---- tests/trap.tests f tests/trap.right f ! tests/trap1.sub f 755 tests/type.tests f tests/type.right f *************** *** 562,573 **** tests/version f tests/version.mini f ! tests/misc/haertel.perftest f ! tests/misc/perf-script f ! tests/misc/redir.t2.sh f ! tests/misc/run.r2.sh f ! tests/misc/sigint.t1.sh f ! tests/misc/sigint.t2.sh f ! tests/misc/sigint.t3.sh f ! tests/misc/sigint.t4.sh f tests/misc/test-minus-e.1 f tests/misc/test-minus-e.2 f --- 628,639 ---- tests/version f tests/version.mini f ! tests/misc/perftest f ! tests/misc/perf-script f ! tests/misc/redir-t2.sh f ! tests/misc/run-r2.sh f ! tests/misc/sigint-1.sh f ! tests/misc/sigint-2.sh f ! tests/misc/sigint-3.sh f ! tests/misc/sigint-4.sh f tests/misc/test-minus-e.1 f tests/misc/test-minus-e.2 f *************** *** 576,579 **** --- 642,646 ---- examples/scripts.v2/arc2tarz f examples/scripts.v2/bashrand f + examples/scripts.v2/cal2day.bash f examples/scripts.v2/cdhist.bash f examples/scripts.v2/corename f diff -Nrc2 bash-2.01.1/Makefile.in bash-2.02/Makefile.in *** bash-2.01.1/Makefile.in Wed May 28 13:34:27 1997 --- bash-2.02/Makefile.in Thu Apr 16 11:35:05 1998 *************** *** 1,3 **** ! # Makefile for bash-2.01, version 2.32 # # Make sure the first target in the makefile is the right one --- 1,3 ---- ! # Makefile for bash-2.02, version 2.84 # # Make sure the first target in the makefile is the right one *************** *** 28,31 **** --- 28,32 ---- @SET_MAKE@ CC = @CC@ + CC_FOR_BUILD = @CC_FOR_BUILD@ YACC = @YACC@ SHELL=/bin/sh *************** *** 69,73 **** # PROFILE_FLAGS is either -pg, to generate profiling info for use # with gprof, or nothing (the default). ! PROFILE_FLAGS= # The GNU coding standards don't recognize the possibility that --- 70,74 ---- # PROFILE_FLAGS is either -pg, to generate profiling info for use # with gprof, or nothing (the default). ! PROFILE_FLAGS= @PROFILE_FLAGS@ # The GNU coding standards don't recognize the possibility that *************** *** 75,78 **** --- 76,80 ---- # passed to cc. A different name should have been used. CFLAGS = @CFLAGS@ + CPPFLAGS = @CPPFLAGS@ LOCAL_CFLAGS = @LOCAL_CFLAGS@ DEFS = @DEFS@ *************** *** 106,109 **** --- 108,132 ---- SUBDIR_INCLUDES = -I. -I$(topdir) -I$(topdir)/$(LIBSUBDIR) -I$(includedir) + # the bash library + # the library is a mix of functions that the C library does not provide on + # some platforms and general shell utility functions + SH_LIBSRC = $(LIBSRC)/sh + SH_LIBDIR = $(dot)/${LIBSUBDIR}/sh + SH_ABSSRC = ${topdir}/${SH_LIBSRC} + + SHLIB_SOURCE = ${SH_LIBSRC}/clktck.c ${SH_LIBSRC}/getcwd.c \ + ${SH_LIBSRC}/getenv.c ${SH_LIBSRC}/oslib.c \ + ${SH_LIBSRC}/setlinebuf.c \ + ${SH_LIBSRC}/strcasecmp.c ${SH_LIBSRC}/strerror.c \ + ${SH_LIBSRC}/strtod.c ${SH_LIBSRC}/strtol.c \ + ${SH_LIBSRC}/strtoul.c ${SH_LIBSRC}/vprint.c \ + ${SH_LIBSRC}/itos.c + + SHLIB_LIB = -lsh + SHLIB_LIBNAME = libsh.a + SHLIB_LIBRARY = ${SH_LIBDIR}/${SHLIB_LIBNAME} + SHLIB_LDFLAGS = -L${SH_LIBDIR} + SHLIB_DEP = ${SHLIB_LIBRARY} + # we assume for now that readline source is being shipped with bash RL_LIBSRC = $(LIBSRC)/readline *************** *** 241,251 **** LIBRARIES = $(READLINE_LIB) $(HISTORY_LIB) $(TERMCAP_LIB) $(GLOB_LIB) \ ! $(TILDE_LIB) $(MALLOC_LIB) $(LOCAL_LIBS) LIBDEP = $(READLINE_DEP) $(TERMCAP_DEP) $(GLOB_DEP) $(HISTORY_DEP) \ ! $(TILDE_DEP) $(MALLOC_DEP) LIBRARY_LDFLAGS = $(READLINE_LDFLAGS) $(HISTORY_LDFLAGS) $(TILDE_LDFLAGS) \ ! $(GLOB_LDFLAGS) $(MALLOC_LDFLAGS) # --- 264,274 ---- LIBRARIES = $(READLINE_LIB) $(HISTORY_LIB) $(TERMCAP_LIB) $(GLOB_LIB) \ ! $(TILDE_LIB) $(MALLOC_LIB) $(SHLIB_LIB) $(LOCAL_LIBS) LIBDEP = $(READLINE_DEP) $(TERMCAP_DEP) $(GLOB_DEP) $(HISTORY_DEP) \ ! $(TILDE_DEP) $(MALLOC_DEP) $(SHLIB_DEP) LIBRARY_LDFLAGS = $(READLINE_LDFLAGS) $(HISTORY_LDFLAGS) $(TILDE_LDFLAGS) \ ! $(GLOB_LDFLAGS) $(MALLOC_LDFLAGS) $(SHLIB_LDFLAGS) # *************** *** 258,264 **** expr.c copy_cmd.c flags.c subst.c hashcmd.c hashlib.c mailcheck.c \ test.c trap.c alias.c jobs.c nojobs.c $(ALLOC_FILES) braces.c \ ! vprint.c input.c bashhist.c array.c sig.c pathexp.c oslib.c \ ! unwind_prot.c siglist.c getcwd.c bashline.c bracecomp.c error.c \ ! list.c stringlib.c locale.c xmalloc.c HSOURCES = shell.h flags.h trap.h hashcmd.h hashlib.h jobs.h builtins.h \ --- 281,287 ---- expr.c copy_cmd.c flags.c subst.c hashcmd.c hashlib.c mailcheck.c \ test.c trap.c alias.c jobs.c nojobs.c $(ALLOC_FILES) braces.c \ ! input.c bashhist.c array.c sig.c pathexp.c \ ! unwind_prot.c siglist.c bashline.c bracecomp.c error.c \ ! list.c stringlib.c locale.c findcmd.c redir.c xmalloc.c HSOURCES = shell.h flags.h trap.h hashcmd.h hashlib.h jobs.h builtins.h \ *************** *** 273,276 **** --- 296,302 ---- SOURCES = $(CSOURCES) $(HSOURCES) $(BUILTIN_DEFS) + # header files chosen based on running of configure + SIGNAMES_H = @SIGNAMES_H@ + # object files chosen based on running of configure JOBS_O = @JOBS_O@ *************** *** 282,287 **** trap.o input.o unwind_prot.o pathexp.o sig.o test.o version.o \ alias.o array.o braces.o bracecomp.o bashhist.o bashline.o \ ! getcwd.o siglist.o vprint.o oslib.o list.o stringlib.o \ ! locale.o xmalloc.o # Where the source code of the shell builtins resides. --- 308,312 ---- trap.o input.o unwind_prot.o pathexp.o sig.o test.o version.o \ alias.o array.o braces.o bracecomp.o bashhist.o bashline.o \ ! siglist.o list.o stringlib.o locale.o findcmd.o redir.o xmalloc.o # Where the source code of the shell builtins resides. *************** *** 304,308 **** $(DEFSRC)/ulimit.def $(DEFSRC)/umask.def $(DEFSRC)/wait.def \ $(DEFSRC)/getopts.def $(DEFSRC)/reserved.def \ ! $(DEFSRC)/pushd.def $(DEFSRC)/shopt.def BUILTIN_C_SRC = $(DEFSRC)/mkbuiltins.c $(DEFSRC)/common.c \ $(DEFSRC)/evalstring.c $(DEFSRC)/evalfile.c \ --- 329,333 ---- $(DEFSRC)/ulimit.def $(DEFSRC)/umask.def $(DEFSRC)/wait.def \ $(DEFSRC)/getopts.def $(DEFSRC)/reserved.def \ ! $(DEFSRC)/pushd.def $(DEFSRC)/shopt.def $(DEFSRC)/printf.def BUILTIN_C_SRC = $(DEFSRC)/mkbuiltins.c $(DEFSRC)/common.c \ $(DEFSRC)/evalstring.c $(DEFSRC)/evalfile.c \ *************** *** 318,322 **** $(DEFDIR)/history.o $(DEFDIR)/jobs.o $(DEFDIR)/kill.o \ $(DEFDIR)/let.o $(DEFDIR)/pushd.o $(DEFDIR)/read.o \ ! $(DEFDIR)/return.o $(DEFDIR)/shopt.o \ $(DEFDIR)/set.o $(DEFDIR)/setattr.o $(DEFDIR)/shift.o \ $(DEFDIR)/source.o $(DEFDIR)/suspend.o $(DEFDIR)/test.o \ --- 343,347 ---- $(DEFDIR)/history.o $(DEFDIR)/jobs.o $(DEFDIR)/kill.o \ $(DEFDIR)/let.o $(DEFDIR)/pushd.o $(DEFDIR)/read.o \ ! $(DEFDIR)/return.o $(DEFDIR)/shopt.o $(DEFDIR)/printf.o \ $(DEFDIR)/set.o $(DEFDIR)/setattr.o $(DEFDIR)/shift.o \ $(DEFDIR)/source.o $(DEFDIR)/suspend.o $(DEFDIR)/test.o \ *************** *** 343,353 **** TESTS_SUPPORT = recho zecho printenv CREATED_SUPPORT = signames.h recho zecho printenv tests/recho tests/zecho \ ! tests/printenv mksignames CREATED_CONFIGURE = config.h config.cache config.status config.log \ stamp-h CREATED_MAKEFILES = Makefile builtins/Makefile doc/Makefile \ lib/readline/Makefile lib/glob/Makefile \ ! lib/tilde/Makefile lib/malloc/Makefile \ ! lib/termcap/Makefile # Keep GNU Make from exporting the entire environment for small machines. --- 368,379 ---- TESTS_SUPPORT = recho zecho printenv CREATED_SUPPORT = signames.h recho zecho printenv tests/recho tests/zecho \ ! tests/printenv mksignames lsignames.h CREATED_CONFIGURE = config.h config.cache config.status config.log \ stamp-h CREATED_MAKEFILES = Makefile builtins/Makefile doc/Makefile \ lib/readline/Makefile lib/glob/Makefile \ ! lib/sh/Makefile lib/tilde/Makefile lib/malloc/Makefile \ ! lib/termcap/Makefile examples/loadables/Makefile \ ! support/Makefile # Keep GNU Make from exporting the entire environment for small machines. *************** *** 359,363 **** $(Program): .build $(OBJECTS) $(BUILTINS_DEP) $(LIBDEP) $(RM) $@ ! $(PURIFY) $(CC) $(LDFLAGS) $(BUILTINS_LDFLAGS) $(LIBRARY_LDFLAGS) -o $(Program) $(OBJECTS) $(LIBS) ls -l $(Program) size $(Program) --- 385,389 ---- $(Program): .build $(OBJECTS) $(BUILTINS_DEP) $(LIBDEP) $(RM) $@ ! $(PURIFY) $(CC) $(BUILTINS_LDFLAGS) $(LIBRARY_LDFLAGS) $(LDFLAGS) -o $(Program) $(OBJECTS) $(LIBS) ls -l $(Program) size $(Program) *************** *** 433,443 **** $(MAKE) $(MFLAGS) libtermcap.a) || exit 1 mksignames: $(SUPPORT_SRC)mksignames.c $(CC) $(CCFLAGS) $(CPPFLAGS) -o $@ $(SUPPORT_SRC)mksignames.c ! signames.h: mksignames $(RM) $@ ./mksignames $@ $(BUILTINS_LIBRARY): $(BUILTIN_DEFS) $(BUILTIN_C_SRC) config.h memalloc.h @(cd $(DEFDIR) && $(MAKE) $(MFLAGS) libbuiltins.a ) || exit 1 --- 459,480 ---- $(MAKE) $(MFLAGS) libtermcap.a) || exit 1 + $(SHLIB_LIBRARY): config.h ${SHLIB_SOURCE} + @echo making $@ in ${SH_LIBDIR} + @(cd ${SH_LIBDIR} && \ + $(MAKE) $(MFLAGS) ${SHLIB_LIBNAME}) || exit 1 + mksignames: $(SUPPORT_SRC)mksignames.c $(CC) $(CCFLAGS) $(CPPFLAGS) -o $@ $(SUPPORT_SRC)mksignames.c ! # make a list of signals for the local system -- this is done when we're ! # *not* cross-compiling ! lsignames.h: mksignames $(RM) $@ ./mksignames $@ + # copy the correct signames header file to signames.h + signames.h: $(SIGNAMES_H) + -if cmp -s $(SIGNAMES_H) $@ ; then :; else $(RM) $@ ; $(CP) $(SIGNAMES_H) $@ ; fi + $(BUILTINS_LIBRARY): $(BUILTIN_DEFS) $(BUILTIN_C_SRC) config.h memalloc.h @(cd $(DEFDIR) && $(MAKE) $(MFLAGS) libbuiltins.a ) || exit 1 *************** *** 588,592 **** @cp $(TESTS_SUPPORT) tests @( cd $(srcdir)/tests && \ ! PATH=$$PATH:$(BUILD_DIR)/tests THIS_SH=$(THIS_SH) sh ${TESTSCRIPT} ) symlinks: --- 625,629 ---- @cp $(TESTS_SUPPORT) tests @( cd $(srcdir)/tests && \ ! PATH=$$PATH:$(BUILD_DIR)/tests THIS_SH=$(THIS_SH) $(SHELL) ${TESTSCRIPT} ) symlinks: *************** *** 634,639 **** dispose_cmd.o: quit.h maxpath.h unwind_prot.h dispose_cmd.h dispose_cmd.o: make_cmd.h subst.h sig.h pathnames.h externs.h - getcwd.o: config.h bashtypes.h bashansi.h - getcwd.o: maxpath.h posixstat.h posixdir.h memalloc.h error.o: config.h bashtypes.h bashansi.h ansi_stdlib.h flags.h stdc.h error.h error.o: command.h general.h externs.h input.h bashhist.h --- 671,674 ---- *************** *** 650,655 **** execute_cmd.o: make_cmd.h subst.h sig.h pathnames.h externs.h execute_cmd.o: memalloc.h ${GRAM_H} flags.h builtins.h jobs.h quit.h siglist.h ! execute_cmd.o: execute_cmd.h trap.h pathexp.h $(DEFSRC)/common.h ! execute_cmd.o: ${DEFDIR}/builtext.h ${GLOB_LIBSRC}/fnmatch.h expr.o: config.h bashansi.h ansi_stdlib.h expr.o: shell.h config.h bashjmp.h posixjmp.h command.h stdc.h error.h --- 685,690 ---- execute_cmd.o: make_cmd.h subst.h sig.h pathnames.h externs.h execute_cmd.o: memalloc.h ${GRAM_H} flags.h builtins.h jobs.h quit.h siglist.h ! execute_cmd.o: execute_cmd.h findcmd.h redir.h trap.h test.h pathexp.h ! execute_cmd.o: $(DEFSRC)/common.h ${DEFDIR}/builtext.h ${GLOB_LIBSRC}/fnmatch.h expr.o: config.h bashansi.h ansi_stdlib.h expr.o: shell.h config.h bashjmp.h posixjmp.h command.h stdc.h error.h *************** *** 657,660 **** --- 692,700 ---- expr.o: quit.h maxpath.h unwind_prot.h dispose_cmd.h expr.o: make_cmd.h subst.h sig.h pathnames.h externs.h + findcmd.o: config.h bashtypes.h filecntl.h posixstat.h bashansi.h + findcmd.o: ansi_stdlib.h memalloc.h shell.h bashjmp.h posixjmp.h command.h + findcmd.o: stdc.h error.h general.h variables.h quit.h maxpath.h unwind_prot.h + findcmd.o: dispose_cmd.h make_cmd.h subst.h sig.h pathnames.h externs.h + findcmd.o: flags.h hashlib.h pathexp.h hashcmd.h flags.o: config.h flags.h flags.o: shell.h config.h bashjmp.h posixjmp.h command.h stdc.h error.h *************** *** 671,675 **** hashcmd.o: shell.h config.h bashjmp.h posixjmp.h command.h stdc.h error.h hashcmd.o: general.h bashtypes.h variables.h array.h hashcmd.h ! hashcmd.o: execute_cmd.h stdc.h hashlib.o: config.h bashansi.h ansi_stdlib.h hashlib.o: shell.h config.h bashjmp.h posixjmp.h command.h stdc.h error.h --- 711,715 ---- hashcmd.o: shell.h config.h bashjmp.h posixjmp.h command.h stdc.h error.h hashcmd.o: general.h bashtypes.h variables.h array.h hashcmd.h ! hashcmd.o: execute_cmd.h findcmd.h stdc.h hashlib.o: config.h bashansi.h ansi_stdlib.h hashlib.o: shell.h config.h bashjmp.h posixjmp.h command.h stdc.h error.h *************** *** 698,706 **** make_cmd.o: variables.h array.h hashlib.h subst.h input.h externs.h make_cmd.o: jobs.h quit.h siglist.h - oslib.o: config.h bashtypes.h posixstat.h filecntl.h bashansi.h maxpath.h - oslib.o: shell.h config.h bashjmp.h posixjmp.h command.h stdc.h error.h - oslib.o: general.h bashtypes.h variables.h array.h hashlib.h - oslib.o: quit.h maxpath.h unwind_prot.h dispose_cmd.h - oslib.o: make_cmd.h subst.h sig.h pathnames.h externs.h y.tab.o: config.h bashtypes.h bashansi.h ansi_stdlib.h memalloc.h y.tab.o: shell.h config.h bashjmp.h posixjmp.h command.h stdc.h error.h --- 738,741 ---- *************** *** 723,726 **** --- 758,766 ---- print_cmd.o: make_cmd.h subst.h sig.h pathnames.h externs.h print_cmd.o: ${GRAM_H} $(DEFSRC)/common.h + redir.o: config.h bashtypes.h posixstat.h bashansi.h ansi_stdlib.h filecntl.h + redir.o: memalloc.h shell.h bashjmp.h posixjmp.h command.h stdc.h error.h + redir.o: general.h variables.h array.h hashlib.h quit.h maxpath.h unwind_prot.h + redir.o: dispose_cmd.h make_cmd.h subst.h sig.h pathnames.h externs.h + redir.o: flags.h execute_cmd.h redir.h input.h shell.o: config.h bashtypes.h posixstat.h bashansi.h ansi_stdlib.h filecntl.h shell.o: shell.h config.h bashjmp.h posixjmp.h command.h stdc.h error.h *************** *** 729,733 **** shell.o: make_cmd.h subst.h sig.h pathnames.h externs.h shell.o: flags.h trap.h mailcheck.h builtins.h $(DEFSRC)/common.h ! shell.o: jobs.h siglist.h input.h execute_cmd.h bashhist.h shell.o: ${GLOB_LIBSRC}/fnmatch.h sig.o: config.h bashtypes.h --- 769,773 ---- shell.o: make_cmd.h subst.h sig.h pathnames.h externs.h shell.o: flags.h trap.h mailcheck.h builtins.h $(DEFSRC)/common.h ! shell.o: jobs.h siglist.h input.h execute_cmd.h findcmd.h bashhist.h shell.o: ${GLOB_LIBSRC}/fnmatch.h sig.o: config.h bashtypes.h *************** *** 755,759 **** test.o: general.h bashtypes.h variables.h array.h hashlib.h test.o: quit.h maxpath.h unwind_prot.h dispose_cmd.h ! test.o: make_cmd.h subst.h sig.h pathnames.h externs.h test.o: ${DEFSRC}/common.h trap.o: config.h bashtypes.h trap.h bashansi.h ansi_stdlib.h --- 795,799 ---- test.o: general.h bashtypes.h variables.h array.h hashlib.h test.o: quit.h maxpath.h unwind_prot.h dispose_cmd.h ! test.o: make_cmd.h subst.h sig.h pathnames.h externs.h test.h test.o: ${DEFSRC}/common.h trap.o: config.h bashtypes.h trap.h bashansi.h ansi_stdlib.h *************** *** 770,777 **** variables.o: quit.h maxpath.h unwind_prot.h dispose_cmd.h variables.o: make_cmd.h subst.h sig.h pathnames.h externs.h ! varibales.o: flags.h execute_cmd.h mailcheck.h input.h $(DEFSRC)/common.h ! variables.o: bashhist.h version.o: version.h .build - vprint.o: config.h xmalloc.o: config.h bashtypes.h ansi_stdlib.h error.h --- 810,816 ---- variables.o: quit.h maxpath.h unwind_prot.h dispose_cmd.h variables.o: make_cmd.h subst.h sig.h pathnames.h externs.h ! variables.o: flags.h execute_cmd.h mailcheck.h input.h $(DEFSRC)/common.h ! variables.o: findcmd.h bashhist.h version.o: version.h .build xmalloc.o: config.h bashtypes.h ansi_stdlib.h error.h *************** *** 820,824 **** bashline.o: quit.h maxpath.h unwind_prot.h dispose_cmd.h bashline.o: make_cmd.h subst.h sig.h pathnames.h externs.h ! bashline.o: builtins.h bashhist.h bashline.h execute_cmd.h pathexp.h bashline.o: $(DEFSRC)/common.h $(GLOB_LIBSRC)/glob.h alias.h bracecomp.o: config.h bashansi.h ansi_stdlib.h --- 859,863 ---- bashline.o: quit.h maxpath.h unwind_prot.h dispose_cmd.h bashline.o: make_cmd.h subst.h sig.h pathnames.h externs.h ! bashline.o: builtins.h bashhist.h bashline.h execute_cmd.h findcmd.h pathexp.h bashline.o: $(DEFSRC)/common.h $(GLOB_LIBSRC)/glob.h alias.h bracecomp.o: config.h bashansi.h ansi_stdlib.h *************** *** 930,934 **** builtins/exec.o: shell.h bashjmp.h posixjmp.h sig.h unwind_prot.h variables.h builtins/exec.o: dispose_cmd.h make_cmd.h subst.h externs.h execute_cmd.h ! builtins/exec.o: flags.h quit.h $(DEFSRC)/common.h stdc.h builtins/exit.o: bashtypes.h builtins/exit.o: command.h config.h memalloc.h error.h general.h maxpath.h --- 969,973 ---- builtins/exec.o: shell.h bashjmp.h posixjmp.h sig.h unwind_prot.h variables.h builtins/exec.o: dispose_cmd.h make_cmd.h subst.h externs.h execute_cmd.h ! builtins/exec.o: findcmd.h flags.h quit.h $(DEFSRC)/common.h stdc.h builtins/exit.o: bashtypes.h builtins/exit.o: command.h config.h memalloc.h error.h general.h maxpath.h *************** *** 949,953 **** builtins/getopts.o: dispose_cmd.h make_cmd.h subst.h externs.h stdc.h builtins/hash.o: bashtypes.h ! builtins/hash.o: builtins.h command.h execute_cmd.h stdc.h $(DEFSRC)/common.h builtins/hash.o: command.h config.h memalloc.h error.h general.h maxpath.h builtins/hash.o: shell.h bashjmp.h posixjmp.h sig.h unwind_prot.h variables.h quit.h --- 988,992 ---- builtins/getopts.o: dispose_cmd.h make_cmd.h subst.h externs.h stdc.h builtins/hash.o: bashtypes.h ! builtins/hash.o: builtins.h command.h findcmd.h stdc.h $(DEFSRC)/common.h builtins/hash.o: command.h config.h memalloc.h error.h general.h maxpath.h builtins/hash.o: shell.h bashjmp.h posixjmp.h sig.h unwind_prot.h variables.h quit.h *************** *** 974,977 **** --- 1013,1020 ---- builtins/let.o: quit.h dispose_cmd.h make_cmd.h subst.h externs.h stdc.h builtins/let.o: shell.h bashjmp.h posixjmp.h sig.h unwind_prot.h variables.h + builtins/printf.o: config.h memalloc.h bashjmp.h command.h error.h + builtins/printf.o: general.h quit.h dispose_cmd.h make_cmd.h subst.h + builtins/printf.o: externs.h sig.h pathnames.h shell.h unwind_prot.h + builtins/printf.o: variables.h stdc.h $(DEFSRC)/bashgetopt.h builtins/pushd.o: command.h config.h memalloc.h error.h general.h maxpath.h builtins/pushd.o: quit.h dispose_cmd.h make_cmd.h subst.h externs.h stdc.h *************** *** 1001,1005 **** builtins/source.o: command.h config.h memalloc.h error.h general.h maxpath.h builtins/source.o: quit.h dispose_cmd.h make_cmd.h subst.h externs.h stdc.h ! builtins/source.o: shell.h bashjmp.h posixjmp.h sig.h unwind_prot.h variables.h builtins/suspend.o: command.h config.h memalloc.h error.h general.h maxpath.h builtins/suspend.o: quit.h dispose_cmd.h make_cmd.h subst.h externs.h stdc.h --- 1044,1049 ---- builtins/source.o: command.h config.h memalloc.h error.h general.h maxpath.h builtins/source.o: quit.h dispose_cmd.h make_cmd.h subst.h externs.h stdc.h ! builtins/source.o: shell.h bashjmp.h posixjmp.h sig.h unwind_prot.h variables.h ! builtins/source.o: findcmd.h builtins/suspend.o: command.h config.h memalloc.h error.h general.h maxpath.h builtins/suspend.o: quit.h dispose_cmd.h make_cmd.h subst.h externs.h stdc.h *************** *** 1008,1011 **** --- 1052,1056 ---- builtins/test.o: quit.h dispose_cmd.h make_cmd.h subst.h externs.h stdc.h builtins/test.o: shell.h bashjmp.h posixjmp.h sig.h unwind_prot.h variables.h + builtins/test.o: test.h builtins/times.o: command.h config.h memalloc.h error.h general.h maxpath.h builtins/times.o: quit.h dispose_cmd.h make_cmd.h subst.h externs.h stdc.h *************** *** 1016,1020 **** builtins/trap.o: dispose_cmd.h make_cmd.h subst.h externs.h stdc.h builtins/type.o: command.h config.h memalloc.h error.h general.h maxpath.h ! builtins/type.o: quit.h $(DEFSRC)/common.h execute_cmd.h builtins/type.o: shell.h bashjmp.h posixjmp.h sig.h unwind_prot.h variables.h builtins/type.o: dispose_cmd.h make_cmd.h subst.h externs.h stdc.h --- 1061,1065 ---- builtins/trap.o: dispose_cmd.h make_cmd.h subst.h externs.h stdc.h builtins/type.o: command.h config.h memalloc.h error.h general.h maxpath.h ! builtins/type.o: quit.h $(DEFSRC)/common.h findcmd.h builtins/type.o: shell.h bashjmp.h posixjmp.h sig.h unwind_prot.h variables.h builtins/type.o: dispose_cmd.h make_cmd.h subst.h externs.h stdc.h diff -Nrc2 bash-2.01.1/NEWS bash-2.02/NEWS *** bash-2.01.1/NEWS Wed Feb 12 12:12:47 1997 --- bash-2.02/NEWS Fri Apr 17 15:52:44 1998 *************** *** 1,2 **** --- 1,121 ---- + This is a terse description of the new features added to bash-2.02 since + the release of bash-2.01.1. As always, the manual page (doc/bash.1) is + the place to look for complete descriptions. + + 1. New Features in Bash + + a. A new version of malloc, based on the older GNU malloc, that has many + changes, is more page-based, is more conservative with memory usage, + and does not `orphan' large blocks when they are freed. + + b. A new version of gmalloc, based on the old GLIBC malloc, with many + changes and range checking included by default. + + c. A new implementation of fnmatch(3) that includes full POSIX.2 Basic + Regular Expression matching, including character classes, collating + symbols, equivalence classes, and support for case-insensitive pattern + matching. + + d. ksh-88 egrep-style extended pattern matching ([@+*?!](patlist)) has been + implemented, controlled by a new `shopt' option, `extglob'. + + e. There is a new ksh-like `[[' compound command, which implements + extended `test' functionality. + + f. There is a new `printf' builtin, implemented according to the POSIX.2 + specification. + + g. There is a new feature for command substitution: $(< filename) now expands + to the contents of `filename', with any trailing newlines removed + (equivalent to $(cat filename)). + + h. There are new tilde prefixes which expand to directories from the + directory stack. + + i. There is a new `**' arithmetic operator to do exponentiation. + + j. There are new configuration options to control how bash is linked: + `--enable-profiling', to allow bash to be profiled with gprof, and + `--enable-static-link', to allow bash to be linked statically. + + k. There is a new configuration option, `--enable-cond-command', which + controls whether or not the `[[' command is included. It is on by + default. + + l. There is a new configuration option, `--enable-extended-glob', which + controls whether or not the ksh extended globbing feature is included. + It is enabled by default. + + m. There is a new configuration #define in config.h.top that, when enabled, + will cause all login shells to source /etc/profile and one of the user- + specific login shell startup files, whether or not the shell is + interactive. + + n. There is a new invocation option, `--dump-po-strings', to dump + a shell script's translatable strings ($"...") in GNU `po' format. + + o. There is a new `shopt' option, `nocaseglob', to enable case-insensitive + pattern matching when globbing filenames and using the `case' construct. + + p. There is a new `shopt' option, `huponexit', which, when enabled, causes + the shell to send SIGHUP to all jobs when an interactive login shell + exits. + + q. `bind' has a new `-u' option, which takes a readline function name as an + argument and unbinds all key sequences bound to that function in a + specified keymap. + + r. `disown' now has `-a' and `-r' options, to limit operation to all jobs + and running jobs, respectively. + + s. The `shopt' `-p' option now causes output to be displayed in a reusable + format. + + t. `test' has a new `-N' option, which returns true if the filename argument + has been modified since it was last accessed. + + u. `umask' now has a `-p' option to print output in a reusable format. + + v. A new escape sequence, `\xNNN', has been added to the `echo -e' and $'...' + translation code. It expands to the character whose ascii code is NNN + in hexadecimal. + + w. The prompt string expansion code has a new `\r' escape sequence. + + x. The shell may now be cross-compiled for the CYGWIN32 environment on + a Unix machine. + + 2. New Features in Readline + + a. There is now an option for `iterative' yank-last-arg handline, so a user + can keep entering `M-.', yanking the last argument of successive history + lines. + + b. New variable, `print-completions-horizontally', which causes completion + matches to be displayed across the screen (like `ls -x') rather than up + and down the screen (like `ls'). + + c. New variable, `completion-ignore-case', which causes filename completion + and matching to be performed case-insensitively. + + d. There is a new bindable command, `magic-space', which causes history + expansion to be performed on the current readline buffer and a space to + be inserted into the result. + + e. There is a new bindable command, `menu-complete', which enables tcsh-like + menu completion (successive executions of menu-complete insert a single + completion match, cycling through the list of possible completions). + + f. There is a new bindable command, `paste-from-clipboard', for use on Win32 + systems, to insert the text from the Win32 clipboard into the editing + buffer. + + g. The key sequence translation code now understands printf-style backslash + escape sequences, including \NNN octal escapes. These escape sequences + may be used in key sequence definitions or macro values. + + h. An `$include' inputrc file parser directive has been added. + + ------------------------------------------------------------------------------- This is a terse description of the new features added to bash-2.01 since the release of bash-2.0. As always, the manual page (doc/bash.1) is the diff -Nrc2 bash-2.01.1/NOTES bash-2.02/NOTES *** bash-2.01.1/NOTES Fri Apr 11 17:00:00 1997 --- bash-2.02/NOTES Tue Apr 14 13:36:37 1998 *************** *** 138,139 **** --- 138,196 ---- /* Need to get the argument to a -c option processed in the + 8. Some people have asked about binding all of the keys in a PC-keyboard- + style numeric keypad to readline functions. Here's something I + received from the gnu-win32 list that may help. Insert the following + lines into ~/.inputrc: + + # home key + "\e[1~":beginning-of-line + # insert key + "\e[2~":kill-whole-line + # del key + "\e[3~":delete-char + # end key + "\e[4~":end-of-line + # pgup key + "\e[5~":history-search-forward + # pgdn key + "\e[6~":history-search-backward + + 9. Hints for building under Minix 2.0 (Contributed by Terry R. McConnell, + ) + + The version of /bin/sh distributed with Minix is not up to the job of + running the configure script. The easiest solution is to swap /bin/sh + with /usr/bin/ash. Then use chmem(1) to increase the memory allocated + to /bin/sh. The following settings are known to work: + + text data bss stack memory + 63552 9440 3304 65536 141832 /bin/sh + + If you have problems with make or yacc it may be worthwhile first to + install the GNU versions of these utilities before attempting to build + bash. (As of this writing, all of these utilities are available for the + i386 as pre-built binaries via anonymous ftp at math.syr.edu in the + pub/mcconnell/minix directory. Note that the GNU version of yacc is called + bison.) + + Unless you want to see lots of warnings about old-style declarations, + do LOCAL_CFLAGS=-wo; export LOCAL_CFLAGS before running configure. + (These warnings are harmless, but annoying.) + + configure will insist that you supply a host type. For example, do + ./configure --host=i386-pc-minix. + + Minix does not support the system calls required for a proper + implementation of ulimit(). The `ulimit' builtin will not be available. + + Configure will fail to notice that many things like uid_t are indeed + typedef'd in , because it uses egrep for this purpose + and minix has no egrep. You could try making a link /usr/bin/egrep --> + /usr/bin/grep. Better is to install the GNU version of grep in + /usr/local/bin and make the link /usr/local/bin/egrep -->/usr/local/bin/grep. + (These must be hard links, of course, since Minix does not support + symbolic links.) + + You will see many warnings of the form: + warning: unknown s_type: 98 + I have no idea what this means, but it doesn't seem to matter. diff -Nrc2 bash-2.01.1/aclocal.m4 bash-2.02/aclocal.m4 *** bash-2.01.1/aclocal.m4 Tue Jul 29 10:52:17 1997 --- bash-2.02/aclocal.m4 Fri Mar 27 12:04:31 1998 *************** *** 27,31 **** } ], bash_cv_dup2_broken=yes, bash_cv_dup2_broken=no, ! AC_MSG_ERROR(cannot check dup2 if cross compiling)) ]) AC_MSG_RESULT($bash_cv_dup2_broken) --- 27,32 ---- } ], bash_cv_dup2_broken=yes, bash_cv_dup2_broken=no, ! [AC_MSG_ERROR(cannot check dup2 if cross compiling -- defaulting to no) ! bash_cv_dup2_broken=no]) ]) AC_MSG_RESULT($bash_cv_dup2_broken) *************** *** 129,133 **** } ], bash_cv_pgrp_pipe=no,bash_cv_pgrp_pipe=yes, ! AC_MSG_ERROR(cannot check pgrp synchronization if cross compiling)) ]) AC_MSG_RESULT($bash_cv_pgrp_pipe) --- 130,135 ---- } ], bash_cv_pgrp_pipe=no,bash_cv_pgrp_pipe=yes, ! [AC_MSG_ERROR(cannot check pgrp synchronization if cross compiling -- defaulting to no) ! bash_cv_pgrp_pipe=no]) ]) AC_MSG_RESULT($bash_cv_pgrp_pipe) *************** *** 170,174 **** [AC_MSG_CHECKING(for size and type of struct rlimit fields) AC_CACHE_VAL(bash_cv_type_rlimit, ! [AC_TRY_COMPILE([#include ], [rlim_t xxx;], bash_cv_type_rlimit=rlim_t,[ AC_TRY_RUN([ --- 172,177 ---- [AC_MSG_CHECKING(for size and type of struct rlimit fields) AC_CACHE_VAL(bash_cv_type_rlimit, ! [AC_TRY_COMPILE([#include ! #include ], [rlim_t xxx;], bash_cv_type_rlimit=rlim_t,[ AC_TRY_RUN([ *************** *** 185,189 **** exit(1); }], bash_cv_type_rlimit=quad_t, bash_cv_type_rlimit=long, ! AC_MSG_ERROR(cannot check quad_t if cross compiling))]) ]) AC_MSG_RESULT($bash_cv_type_rlimit) --- 188,193 ---- exit(1); }], bash_cv_type_rlimit=quad_t, bash_cv_type_rlimit=long, ! [AC_MSG_ERROR(cannot check quad_t if cross compiling -- defaulting to long) ! bash_cv_type_rlimit=long])]) ]) AC_MSG_RESULT($bash_cv_type_rlimit) *************** *** 208,212 **** #endif], [ char *msg = _sys_siglist[2]; ], bash_cv_decl_under_sys_siglist=yes, bash_cv_decl_under_sys_siglist=no, ! AC_MSG_ERROR(cannot check for _sys_siglist[] if cross compiling))])dnl AC_MSG_RESULT($bash_cv_decl_under_sys_siglist) if test $bash_cv_decl_under_sys_siglist = yes; then --- 212,216 ---- #endif], [ char *msg = _sys_siglist[2]; ], bash_cv_decl_under_sys_siglist=yes, bash_cv_decl_under_sys_siglist=no, ! [AC_MSG_ERROR(cannot check for _sys_siglist[] if cross compiling -- defaulting to no)])])dnl AC_MSG_RESULT($bash_cv_decl_under_sys_siglist) if test $bash_cv_decl_under_sys_siglist = yes; then *************** *** 233,238 **** exit(msg == 0); }], ! bash_cv_under_sys_siglist=yes, bash_cv_under_sys_siglist=no, ! AC_MSG_ERROR(cannot check for _sys_siglist[] if cross compiling))])dnl AC_MSG_RESULT($bash_cv_under_sys_siglist) if test $bash_cv_under_sys_siglist = yes; then --- 237,243 ---- exit(msg == 0); }], ! bash_cv_under_sys_siglist=yes, bash_cv_under_sys_siglist=no, ! [AC_MSG_ERROR(cannot check for _sys_siglist[] if cross compiling -- defaulting to no) ! bash_cv_under_sys_siglist=no])]) AC_MSG_RESULT($bash_cv_under_sys_siglist) if test $bash_cv_under_sys_siglist = yes; then *************** *** 259,264 **** exit(msg == 0); }], ! bash_cv_sys_siglist=yes, bash_cv_sys_siglist=no, ! AC_MSG_ERROR(cannot check for sys_siglist if cross compiling))])dnl AC_MSG_RESULT($bash_cv_sys_siglist) if test $bash_cv_sys_siglist = yes; then --- 264,270 ---- exit(msg == 0); }], ! bash_cv_sys_siglist=yes, bash_cv_sys_siglist=no, ! [AC_MSG_ERROR(cannot check for sys_siglist if cross compiling -- defaulting to no) ! bash_cv_sys_siglist=no])]) AC_MSG_RESULT($bash_cv_sys_siglist) if test $bash_cv_sys_siglist = yes; then *************** *** 320,324 **** exit (dir == 0); }], bash_cv_opendir_not_robust=yes,bash_cv_opendir_not_robust=no, ! AC_MSG_ERROR(cannot check opendir if cross compiling))]) AC_MSG_RESULT($bash_cv_opendir_not_robust) if test $bash_cv_opendir_not_robust = yes; then --- 326,332 ---- exit (dir == 0); }], bash_cv_opendir_not_robust=yes,bash_cv_opendir_not_robust=no, ! [AC_MSG_ERROR(cannot check opendir if cross compiling -- defaulting to no) ! bash_cv_opendir_not_robust=no] ! )]) AC_MSG_RESULT($bash_cv_opendir_not_robust) if test $bash_cv_opendir_not_robust = yes; then *************** *** 347,352 **** ]) AC_DEFUN(BASH_FUNC_STRSIGNAL, ! [AC_MSG_CHECKING([for the existance of strsignal]) AC_CACHE_VAL(bash_cv_have_strsignal, [AC_TRY_LINK([#include --- 355,468 ---- ]) + AC_DEFUN(BASH_TYPE_INT32_T, + [ + if test "X$bash_cv_type_int32_t" = "X"; then + _bash_needmsg=yes + else + AC_MSG_CHECKING(which builtin C type is 32 bits wide) + _bash_needmsg= + fi + AC_CACHE_VAL(bash_cv_type_int32_t, + [AC_TRY_RUN([ + main() + { + #if SIZEOF_INT == 4 + exit (0); + #else + # if SIZEOF_LONG == 4 + exit (1); + # else + # error cannot find 32 bit type... + # endif + #endif + }], bash_cv_type_int32_t=int, bash_cv_type_int32_t=long, + [AC_MSG_ERROR(cannot check type sizes if cross-compiling -- defaulting to int) + bash_cv_type_int32_t=int] + )]) + if test "X$_bash_needmsg" = "Xyes"; then + AC_MSG_CHECKING(which builtin C type is 32 bits wide) + fi + AC_MSG_RESULT($bash_cv_type_int32_t); + if test "$bash_cv_type_int32_t" = "int"; then + AC_DEFINE(int32_t, int) + else + AC_DEFINE(int32_t, long) + fi + ]) + + AC_DEFUN(BASH_TYPE_U_INT32_T, + [ + if test "X$bash_cv_type_u_int32_t" = "X"; then + _bash_needmsg=yes + else + AC_MSG_CHECKING(which unsigned builtin C type is 32 bits wide) + _bash_needmsg= + fi + AC_CACHE_VAL(bash_cv_type_u_int32_t, + [AC_TRY_RUN([ + main() + { + #if SIZEOF_INT == 4 + exit (0); + #else + # if SIZEOF_LONG == 4 + exit (1); + # else + # error cannot find 32 bit type... + # endif + #endif + }], bash_cv_type_u_int32_t=int, bash_cv_type_u_int32_t=long, + [AC_MSG_ERROR(cannot check type sizes if cross-compiling -- defaulting to int) + bash_cv_type_u_int32_t=int] + )]) + if test "X$_bash_needmsg" = "Xyes"; then + AC_MSG_CHECKING(which unsigned builtin C type is 32 bits wide) + fi + AC_MSG_RESULT($bash_cv_type_u_int32_t); + if test "$bash_cv_type_u_int32_t" = "int"; then + AC_DEFINE(u_int32_t, unsigned int) + else + AC_DEFINE(u_int32_t, unsigned long) + fi + ]) + + AC_DEFUN(BASH_TYPE_PTRDIFF_T, + [ + if test "X$bash_cv_type_ptrdiff_t" = "X"; then + _bash_needmsg=yes + else + AC_MSG_CHECKING(which builtin C type is correct for ptrdiff_t) + _bash_needmsg= + fi + AC_CACHE_VAL(bash_cv_type_ptrdiff_t, + [AC_TRY_RUN([ + main() + { + #if SIZEOF_CHAR_P == SIZEOF_INT + exit (0); + #else + # if SIZEOF_CHAR_P == SIZEOF_LONG + exit (1); + # else + # error cannot find type for pointer arithmetic... + # endif + #endif + }], bash_cv_type_ptrdiff_t=int, bash_cv_type_ptrdiff_t=long, + [AC_MSG_ERROR(cannot check type sizes if cross-compiling -- defaulting to int) + bash_cv_type_ptrdiff_t=int] + )]) + if test "X$_bash_needmsg" = "Xyes"; then + AC_MSG_CHECKING(which builtin C type is correct for ptrdiff_t) + fi + AC_MSG_RESULT($bash_cv_type_ptrdiff_t); + if test "$bash_cv_type_ptrdiff_t" = "int"; then + AC_DEFINE(ptrdiff_t, int) + else + AC_DEFINE(ptrdiff_t, long) + fi + ]) + AC_DEFUN(BASH_FUNC_STRSIGNAL, ! [AC_MSG_CHECKING([for the existence of strsignal]) AC_CACHE_VAL(bash_cv_have_strsignal, [AC_TRY_LINK([#include *************** *** 367,371 **** #include #include ! ],[ lstat("",(struct stat *)0); ], bash_cv_func_lstat=yes, bash_cv_func_lstat=no)]) if test $bash_cv_func_lstat = yes; then --- 483,487 ---- #include #include ! ],[ lstat(".",(struct stat *)0); ], bash_cv_func_lstat=yes, bash_cv_func_lstat=no)]) if test $bash_cv_func_lstat = yes; then *************** *** 433,437 **** } ], bash_cv_getenv_redef=yes, bash_cv_getenv_redef=no, ! AC_MSG_ERROR(cannot check getenv redefinition if cross compiling))]) AC_MSG_RESULT($bash_cv_getenv_redef) if test $bash_cv_getenv_redef = yes; then --- 549,555 ---- } ], bash_cv_getenv_redef=yes, bash_cv_getenv_redef=no, ! [AC_MSG_ERROR(cannot check getenv redefinition if cross compiling -- defaulting to yes) ! bash_cv_getenv_redef=yes] ! )]) AC_MSG_RESULT($bash_cv_getenv_redef) if test $bash_cv_getenv_redef = yes; then *************** *** 456,461 **** exit(pf == 0); } ! ],bash_cv_printf_declared=yes, bash_cv_printf_declared=no, ! AC_MSG_ERROR(cannot check printf declaration if cross compiling))]) AC_MSG_RESULT($bash_cv_printf_declared) if test $bash_cv_printf_declared = yes; then --- 574,581 ---- exit(pf == 0); } ! ], bash_cv_printf_declared=yes, bash_cv_printf_declared=no, ! [AC_MSG_ERROR(cannot check printf declaration if cross compiling -- defaulting to yes) ! bash_cv_printf_declared=yes] ! )]) AC_MSG_RESULT($bash_cv_printf_declared) if test $bash_cv_printf_declared = yes; then *************** *** 473,478 **** exit (maxfds == -1L); } ! ],bash_cv_ulimit_maxfds=yes, bash_cv_ulimit_maxfds=no, ! AC_MSG_ERROR(cannot check ulimit if cross compiling))]) AC_MSG_RESULT($bash_cv_ulimit_maxfds) if test $bash_cv_ulimit_maxfds = yes; then --- 593,600 ---- exit (maxfds == -1L); } ! ], bash_cv_ulimit_maxfds=yes, bash_cv_ulimit_maxfds=no, ! [AC_MSG_ERROR(cannot check ulimit if cross compiling -- defaulting to no) ! bash_cv_ulimit_maxfds=no] ! )]) AC_MSG_RESULT($bash_cv_ulimit_maxfds) if test $bash_cv_ulimit_maxfds = yes; then *************** *** 498,502 **** fi AC_MSG_RESULT(using $bash_cv_termcap_lib) ! if test $bash_cv_termcap_lib = gnutermcap; then LDFLAGS="$LDFLAGS -L./lib/termcap" TERMCAP_LIB="./lib/termcap/libtermcap.a" --- 620,624 ---- fi AC_MSG_RESULT(using $bash_cv_termcap_lib) ! if test $bash_cv_termcap_lib = gnutermcap && test -z "$prefer_curses"; then LDFLAGS="$LDFLAGS -L./lib/termcap" TERMCAP_LIB="./lib/termcap/libtermcap.a" *************** *** 569,573 **** } ], bash_cv_getcwd_calls_popen=no, bash_cv_getcwd_calls_popen=yes, ! AC_MSG_ERROR(cannot check whether getcwd calls popen if cross compiling))]) AC_MSG_RESULT($bash_cv_getcwd_calls_popen) if test $bash_cv_getcwd_calls_popen = yes; then --- 691,697 ---- } ], bash_cv_getcwd_calls_popen=no, bash_cv_getcwd_calls_popen=yes, ! [AC_MSG_ERROR(cannot check whether getcwd calls popen if cross compiling -- defaulting to no) ! bash_cv_getcwd_calls_popen=no] ! )]) AC_MSG_RESULT($bash_cv_getcwd_calls_popen) if test $bash_cv_getcwd_calls_popen = yes; then *************** *** 691,695 **** } ], bash_cv_must_reinstall_sighandlers=no, bash_cv_must_reinstall_sighandlers=yes, ! AC_MSG_ERROR(cannot check signal handling if cross compiling))]) AC_MSG_RESULT($bash_cv_must_reinstall_sighandlers) if test $bash_cv_must_reinstall_sighandlers = yes; then --- 815,821 ---- } ], bash_cv_must_reinstall_sighandlers=no, bash_cv_must_reinstall_sighandlers=yes, ! [AC_MSG_ERROR(cannot check signal handling if cross compiling -- defaulting to no) ! bash_cv_must_reinstall_sighandlers=no] ! )]) AC_MSG_RESULT($bash_cv_must_reinstall_sighandlers) if test $bash_cv_must_reinstall_sighandlers = yes; then *************** *** 757,763 **** exit(0); ! }],bash_cv_job_control_missing=present, bash_cv_job_control_missing=missing, ! AC_MSG_ERROR(cannot check job control if cross-compiling)) ! ]) AC_MSG_RESULT($bash_cv_job_control_missing) if test $bash_cv_job_control_missing = missing; then --- 883,890 ---- exit(0); ! }], bash_cv_job_control_missing=present, bash_cv_job_control_missing=missing, ! [AC_MSG_ERROR(cannot check job control if cross-compiling -- defaulting to missing) ! bash_cv_job_control_missing=missing] ! )]) AC_MSG_RESULT($bash_cv_job_control_missing) if test $bash_cv_job_control_missing = missing; then *************** *** 801,807 **** unlink ("/tmp/sh-np-autoconf"); exit(0); ! }],bash_cv_sys_named_pipes=present, bash_cv_sys_named_pipes=missing, ! AC_MSG_ERROR(cannot check for named pipes if cross-compiling)) ! ]) AC_MSG_RESULT($bash_cv_sys_named_pipes) if test $bash_cv_sys_named_pipes = missing; then --- 928,935 ---- unlink ("/tmp/sh-np-autoconf"); exit(0); ! }], bash_cv_sys_named_pipes=present, bash_cv_sys_named_pipes=missing, ! [AC_MSG_ERROR(cannot check for named pipes if cross-compiling -- defaulting to missing) ! bash_cv_sys_named_pipes=missing] ! )]) AC_MSG_RESULT($bash_cv_sys_named_pipes) if test $bash_cv_sys_named_pipes = missing; then *************** *** 851,857 **** exit(1); #endif ! }],bash_cv_func_sigsetjmp=present, bash_cv_func_sigsetjmp=missing, ! AC_MSG_ERROR(cannot check for sigsetjmp/siglongjmp if cross-compiling)) ! ]) AC_MSG_RESULT($bash_cv_func_sigsetjmp) if test $bash_cv_func_sigsetjmp = present; then --- 979,986 ---- exit(1); #endif ! }], bash_cv_func_sigsetjmp=present, bash_cv_func_sigsetjmp=missing, ! [AC_MSG_ERROR(cannot check for sigsetjmp/siglongjmp if cross-compiling -- defaulting to missing) ! bash_cv_func_sigsetjmp=missing] ! )]) AC_MSG_RESULT($bash_cv_func_sigsetjmp) if test $bash_cv_func_sigsetjmp = present; then *************** *** 873,884 **** AC_DEFUN(BASH_STRUCT_WINSIZE, ! [AC_MSG_CHECKING(for struct winsize in sys/ioctl.h) ! AC_CACHE_VAL(bash_cv_struct_winsize_in_ioctl, [AC_TRY_COMPILE([#include #include ], [struct winsize x;], ! bash_cv_struct_winsize_in_ioctl=yes,bash_cv_struct_winsize_in_ioctl=no)]) ! AC_MSG_RESULT($bash_cv_struct_winsize_in_ioctl) ! if test $bash_cv_struct_winsize_in_ioctl = yes; then ! AC_DEFINE(STRUCT_WINSIZE_IN_SYS_IOCTL) fi ]) --- 1002,1022 ---- AC_DEFUN(BASH_STRUCT_WINSIZE, ! [AC_MSG_CHECKING(for struct winsize in sys/ioctl.h and termios.h) ! AC_CACHE_VAL(bash_cv_struct_winsize_header, [AC_TRY_COMPILE([#include #include ], [struct winsize x;], ! bash_cv_struct_winsize_header=ioctl_h, ! [AC_TRY_COMPILE([#include ! #include ], [struct winsize x;], ! bash_cv_struct_winsize_header=termios_h, bash_cv_struct_winsize_header=other) ! ])]) ! if test $bash_cv_struct_winsize_header = ioctl_h; then ! AC_MSG_RESULT(sys/ioctl.h) ! AC_DEFINE(STRUCT_WINSIZE_IN_SYS_IOCTL) ! elif test $bash_cv_struct_winsize_header = termios_h; then ! AC_MSG_RESULT(termios.h) ! AC_DEFINE(STRUCT_WINSIZE_IN_TERMIOS) ! else ! AC_MSG_RESULT(not found) fi ]) *************** *** 1052,1065 **** f = RLIMIT_DATA; ], bash_cv_kernel_rlimit=no, ! [AC_TRY_COMPILE([ ! #include ! #define _KERNEL ! #include ! #undef _KERNEL ! ], ! [ int f; f = RLIMIT_DATA; ! ], bash_cv_kernel_rlimit=yes, bash_cv_kernel_rlimit=no)] )]) AC_MSG_RESULT($bash_cv_kernel_rlimit) --- 1190,1203 ---- f = RLIMIT_DATA; ], bash_cv_kernel_rlimit=no, ! [AC_TRY_COMPILE([ ! #include ! #define _KERNEL ! #include ! #undef _KERNEL ! ], ! [ int f; f = RLIMIT_DATA; ! ], bash_cv_kernel_rlimit=yes, bash_cv_kernel_rlimit=no)] )]) AC_MSG_RESULT($bash_cv_kernel_rlimit) *************** *** 1109,1117 **** } ], bash_cv_func_strcoll_broken=yes, bash_cv_func_strcoll_broken=no, ! AC_MSG_ERROR(cannot check strcoll if cross compiling)) ! ]) AC_MSG_RESULT($bash_cv_func_strcoll_broken) if test $bash_cv_func_strcoll_broken = yes; then AC_DEFINE(STRCOLL_BROKEN) fi ]) --- 1247,1344 ---- } ], bash_cv_func_strcoll_broken=yes, bash_cv_func_strcoll_broken=no, ! [AC_MSG_ERROR(cannot check strcoll if cross compiling -- defaulting to no) ! bash_cv_func_strcoll_broken=no] ! )]) AC_MSG_RESULT($bash_cv_func_strcoll_broken) if test $bash_cv_func_strcoll_broken = yes; then AC_DEFINE(STRCOLL_BROKEN) + fi + ]) + + dnl + dnl If available, use support for large files unless the user specified + dnl one of the CPPFLAGS, LDFLAGS, or LIBS variables ( + dnl via GNU patch 2.5) + dnl + AC_DEFUN(BASH_LARGE_FILE_SUPPORT, + [AC_MSG_CHECKING(whether large file support needs explicit enabling) + ac_getconfs='' + ac_result=yes + ac_set='' + ac_shellvars='CPPFLAGS LDFLAGS LIBS' + for ac_shellvar in $ac_shellvars; do + case $ac_shellvar in + CPPFLAGS) ac_lfsvar=LFS_CFLAGS ac_lfs64var=LFS64_CFLAGS ;; + *) ac_lfsvar=LFS_$ac_shellvar ac_lfs64var=LFS64_$ac_shellvar ;; + esac + eval test '"${'$ac_shellvar'+set}"' = set && ac_set=$ac_shellvar + (getconf $ac_lfsvar) >/dev/null 2>&1 || { ac_result=no; break; } + ac_getconf=`getconf $ac_lfsvar` + ac_getconf64=`getconf $ac_lfs64var` + ac_getconfs=$ac_getconfs$ac_getconf\ $ac_getconf64 + eval ac_test_$ac_shellvar="\$ac_getconf\ \$ac_getconf64" + done + case "$ac_result$ac_getconfs" in + yes) ac_result=no ;; + esac + case "$ac_result$ac_set" in + yes?*) ac_result="yes, but $ac_set is already set, so use its settings" + esac + AC_MSG_RESULT($ac_result) + case $ac_result in + yes) + for ac_shellvar in $ac_shellvars; do + eval $ac_shellvar=\$ac_test_$ac_shellvar + done ;; + esac + ]) + + dnl + dnl AC_SYS_RESTARTABLE_SYSCALLS tests only for restarted system calls + dnl after a signal handler has been installed with signal(). Since + dnl Bash uses sigaction() if it is available, we need to check whether + dnl or not a signal handler installed with sigaction and SA_RESTART + dnl causes system calls to be restarted after the signal is caught + dnl + AC_DEFUN(BASH_SYS_RESTARTABLE_SYSCALLS, + [AC_REQUIRE([BASH_SIGNAL_CHECK]) + AC_CACHE_CHECK(for restartable system calls with posix sigaction, + bash_cv_sys_restartable_syscalls, + [AC_TRY_RUN( + [/* Exit 0 (true) if wait returns something other than -1, + i.e. the pid of the child, which means that wait was restarted + after getting the signal. */ + #include + #include + static int caught = 0; + void ucatch (isig) int isig; { caught = 1; } + main () + { + #if !defined (_POSIX_VERSION) || !defined (HAVE_POSIX_SIGNALS) + exit (1); + #else + struct sigaction act, oact; + int i, status; + + act.sa_handler = ucatch; + /* Might want to add SA_RESTART here, but bash's set_signal_handler + does not. */ + act.sa_flags = 0; + sigemptyset(&act.sa_mask); + sigemptyset(&oact.sa_mask); + i = fork (); + /* A possible race condition here, but in practice it never happens. */ + if (i == 0) { sleep (3); kill (getppid (), SIGINT); sleep (3); exit (0); } + sigaction(SIGINT, &act, &oact); + status = wait(&i); + if (status == -1) wait(&i); + exit (status == -1); + #endif + } + ], bash_cv_sys_restartable_syscalls=yes, bash_cv_sys_restartable_syscalls=no, + AC_MSG_ERROR(cannot check restartable syscalls if cross compiling)) + ]) + if test $bash_cv_sys_restartable_syscalls = yes; then + AC_DEFINE(HAVE_RESTARTABLE_SYSCALLS) fi ]) diff -Nrc2 bash-2.01.1/alias.c bash-2.02/alias.c *** bash-2.01.1/alias.c Mon Apr 14 15:58:00 1997 --- bash-2.02/alias.c Tue Mar 17 13:30:34 1998 *************** *** 25,28 **** --- 25,31 ---- #if defined (HAVE_UNISTD_H) + # ifdef _MINIX + # include + # endif # include #endif *************** *** 412,415 **** --- 415,424 ---- { i = skipquotes (string, i); + /* This could be a line that contains a single quote character, + in which case skipquotes () terminates with string[i] == '\0' + (the end of the string). Check for that here. */ + if (string[i] == '\0') + break; + /* Now string[i] is the matching quote character, and the quoted portion of the token has been scanned. */ diff -Nrc2 bash-2.01.1/array.c bash-2.02/array.c *** bash-2.01.1/array.c Wed Feb 26 17:01:36 1997 --- bash-2.02/array.c Fri Nov 21 12:49:40 1997 *************** *** 14,17 **** --- 14,20 ---- #if defined (HAVE_UNISTD_H) + # ifdef _MINIX + # include + # endif # include #endif *************** *** 152,155 **** --- 155,159 ---- #endif + #ifdef INCLUDE_UNUSED ARRAY_ELEMENT * copy_array_element(ae) *************** *** 159,162 **** --- 163,167 ---- : (ARRAY_ELEMENT *) NULL); } + #endif /* *************** *** 249,252 **** --- 254,258 ---- } + #ifdef TEST_ARRAY /* * Walk the array, calling FUNC once for each element, with the array *************** *** 265,268 **** --- 271,275 ---- (*func)(ae); } + #endif /* diff -Nrc2 bash-2.01.1/bashhist.c bash-2.02/bashhist.c *** bash-2.01.1/bashhist.c Wed May 14 14:08:52 1997 --- bash-2.02/bashhist.c Fri Feb 27 12:34:33 1998 *************** *** 24,27 **** --- 24,30 ---- #if defined (HAVE_UNISTD_H) + # ifdef _MINIX + # include + # endif # include #endif *************** *** 175,178 **** --- 178,185 ---- member ('}', string + i + 1)) return (1); + #if defined (EXTENDED_GLOB) + else if (extended_glob && i > 1 && string[i+1] == '(' && member (')', string + i + 2)) + return (1); + #endif else return (0); *************** *** 400,404 **** { if (expanded < 0) ! internal_error (history_value); #if defined (READLINE) else if (hist_verify == 0) --- 407,411 ---- { if (expanded < 0) ! internal_error ("%s", history_value); #if defined (READLINE) else if (hist_verify == 0) *************** *** 462,468 **** /* Don't use the value of history_control to affect the second ! and subsequent lines of a multi-line command when ! command_oriented_history is enabled. */ if (command_oriented_history && current_command_line_count > 1) { bash_add_history (line); --- 469,479 ---- /* Don't use the value of history_control to affect the second ! and subsequent lines of a multi-line command (old code did ! this only when command_oriented_history is enabled). */ ! #if 0 if (command_oriented_history && current_command_line_count > 1) + #else + if (current_command_line_count > 1) + #endif { bash_add_history (line); *************** *** 694,698 **** npat = histignore.ignores[i].val; ! match = fnmatch (npat, line, 0) != FNM_NOMATCH; if (histignore.ignores[i].flags & HIGN_EXPAND) --- 705,709 ---- npat = histignore.ignores[i].val; ! match = fnmatch (npat, line, FNMATCH_EXTFLAG) != FNM_NOMATCH; if (histignore.ignores[i].flags & HIGN_EXPAND) diff -Nrc2 bash-2.01.1/bashline.c bash-2.02/bashline.c *** bash-2.01.1/bashline.c Fri Aug 29 13:54:04 1997 --- bash-2.02/bashline.c Tue Feb 17 12:09:43 1998 *************** *** 37,40 **** --- 37,41 ---- #include "bashline.h" #include "execute_cmd.h" + #include "findcmd.h" #include "pathexp.h" #include "builtins/common.h" *************** *** 56,65 **** static void shell_expand_line (); static void display_shell_version (), operate_and_get_next (); ! static void history_expand_line (), bash_ignore_filenames (); #ifdef ALIAS ! static void alias_expand_line (); #endif - static void history_and_alias_expand_line (); - static void cleanup_expansion_error (), set_up_new_line (); /* Helper functions for Readline. */ --- 57,73 ---- static void shell_expand_line (); static void display_shell_version (), operate_and_get_next (); ! static void bash_ignore_filenames (); ! static void cleanup_expansion_error (), set_up_new_line (); ! ! #if defined (BANG_HISTORY) ! static int history_expand_line (); ! static int tcsh_magic_space (); ! #endif /* BANG_HISTORY */ #ifdef ALIAS ! static int alias_expand_line (); ! #endif ! #if defined (BANG_HISTORY) && defined (ALIAS) ! static int history_and_alias_expand_line (); #endif /* Helper functions for Readline. */ *************** *** 197,203 **** --- 205,215 ---- /* Bind up our special shell functions. */ + #ifdef BANG_HISTORY rl_add_defun ("history-expand-line", (Function *)history_expand_line, -1); rl_bind_key_in_map ('^', (Function *)history_expand_line, emacs_meta_keymap); + rl_add_defun ("magic-space", (Function *)tcsh_magic_space, -1); + #endif + #ifdef ALIAS rl_add_defun ("alias-expand-line", (Function *)alias_expand_line, -1); *************** *** 1031,1035 **** if (*text == '`') text++; ! else if (*text == '$' && text[1] == '(') text += 2; start_len = text - orig_start; --- 1043,1047 ---- if (*text == '`') text++; ! else if (*text == '$' && text[1] == '(') /* ) */ text += 2; start_len = text - orig_start; *************** *** 1174,1178 **** } ! /* History and alias expand the line. */ static char * history_expand_line_internal (line) --- 1186,1195 ---- } ! /* Functions to perform history and alias expansions on the current line. */ ! ! #if defined (BANG_HISTORY) ! /* Perform history expansion on the current line. If no history expansion ! is done, pre_process_line() returns what it was passed, so we need to ! allocate a new line here. */ static char * history_expand_line_internal (line) *************** *** 1184,1203 **** return (new_line == line) ? savestring (line) : new_line; } - - #if defined (ALIAS) - /* Expand aliases in the current readline line. */ - static void - alias_expand_line (ignore) - int ignore; - { - char *new_line; - - new_line = alias_expand (rl_line_buffer); - - if (new_line) - set_up_new_line (new_line); - else - cleanup_expansion_error (); - } #endif --- 1201,1204 ---- *************** *** 1260,1265 **** } /* History expand the line. */ ! static void history_expand_line (ignore) int ignore; --- 1261,1290 ---- } + #if defined (ALIAS) + /* Expand aliases in the current readline line. */ + static int + alias_expand_line (ignore) + int ignore; + { + char *new_line; + + new_line = alias_expand (rl_line_buffer); + + if (new_line) + { + set_up_new_line (new_line); + return (0); + } + else + { + cleanup_expansion_error (); + return (1); + } + } + #endif + + #if defined (BANG_HISTORY) /* History expand the line. */ ! static int history_expand_line (ignore) int ignore; *************** *** 1270,1280 **** if (new_line) ! set_up_new_line (new_line); else ! cleanup_expansion_error (); } /* History and alias expand the line. */ ! static void history_and_alias_expand_line (ignore) int ignore; --- 1295,1327 ---- if (new_line) ! { ! set_up_new_line (new_line); ! return (0); ! } else ! { ! cleanup_expansion_error (); ! return (1); ! } ! } ! ! /* Expand history substitutions in the current line and then insert a ! space wherever set_up_new_line decided to put rl_point. */ ! static int ! tcsh_magic_space (ignore) ! int ignore; ! { ! if (history_expand_line (ignore) == 0) ! { ! rl_insert (1, ' '); ! return (0); ! } ! else ! return (1); } + #endif /* History and alias expand the line. */ ! static int history_and_alias_expand_line (ignore) int ignore; *************** *** 1298,1308 **** if (new_line) ! set_up_new_line (new_line); else ! cleanup_expansion_error (); } /* History and alias expand the line, then perform the shell word ! expansions by calling expand_string. */ static void shell_expand_line (ignore) --- 1345,1363 ---- if (new_line) ! { ! set_up_new_line (new_line); ! return (0); ! } else ! { ! cleanup_expansion_error (); ! return (1); ! } } /* History and alias expand the line, then perform the shell word ! expansions by calling expand_string. This can't use set_up_new_line() ! because we want the variable expansions as a separate undo'able ! set of operations. */ static void shell_expand_line (ignore) *************** *** 1370,1373 **** --- 1425,1432 ---- } + /* Define NO_FORCE_FIGNORE if you want to match filenames that would + otherwise be ignored if they are the only possible matches. */ + /* #define NO_FORCE_FIGNORE */ + /* If FIGNORE is set, then don't match files with the given suffixes when completing filenames. If only one of the possibilities has an acceptable *************** *** 1394,1397 **** --- 1453,1460 ---- char **newnames; int idx, nidx; + #ifdef NO_FORCE_FIGNORE + char **oldnames; + int oidx; + #endif /* If there is only one completion, see if it is acceptable. If it is *************** *** 1401,1404 **** --- 1464,1468 ---- if (names[1] == (char *)0) { + #ifndef NO_FORCE_FIGNORE if ((*name_func) (names[0]) == 0) { *************** *** 1406,1409 **** --- 1470,1474 ---- names[0] = (char *)NULL; } + #endif return; } *************** *** 1414,1417 **** --- 1479,1486 ---- ; newnames = (char **)xmalloc ((nidx + 1) * (sizeof (char *))); + #ifdef NO_FORCE_FIGNORE + oldnames = (char **)xmalloc ((nidx - 1) * (sizeof (char *))); + oidx = 0; + #endif newnames[0] = names[0]; *************** *** 1421,1425 **** --- 1490,1498 ---- newnames[nidx++] = names[idx]; else + #ifndef NO_FORCE_FIGNORE free (names[idx]); + #else + oldnames[oidx++] = names[idx]; + #endif } *************** *** 1429,1437 **** --- 1502,1520 ---- if (nidx == 1) { + #ifndef NO_FORCE_FIGNORE free (names[0]); names[0] = (char *)NULL; + #else + free (oldnames); + #endif free (newnames); return; } + + #ifdef NO_FORCE_FIGNORE + while (oidx) + free (oldnames[--oidx]); + free (oldnames); + #endif /* If only one is acceptable, copy it to names[0] and return. */ diff -Nrc2 bash-2.01.1/bracecomp.c bash-2.02/bracecomp.c *** bash-2.01.1/bracecomp.c Mon Aug 18 12:32:52 1997 --- bash-2.02/bracecomp.c Tue Jul 22 13:39:03 1997 *************** *** 29,32 **** --- 29,35 ---- #if defined (HAVE_UNISTD_H) + # ifdef _MINIX + # include + # endif # include #endif diff -Nrc2 bash-2.01.1/braces.c bash-2.02/braces.c *** bash-2.01.1/braces.c Wed Feb 19 11:12:08 1997 --- bash-2.02/braces.c Fri Jul 18 16:44:42 1997 *************** *** 26,29 **** --- 26,32 ---- #if defined (HAVE_UNISTD_H) + # ifdef _MINIX + # include + # endif # include #endif diff -Nrc2 bash-2.01.1/builtins/Makefile.in bash-2.02/builtins/Makefile.in *** bash-2.01.1/builtins/Makefile.in Mon Sep 22 16:22:27 1997 --- bash-2.02/builtins/Makefile.in Wed Oct 15 11:28:57 1997 *************** *** 4,7 **** --- 4,8 ---- RANLIB = @RANLIB@ CC = @CC@ + CC_FOR_BUILD = @CC_FOR_BUILD@ AR = @AR@ RM = rm -f *************** *** 12,17 **** topdir = @top_srcdir@ includedir = @includedir@ ! PROFILE_FLAGS = CFLAGS = @CFLAGS@ LOCAL_CFLAGS = @LOCAL_CFLAGS@ --- 13,19 ---- topdir = @top_srcdir@ includedir = @includedir@ + BUILD_DIR = @BUILD_DIR@ ! PROFILE_FLAGS = @PROFILE_FLAGS@ CFLAGS = @CFLAGS@ LOCAL_CFLAGS = @LOCAL_CFLAGS@ *************** *** 19,22 **** --- 21,26 ---- DEFS = @DEFS@ LOCAL_DEFS = @LOCAL_DEFS@ + LDFLAGS = @LDFLAGS@ $(LOCAL_LDFLAGS) $(CFLAGS) + LOCAL_LDFLAGS = @LOCAL_LDFLAGS@ LIBS = @LIBS@ *************** *** 63,67 **** $(srcdir)/times.def $(srcdir)/trap.def $(srcdir)/type.def \ $(srcdir)/ulimit.def $(srcdir)/umask.def $(srcdir)/wait.def \ ! $(srcdir)/reserved.def $(srcdir)/pushd.def $(srcdir)/shopt.def STATIC_SOURCE = common.c evalstring.c evalfile.c getopt.c bashgetopt.c \ --- 67,72 ---- $(srcdir)/times.def $(srcdir)/trap.def $(srcdir)/type.def \ $(srcdir)/ulimit.def $(srcdir)/umask.def $(srcdir)/wait.def \ ! $(srcdir)/reserved.def $(srcdir)/pushd.def $(srcdir)/shopt.def \ ! $(srcdir)/printf.def STATIC_SOURCE = common.c evalstring.c evalfile.c getopt.c bashgetopt.c \ *************** *** 75,79 **** pushd.o read.o return.o set.o setattr.o shift.o source.o \ suspend.o test.o times.o trap.o type.o ulimit.o umask.o \ ! wait.o getopts.o shopt.o getopt.o bashgetopt.o CREATED_FILES = builtext.h builtins.c psize.aux pipesize.h --- 80,84 ---- pushd.o read.o return.o set.o setattr.o shift.o source.o \ suspend.o test.o times.o trap.o type.o ulimit.o umask.o \ ! wait.o getopts.o shopt.o printf.o getopt.o bashgetopt.o CREATED_FILES = builtext.h builtins.c psize.aux pipesize.h *************** *** 81,85 **** all: $(MKBUILTINS) libbuiltins.a ! libbuiltins.a: $(MKBUILTINS) $(OFILES) $(RM) $@ $(AR) cr $@ $(OFILES) --- 86,90 ---- all: $(MKBUILTINS) libbuiltins.a ! libbuiltins.a: $(MKBUILTINS) $(OFILES) builtins.o $(RM) $@ $(AR) cr $@ $(OFILES) *************** *** 87,105 **** builtext.h builtins.c: $(MKBUILTINS) $(DEFSRC) ! $(RM) builtext.h builtins.c ./$(MKBUILTINS) -externfile builtext.h -structfile builtins.c \ ! -noproduction $(DIRECTDEFINE) $(DEFSRC) ! mkbuiltins: $(srcdir)/mkbuiltins.c ../config.h ! $(CC) $(CCFLAGS) -o $(MKBUILTINS) $(srcdir)/mkbuiltins.c $(LIBS) # rules for deficient makes, like SunOS common.o: common.c bashgetopt.o: bashgetopt.c getopt.o: getopt.c ! evalstring.o: evalstring.c ! evalfile.o: evalfile.c - ulimit.o: ulimit.def ulimit.o: pipesize.h --- 92,127 ---- builtext.h builtins.c: $(MKBUILTINS) $(DEFSRC) ! @-if test -f builtins.c; then mv -f builtins.c old-builtins.c; fi ! @-if test -f builtext.h; then mv -f builtext.h old-builtext.h; fi ./$(MKBUILTINS) -externfile builtext.h -structfile builtins.c \ ! -noproduction $(DIRECTDEFINE) $(DEFSRC) ! @-if cmp -s old-builtext.h builtext.h; then \ ! mv old-builtext.h builtext.h; \ ! else \ ! $(RM) old-builtext.h; \ ! fi ! @-if cmp -s old-builtins.c builtins.c; then \ ! mv old-builtins.c builtins.c; \ ! else \ ! $(RM) old-builtins.c; \ ! fi ! mkbuiltins.o: ../config.h ! mkbuiltins.o: mkbuiltins.c ! $(RM) $@ ! $(CC_FOR_BUILD) -c $(CCFLAGS) $< ! ! mkbuiltins: mkbuiltins.o ! $(CC_FOR_BUILD) $(LDFLAGS) -o $(MKBUILTINS) mkbuiltins.o $(LIBS) # rules for deficient makes, like SunOS + mkbuiltins.o: mkbuiltins.c + builtins.o: builtins.c common.o: common.c bashgetopt.o: bashgetopt.c getopt.o: getopt.c ! evalstring.o: evalstring.c ! evalfile.o: evalfile.c ulimit.o: pipesize.h *************** *** 108,112 **** psize.aux: psize.c ! $(CC) $(CCFLAGS) -o $@ $(srcdir)/psize.c documentation: builtins.texi --- 130,134 ---- psize.aux: psize.c ! $(CC_FOR_BUILD) $(CCFLAGS) -o $@ $(srcdir)/psize.c documentation: builtins.texi *************** *** 147,150 **** --- 169,173 ---- kill.o: kill.def let.o: let.def + printf.o: printf.def pushd.o: pushd.def read.o: read.def *************** *** 160,163 **** --- 183,187 ---- trap.o: trap.def type.o: type.def + ulimit.o: ulimit.def umask.o: umask.def wait.o: wait.def *************** *** 275,278 **** --- 299,303 ---- exec.o: $(topdir)/shell.h $(topdir)/unwind_prot.h $(topdir)/variables.h exec.o: $(srcdir)/common.h $(topdir)/execute_cmd.h $(topdir)/maxpath.h + exec.o: $(topdir)/findcmd.h exit.o: $(topdir)/bashtypes.h exit.o: $(topdir)/command.h ../config.h $(topdir)/memalloc.h *************** *** 303,307 **** getopts.o: $(topdir)/shell.h $(topdir)/unwind_prot.h $(topdir)/variables.h hash.o: $(topdir)/builtins.h $(topdir)/command.h $(topdir)/quit.h ! hash.o: $(topdir)/execute_cmd.h $(topdir)/hashlib.h hash.o: $(topdir)/command.h ../config.h $(topdir)/memalloc.h hash.o: $(topdir)/error.h $(topdir)/general.h --- 328,332 ---- getopts.o: $(topdir)/shell.h $(topdir)/unwind_prot.h $(topdir)/variables.h hash.o: $(topdir)/builtins.h $(topdir)/command.h $(topdir)/quit.h ! hash.o: $(topdir)/findcmd.h $(topdir)/hashlib.h hash.o: $(topdir)/command.h ../config.h $(topdir)/memalloc.h hash.o: $(topdir)/error.h $(topdir)/general.h *************** *** 340,343 **** --- 365,374 ---- let.o: $(topdir)/subst.h $(topdir)/externs.h $(topdir)/maxpath.h let.o: $(topdir)/shell.h $(topdir)/unwind_prot.h $(topdir)/variables.h + printf.o: ../config.h $(topdir)/memalloc.h $(topdir)/bashjmp.h + printf.o: $(topdir)/command.h $(topdir)/error.h $(topdir)/general.h + printf.o: $(topdir)/quit.h $(topdir)/dispose_cmd.h $(topdir)/make_cmd.h + printf.o: $(topdir)/subst.h $(topdir)/externs.h $(topdir)/sig.h + printf.o: $(topdir)/pathnames.h $(topdir)/shell.h $(topdir)/unwind_prot.h + printf.o: $(topdir)/variables.h $(topdir)/stdc.h $(srcdir)/bashgetopt.h pushd.o: $(topdir)/command.h ../config.h $(topdir)/memalloc.h pushd.o: $(topdir)/error.h $(topdir)/general.h *************** *** 373,377 **** shift.o: $(topdir)/shell.h $(topdir)/unwind_prot.h $(topdir)/variables.h source.o: $(topdir)/command.h ../config.h $(topdir)/memalloc.h ! source.o: $(topdir)/error.h $(topdir)/general.h source.o: $(topdir)/quit.h $(topdir)/dispose_cmd.h $(topdir)/make_cmd.h source.o: $(topdir)/subst.h $(topdir)/externs.h $(topdir)/maxpath.h --- 404,408 ---- shift.o: $(topdir)/shell.h $(topdir)/unwind_prot.h $(topdir)/variables.h source.o: $(topdir)/command.h ../config.h $(topdir)/memalloc.h ! source.o: $(topdir)/error.h $(topdir)/general.h $(topdir)/findcmd.h source.o: $(topdir)/quit.h $(topdir)/dispose_cmd.h $(topdir)/make_cmd.h source.o: $(topdir)/subst.h $(topdir)/externs.h $(topdir)/maxpath.h *************** *** 387,390 **** --- 418,422 ---- test.o: $(topdir)/subst.h $(topdir)/externs.h $(topdir)/maxpath.h test.o: $(topdir)/shell.h $(topdir)/unwind_prot.h $(topdir)/variables.h + test.o: $(topdir)/test.h times.o: $(topdir)/command.h ../config.h $(topdir)/memalloc.h times.o: $(topdir)/error.h $(topdir)/general.h *************** *** 397,401 **** trap.o: $(topdir)/dispose_cmd.h $(topdir)/make_cmd.h $(topdir)/subst.h trap.o: $(topdir)/shell.h $(topdir)/unwind_prot.h $(topdir)/variables.h ! trap.o: $(topdir)/execute_cmd.h type.o: $(topdir)/command.h ../config.h $(topdir)/memalloc.h type.o: $(topdir)/error.h $(topdir)/general.h --- 429,433 ---- trap.o: $(topdir)/dispose_cmd.h $(topdir)/make_cmd.h $(topdir)/subst.h trap.o: $(topdir)/shell.h $(topdir)/unwind_prot.h $(topdir)/variables.h ! trap.o: $(topdir)/findcmd.h type.o: $(topdir)/command.h ../config.h $(topdir)/memalloc.h type.o: $(topdir)/error.h $(topdir)/general.h diff -Nrc2 bash-2.01.1/builtins/alias.def bash-2.02/builtins/alias.def *** bash-2.01.1/builtins/alias.def Wed Feb 5 11:41:59 1997 --- bash-2.02/builtins/alias.def Mon Nov 17 12:17:09 1997 *************** *** 38,41 **** --- 38,44 ---- #if defined (HAVE_UNISTD_H) + # ifdef _MINIX + # include + # endif # include #endif *************** *** 81,90 **** { if (aliases == 0) ! return (EXECUTION_FAILURE); alias_list = all_aliases (); if (alias_list == 0) ! return (EXECUTION_FAILURE); for (offset = 0; alias_list[offset]; offset++) --- 84,93 ---- { if (aliases == 0) ! return (EXECUTION_SUCCESS); alias_list = all_aliases (); if (alias_list == 0) ! return (EXECUTION_SUCCESS); for (offset = 0; alias_list[offset]; offset++) *************** *** 119,124 **** else { ! if (interactive) ! builtin_error ("`%s' not found", name); any_failed++; } --- 122,126 ---- else { ! builtin_error ("`%s' not found", name); any_failed++; } *************** *** 180,186 **** else { ! if (interactive) ! builtin_error ("`%s': not an alias", list->word->word); ! aflag++; } --- 182,186 ---- else { ! builtin_error ("`%s': not an alias", list->word->word); aflag++; } diff -Nrc2 bash-2.01.1/builtins/bashgetopt.c bash-2.02/builtins/bashgetopt.c *** bash-2.01.1/builtins/bashgetopt.c Fri Sep 13 11:29:30 1996 --- bash-2.02/builtins/bashgetopt.c Fri Nov 14 13:30:26 1997 *************** *** 162,165 **** --- 162,166 ---- } + #ifdef INCLUDE_UNUSED void report_bad_option () *************** *** 172,173 **** --- 173,175 ---- bad_option (s); } + #endif diff -Nrc2 bash-2.01.1/builtins/bind.def bash-2.02/builtins/bind.def *** bash-2.01.1/builtins/bind.def Thu Sep 12 14:23:00 1996 --- bash-2.02/builtins/bind.def Thu Sep 4 13:38:57 1997 *************** *** 27,31 **** $DEPENDS_ON READLINE $FUNCTION bind_builtin ! $SHORT_DOC bind [-lpvsPVS] [-m keymap] [-f filename] [-q name] [-r keyseq] [keyseq:readline-function] Bind a key sequence to a Readline function, or to a macro. The syntax is equivalent to that found in ~/.inputrc, but must be --- 27,31 ---- $DEPENDS_ON READLINE $FUNCTION bind_builtin ! $SHORT_DOC bind [-lpvsPVS] [-m keymap] [-f filename] [-q name] [-u name] [-r keyseq] [keyseq:readline-function] Bind a key sequence to a Readline function, or to a macro. The syntax is equivalent to that found in ~/.inputrc, but must be *************** *** 43,46 **** --- 43,47 ---- -f filename Read key bindings from FILENAME. -q function-name Query about which keys invoke the named function. + -u function-name Unbind all keys which are bound to the named function. -V List variable names and values -v List variable names and values in a form that can *************** *** 54,57 **** --- 55,61 ---- #if defined (HAVE_UNISTD_H) + # ifdef _MINIX + # include + # endif # include #endif *************** *** 72,75 **** --- 76,80 ---- static int query_bindings (); + static int unbind_command (); extern int no_line_editing; *************** *** 77,91 **** #define BIND_RETURN(x) do { return_code = x; goto bind_exit; } while (0) ! #define LFLAG 0x01 ! #define PFLAG 0x02 ! #define FFLAG 0x04 ! #define VFLAG 0x08 ! #define QFLAG 0x10 ! #define MFLAG 0x20 ! #define RFLAG 0x40 ! #define PPFLAG 0x80 ! #define VVFLAG 0x100 ! #define SFLAG 0x200 ! #define SSFLAG 0x400 int --- 82,97 ---- #define BIND_RETURN(x) do { return_code = x; goto bind_exit; } while (0) ! #define LFLAG 0x0001 ! #define PFLAG 0x0002 ! #define FFLAG 0x0004 ! #define VFLAG 0x0008 ! #define QFLAG 0x0010 ! #define MFLAG 0x0020 ! #define RFLAG 0x0040 ! #define PPFLAG 0x0080 ! #define VVFLAG 0x0100 ! #define SFLAG 0x0200 ! #define SSFLAG 0x0400 ! #define UFLAG 0x0800 int *************** *** 97,101 **** Keymap kmap, saved_keymap; int flags, opt; ! char *initfile, *map_name, *fun_name, *remove_seq; if (no_line_editing) --- 103,107 ---- Keymap kmap, saved_keymap; int flags, opt; ! char *initfile, *map_name, *fun_name, *unbind_name, *remove_seq; if (no_line_editing) *************** *** 104,108 **** kmap = saved_keymap = (Keymap) NULL; flags = 0; ! initfile = map_name = fun_name = remove_seq = (char *)NULL; return_code = EXECUTION_SUCCESS; --- 110,114 ---- kmap = saved_keymap = (Keymap) NULL; flags = 0; ! initfile = map_name = fun_name = unbind_name = remove_seq = (char *)NULL; return_code = EXECUTION_SUCCESS; *************** *** 117,121 **** reset_internal_getopt (); ! while ((opt = internal_getopt (list, "lvpVPsSf:q:m:r:")) != EOF) { switch (opt) --- 123,127 ---- reset_internal_getopt (); ! while ((opt = internal_getopt (list, "lvpVPsSf:q:u:m:r:")) != EOF) { switch (opt) *************** *** 142,145 **** --- 148,155 ---- fun_name = list_optarg; break; + case 'u': + flags |= UFLAG; + unbind_name = list_optarg; + break; case 'r': flags |= RFLAG; *************** *** 221,224 **** --- 231,237 ---- return_code = query_bindings (fun_name); + if ((flags & UFLAG) && unbind_name) + return_code = unbind_command (unbind_name); + if ((flags & RFLAG) && remove_seq) { *************** *** 254,258 **** function = rl_named_function (name); ! if (!function) { builtin_error ("unknown function name `%s'", name); --- 267,271 ---- function = rl_named_function (name); ! if (function == 0) { builtin_error ("unknown function name `%s'", name); *************** *** 274,277 **** --- 287,307 ---- printf ("...\n"); free_array (keyseqs); + return EXECUTION_SUCCESS; + } + + static int + unbind_command (name) + char *name; + { + Function *function; + + function = rl_named_function (name); + if (function == 0) + { + builtin_error ("unknown function name `%s'", name); + return EXECUTION_FAILURE; + } + + rl_unbind_function_in_map (function, rl_get_keymap ()); return EXECUTION_SUCCESS; } diff -Nrc2 bash-2.01.1/builtins/break.def bash-2.02/builtins/break.def *** bash-2.01.1/builtins/break.def Mon Mar 3 12:46:46 1997 --- bash-2.02/builtins/break.def Fri Jul 18 16:53:51 1997 *************** *** 31,35 **** #if defined (HAVE_UNISTD_H) ! #include #endif --- 31,38 ---- #if defined (HAVE_UNISTD_H) ! # ifdef _MINIX ! # include ! # endif ! # include #endif diff -Nrc2 bash-2.01.1/builtins/builtin.def bash-2.02/builtins/builtin.def *** bash-2.01.1/builtins/builtin.def Mon Mar 27 14:38:32 1995 --- bash-2.02/builtins/builtin.def Fri Jul 18 16:53:59 1997 *************** *** 32,35 **** --- 32,38 ---- #if defined (HAVE_UNISTD_H) + # ifdef _MINIX + # include + # endif # include #endif diff -Nrc2 bash-2.01.1/builtins/cd.def bash-2.02/builtins/cd.def *** bash-2.01.1/builtins/cd.def Fri Apr 11 12:55:47 1997 --- bash-2.02/builtins/cd.def Tue Mar 17 13:50:51 1998 *************** *** 24,27 **** --- 24,30 ---- #if defined (HAVE_UNISTD_H) + # ifdef _MINIX + # include + # endif # include #endif *************** *** 30,34 **** --- 33,39 ---- #include "../posixdir.h" #include "../posixstat.h" + #ifndef _MINIX #include + #endif #include *************** *** 67,75 **** $SHORT_DOC cd [-PL] [dir] Change the current directory to DIR. The variable $HOME is the ! default DIR. The variable $CDPATH defines the search path for the directory containing DIR. Alternative directory names in CDPATH are separated by a colon (:). A null directory name is the same as the current directory, i.e. `.'. If DIR begins with a slash (/), ! then $CDPATH is not used. If the directory is not found, and the shell option `cdable_vars' is set, then try the word as a variable name. If that variable has a value, then cd to the value of that --- 72,80 ---- $SHORT_DOC cd [-PL] [dir] Change the current directory to DIR. The variable $HOME is the ! default DIR. The variable CDPATH defines the search path for the directory containing DIR. Alternative directory names in CDPATH are separated by a colon (:). A null directory name is the same as the current directory, i.e. `.'. If DIR begins with a slash (/), ! then CDPATH is not used. If the directory is not found, and the shell option `cdable_vars' is set, then try the word as a variable name. If that variable has a value, then cd to the value of that *************** *** 147,153 **** if (old_anm == 0 && array_needs_making && exported_p (tvar)) { ! pwdvar = xmalloc (strlen (dirname) + 5); /* 5 = "PWD" + '=' + '\0' */ strcpy (pwdvar, "PWD="); ! strcpy (pwdvar + 4, dirname); add_or_supercede_exported_var (pwdvar, 0); array_needs_making = 0; --- 152,159 ---- if (old_anm == 0 && array_needs_making && exported_p (tvar)) { ! pwdvar = xmalloc (STRLEN (dirname) + 5); /* 5 = "PWD" + '=' + '\0' */ strcpy (pwdvar, "PWD="); ! if (dirname) ! strcpy (pwdvar + 4, dirname); add_or_supercede_exported_var (pwdvar, 0); array_needs_making = 0; *************** *** 227,230 **** --- 233,238 ---- return (EXECUTION_FAILURE); } + if (interactive) + printf ("%s\n", dirname); } else *************** *** 238,241 **** --- 246,251 ---- while ((path = extract_colon_unit (cdpath, &path_index))) { + /* OPT is 1 if the path element is non-empty */ + opt = path[0] != '\0'; temp = mkpath (path, dirname, 1); free (path); *************** *** 249,262 **** if (change_to_directory (temp, no_symlinks)) { ! if (temp[0] != '.' || temp[1] != '/') ! printf ("%s\n", temp); free (temp); /* Posix.2 says that after using CDPATH, the resultant value of $PWD will not contain symlinks. */ ! return (bindpwd (posixly_correct)); } else free (temp); } } --- 259,285 ---- if (change_to_directory (temp, no_symlinks)) { ! /* POSIX.2 says that if a nonempty directory from CDPATH ! is used to find the directory to change to, the new ! directory name is echoed to stdout, whether or not ! the shell is interactive. */ ! if (opt) ! printf ("%s\n", the_current_working_directory); free (temp); /* Posix.2 says that after using CDPATH, the resultant value of $PWD will not contain symlinks. */ ! return (bindpwd (posixly_correct || no_symlinks)); } else free (temp); + } + + /* POSIX.2 says that if `.' does not appear in $CDPATH, we don't + try the current directory, so we just punt now with an error + message if POSIXLY_CORRECT is non-zero. */ + if (posixly_correct) + { + builtin_error ("%s: %s", dirname, strerror (ENOENT)); + return (EXECUTION_FAILURE); } } diff -Nrc2 bash-2.01.1/builtins/command.def bash-2.02/builtins/command.def *** bash-2.01.1/builtins/command.def Fri Feb 28 12:59:26 1997 --- bash-2.02/builtins/command.def Fri Feb 27 12:01:35 1998 *************** *** 36,39 **** --- 36,42 ---- #if defined (HAVE_UNISTD_H) + # ifdef _MINIX + # include + # endif # include #endif *************** *** 180,188 **** len = (size_t)confstr (_CS_PATH, (char *)NULL, (size_t)0); ! p = xmalloc ((int)len + 2); ! *p = '\0'; ! confstr (_CS_PATH, p, len); ! return (p); ! #else /* !_CSPATH || !HAVE_CONFSTR */ # if defined (CS_PATH) return (savestring (CS_PATH)); --- 183,196 ---- len = (size_t)confstr (_CS_PATH, (char *)NULL, (size_t)0); ! if (len > 0) ! { ! p = xmalloc ((int)len + 2); ! *p = '\0'; ! confstr (_CS_PATH, p, len); ! return (p); ! } ! else ! return (savestring (STANDARD_UTILS_PATH)); ! #else /* !_CS_PATH || !HAVE_CONFSTR */ # if defined (CS_PATH) return (savestring (CS_PATH)); diff -Nrc2 bash-2.01.1/builtins/common.c bash-2.02/builtins/common.c *** bash-2.01.1/builtins/common.c Tue Apr 1 12:24:44 1997 --- bash-2.02/builtins/common.c Wed Feb 4 14:56:31 1998 *************** *** 20,23 **** --- 20,26 ---- #if defined (HAVE_UNISTD_H) + # ifdef _MINIX + # include + # endif # include #endif *************** *** 28,31 **** --- 31,36 ---- #include + #include + #if defined (PREFER_STDARG) # include *************** *** 55,58 **** --- 60,67 ---- #endif + #if !defined (errno) + extern int errno; + #endif /* !errno */ + extern int no_symbolic_links, interactive, interactive_shell; extern int indirection_level, startup_state, subshell_environment; *************** *** 400,408 **** if (directory == 0) { ! fprintf (stderr, "%s: could not get current directory: %s\n", (for_whom && *for_whom) ? for_whom : get_name_for_error (), the_current_working_directory[0] ? the_current_working_directory ! : bash_getcwd_errstr); free (the_current_working_directory); --- 409,418 ---- if (directory == 0) { ! fprintf (stderr, "%s: could not get current directory: %s: %s\n", (for_whom && *for_whom) ? for_whom : get_name_for_error (), the_current_working_directory[0] ? the_current_working_directory ! : bash_getcwd_errstr, ! strerror (errno)); free (the_current_working_directory); *************** *** 692,697 **** --- 702,712 ---- initialize_shell_builtins () { + #ifdef _MINIX + qsort (shell_builtins, num_shell_builtins, sizeof (struct builtin), + (int (*)(const void *, const void *))shell_builtin_compare); + #else qsort (shell_builtins, num_shell_builtins, sizeof (struct builtin), shell_builtin_compare); + #endif } *************** *** 792,799 **** *r++ = c; break; - case '#': /* comment char */ #if 0 case '~': /* tilde expansion */ #endif if (s == string) *r++ = '\\'; --- 807,818 ---- *r++ = c; break; #if 0 case '~': /* tilde expansion */ + if (s == string || s[-1] == '=' || s[-1] == ':') + *r++ = '\\'; + *r++ = c; + break; #endif + case '#': /* comment char */ if (s == string) *r++ = '\\'; *************** *** 828,831 **** --- 847,853 ---- case '$': case '`': /* expansion chars */ return (1); + case '~': /* tilde expansion */ + if (s == string || s[-1] == '=' || s[-1] == ':') + return (1); case '#': if (s == string) /* comment char */ diff -Nrc2 bash-2.01.1/builtins/common.h bash-2.02/builtins/common.h *** bash-2.01.1/builtins/common.h Wed May 14 12:56:35 1997 --- bash-2.02/builtins/common.h Fri Oct 3 16:53:05 1997 *************** *** 31,105 **** #define SEVAL_NOHIST 0x04 extern void builtin_error __P((const char *, ...)); ! extern void builtin_usage (); ! extern void bad_option (); ! extern char **make_builtin_argv (); ! ! extern int get_numeric_arg (); ! extern void remember_args (); ! extern void no_args (); ! extern int no_options (); ! ! extern int read_octal (); ! ! extern void push_context (), pop_context (); ! extern void push_dollar_vars (), pop_dollar_vars (); ! extern void dispose_saved_dollar_vars (); ! extern int dollar_vars_changed (); ! extern void set_dollar_vars_unchanged (), set_dollar_vars_changed (); /* Keeps track of the current working directory. */ extern char *the_current_working_directory; ! extern char *get_working_directory (); ! extern void set_working_directory (); #if defined (JOB_CONTROL) ! extern int get_job_spec (); #endif ! ! extern int display_signal_list (); /* It's OK to declare a function as returning a Function * without providing a definition of what a `Function' is. */ ! extern struct builtin *builtin_address_internal (); ! extern Function *find_shell_builtin (); ! extern Function *builtin_address (); ! extern Function *find_special_builtin (); ! ! extern void initialize_shell_builtins (); ! ! extern char *single_quote (); ! extern char *double_quote (); ! extern char *backslash_quote (); ! extern int contains_shell_metas (); /* Functions from set.def */ ! extern void initialize_shell_options (); ! extern void list_minus_o_opts (); ! extern int set_minus_o_option (); ! extern int minus_o_option_value (); ! extern void reset_shell_options (); /* Functions from shopt.def */ ! extern void reset_shopt_options (); /* Functions from type.def */ ! extern int describe_command (); /* Functions from setattr.def */ ! extern int set_or_show_attributes (); ! extern int show_var_attributes (); ! extern int show_name_attributes (); ! extern void set_var_attribute (); /* Functions from pushd.def */ ! extern char *get_dirstack_element (); ! extern void set_dirstack_element (); ! extern WORD_LIST *get_directory_stack (); /* Functions from evalstring.c */ ! extern int parse_and_execute (); ! extern void parse_and_execute_cleanup (); /* Functions from evalfile.c */ --- 31,107 ---- #define SEVAL_NOHIST 0x04 + /* Functions from common.c */ extern void builtin_error __P((const char *, ...)); ! extern void builtin_usage __P((void)); ! extern void no_args __P((WORD_LIST *)); ! extern void bad_option __P((char *)); ! extern int no_options __P((WORD_LIST *)); ! ! extern char **make_builtin_argv __P((WORD_LIST *, int *)); ! extern void remember_args __P((WORD_LIST *, int)); ! ! extern void push_context __P((void)); ! extern void pop_context __P((void)); ! extern void push_dollar_vars __P((void)); ! extern void pop_dollar_vars __P((void)); ! extern void dispose_saved_dollar_vars __P((void)); ! extern int dollar_vars_changed __P((void)); ! extern void set_dollar_vars_unchanged __P((void)); ! extern void set_dollar_vars_changed __P((void)); ! extern int get_numeric_arg __P((WORD_LIST *, int)); ! extern int read_octal __P((char *)); /* Keeps track of the current working directory. */ extern char *the_current_working_directory; ! extern char *get_working_directory __P((char *)); ! extern void set_working_directory __P((char *)); #if defined (JOB_CONTROL) ! extern int get_job_spec __P((WORD_LIST *)); #endif ! extern int display_signal_list __P((WORD_LIST *, int)); /* It's OK to declare a function as returning a Function * without providing a definition of what a `Function' is. */ ! extern struct builtin *builtin_address_internal __P((char *, int)); ! extern Function *find_shell_builtin __P((char *)); ! extern Function *builtin_address __P((char *)); ! extern Function *find_special_builtin __P((char *)); ! extern void initialize_shell_builtins __P((void)); ! ! extern char *single_quote __P((char *)); ! extern char *double_quote __P((char *)); ! extern char *backslash_quote __P((char *)); ! extern int contains_shell_metas __P((char *)); /* Functions from set.def */ ! extern void initialize_shell_options __P((int)); ! extern void list_minus_o_opts __P((int, int)); ! extern int set_minus_o_option __P((int, char *)); ! extern int minus_o_option_value __P((char *)); ! extern void reset_shell_options __P((void)); /* Functions from shopt.def */ ! extern void reset_shopt_options __P((void)); /* Functions from type.def */ ! extern int describe_command __P((char *, int, int)); /* Functions from setattr.def */ ! extern int set_or_show_attributes __P((WORD_LIST *, int, int)); ! extern int show_var_attributes __P((SHELL_VAR *, int, int)); ! extern int show_name_attributes __P((char *, int)); ! extern void set_var_attribute __P((char *, int, int)); /* Functions from pushd.def */ ! extern char *get_dirstack_from_string __P((char *)); ! extern char *get_dirstack_element __P((int, int)); ! extern void set_dirstack_element __P((int, int, char *)); ! extern WORD_LIST *get_directory_stack __P((void)); /* Functions from evalstring.c */ ! extern int parse_and_execute __P((char *, char *, int)); ! extern void parse_and_execute_cleanup __P((void)); /* Functions from evalfile.c */ diff -Nrc2 bash-2.01.1/builtins/declare.def bash-2.02/builtins/declare.def *** bash-2.01.1/builtins/declare.def Tue Jul 1 14:05:10 1997 --- bash-2.02/builtins/declare.def Thu Oct 16 09:53:20 1997 *************** *** 58,61 **** --- 58,64 ---- #if defined (HAVE_UNISTD_H) + # ifdef _MINIX + # include + # endif # include #endif *************** *** 377,380 **** --- 380,395 ---- FREE (var->value); var->value = t; + } + + /* If we found this variable in the temporary environment, as with + `var=value declare -x var', make sure it is treated identically + to `var=value export var'. Do the same for `declare -r' and + `readonly'. Preserve the attributes, except for att_tempvar. */ + if ((flags_on & (att_exported|att_readonly)) && tempvar_p (var)) + { + SHELL_VAR *tv; + tv = bind_variable (var->name, var->value ? var->value : ""); + tv->attributes = var->attributes & ~att_tempvar; + dispose_variable (var); } } diff -Nrc2 bash-2.01.1/builtins/enable.def bash-2.02/builtins/enable.def *** bash-2.01.1/builtins/enable.def Fri Feb 7 14:05:00 1997 --- bash-2.02/builtins/enable.def Fri Jul 18 16:55:00 1997 *************** *** 43,46 **** --- 43,49 ---- #if defined (HAVE_UNISTD_H) + # ifdef _MINIX + # include + # endif # include #endif diff -Nrc2 bash-2.01.1/builtins/eval.def bash-2.02/builtins/eval.def *** bash-2.01.1/builtins/eval.def Wed May 14 13:15:34 1997 --- bash-2.02/builtins/eval.def Fri Jul 18 16:55:08 1997 *************** *** 30,34 **** #include #if defined (HAVE_UNISTD_H) ! #include #endif --- 30,37 ---- #include #if defined (HAVE_UNISTD_H) ! # ifdef _MINIX ! # include ! # endif ! # include #endif diff -Nrc2 bash-2.01.1/builtins/evalfile.c bash-2.02/builtins/evalfile.c *** bash-2.01.1/builtins/evalfile.c Wed May 14 13:41:47 1997 --- bash-2.02/builtins/evalfile.c Mon Oct 13 14:47:49 1997 *************** *** 76,79 **** --- 76,80 ---- char *string; struct stat finfo; + size_t file_size; VFunction *errfunc; *************** *** 109,114 **** } ! string = xmalloc (1 + (int)finfo.st_size); ! result = read (fd, string, finfo.st_size); string[result] = '\0'; --- 110,122 ---- } ! file_size = (size_t)finfo.st_size; ! /* Check for overflow with large files. */ ! if (file_size != finfo.st_size || file_size + 1 < file_size) ! { ! (*errfunc) ("%s: file is too large", filename); ! return ((flags & FEVAL_BUILTIN) ? EXECUTION_FAILURE : -1); ! } ! string = xmalloc (1 + file_size); ! result = read (fd, string, file_size); string[result] = '\0'; *************** *** 117,121 **** errno = return_val; ! if (result != (int)finfo.st_size) { free (string); --- 125,129 ---- errno = return_val; ! if (result < 0) /* XXX was != file_size, not < 0 */ { free (string); *************** *** 123,126 **** --- 131,140 ---- } + if (result == 0) + { + free (string); + return ((flags & FEVAL_BUILTIN) ? EXECUTION_SUCCESS : 1); + } + if (check_binary_file ((unsigned char *)string, (result > 80) ? 80 : result)) { diff -Nrc2 bash-2.01.1/builtins/evalstring.c bash-2.02/builtins/evalstring.c *** bash-2.01.1/builtins/evalstring.c Mon Sep 22 12:54:29 1997 --- bash-2.02/builtins/evalstring.c Mon Sep 22 12:39:24 1997 *************** *** 20,23 **** --- 20,26 ---- #if defined (HAVE_UNISTD_H) + # ifdef _MINIX + # include + # endif # include #endif *************** *** 26,29 **** --- 29,35 ---- #include + #include + + #include "../filecntl.h" #include "../bashansi.h" *************** *** 34,37 **** --- 40,44 ---- #include "../input.h" #include "../execute_cmd.h" + #include "../redir.h" #if defined (HISTORY) *************** *** 41,44 **** --- 48,55 ---- #include "common.h" + #if !defined (errno) + extern int errno; + #endif + extern void run_trap_cleanup (); *************** *** 48,55 **** --- 59,69 ---- extern int last_command_exit_value; extern int running_trap; + extern int posixly_correct; extern COMMAND *global_command; int parse_and_execute_level = 0; + static int cat_file (); + /* How to force parse_and_execute () to clean up after itself. */ void *************** *** 203,207 **** #endif /* ONESHOT */ ! last_result = execute_command_internal (command, 0, NO_PIPE, NO_PIPE, bitmap); --- 217,237 ---- #endif /* ONESHOT */ ! /* See if this is a candidate for $( type == cm_simple && !command->redirects && ! (command->flags & CMD_TIME_PIPELINE) == 0 && ! command->value.Simple->words == 0 && ! command->value.Simple->redirects && ! command->value.Simple->redirects->next == 0 && ! command->value.Simple->redirects->instruction == r_input_direction) ! { ! int r; ! r = cat_file (command->value.Simple->redirects); ! last_result = (r < 0) ? EXECUTION_FAILURE : EXECUTION_SUCCESS; ! } ! else ! last_result = execute_command_internal (command, 0, NO_PIPE, NO_PIPE, bitmap); *************** *** 238,240 **** --- 268,361 ---- return (last_result); + } + + /* Write NB bytes from BUF to file descriptor FD, retrying the write if + it is interrupted. We retry three times if we get a zero-length + write. Any other signal causes this function to return prematurely. */ + static int + zwrite (fd, buf, nb) + int fd; + unsigned char *buf; + int nb; + { + int n, i, nt; + + for (n = nb, nt = 0;;) + { + i = write (fd, buf, n); + if (i > 0) + { + n -= i; + if (n <= 0) + return nb; + } + else if (i == 0) + { + if (++nt > 3) + return (nb - n); + } + else if (errno != EINTR) + return -1; + } + } + + /* Handle a $( < file ) command substitution. This expands the filename, + returning errors as appropriate, then just cats the file to the standard + output. */ + static int + cat_file (r) + REDIRECT *r; + { + char lbuf[128], *fn; + int nr, fd, rval; + + if (r->instruction != r_input_direction) + return -1; + + /* Get the filename. */ + if (posixly_correct && !interactive_shell) + disallow_filename_globbing++; + fn = redirection_expand (r->redirectee.filename); + if (posixly_correct && !interactive_shell) + disallow_filename_globbing--; + + if (fn == 0) + { + redirection_error (r, AMBIGUOUS_REDIRECT); + return -1; + } + + fd = open(fn, O_RDONLY); + if (fd < 0) + { + file_error (fn); + free (fn); + return -1; + } + + rval = 0; + while (1) + { + /* Retry the reads on EINTR. Any other error causes a break from the + loop. */ + while ((nr = read (fd, lbuf, sizeof(lbuf))) < 0 && errno == EINTR) + ; + if (nr == 0) + break; + else if (nr < 0) + { + rval = -1; + break; + } + if (zwrite (1, lbuf, nr) < 0) + { + rval = -1; + break; + } + } + + free (fn); + close (fd); + + return (0); } diff -Nrc2 bash-2.01.1/builtins/exec.def bash-2.02/builtins/exec.def *** bash-2.01.1/builtins/exec.def Mon Apr 14 16:40:00 1997 --- bash-2.02/builtins/exec.def Thu Jul 10 11:49:51 1997 *************** *** 50,53 **** --- 50,54 ---- #include "../shell.h" #include "../execute_cmd.h" + #include "../findcmd.h" #if defined (JOB_CONTROL) # include "../jobs.h" diff -Nrc2 bash-2.01.1/builtins/exit.def bash-2.02/builtins/exit.def *** bash-2.01.1/builtins/exit.def Thu Mar 6 10:51:44 1997 --- bash-2.02/builtins/exit.def Wed Nov 12 13:24:31 1997 *************** *** 76,80 **** WORD_LIST *list; { ! if (login_shell == 0 && interactive) { builtin_error ("not login shell: use `exit'"); --- 76,80 ---- WORD_LIST *list; { ! if (login_shell == 0 /* && interactive */) { builtin_error ("not login shell: use `exit'"); diff -Nrc2 bash-2.01.1/builtins/fc.def bash-2.02/builtins/fc.def *** bash-2.01.1/builtins/fc.def Wed May 14 14:24:09 1997 --- bash-2.02/builtins/fc.def Thu Jul 17 09:42:44 1997 *************** *** 50,57 **** #if defined (HISTORY) ! #include #include "../bashtypes.h" #include "../posixstat.h" ! #include #if defined (HAVE_UNISTD_H) --- 50,61 ---- #if defined (HISTORY) ! #ifndef _MINIX ! # include ! #endif #include "../bashtypes.h" #include "../posixstat.h" ! #ifndef _MINIX ! # include ! #endif #if defined (HAVE_UNISTD_H) diff -Nrc2 bash-2.01.1/builtins/getopt.c bash-2.02/builtins/getopt.c *** bash-2.01.1/builtins/getopt.c Thu Mar 6 15:54:53 1997 --- bash-2.02/builtins/getopt.c Fri Jul 18 16:56:06 1997 *************** *** 21,24 **** --- 21,27 ---- #if defined (HAVE_UNISTD_H) + # ifdef _MINIX + # include + # endif # include #endif diff -Nrc2 bash-2.01.1/builtins/getopts.def bash-2.02/builtins/getopts.def *** bash-2.01.1/builtins/getopts.def Fri Feb 28 15:54:28 1997 --- bash-2.02/builtins/getopts.def Fri Jul 18 16:56:17 1997 *************** *** 62,65 **** --- 62,68 ---- #if defined (HAVE_UNISTD_H) + # ifdef _MINIX + # include + # endif # include #endif diff -Nrc2 bash-2.01.1/builtins/hash.def bash-2.02/builtins/hash.def *** bash-2.01.1/builtins/hash.def Thu May 29 09:51:24 1997 --- bash-2.02/builtins/hash.def Thu Jan 29 14:51:26 1998 *************** *** 36,39 **** --- 36,41 ---- #include + #include "../bashtypes.h" + #if defined (HAVE_UNISTD_H) # include *************** *** 44,49 **** #include "../shell.h" #include "../builtins.h" - #include "../execute_cmd.h" #include "../flags.h" #include "../hashcmd.h" #include "common.h" --- 46,51 ---- #include "../shell.h" #include "../builtins.h" #include "../flags.h" + #include "../findcmd.h" #include "../hashcmd.h" #include "common.h" *************** *** 64,68 **** { int expunge_hash_table, opt; ! char *word, *pathname; if (hashing_enabled == 0) --- 66,70 ---- { int expunge_hash_table, opt; ! char *w, *pathname; if (hashing_enabled == 0) *************** *** 108,117 **** { /* Add or rehash the specified commands. */ ! word = list->word->word; if (pathname) ! remember_filename (word, pathname, 0, 0); ! else if (absolute_program (word)) continue; ! else if (add_hashed_command (word, 0)) opt = EXECUTION_FAILURE; } --- 110,119 ---- { /* Add or rehash the specified commands. */ ! w = list->word->word; if (pathname) ! remember_filename (w, pathname, 0, 0); ! else if (absolute_program (w)) continue; ! else if (add_hashed_command (w, 0)) opt = EXECUTION_FAILURE; } *************** *** 122,127 **** static int ! add_hashed_command (word, quiet) ! char *word; int quiet; { --- 124,129 ---- static int ! add_hashed_command (w, quiet) ! char *w; int quiet; { *************** *** 130,142 **** rv = 0; ! if (find_function (word) == 0 && find_shell_builtin (word) == 0) { ! full_path = find_user_command (word); if (full_path && executable_file (full_path)) ! remember_filename (word, full_path, dot_found_in_search, 0); else { if (quiet == 0) ! builtin_error ("%s: not found", word); rv++; } --- 132,144 ---- rv = 0; ! if (find_function (w) == 0 && find_shell_builtin (w) == 0) { ! full_path = find_user_command (w); if (full_path && executable_file (full_path)) ! remember_filename (w, full_path, dot_found_in_search, 0); else { if (quiet == 0) ! builtin_error ("%s: not found", w); rv++; } diff -Nrc2 bash-2.01.1/builtins/help.def bash-2.02/builtins/help.def *** bash-2.01.1/builtins/help.def Wed Feb 5 12:18:38 1997 --- bash-2.02/builtins/help.def Tue Aug 5 12:10:52 1997 *************** *** 37,40 **** --- 37,43 ---- #if defined (HAVE_UNISTD_H) + # ifdef _MINIX + # include + # endif # include #endif *************** *** 42,45 **** --- 45,49 ---- #include "../shell.h" #include "../builtins.h" + #include "../pathexp.h" #include "bashgetopt.h" *************** *** 101,105 **** QUIT; if ((strncmp (pattern, name, plen) == 0) || ! (fnmatch (pattern, name, 0) != FNM_NOMATCH)) { printf ("%s: %s\n", name, shell_builtins[i].short_doc); --- 105,109 ---- QUIT; if ((strncmp (pattern, name, plen) == 0) || ! (fnmatch (pattern, name, FNMATCH_EXTFLAG) != FNM_NOMATCH)) { printf ("%s: %s\n", name, shell_builtins[i].short_doc); diff -Nrc2 bash-2.01.1/builtins/history.def bash-2.02/builtins/history.def *** bash-2.01.1/builtins/history.def Mon Mar 3 12:47:07 1997 --- bash-2.02/builtins/history.def Thu Jul 17 09:43:07 1997 *************** *** 47,51 **** #if defined (HISTORY) #include "../bashtypes.h" ! #include #include "../posixstat.h" #include "../filecntl.h" --- 47,53 ---- #if defined (HISTORY) #include "../bashtypes.h" ! #ifndef _MINIX ! # include ! #endif #include "../posixstat.h" #include "../filecntl.h" diff -Nrc2 bash-2.01.1/builtins/jobs.def bash-2.02/builtins/jobs.def *** bash-2.01.1/builtins/jobs.def Thu May 8 15:10:02 1997 --- bash-2.02/builtins/jobs.def Mon Oct 13 11:39:48 1997 *************** *** 206,214 **** $FUNCTION disown_builtin $DEPENDS_ON JOB_CONTROL ! $SHORT_DOC disown [-h] [jobspec ...] By default, removes each JOBSPEC argument from the table of active jobs. If the -h option is given, the job is not removed from the table, but is marked so that SIGHUP is not sent to the job if the shell receives a ! SIGHUP. $END --- 206,215 ---- $FUNCTION disown_builtin $DEPENDS_ON JOB_CONTROL ! $SHORT_DOC disown [-h] [-ar] [jobspec ...] By default, removes each JOBSPEC argument from the table of active jobs. If the -h option is given, the job is not removed from the table, but is marked so that SIGHUP is not sent to the job if the shell receives a ! SIGHUP. The -a option, when JOBSPEC is not supplied, means to remove all ! jobs from the job table; the -r option means to remove only running jobs. $END *************** *** 218,233 **** WORD_LIST *list; { ! int opt, job, retval, nohup_only; sigset_t set, oset; ! nohup_only = 0; reset_internal_getopt (); ! while ((opt = internal_getopt (list, "h")) != -1) { switch (opt) { case 'h': nohup_only = 1; break; default: builtin_usage (); --- 219,240 ---- WORD_LIST *list; { ! int opt, job, retval, nohup_only, running_jobs, all_jobs; sigset_t set, oset; ! nohup_only = running_jobs = all_jobs = 0; reset_internal_getopt (); ! while ((opt = internal_getopt (list, "ahr")) != -1) { switch (opt) { + case 'a': + all_jobs = 1; + break; case 'h': nohup_only = 1; break; + case 'r': + running_jobs = 1; + break; default: builtin_usage (); *************** *** 238,252 **** retval = EXECUTION_SUCCESS; ! #if 0 ! /* For the future `disown -a' */ ! if (list == 0) { if (nohup_only) ! nohup_all_jobs (); else ! delete_all_jobs (); return (EXECUTION_SUCCESS); } - #endif do --- 245,257 ---- retval = EXECUTION_SUCCESS; ! /* `disown -a' or `disown -r' */ ! if (list == 0 && (all_jobs || running_jobs)) { if (nohup_only) ! nohup_all_jobs (running_jobs); else ! delete_all_jobs (running_jobs); return (EXECUTION_SUCCESS); } do *************** *** 257,261 **** : get_job_spec (list); ! if (job == NO_JOB || jobs == 0 || jobs[job] == 0) { builtin_error ("%s: no such job", list ? list->word->word : "current"); --- 262,266 ---- : get_job_spec (list); ! if (job == NO_JOB || jobs == 0 || job < 0 || job >= job_slots || jobs[job] == 0) { builtin_error ("%s: no such job", list ? list->word->word : "current"); *************** *** 265,269 **** nohup_job (job); else ! delete_job (job); UNBLOCK_CHILD (oset); --- 270,274 ---- nohup_job (job); else ! delete_job (job, 1); UNBLOCK_CHILD (oset); diff -Nrc2 bash-2.01.1/builtins/kill.def bash-2.02/builtins/kill.def *** bash-2.01.1/builtins/kill.def Mon Feb 24 16:08:33 1997 --- bash-2.02/builtins/kill.def Tue Mar 17 13:24:37 1998 *************** *** 40,43 **** --- 40,46 ---- #include #if defined (HAVE_UNISTD_H) + # ifdef _MINIX + # include + # endif # include #endif *************** *** 78,82 **** if (list == 0) ! return (EXECUTION_SUCCESS); any_succeeded = listing = saw_signal = 0; --- 81,88 ---- if (list == 0) ! { ! builtin_usage (); ! return (EXECUTION_FAILURE); ! } any_succeeded = listing = saw_signal = 0; *************** *** 146,149 **** --- 152,161 ---- } + if (list == 0) + { + builtin_usage (); + return (EXECUTION_FAILURE); + } + while (list) { *************** *** 153,157 **** word++; ! if (all_digits (word)) { /* Use the entire argument in case of minus sign presence. */ --- 165,169 ---- word++; ! if (*word && all_digits (word)) { /* Use the entire argument in case of minus sign presence. */ *************** *** 163,172 **** any_succeeded++; } ! else if (*list->word->word != '%') { builtin_error ("%s: no such pid", list->word->word); CONTINUE_OR_FAIL; } ! else if (interactive || job_control) /* Posix.2 says you can kill without job control active (4.32.4) */ { /* Must be a job spec. Check it out. */ --- 175,184 ---- any_succeeded++; } ! else if (*list->word->word && *list->word->word != '%') { builtin_error ("%s: no such pid", list->word->word); CONTINUE_OR_FAIL; } ! else if (*word && (interactive || job_control)) /* Posix.2 says you can kill without job control active (4.32.4) */ { /* Must be a job spec. Check it out. */ *************** *** 209,213 **** else { ! builtin_error ("`%s' is not a pid or valid job spec", list->word->word); CONTINUE_OR_FAIL; } --- 221,225 ---- else { ! builtin_error ("`%s': not a pid or valid job spec", list->word->word); CONTINUE_OR_FAIL; } diff -Nrc2 bash-2.01.1/builtins/let.def bash-2.02/builtins/let.def *** bash-2.01.1/builtins/let.def Tue Apr 15 14:30:59 1997 --- bash-2.02/builtins/let.def Fri Jul 18 16:57:40 1997 *************** *** 64,67 **** --- 64,70 ---- #if defined (HAVE_UNISTD_H) + # ifdef _MINIX + # include + # endif # include #endif diff -Nrc2 bash-2.01.1/builtins/mkbuiltins.c bash-2.02/builtins/mkbuiltins.c *** bash-2.01.1/builtins/mkbuiltins.c Mon Feb 17 14:57:12 1997 --- bash-2.02/builtins/mkbuiltins.c Mon Oct 13 14:00:49 1997 *************** *** 23,38 **** #if defined (HAVE_UNISTD_H) # include #endif #include "../bashtypes.h" #include #include "../posixstat.h" #include "../filecntl.h" - #if defined (HAVE_UNISTD_H) - # include - #endif /* HAVE_UNISTD_H */ - #include "../bashansi.h" #include --- 23,40 ---- #if defined (HAVE_UNISTD_H) + # ifdef _MINIX + # include + # endif # include #endif + #ifndef _MINIX #include "../bashtypes.h" #include + #endif + #include "../posixstat.h" #include "../filecntl.h" #include "../bashansi.h" #include *************** *** 438,443 **** DEF_FILE *defs; struct stat finfo; char *buffer, *line; ! int fd; if (stat (filename, &finfo) == -1) --- 440,446 ---- DEF_FILE *defs; struct stat finfo; + size_t file_size; char *buffer, *line; ! int fd, nr; if (stat (filename, &finfo) == -1) *************** *** 449,459 **** file_error (filename); ! buffer = xmalloc (1 + (int)finfo.st_size); ! if (read (fd, buffer, finfo.st_size) != finfo.st_size) file_error (filename); close (fd); /* Create and fill in the initial structure describing this file. */ defs = (DEF_FILE *)xmalloc (sizeof (DEF_FILE)); --- 452,469 ---- file_error (filename); ! file_size = (size_t)finfo.st_size; ! buffer = xmalloc (1 + file_size); ! if ((nr = read (fd, buffer, file_size)) < 0) file_error (filename); close (fd); + if (nr == 0) + { + fprintf (stderr, "mkbuiltins: %s: skipping zero-length file\n", filename); + return; + } + /* Create and fill in the initial structure describing this file. */ defs = (DEF_FILE *)xmalloc (sizeof (DEF_FILE)); *************** *** 467,475 **** /* Build the array of lines. */ i = 0; ! while (i < finfo.st_size) { array_add (&buffer[i], defs->lines); ! while (buffer[i] != '\n' && i < finfo.st_size) i++; buffer[i++] = '\0'; --- 477,485 ---- /* Build the array of lines. */ i = 0; ! while (i < file_size) { array_add (&buffer[i], defs->lines); ! while (buffer[i] != '\n' && i < file_size) i++; buffer[i++] = '\0'; *************** *** 677,681 **** { must_be_building (directive, defs); ! return ((BUILTIN_DESC *)defs->builtins->array[defs->builtins->sindex - 1]); } --- 687,694 ---- { must_be_building (directive, defs); ! if (defs->builtins) ! return ((BUILTIN_DESC *)defs->builtins->array[defs->builtins->sindex - 1]); ! else ! return ((BUILTIN_DESC *)NULL); } *************** *** 757,760 **** --- 770,778 ---- builtin = current_builtin (self, defs); + if (builtin == 0) + { + line_error (defs, "syntax error: no current builtin for $FUNCTION directive"); + exit (1); + } if (builtin->function) line_error (defs, "%s already has a function (%s)", diff -Nrc2 bash-2.01.1/builtins/printf.def bash-2.02/builtins/printf.def *** bash-2.01.1/builtins/printf.def Wed Dec 31 19:00:00 1969 --- bash-2.02/builtins/printf.def Thu Jan 29 15:06:57 1998 *************** *** 0 **** --- 1,693 ---- + This file is printf.def, from which is created printf.c. + It implements the builtin "printf" in Bash. + + Copyright (C) 1997 Free Software Foundation, Inc. + + This file is part of GNU Bash, the Bourne Again SHell. + + Bash is free software; you can redistribute it and/or modify it under + the terms of the GNU General Public License as published by the Free + Software Foundation; either version 1, or (at your option) any later + version. + + Bash is distributed in the hope that it will be useful, but WITHOUT ANY + WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + for more details. + + You should have received a copy of the GNU General Public License along + with Bash; see the file COPYING. If not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA + + $PRODUCES printf.c + + $BUILTIN printf + $FUNCTION printf_builtin + $SHORT_DOC printf format [arguments] + printf formats and prints ARGUMENTS under control of the FORMAT. FORMAT + is a character string which contains three types of objects: plain + characters, which are simply copied to standard output, character escape + sequences which are converted and copied to the standard output, and + format specifications, each of which causes printing of the next successive + argument. In addition to the standard printf(1) formats, %b means to + expand backslash escape sequences in the corresponding argument, and %q + means to quote the argument in a way that can be reused as shell input. + $END + + #include + + #include "../bashtypes.h" + + #include + #if defined (HAVE_LIMITS_H) + # include + #else + /* Assume 32-bit ints and longs. */ + # define LONG_MAX 2147483647L + # define LONG_MIN (-2147483647L-1) + # define INT_MAX 2147483647 + # define INT_MIN (-2147483647-1) + #endif + + #include + #include + + #include "../bashansi.h" + #include "../shell.h" + #include "../stdc.h" + #include "bashgetopt.h" + + #if !defined (errno) + extern int errno; + #endif + + #define PF(f, func) \ + do { \ + if (fieldwidth && precision) \ + (void)printf(f, fieldwidth, precision, func); \ + else if (fieldwidth && precision == 0) \ + (void)printf(f, fieldwidth, func); \ + else if (precision) \ + (void)printf(f, precision, func); \ + else \ + (void)printf(f, func); \ + } while (0) + + #define PRETURN(value) \ + do { free (format); fflush (stdout); return (value); } while (0) + + #define SKIP1 "#-+ 0" + #define SKIP2 "*0123456789" + + static void printstr __P((char *, char *, int, int, int)); + static char *bexpand __P((char *, int, int *, int *)); + static char *mklong __P((char *, int)); + static int getchr __P((void)); + static char *getstr __P((void)); + static int getint __P((void)); + static int getlong __P((long *)); + static int getulong __P((unsigned long *)); + static double getdouble __P((void)); + static int asciicode __P((void)); + + static WORD_LIST *garglist; + static int retval; + + extern char *backslash_quote (); + + int + printf_builtin (list) + WORD_LIST *list; + { + int ch, end, fieldwidth, precision, foundmod; + char convch, nextch, *format, *fmt, *start; + + retval = EXECUTION_SUCCESS; + reset_internal_getopt (); + while ((ch = internal_getopt (list, "")) != -1) + { + switch (ch) + { + case '?': + default: + builtin_usage(); + return (EX_USAGE); + } + } + list = loptend; + + if (list == 0) + { + builtin_usage (); + return (EX_USAGE); + } + + if (list->word->word == 0 || list->word->word[0] == '\0') + return (EXECUTION_SUCCESS); + + format = ansicstr (list->word->word, strlen (list->word->word), (int *)NULL, (int *)NULL); + + garglist = list->next; + + /* Basic algorithm is to scan the format string for conversion + specifications -- once one is found, find out if the field + width or precision is a '*'; if it is, gather up value. Note, + format strings are reused as necessary to use up the provided + arguments, arguments of zero/null string are provided to use + up the format string. */ + + do + { + /* find next format specification */ + for (fmt = format; *fmt; fmt++) + { + precision = fieldwidth = foundmod = 0; + + if (*fmt != '%') + { + putchar (*fmt); + continue; + } + + /* ASSERT(*fmt == '%') */ + start = fmt++; + + if (*fmt == '%') /* %% prints a % */ + { + putchar ('%'); + continue; + } + + /* found format specification, skip to field width */ + for (; *fmt && strchr(SKIP1, *fmt); ++fmt) + ; + fieldwidth = (*fmt == '*') ? getint () : 0; + + /* skip to possible '.', get following precision */ + for (; *fmt && strchr(SKIP2, *fmt); ++fmt) + ; + if (*fmt == '.') + { + ++fmt; + precision = (*fmt == '*') ? getint () : 0; + } + + /* skip to conversion char */ + for (; *fmt && strchr(SKIP2, *fmt); ++fmt) + ; + if (*fmt == 0) + { + builtin_error ("`%s': missing format character", start); + PRETURN (EXECUTION_FAILURE); + } + + /* skip possible format modifiers */ + if (*fmt == 'l' || *fmt == 'L' || *fmt == 'h') + { + fmt++; + foundmod = 1; + } + + convch = *fmt; + nextch = fmt[1]; + fmt[1] = '\0'; + switch(convch) + { + case 'c': + { + char p; + + p = getchr (); + PF(start, p); + break; + } + + case 's': + { + char *p; + + p = getstr (); + PF(start, p); + break; + } + + case 'b': /* expand escapes in argument */ + { + char *p, *xp; + int rlen; + + p = getstr (); + ch = rlen = 0; + xp = bexpand (p, strlen (p), &ch, &rlen); + + if (xp) + { + /* Have to use printstr because of possible NUL bytes + in XP -- printf does not handle that well. */ + printstr (start, xp, rlen, fieldwidth, precision); + free (xp); + } + + if (ch) + PRETURN (retval); + break; + } + + case 'q': /* print with shell quoting */ + { + char *p, *xp; + + p = getstr (); + xp = backslash_quote (p); + if (xp) + { + /* Use printstr to get fieldwidth and precision right. */ + printstr (start, xp, strlen (xp), fieldwidth, precision); + free (xp); + } + break; + } + + case 'd': + case 'i': + { + long p; + char *f; + + if (foundmod == 0 && ((f = mklong (start, convch)) == NULL)) + PRETURN (EXECUTION_FAILURE); + else + f = start; + if (getlong (&p)) + PRETURN (EXECUTION_FAILURE); + PF(f, p); + break; + } + + case 'o': + case 'u': + case 'x': + case 'X': + { + unsigned long p; + char *f; + + if (foundmod == 0 && ((f = mklong (start, convch)) == NULL)) + PRETURN (EXECUTION_FAILURE); + else + f = start; + if (getulong (&p)) + PRETURN (EXECUTION_FAILURE); + PF (f, p); + break; + } + + case 'e': + case 'E': + case 'f': + case 'g': + case 'G': + { + double p; + + p = getdouble (); + PF(start, p); + break; + } + + /* We output unrecognized format characters, but we print a + warning message and return a failure exit status. */ + default: + builtin_error ("`%c': illegal format character", convch); + PRETURN (EXECUTION_FAILURE); + } + + fmt[1] = nextch; + } + } + while (garglist); + + PRETURN (retval); + } + + /* We duplicate a lot of what printf(3) does here. */ + static void + printstr (fmt, string, len, fieldwidth, precision) + char *fmt; /* format */ + char *string; /* expanded string argument */ + int len; /* length of expanded string */ + int fieldwidth; /* argument for width of `*' */ + int precision; /* argument for precision of `*' */ + { + #if 0 + char *s; + #endif + int padlen, nc, ljust, i; + int fw, pr; /* fieldwidth and precision */ + + if (string == 0 || *string == '\0') + return; + + #if 0 + s = fmt; + #endif + if (*fmt == '%') + fmt++; + + ljust = fw = pr = 0; + + /* skip flags */ + while (*fmt == '#' || *fmt == '-' || *fmt == '+' || *fmt == ' ' || *fmt == '0') + { + if (*fmt == '-') + ljust = 1; + fmt++; + } + + /* get fieldwidth, if present */ + if (*fmt == '*') + { + fmt++; + fw = fieldwidth; + } + else if (isdigit (*fmt)) + { + fw = *fmt++ - '0'; + while (isdigit (*fmt)) + fw = (fw * 10) + (*fmt++ - '0'); + } + + /* get precision, if present */ + if (*fmt == '.') + { + fmt++; + if (*fmt == '*') + { + fmt++; + pr = precision; + } + else if (isdigit (*fmt)) + { + pr = *fmt++ - '0'; + while (isdigit (*fmt)) + pr = (pr * 10) + (*fmt++ - '0'); + } + } + + #if 0 + /* If we remove this, get rid of `s'. */ + if (*fmt != 'b' && *fmt != 'q') + { + internal_error ("format parsing problem: %s", s); + fw = pr = 0; + } + #endif + + /* chars from string to print */ + nc = (pr > 0 && pr <= len) ? pr : len; + + padlen = fw - nc; + if (padlen < 0) + padlen = 0; + if (ljust) + padlen = -padlen; + + /* leading pad characters */ + for (; padlen > 0; padlen--) + putchar (' '); + + /* output NC characters from STRING */ + for (i = 0; i < nc; i++) + putchar (string[i]); + + /* output any necessary trailing padding */ + for (; padlen < 0; padlen++) + putchar (' '); + } + + /* Convert STRING by expanding the escape sequences specified by the + POSIX standard for printf's `%b' format string. If SAWC is non-null, + recognize `\c' and use that as a string terminator. If we see \c, set + *SAWC to 1 before returning. LEN is the length of STRING. */ + + #ifdef isoctal + #undef isoctal + #endif + + #define isoctal(c) ((c) >= '0' && (c) <= '7') + + #define OCTVALUE(c) ((c) - '0') + + #ifndef isxdigit + # define isxdigit(c) (isdigit((c)) || ((c) >= 'a' && (c) <= 'f') || ((c) >= 'A' && (c) <= 'F')) + #endif + + #define HEXVALUE(c) \ + ((c) >= 'a' && (c) <= 'f' ? (c)-'a'+10 : (c) >= 'A' && (c) <= 'F' ? (c)-'A'+10 : (c)-'0') + + static char * + bexpand (string, len, sawc, lenp) + char *string; + int len, *sawc, *lenp; + { + int c, temp; + char *ret, *r, *s; + + if (string == 0 || *string == '\0') + { + if (sawc) + *sawc = 0; + if (lenp) + *lenp = 0; + return ((char *)NULL); + } + + ret = xmalloc (len + 1); + for (r = ret, s = string; s && *s; ) + { + c = *s++; + if (c != '\\' || *s == '\0') + { + *r++ = c; + continue; + } + + switch (c = *s++) + { + #if defined (__STDC__) + case 'a': c = '\a'; break; + #else + case 'a': c = '\007'; break; + #endif + + case 'b': c = '\b'; break; + + case 'e': c = '\033'; break; /* ESC -- non-ANSI */ + + case 'f': c = '\f'; break; + + case 'n': c = '\n'; break; + + case 'r': c = '\r'; break; + + case 't': c = '\t'; break; + + case 'v': c = '\v'; break; + + /* %b octal constants are `\0' followed by one, two, or three + octal digits... */ + case '0': + for (temp = 3, c = 0; isoctal (*s) && temp--; s++) + c = (c * 8) + OCTVALUE (*s); + break; + + /* but, as an extension, the other echo-like octal escape + sequences are supported as well. */ + case '1': case '2': case '3': case '4': + case '5': case '6': case '7': + for (temp = 2, c -= '0'; isoctal (*s) && temp--; s++) + c = (c * 8) + OCTVALUE (*s); + break; + + /* And, as another extension, we allow \xNNN, where each N is a + hex digit. */ + case 'x': + for (temp = 3, c = 0; isxdigit (*s) && temp--; s++) + c = (c * 16) + HEXVALUE (*s); + if (temp == 3) + { + builtin_error ("missing hex digit for \\x"); + *r++ = '\\'; + c = 'x'; + } + break; + + case '\\': + #if 0 + case '\'': /* XXX */ + case '"': /* XXX */ + #endif + break; + + case 'c': + if (sawc) + *sawc = 1; + *r = '\0'; + if (lenp) + *lenp = r - ret; + return ret; + + /* other backslash escapes are passed through unaltered */ + default: *r++ = '\\'; break; + } + + *r++ = c; + } + + *r = '\0'; + if (lenp) + *lenp = r - ret; + return ret; + } + + static char * + mklong (str, ch) + char *str; + int ch; + { + static char copy[64]; + int len; + + len = strlen (str) + 2; + FASTCOPY (str, copy, len - 3); + copy[len - 3] = 'l'; + copy[len - 2] = ch; + copy[len - 1] = '\0'; + return (copy); + } + + static int + getchr () + { + int ret; + + if (garglist == 0) + return ('\0'); + + ret = (int)garglist->word->word[0]; + garglist = garglist->next; + return ret; + } + + static char * + getstr () + { + char *ret; + + if (garglist == 0) + return (""); + + ret = garglist->word->word; + garglist = garglist->next; + return ret; + } + + static int + getint () + { + long ret; + + if (getlong (&ret)) + return (0); + + if (ret > INT_MAX) + { + builtin_error ("%s: %s", garglist->word->word, strerror(ERANGE)); + return (0); + } + + return ((int)ret); + } + + static int + getlong (lp) + long *lp; + { + long ret; + + if (garglist == 0) + { + *lp = 0L; + return (0); + } + + if (garglist->word->word[0] == '\'' || garglist->word->word[0] == '"') + { + *lp = (long)asciicode (); + return (0); + } + + errno = 0; + /* legal_number does not currently detect overflow, but it should. + Someday it will. */ + if (legal_number (garglist->word->word, &ret) == 0) + { + builtin_error ("%s: illegal number", garglist->word->word); + return (1); + } + else if (errno == ERANGE) + { + builtin_error ("%s: %s", garglist->word->word, strerror(ERANGE)); + return (1); + } + + *lp = ret; + garglist = garglist->next; + return (0); + } + + static int + getulong (ulp) + unsigned long *ulp; + { + unsigned long ret; + char *ep; + + if (garglist == 0) + { + *ulp = (unsigned long)0; + return (0); + } + + if (garglist->word->word[0] == '\'' || garglist->word->word[0] == '"') + { + *ulp = (unsigned long)asciicode (); + return (0); + } + + errno = 0; + ret = strtoul (garglist->word->word, &ep, 0); + + if (*ep) + { + builtin_error ("%s: illegal number", garglist->word->word); + return (1); + } + else if (errno == ERANGE) + { + builtin_error ("%s: %s", garglist->word->word, strerror(ERANGE)); + return (1); + } + + *ulp = ret; + garglist = garglist->next; + return (0); + } + + static double + getdouble () + { + double ret; + + if (garglist == 0) + return ((double)0); + + if (garglist->word->word[0] == '\'' || garglist->word->word[0] == '"') + return ((double)asciicode ()); + + /* This should use strtod if it is available. */ + ret = atof (garglist->word->word); + garglist = garglist->next; + return (ret); + } + + /* NO check is needed for garglist here. */ + static int + asciicode () + { + register int ch; + + ch = garglist->word->word[1]; + garglist = garglist->next; + return (ch); + } diff -Nrc2 bash-2.01.1/builtins/psize.c bash-2.02/builtins/psize.c *** bash-2.01.1/builtins/psize.c Mon Feb 17 14:35:30 1997 --- bash-2.02/builtins/psize.c Fri Jul 18 16:58:53 1997 *************** *** 25,33 **** --- 25,38 ---- #if defined (HAVE_UNISTD_H) + # ifdef _MINIX + # include + # endif # include #endif #include + #ifndef _MINIX #include "../bashtypes.h" + #endif #include #include diff -Nrc2 bash-2.01.1/builtins/psize.sh bash-2.02/builtins/psize.sh *** bash-2.01.1/builtins/psize.sh Thu May 12 11:13:50 1994 --- bash-2.02/builtins/psize.sh Tue Mar 17 12:27:11 1998 *************** *** 4,7 **** --- 4,13 ---- # pipesize.h so ulimit.c can use it. + TMPDIR=/tmp + TMPNAME=pipsize.$$ + TMPFILE=$TMPDIR/$TMPNAME + + trap 'rm -f $TMPFILE' 0 1 2 3 6 15 + echo "/*" echo " * pipesize.h" *************** *** 12,24 **** echo "" ! ./psize.aux 2>/tmp/pipesize | sleep 3 ! if [ -s /tmp/pipesize ]; then ! echo "#define PIPESIZE `cat /tmp/pipesize`" else echo "#define PIPESIZE 512" fi - - rm -f /tmp/pipesize exit 0 --- 18,36 ---- echo "" ! # ! # Try to avoid tempfile races. We can't really check for the file's ! # existance before we run psize.aux, because `test -e' is not portable, ! # `test -h' (test for symlinks) is not portable, and `test -f' only ! # checks for regular files ! # ! rm -f $TMPFILE ! ./psize.aux 2>$TMPFILE | sleep 3 ! ! if [ -s $TMPFILE ]; then ! echo "#define PIPESIZE `cat $TMPFILE`" else echo "#define PIPESIZE 512" fi exit 0 diff -Nrc2 bash-2.01.1/builtins/pushd.def bash-2.02/builtins/pushd.def *** bash-2.01.1/builtins/pushd.def Tue Apr 15 11:28:10 1997 --- bash-2.02/builtins/pushd.def Fri Nov 14 12:32:52 1997 *************** *** 96,102 **** #if defined (PUSHD_AND_POPD) #include ! #include #if defined (HAVE_UNISTD_H) # include #endif --- 96,107 ---- #if defined (PUSHD_AND_POPD) #include ! #ifndef _MINIX ! # include ! #endif #if defined (HAVE_UNISTD_H) + # ifdef _MINIX + # include + # endif # include #endif *************** *** 548,551 **** --- 553,584 ---- } + /* Used by the tilde expansion code. */ + char * + get_dirstack_from_string (string) + char *string; + { + int ind, sign, index_flag; + long i; + + sign = 1; + if (*string == '-' || *string == '+') + { + sign = (*string == '-') ? -1 : 1; + string++; + } + if (legal_number (string, &i) == 0) + return ((char *)NULL); + + index_flag = 0; + ind = get_dirstack_index (i, sign, &index_flag); + if (index_flag && (ind < 0 || ind > directory_list_offset)) + return ((char *)NULL); + if (index_flag == 0 || (index_flag == 1 && ind == 0)) + return (get_string_value ("PWD")); + else + return (pushd_directory_list[ind]); + } + + #ifdef INCLUDE_UNUSED char * get_dirstack_element (ind, sign) *************** *** 558,561 **** --- 591,595 ---- : pushd_directory_list[i]; } + #endif void diff -Nrc2 bash-2.01.1/builtins/read.def bash-2.02/builtins/read.def *** bash-2.01.1/builtins/read.def Wed Sep 10 17:04:47 1997 --- bash-2.02/builtins/read.def Mon Nov 17 14:31:28 1997 *************** *** 44,47 **** --- 44,50 ---- #if defined (HAVE_UNISTD_H) + # ifdef _MINIX + # include + # endif # include #endif *************** *** 396,399 **** --- 399,403 ---- if (valid_array_reference (name) == 0) { + #if 0 if (legal_identifier (name) == 0) { *************** *** 401,404 **** --- 405,409 ---- return ((SHELL_VAR *)NULL); } + #endif return (bind_variable (name, value)); } diff -Nrc2 bash-2.01.1/builtins/return.def bash-2.02/builtins/return.def *** bash-2.01.1/builtins/return.def Mon Mar 3 12:47:20 1997 --- bash-2.02/builtins/return.def Fri Jul 18 16:59:43 1997 *************** *** 33,36 **** --- 33,39 ---- #if defined (HAVE_UNISTD_H) + # ifdef _MINIX + # include + # endif # include #endif diff -Nrc2 bash-2.01.1/builtins/set.def bash-2.02/builtins/set.def *** bash-2.01.1/builtins/set.def Fri Apr 25 10:57:03 1997 --- bash-2.02/builtins/set.def Thu Dec 4 09:28:24 1997 *************** *** 25,28 **** --- 25,31 ---- #if defined (HAVE_UNISTD_H) + # ifdef _MINIX + # include + # endif # include #endif *************** *** 230,258 **** #define MINUS_O_FORMAT "%-15s\t%s\n" ! void ! list_minus_o_opts (mode) ! int mode; { ! register int i; ! int *on_or_off, value; ! ! for (value = i = 0; o_options[i].name; i++) ! { ! on_or_off = find_flag (o_options[i].letter); ! if (on_or_off == FLAG_UNKNOWN) ! on_or_off = &value; ! if (mode == -1 || mode == *on_or_off) ! printf (MINUS_O_FORMAT, o_options[i].name, *on_or_off ? on : off); ! } ! for (i = 0; binary_o_options[i].name; i++) ! { ! value = GET_BINARY_O_OPTION_VALUE (i, binary_o_options[i].name); ! if (mode == -1 || mode == value) ! printf (MINUS_O_FORMAT, binary_o_options[i].name, value ? on : off); ! } } ! static void ! minus_o_option_commands () { register int i; --- 233,250 ---- #define MINUS_O_FORMAT "%-15s\t%s\n" ! static void ! print_minus_o_option (name, value, pflag) ! char *name; ! int value, pflag; { ! if (pflag == 0) ! printf (MINUS_O_FORMAT, name, value ? on : off); ! else ! printf ("set %co %s\n", value ? '-' : '+', name); } ! void ! list_minus_o_opts (mode, reusable) ! int mode, reusable; { register int i; *************** *** 264,273 **** if (on_or_off == FLAG_UNKNOWN) on_or_off = &value; ! printf ("set %co %s\n", *on_or_off ? '-' : '+', o_options[i].name); } for (i = 0; binary_o_options[i].name; i++) { value = GET_BINARY_O_OPTION_VALUE (i, binary_o_options[i].name); ! printf ("set %co %s\n", value ? '-' : '+', binary_o_options[i].name); } } --- 256,267 ---- if (on_or_off == FLAG_UNKNOWN) on_or_off = &value; ! if (mode == -1 || mode == *on_or_off) ! print_minus_o_option (o_options[i].name, *on_or_off, reusable); } for (i = 0; binary_o_options[i].name; i++) { value = GET_BINARY_O_OPTION_VALUE (i, binary_o_options[i].name); ! if (mode == -1 || mode == value) ! print_minus_o_option (binary_o_options[i].name, value, reusable); } } *************** *** 422,426 **** { char *value; ! int vsize, i, vptr, *ip; SHELL_VAR *v; --- 416,420 ---- { char *value; ! int vsize, i, vptr, *ip, exported; SHELL_VAR *v; *************** *** 459,466 **** v = find_variable ("SHELLOPTS"); if (v) ! v->attributes &= ~att_readonly; v = bind_variable ("SHELLOPTS", value); v->attributes |= att_readonly; free (value); --- 453,475 ---- v = find_variable ("SHELLOPTS"); + + /* Turn off the read-only attribute so we can bind the new value, and + note whether or not the variable was exported. */ if (v) ! { ! v->attributes &= ~att_readonly; ! exported = exported_p (v); ! } ! else ! exported = 0; ! v = bind_variable ("SHELLOPTS", value); + + /* Turn the read-only attribute back on, and turn off the export attribute + if it was set implicitly by mark_modified_vars and SHELLOPTS was not + exported before we bound the new value. */ v->attributes |= att_readonly; + if (mark_modified_vars && exported == 0 && exported_p (v)) + v->attributes &= ~att_exported; free (value); *************** *** 483,500 **** void ! initialize_shell_options () { char *temp; SHELL_VAR *var; ! var = find_variable ("SHELLOPTS"); ! /* set up any shell options we may have inherited. */ ! if (var && imported_p (var)) { ! temp = (array_p (var)) ? (char *)NULL : savestring (value_cell (var)); ! if (temp) { ! parse_shellopts (temp); ! free (temp); } } --- 492,513 ---- void ! initialize_shell_options (no_shellopts) ! int no_shellopts; { char *temp; SHELL_VAR *var; ! if (no_shellopts == 0) { ! var = find_variable ("SHELLOPTS"); ! /* set up any shell options we may have inherited. */ ! if (var && imported_p (var)) { ! temp = (array_p (var)) ? (char *)NULL : savestring (value_cell (var)); ! if (temp) ! { ! parse_shellopts (temp); ! free (temp); ! } } } *************** *** 608,615 **** if (opt == 0) { ! if (on_or_off == '-') ! list_minus_o_opts (-1); ! else ! minus_o_option_commands (); continue; } --- 621,625 ---- if (opt == 0) { ! list_minus_o_opts (-1, (on_or_off == '+')); continue; } *************** *** 620,627 **** *option_name == '-' || *option_name == '+') { ! if (on_or_off == '-') ! list_minus_o_opts (-1); ! else ! minus_o_option_commands (); continue; } --- 630,634 ---- *option_name == '-' || *option_name == '+') { ! list_minus_o_opts (-1, (on_or_off == '+')); continue; } *************** *** 731,735 **** #endif ! if (legal_identifier (name) == 0) { builtin_error ("`%s': not a valid identifier", name); --- 738,745 ---- #endif ! /* Bash allows functions with names which are not valid identifiers ! to be created when not in posix mode, so check only when in posix ! mode when unsetting a function. */ ! if (((unset_function && posixly_correct) || !unset_function) && legal_identifier (name) == 0) { builtin_error ("`%s': not a valid identifier", name); diff -Nrc2 bash-2.01.1/builtins/setattr.def bash-2.02/builtins/setattr.def *** bash-2.01.1/builtins/setattr.def Mon Aug 18 12:01:47 1997 --- bash-2.02/builtins/setattr.def Wed Oct 15 12:12:19 1997 *************** *** 25,28 **** --- 25,31 ---- #if defined (HAVE_UNISTD_H) + # ifdef _MINIX + # include + # endif # include #endif *************** *** 340,343 **** --- 343,347 ---- { SHELL_VAR *var; + int ret; var = find_tempenv_variable (name); *************** *** 348,351 **** --- 352,357 ---- { show_var_attributes (var, READONLY_OR_EXPORT, nodefs); + if (tempvar_p (var)) + dispose_variable (var); return (0); } diff -Nrc2 bash-2.01.1/builtins/shift.def bash-2.02/builtins/shift.def *** bash-2.01.1/builtins/shift.def Mon Mar 3 12:47:26 1997 --- bash-2.02/builtins/shift.def Fri Jul 18 17:00:19 1997 *************** *** 25,28 **** --- 25,31 ---- #if defined (HAVE_UNISTD_H) + # ifdef _MINIX + # include + # endif # include #endif diff -Nrc2 bash-2.01.1/builtins/shopt.def bash-2.02/builtins/shopt.def *** bash-2.01.1/builtins/shopt.def Thu Apr 17 10:13:23 1997 --- bash-2.02/builtins/shopt.def Fri Sep 19 11:30:38 1997 *************** *** 39,42 **** --- 39,45 ---- #if defined (HAVE_UNISTD_H) + # ifdef _MINIX + # include + # endif # include #endif *************** *** 60,63 **** --- 63,72 ---- extern int cdspelling, expand_aliases; extern int check_window_size; + extern int glob_ignore_case; + extern int hup_on_exit; + + #if defined (EXTENDED_GLOB) + extern int extended_glob; + #endif #if defined (HISTORY) *************** *** 90,93 **** --- 99,105 ---- { "execfail", &no_exit_on_failed_exec, (Function *)NULL }, { "expand_aliases", &expand_aliases, (Function *)NULL }, + #if defined (EXTENDED_GLOB) + { "extglob", &extended_glob, (Function *)NULL }, + #endif #if defined (READLINE) { "histreedit", &history_reediting, (Function *)NULL }, *************** *** 100,103 **** --- 112,116 ---- { "hostcomplete", &perform_hostname_completion, (Function *)enable_hostname_completion }, #endif + { "huponexit", &hup_on_exit, (Function *)NULL }, { "interactive_comments", &interactive_comments, set_interactive_comments }, #if defined (HISTORY) *************** *** 105,108 **** --- 118,122 ---- #endif { "mailwarn", &mail_warning, (Function *)NULL }, + { "nocaseglob", &glob_ignore_case, (Function *)NULL }, { "nullglob", &allow_null_glob_expansion, (Function *)NULL }, { "promptvars", &promptvars, (Function *)NULL }, *************** *** 167,181 **** rval = EXECUTION_SUCCESS; if ((flags & OFLAG) && ((flags & (SFLAG|UFLAG)) == 0)) /* shopt -o */ ! rval = list_shopt_o_options (list, flags & QFLAG); else if (list && (flags & OFLAG)) /* shopt -so args */ rval = set_shopt_o_options ((flags & SFLAG) ? FLAG_ON : FLAG_OFF, list, flags & QFLAG); else if (flags & OFLAG) /* shopt -so */ ! rval = list_some_o_options ((flags & SFLAG) ? FLAG_ON : FLAG_OFF, flags & QFLAG); else if (list && (flags & (SFLAG|UFLAG))) /* shopt -su args */ rval = toggle_shopts ((flags & SFLAG) ? SETOPT : UNSETOPT, list, flags & QFLAG); else if ((flags & (SFLAG|UFLAG)) == 0) /* shopt [args] */ ! rval = list_shopts (list, flags & QFLAG); else /* shopt -su */ ! rval = list_some_shopts ((flags & SFLAG) ? SETOPT : UNSETOPT, flags & QFLAG); return (rval); } --- 181,195 ---- rval = EXECUTION_SUCCESS; if ((flags & OFLAG) && ((flags & (SFLAG|UFLAG)) == 0)) /* shopt -o */ ! rval = list_shopt_o_options (list, flags); else if (list && (flags & OFLAG)) /* shopt -so args */ rval = set_shopt_o_options ((flags & SFLAG) ? FLAG_ON : FLAG_OFF, list, flags & QFLAG); else if (flags & OFLAG) /* shopt -so */ ! rval = list_some_o_options ((flags & SFLAG) ? 1 : 0, flags); else if (list && (flags & (SFLAG|UFLAG))) /* shopt -su args */ rval = toggle_shopts ((flags & SFLAG) ? SETOPT : UNSETOPT, list, flags & QFLAG); else if ((flags & (SFLAG|UFLAG)) == 0) /* shopt [args] */ ! rval = list_shopts (list, flags); else /* shopt -su */ ! rval = list_some_shopts ((flags & SFLAG) ? SETOPT : UNSETOPT, flags); return (rval); } *************** *** 193,196 **** --- 207,214 ---- source_uses_path = promptvars = 1; + #if defined (EXTENDED_GLOB) + extended_glob = 0; + #endif + #if defined (HISTORY) literal_history = force_append_history = 0; *************** *** 245,254 **** } /* List the values of all or any of the `shopt' options. Returns 0 if all were listed or all variables queried were on; 1 otherwise. */ static int ! list_shopts (list, quiet) WORD_LIST *list; ! int quiet; { WORD_LIST *l; --- 263,283 ---- } + static int + print_shopt (name, val, flags) + char *name; + int val, flags; + { + if (flags & PFLAG) + printf ("shopt %s %s\n", val ? "-s" : "-u", name); + else + printf (OPTFMT, name, val ? on : off); + } + /* List the values of all or any of the `shopt' options. Returns 0 if all were listed or all variables queried were on; 1 otherwise. */ static int ! list_shopts (list, flags) WORD_LIST *list; ! int flags; { WORD_LIST *l; *************** *** 260,265 **** { val = *shopt_vars[i].value; ! if (quiet == 0) ! printf (OPTFMT, shopt_vars[i].name, val ? on : off); } return (EXECUTION_SUCCESS); --- 289,294 ---- { val = *shopt_vars[i].value; ! if ((flags & QFLAG) == 0) ! print_shopt (shopt_vars[i].name, val, flags); } return (EXECUTION_SUCCESS); *************** *** 278,283 **** if (val == 0) rval = EXECUTION_FAILURE; ! if (quiet == 0) ! printf (OPTFMT, l->word->word, val ? on : off); } return (rval); --- 307,312 ---- if (val == 0) rval = EXECUTION_FAILURE; ! if ((flags & QFLAG) == 0) ! print_shopt (l->word->word, val, flags); } return (rval); *************** *** 285,290 **** static int ! list_some_shopts (mode, quiet) ! int mode, quiet; { int val, i; --- 314,319 ---- static int ! list_some_shopts (mode, flags) ! int mode, flags; { int val, i; *************** *** 293,298 **** { val = *shopt_vars[i].value; ! if (quiet == 0 && mode == val) ! printf (OPTFMT, shopt_vars[i].name, val ? on : off); } return (EXECUTION_SUCCESS); --- 322,327 ---- { val = *shopt_vars[i].value; ! if (((flags & QFLAG) == 0) && mode == val) ! print_shopt (shopt_vars[i].name, val, flags); } return (EXECUTION_SUCCESS); *************** *** 300,306 **** static int ! list_shopt_o_options (list, quiet) WORD_LIST *list; ! int quiet; { WORD_LIST *l; --- 329,335 ---- static int ! list_shopt_o_options (list, flags) WORD_LIST *list; ! int flags; { WORD_LIST *l; *************** *** 309,314 **** if (list == 0) { ! if (quiet == 0) ! list_minus_o_opts (-1); return (EXECUTION_SUCCESS); } --- 338,343 ---- if (list == 0) { ! if ((flags & QFLAG) == 0) ! list_minus_o_opts (-1, (flags & PFLAG)); return (EXECUTION_SUCCESS); } *************** *** 325,330 **** if (val == 0) rval = EXECUTION_FAILURE; ! if (quiet == 0) ! printf (OPTFMT, l->word->word, val ? "on" : "off"); } return (rval); --- 354,364 ---- if (val == 0) rval = EXECUTION_FAILURE; ! if ((flags & QFLAG) == 0) ! { ! if (flags & PFLAG) ! printf ("set %co %s\n", val ? '-' : '+', l->word->word); ! else ! printf (OPTFMT, l->word->word, val ? on : off); ! } } return (rval); *************** *** 332,340 **** static int ! list_some_o_options (mode, quiet) ! int mode, quiet; { ! if (quiet == 0) ! list_minus_o_opts (mode); return (EXECUTION_SUCCESS); } --- 366,374 ---- static int ! list_some_o_options (mode, flags) ! int mode, flags; { ! if ((flags & QFLAG) == 0) ! list_minus_o_opts (mode, (flags & PFLAG)); return (EXECUTION_SUCCESS); } diff -Nrc2 bash-2.01.1/builtins/source.def bash-2.02/builtins/source.def *** bash-2.01.1/builtins/source.def Fri Aug 9 14:09:19 1996 --- bash-2.02/builtins/source.def Thu Jul 17 09:44:41 1997 *************** *** 42,46 **** #include "../posixstat.h" #include "../filecntl.h" ! #include #include --- 42,48 ---- #include "../posixstat.h" #include "../filecntl.h" ! #ifndef _MINIX ! # include ! #endif #include *************** *** 52,56 **** #include "../shell.h" ! #include "../execute_cmd.h" #include "common.h" --- 54,58 ---- #include "../shell.h" ! #include "../findcmd.h" #include "common.h" diff -Nrc2 bash-2.01.1/builtins/suspend.def bash-2.02/builtins/suspend.def *** bash-2.01.1/builtins/suspend.def Wed Feb 5 11:49:32 1997 --- bash-2.02/builtins/suspend.def Fri Jul 18 17:00:49 1997 *************** *** 35,38 **** --- 35,41 ---- #if defined (JOB_CONTROL) #if defined (HAVE_UNISTD_H) + # ifdef _MINIX + # include + # endif # include #endif diff -Nrc2 bash-2.01.1/builtins/test.def bash-2.02/builtins/test.def *** bash-2.01.1/builtins/test.def Thu Aug 8 12:16:27 1996 --- bash-2.02/builtins/test.def Thu Sep 11 09:28:37 1997 *************** *** 51,57 **** -O FILE True if the file is effectively owned by you. -G FILE True if the file is effectively owned by your group. ! FILE1 -nt FILE2 True if file1 is newer than (according to ! modification date) file2. FILE1 -ot FILE2 True if file1 is older than file2. --- 51,58 ---- -O FILE True if the file is effectively owned by you. -G FILE True if the file is effectively owned by your group. + -N FILE True if the file has been modified since it was last read. ! FILE1 -nt FILE2 True if file1 is newer than file2 (according to ! modification date). FILE1 -ot FILE2 True if file1 is older than file2. *************** *** 71,80 **** True if the strings are not equal. STRING1 < STRING2 ! True if STRING1 sorts before STRING2 lexicographically STRING1 > STRING2 ! True if STRING1 sorts after STRING2 lexicographically Other operators: ! EXPR True if expr is false. EXPR1 -a EXPR2 True if both expr1 AND expr2 are true. --- 72,82 ---- True if the strings are not equal. STRING1 < STRING2 ! True if STRING1 sorts before STRING2 lexicographically. STRING1 > STRING2 ! True if STRING1 sorts after STRING2 lexicographically. Other operators: + -o OPTION True if the shell option OPTION is enabled. ! EXPR True if expr is false. EXPR1 -a EXPR2 True if both expr1 AND expr2 are true. *************** *** 100,103 **** --- 102,108 ---- #if defined (HAVE_UNISTD_H) + # ifdef _MINIX + # include + # endif # include #endif *************** *** 106,109 **** --- 111,115 ---- #include "../shell.h" + #include "../test.h" #include "common.h" diff -Nrc2 bash-2.01.1/builtins/times.def bash-2.02/builtins/times.def *** bash-2.01.1/builtins/times.def Wed Jul 24 13:06:55 1996 --- bash-2.02/builtins/times.def Mon Oct 6 12:55:22 1997 *************** *** 32,35 **** --- 32,38 ---- #if defined (HAVE_UNISTD_H) + # ifdef _MINIX + # include + # endif # include #endif *************** *** 54,58 **** #endif /* HAVE_SYS_TIMES_H */ ! #if defined (HAVE_SYS_RESOURCE_H) # include #endif --- 57,61 ---- #endif /* HAVE_SYS_TIMES_H */ ! #if defined (HAVE_SYS_RESOURCE_H) && !defined (RLIMTYPE) # include #endif diff -Nrc2 bash-2.01.1/builtins/trap.def bash-2.02/builtins/trap.def *** bash-2.01.1/builtins/trap.def Mon Aug 18 12:07:20 1997 --- bash-2.02/builtins/trap.def Mon Aug 18 12:06:35 1997 *************** *** 43,46 **** --- 43,49 ---- #if defined (HAVE_UNISTD_H) + # ifdef _MINIX + # include + # endif # include #endif diff -Nrc2 bash-2.01.1/builtins/type.def bash-2.02/builtins/type.def *** bash-2.01.1/builtins/type.def Tue Jun 3 11:21:51 1997 --- bash-2.02/builtins/type.def Thu Jul 10 11:55:57 1997 *************** *** 28,45 **** command name. ! If the -t option is used, returns a single word which is one of `alias', `keyword', `function', `builtin', `file' or `', if NAME is an alias, shell reserved word, shell function, shell builtin, disk file, or unfound, respectively. ! If the -p flag is used, either returns the name of the disk file ! that would be executed, or nothing if -t would not return `file'. ! ! If the -a flag is used, displays all of the places that contain an ! executable named `file'. This includes aliases and functions, if and ! only if the -p flag is not also used. ! ! Type accepts -all, -path, and -type in place of -a, -p, and -t, ! respectively. $END --- 28,43 ---- command name. ! If the -t option is used, `type' outputs a single word which is one of `alias', `keyword', `function', `builtin', `file' or `', if NAME is an alias, shell reserved word, shell function, shell builtin, disk file, or unfound, respectively. ! If the -p flag is used, `type' either returns the name of the disk ! file that would be executed, or nothing if `type -t NAME' would not ! return `file'. ! ! If the -a flag is used, `type' displays all of the places that contain ! an executable named `file'. This includes aliases and functions, if ! and only if the -p flag is not also used. $END *************** *** 57,61 **** #include "../shell.h" ! #include "../execute_cmd.h" #include "../hashcmd.h" --- 55,59 ---- #include "../shell.h" ! #include "../findcmd.h" #include "../hashcmd.h" diff -Nrc2 bash-2.01.1/builtins/ulimit.def bash-2.02/builtins/ulimit.def *** bash-2.01.1/builtins/ulimit.def Tue Apr 22 16:37:55 1997 --- bash-2.02/builtins/ulimit.def Thu Oct 9 13:19:19 1997 *************** *** 24,28 **** $BUILTIN ulimit $FUNCTION ulimit_builtin ! $DEPENDS_ON !MINIX $SHORT_DOC ulimit [-SHacdflmnpstuv] [limit] Ulimit provides control over the resources available to processes --- 24,28 ---- $BUILTIN ulimit $FUNCTION ulimit_builtin ! $DEPENDS_ON !_MINIX $SHORT_DOC ulimit [-SHacdflmnpstuv] [limit] Ulimit provides control over the resources available to processes *************** *** 53,60 **** $END #include #include "../bashtypes.h" ! #include #if defined (HAVE_UNISTD_H) --- 53,64 ---- $END + #if !defined (_MINIX) + #include #include "../bashtypes.h" ! #ifndef _MINIX ! # include ! #endif #if defined (HAVE_UNISTD_H) *************** *** 102,106 **** #if !defined (RLIMTYPE) # define RLIMTYPE long ! # define string_to_rlimtype string_to_long # define print_rlimtype(num, nl) printf ("%ld%s", num, nl ? "\n" : "") #endif --- 106,110 ---- #if !defined (RLIMTYPE) # define RLIMTYPE long ! # define string_to_rlimtype(s) strtol(s, (char **)NULL, 10) # define print_rlimtype(num, nl) printf ("%ld%s", num, nl ? "\n" : "") #endif *************** *** 598,603 **** puts ("unlimited"); else if (curlim == RLIM_INVALID) ! printf ("cannot get limit: %s\n", strerror (errno)); else print_rlimtype ((curlim / limits[limind].block_factor), 1); } --- 602,608 ---- puts ("unlimited"); else if (curlim == RLIM_INVALID) ! builtin_error ("cannot get limit: %s\n", strerror (errno)); else print_rlimtype ((curlim / limits[limind].block_factor), 1); } + #endif /* !_MINIX */ diff -Nrc2 bash-2.01.1/builtins/umask.def bash-2.02/builtins/umask.def *** bash-2.01.1/builtins/umask.def Fri Feb 28 13:54:59 1997 --- bash-2.02/builtins/umask.def Thu Jul 17 09:45:26 1997 *************** *** 24,33 **** $BUILTIN umask $FUNCTION umask_builtin ! $SHORT_DOC umask [-S] [mode] The user file-creation mask is set to MODE. If MODE is omitted, or if `-S' is supplied, the current value of the mask is printed. The `-S' option makes the output symbolic; otherwise an octal number is output. ! If MODE begins with a digit, it is interpreted as an octal number, ! otherwise it is a symbolic mode string like that accepted by chmod(1). $END --- 24,35 ---- $BUILTIN umask $FUNCTION umask_builtin ! $SHORT_DOC umask [-p] [-S] [mode] The user file-creation mask is set to MODE. If MODE is omitted, or if `-S' is supplied, the current value of the mask is printed. The `-S' option makes the output symbolic; otherwise an octal number is output. ! If `-p' is supplied, and MODE is omitted, the output is in a form ! that may be used as input. If MODE begins with a digit, it is ! interpreted as an octal number, otherwise it is a symbolic mode string ! like that accepted by chmod(1). $END *************** *** 36,40 **** #include "../bashtypes.h" #include "../filecntl.h" ! #include #if defined (HAVE_UNISTD_H) --- 38,44 ---- #include "../bashtypes.h" #include "../filecntl.h" ! #ifndef _MINIX ! # include ! #endif #if defined (HAVE_UNISTD_H) *************** *** 64,73 **** WORD_LIST *list; { ! int print_symbolically, opt, umask_value; mode_t umask_arg; ! print_symbolically = 0; reset_internal_getopt (); ! while ((opt = internal_getopt (list, "S")) != -1) { switch (opt) --- 68,77 ---- WORD_LIST *list; { ! int print_symbolically, opt, umask_value, pflag; mode_t umask_arg; ! print_symbolically = pflag = 0; reset_internal_getopt (); ! while ((opt = internal_getopt (list, "Sp")) != -1) { switch (opt) *************** *** 76,79 **** --- 80,86 ---- print_symbolically++; break; + case 'p': + pflag++; + break; default: builtin_usage (); *************** *** 117,120 **** --- 124,129 ---- umask (umask_arg); + if (pflag) + printf ("umask%s ", (print_symbolically ? " -S" : "")); if (print_symbolically) print_symbolic_umask (umask_arg); diff -Nrc2 bash-2.01.1/builtins/wait.def bash-2.02/builtins/wait.def *** bash-2.01.1/builtins/wait.def Thu Feb 20 15:20:00 1997 --- bash-2.02/builtins/wait.def Wed Jul 23 15:14:10 1997 *************** *** 137,140 **** --- 137,146 ---- status = wait_for_job (job); } + else if (job_control == 0 && *w == '%') + { + /* can't use jobspecs as arguments if job control is not active. */ + builtin_error ("job control not enabled"); + status = EXECUTION_FAILURE; + } #endif /* JOB_CONTROL */ else diff -Nrc2 bash-2.01.1/builtins.h bash-2.02/builtins.h *** bash-2.01.1/builtins.h Thu Apr 18 13:23:10 1996 --- bash-2.02/builtins.h Fri Jul 18 16:46:36 1997 *************** *** 22,25 **** --- 22,28 ---- #if defined (HAVE_UNISTD_H) + # ifdef _MINIX + # include + # endif # include #endif diff -Nrc2 bash-2.01.1/command.h bash-2.02/command.h *** bash-2.01.1/command.h Tue Mar 18 15:39:24 1997 --- bash-2.02/command.h Fri Nov 21 13:04:39 1997 *************** *** 55,59 **** /* Command Types: */ enum command_type { cm_for, cm_case, cm_while, cm_if, cm_simple, cm_select, ! cm_connection, cm_function_def, cm_until, cm_group }; /* Possible values for the `flags' field of a WORD_DESC. */ --- 55,60 ---- /* Command Types: */ enum command_type { cm_for, cm_case, cm_while, cm_if, cm_simple, cm_select, ! cm_connection, cm_function_def, cm_until, cm_group, ! cm_arith, cm_cond }; /* Possible values for the `flags' field of a WORD_DESC. */ *************** *** 144,147 **** --- 145,154 ---- struct select_com *Select; #endif + #if defined (DPAREN_ARITHMETIC) + struct arith_com *Arith; + #endif + #if defined (COND_COMMAND) + struct cond_com *Cond; + #endif } value; } COMMAND; *************** *** 208,211 **** --- 215,246 ---- } WHILE_COM; + #if defined (DPAREN_ARITHMETIC) + /* The arithmetic evaluation command, ((...)). Just a set of flags and + a WORD_LIST, of which the first element is the only one used, for the + time being. */ + typedef struct arith_com { + int flags; + WORD_LIST *exp; + int line; + } ARITH_COM; + #endif /* DPAREN_ARITHMETIC */ + + /* The conditional command, [[...]]. This is a binary tree -- we slippped + a recursive-descent parser into the YACC grammar to parse it. */ + #define COND_AND 1 + #define COND_OR 2 + #define COND_UNARY 3 + #define COND_BINARY 4 + #define COND_TERM 5 + #define COND_EXPR 6 + + typedef struct cond_com { + int flags; + int line; + int type; + WORD_DESC *op; + struct cond_com *left, *right; + } COND_COM; + /* The "simple" command. Just a collection of words and redirects. */ typedef struct simple_com { *************** *** 219,223 **** /* The "function definition" command. */ typedef struct function_def { ! int ignore; /* See description of CMD flags. */ WORD_DESC *name; /* The name of the function. */ COMMAND *command; /* The parsed execution tree. */ --- 254,258 ---- /* The "function definition" command. */ typedef struct function_def { ! int flags; /* See description of CMD flags. */ WORD_DESC *name; /* The name of the function. */ COMMAND *command; /* The parsed execution tree. */ diff -Nrc2 bash-2.01.1/config.h.in bash-2.02/config.h.in *** bash-2.01.1/config.h.in Tue Jul 29 10:54:26 1997 --- bash-2.02/config.h.in Thu Oct 9 11:43:00 1997 *************** *** 111,114 **** --- 111,122 ---- #undef DPAREN_ARITHMETIC + /* Define EXTENDED_GLOB if you want the ksh-style [*+@?!](patlist) extended + pattern matching. */ + #undef EXTENDED_GLOB + + /* Define COND_COMMAND if you want the ksh-style [[...]] conditional + command. */ + #undef COND_COMMAND + /* Define AFS if you are using Transarc's AFS. */ #undef AFS *************** *** 171,174 **** --- 179,191 ---- #undef _MINIX + /* The number of bytes in a int. */ + #undef SIZEOF_INT + + /* The number of bytes in a long. */ + #undef SIZEOF_LONG + + /* The number of bytes in a pointer to char. */ + #undef SIZEOF_CHAR_P + /* Define to `long' if doesn't define. */ #undef off_t *************** *** 183,186 **** --- 200,224 ---- #undef pid_t + /* Define to `int' if doesn't define. */ + #undef int32_t + + /* Define to `unsigned int' if doesn't define. */ + #undef u_int32_t + + /* Define to `int' if doesn't define. */ + #undef ptrdiff_t + + /* Define to `unsigned' if doesn't define. */ + #undef size_t + + /* Define to `int' if doesn't define. */ + #undef uid_t + + /* Define to `long' if doesn't define. */ + #undef clock_t + + /* Define to `long' if doesn't define. */ + #undef time_t + /* Define if the system does not provide POSIX.1 features except with this defined. */ *************** *** 198,204 **** #undef SETVBUF_REVERSED - /* Define to `unsigned' if doesn't define. */ - #undef size_t - /* If using the C implementation of alloca, define if you know the direction of stack growth for your system; otherwise it will be --- 236,239 ---- *************** *** 213,217 **** #undef STDC_HEADERS ! /* Define if `sys_siglist' is declared by . */ #undef SYS_SIGLIST_DECLARED --- 248,252 ---- #undef STDC_HEADERS ! /* Define if `sys_siglist' is declared by or . */ #undef SYS_SIGLIST_DECLARED *************** *** 219,231 **** #undef UNDER_SYS_SIGLIST_DECLARED - /* Define to `int' if doesn't define. */ - #undef uid_t - - /* Define to `long' if doesn't define. */ - #undef clock_t - - /* Define to `long' if doesn't define. */ - #undef time_t - #undef DUP2_BROKEN --- 254,257 ---- *************** *** 308,311 **** --- 334,339 ---- #undef STRUCT_WINSIZE_IN_SYS_IOCTL + #undef STRUCT_WINSIZE_IN_TERMIOS + #undef SPEED_T_IN_SYS_TYPES *************** *** 396,399 **** --- 424,436 ---- #undef HAVE_STRERROR + /* Define if you have the strtod function. */ + #undef HAVE_STRTOD + + /* Define if you have the strtol function. */ + #undef HAVE_STRTOL + + /* Define if you have the strtoul function. */ + #undef HAVE_STRTOUL + /* Define if you have the tcgetattr function. */ #undef HAVE_TCGETATTR *************** *** 496,499 **** --- 533,539 ---- /* Define if you have the header file. */ #undef HAVE_LIBINTL_H + + /* Define if you have the header file. */ + #undef HAVE_STDDEF_H #undef HAVE_LIBDL diff -Nrc2 bash-2.01.1/configure bash-2.02/configure *** bash-2.01.1/configure Mon Sep 22 12:58:33 1997 --- bash-2.02/configure Thu Apr 16 10:42:52 1998 *************** *** 1,5 **** #! /bin/sh ! # From configure.in for Bash 2.01, version 1.28, from autoconf version 2.12 --- 1,15 ---- #! /bin/sh ! # From configure.in for Bash 2.02, version 2.19, from autoconf version 2.12 ! ! ! ! ! ! ! ! ! ! *************** *** 113,116 **** --- 123,128 ---- --enable-command-timing enable the time reserved word and command timing" ac_help="$ac_help + --enable-cond-command enable the conditional command" + ac_help="$ac_help --enable-directory-stack enable builtins pushd/popd/dirs" ac_help="$ac_help *************** *** 119,122 **** --- 131,136 ---- --enable-dparen-arithmetic include ((...)) command" ac_help="$ac_help + --enable-extended-glob include ksh-style extended pattern matching" + ac_help="$ac_help --enable-help-builtin include the help builtin" ac_help="$ac_help *************** *** 136,139 **** --- 150,157 ---- ac_help="$ac_help --enable-usg-echo-default make the echo builtin expand escape sequences by default" + ac_help="$ac_help + --enable-profiling allow profiling with gprof" + ac_help="$ac_help + --enable-static-link link bash statically, for use as a root shell" # Initialize some variables set by options. *************** *** 674,678 **** echo $ac_n "checking host system type""... $ac_c" 1>&6 ! echo "configure:677: checking host system type" >&5 host_alias=$host --- 692,696 ---- echo $ac_n "checking host system type""... $ac_c" 1>&6 ! echo "configure:695: checking host system type" >&5 host_alias=$host *************** *** 704,708 **** case "${host_cpu}-${host_os}" in alpha-*) opt_gnu_malloc=no ;; # alpha running osf/1 or linux ! *cray*-*) opt_gnu_malloc=no ;; # Crays *-osf1*) opt_gnu_malloc=no ;; # other osf/1 machines sparc-svr4*) opt_gnu_malloc=no ;; # sparc SVR4, SVR4.2 --- 722,726 ---- case "${host_cpu}-${host_os}" in alpha-*) opt_gnu_malloc=no ;; # alpha running osf/1 or linux ! *Ccray*-*) opt_gnu_malloc=no ;; # Crays *-osf1*) opt_gnu_malloc=no ;; # other osf/1 machines sparc-svr4*) opt_gnu_malloc=no ;; # sparc SVR4, SVR4.2 *************** *** 710,714 **** sgi-irix6*) opt_gnu_malloc=no ;; # needs 8-byte alignment sparc-linux*) opt_gnu_malloc=no ;; # sparc running linux; requires ELF ! *-freebsd*) opt_gnu_malloc=no ;; # they claim it's better *-aix*) opt_gnu_malloc=no ;; # AIX machines *-nextstep*) opt_gnu_malloc=no ;; # NeXT machines running NeXTstep --- 728,732 ---- sgi-irix6*) opt_gnu_malloc=no ;; # needs 8-byte alignment sparc-linux*) opt_gnu_malloc=no ;; # sparc running linux; requires ELF ! #*-freebsd*) opt_gnu_malloc=no ;; # they claim it's better *-aix*) opt_gnu_malloc=no ;; # AIX machines *-nextstep*) opt_gnu_malloc=no ;; # NeXT machines running NeXTstep *************** *** 716,720 **** *-qnx*) opt_gnu_malloc=no ;; # QNX 4.2 *-machten4) opt_gnu_malloc=no ;; # MachTen 4.x ! *-bsdi2.1|*-bsdi3.0) opt_gnu_malloc=no ; : ${CC:=shlicc2} ;; # for loadable builtins esac --- 734,739 ---- *-qnx*) opt_gnu_malloc=no ;; # QNX 4.2 *-machten4) opt_gnu_malloc=no ;; # MachTen 4.x ! *-bsdi2.1|*-bsdi3.?) opt_gnu_malloc=no ; : ${CC:=shlicc2} ;; # for loadable builtins ! *-cygwin32*) opt_gnu_malloc=no ;; # Cygnus's CYGWIN32 environment esac *************** *** 803,810 **** --- 822,834 ---- opt_array_variables=yes opt_dparen_arith=yes + opt_extended_glob=yes opt_brace_expansion=yes opt_disabled_builtins=no opt_command_timing=yes opt_usg_echo=no + opt_cond_command=yes + + opt_static_link=no + opt_profiling=no # Check whether --enable-minimal-config or --disable-minimal-config was given. *************** *** 821,824 **** --- 845,849 ---- opt_select=no opt_help=no opt_array_variables=no opt_dparen_arith=no opt_brace_expansion=no opt_disabled_builtins=no opt_command_timing=no + opt_extended_glob=no opt_cond_command=no fi *************** *** 853,856 **** --- 878,887 ---- fi + # Check whether --enable-cond-command or --disable-cond-command was given. + if test "${enable_cond_command+set}" = set; then + enableval="$enable_cond_command" + opt_cond_command=$enableval + fi + # Check whether --enable-directory-stack or --disable-directory-stack was given. if test "${enable_directory_stack+set}" = set; then *************** *** 871,874 **** --- 902,911 ---- fi + # Check whether --enable-extended-glob or --disable-extended-glob was given. + if test "${enable_extended_glob+set}" = set; then + enableval="$enable_extended_glob" + opt_extended_glob=$enableval + fi + # Check whether --enable-help-builtin or --disable-help-builtin was given. if test "${enable_help_builtin+set}" = set; then *************** *** 926,929 **** --- 963,979 ---- + # Check whether --enable-profiling or --disable-profiling was given. + if test "${enable_profiling+set}" = set; then + enableval="$enable_profiling" + opt_profiling=$enableval + fi + + # Check whether --enable-static-link or --disable-static-link was given. + if test "${enable_static_link+set}" = set; then + enableval="$enable_static_link" + opt_static_link=$enableval + fi + + if test $opt_alias = yes; then *************** *** 1035,1038 **** --- 1085,1100 ---- fi + if test $opt_extended_glob = yes ; then + cat >> confdefs.h <<\EOF + #define EXTENDED_GLOB 1 + EOF + + fi + if test $opt_cond_command = yes ; then + cat >> confdefs.h <<\EOF + #define COND_COMMAND 1 + EOF + + fi if test "$opt_minimal_config" = yes; then *************** *** 1051,1063 **** ! BASHVERS=2.01 ! BASHPATCH=1 ! echo "Beginning configuration for bash-$BASHVERS" # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 ! echo "configure:1062: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 --- 1113,1125 ---- ! BASHVERS=2.02 ! BASHPATCH=0 ! echo "Beginning configuration for bash-$BASHVERS for ${host_cpu}-${host_vendor}-${host_os}" # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 ! echo "configure:1124: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 *************** *** 1088,1092 **** set dummy cc; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 ! echo "configure:1091: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 --- 1150,1154 ---- set dummy cc; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 ! echo "configure:1153: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 *************** *** 1136,1140 **** echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6 ! echo "configure:1139: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5 ac_ext=c --- 1198,1202 ---- echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6 ! echo "configure:1201: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5 ac_ext=c *************** *** 1146,1154 **** cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then ac_cv_prog_cc_works=yes # If we can't run a trivial program, we are probably using a cross compiler. --- 1208,1216 ---- cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then ac_cv_prog_cc_works=yes # If we can't run a trivial program, we are probably using a cross compiler. *************** *** 1170,1179 **** fi echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6 ! echo "configure:1173: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5 echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6 cross_compiling=$ac_cv_prog_cc_cross echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6 ! echo "configure:1178: checking whether we are using GNU C" >&5 if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 --- 1232,1241 ---- fi echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6 ! echo "configure:1235: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5 echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6 cross_compiling=$ac_cv_prog_cc_cross echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6 ! echo "configure:1240: checking whether we are using GNU C" >&5 if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 *************** *** 1184,1188 **** #endif EOF ! if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:1187: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then ac_cv_prog_gcc=yes else --- 1246,1250 ---- #endif EOF ! if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:1249: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then ac_cv_prog_gcc=yes else *************** *** 1199,1203 **** CFLAGS= echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6 ! echo "configure:1202: checking whether ${CC-cc} accepts -g" >&5 if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 --- 1261,1265 ---- CFLAGS= echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6 ! echo "configure:1264: checking whether ${CC-cc} accepts -g" >&5 if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 *************** *** 1226,1231 **** fi echo $ac_n "checking for POSIXized ISC""... $ac_c" 1>&6 ! echo "configure:1230: checking for POSIXized ISC" >&5 if test -d /etc/conf/kconfig.d && grep _POSIX_VERSION /usr/include/sys/unistd.h >/dev/null 2>&1 --- 1288,1325 ---- fi + echo $ac_n "checking whether large file support needs explicit enabling""... $ac_c" 1>&6 + echo "configure:1292: checking whether large file support needs explicit enabling" >&5 + ac_getconfs='' + ac_result=yes + ac_set='' + ac_shellvars='CPPFLAGS LDFLAGS LIBS' + for ac_shellvar in $ac_shellvars; do + case $ac_shellvar in + CPPFLAGS) ac_lfsvar=LFS_CFLAGS ac_lfs64var=LFS64_CFLAGS ;; + *) ac_lfsvar=LFS_$ac_shellvar ac_lfs64var=LFS64_$ac_shellvar ;; + esac + eval test '"${'$ac_shellvar'+set}"' = set && ac_set=$ac_shellvar + (getconf $ac_lfsvar) >/dev/null 2>&1 || { ac_result=no; break; } + ac_getconf=`getconf $ac_lfsvar` + ac_getconf64=`getconf $ac_lfs64var` + ac_getconfs=$ac_getconfs$ac_getconf\ $ac_getconf64 + eval ac_test_$ac_shellvar="\$ac_getconf\ \$ac_getconf64" + done + case "$ac_result$ac_getconfs" in + yes) ac_result=no ;; + esac + case "$ac_result$ac_set" in + yes?*) ac_result="yes, but $ac_set is already set, so use its settings" + esac + echo "$ac_t""$ac_result" 1>&6 + case $ac_result in + yes) + for ac_shellvar in $ac_shellvars; do + eval $ac_shellvar=\$ac_test_$ac_shellvar + done ;; + esac + echo $ac_n "checking for POSIXized ISC""... $ac_c" 1>&6 ! echo "configure:1324: checking for POSIXized ISC" >&5 if test -d /etc/conf/kconfig.d && grep _POSIX_VERSION /usr/include/sys/unistd.h >/dev/null 2>&1 *************** *** 1248,1252 **** echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6 ! echo "configure:1251: checking how to run the C preprocessor" >&5 # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then --- 1342,1346 ---- echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6 ! echo "configure:1345: checking how to run the C preprocessor" >&5 # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then *************** *** 1263,1267 **** # not just through cpp. cat > conftest.$ac_ext < --- 1357,1361 ---- # not just through cpp. cat > conftest.$ac_ext < *************** *** 1269,1273 **** EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" ! { (eval echo configure:1272: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then --- 1363,1367 ---- EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" ! { (eval echo configure:1366: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then *************** *** 1280,1284 **** CPP="${CC-cc} -E -traditional-cpp" cat > conftest.$ac_ext < --- 1374,1378 ---- CPP="${CC-cc} -E -traditional-cpp" cat > conftest.$ac_ext < *************** *** 1286,1290 **** EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" ! { (eval echo configure:1289: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then --- 1380,1384 ---- EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" ! { (eval echo configure:1383: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then *************** *** 1310,1324 **** ac_safe=`echo "minix/config.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for minix/config.h""... $ac_c" 1>&6 ! echo "configure:1313: checking for minix/config.h" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" ! { (eval echo configure:1323: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then --- 1404,1418 ---- ac_safe=`echo "minix/config.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for minix/config.h""... $ac_c" 1>&6 ! echo "configure:1407: checking for minix/config.h" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" ! { (eval echo configure:1417: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then *************** *** 1358,1365 **** --- 1452,1504 ---- + + if test "x$cross_compiling" = "xyes"; then + case "${host}" in + *-cygwin32*) + cross_cache=${srcdir}/cross-build/cygwin32.cache + if test -r "${cross_cache}"; then + echo "loading cross-build cache file ${cross_cache}" + . ${cross_cache} + fi + unset cross_cache + ;; + *) echo "configure: cross-compiling for a non-cygwin32 target is not supported" >&2 + ;; + esac + fi + + if test -z "$CC_FOR_BUILD"; then + if test "x$cross_compiling" = "xno"; then + CC_FOR_BUILD='$(CC)' + else + CC_FOR_BUILD=gcc + fi + fi + + + if test "x$cross_compiling" = "xno"; then + SIGNAMES_H=lsignames.h + else + SIGNAMES_H='$(srcdir)/cross-build/win32sig.h' + fi + + + test -z "$CFLAGS" && CFLAGS=-g auto_cflags=1 test -n "$GCC" && test -n "$auto_cflags" && CFLAGS="$CFLAGS -O2" + if test "$opt_profiling" = "yes"; then + PROFILE_FLAGS=-pg + opt_static_link=yes + fi + + if test "$opt_static_link" = yes; then + # if we're using gcc, add `-static' to LDFLAGS + if test -n "$GCC" || test "$ac_cv_prog_gcc" = "yes"; then + LDFLAGS="$LDFLAGS -static" + fi + fi + *************** *** 1368,1372 **** if test $ac_cv_prog_gcc = yes; then echo $ac_n "checking whether ${CC-cc} needs -traditional""... $ac_c" 1>&6 ! echo "configure:1371: checking whether ${CC-cc} needs -traditional" >&5 if eval "test \"`echo '$''{'ac_cv_prog_gcc_traditional'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 --- 1507,1511 ---- if test $ac_cv_prog_gcc = yes; then echo $ac_n "checking whether ${CC-cc} needs -traditional""... $ac_c" 1>&6 ! echo "configure:1510: checking whether ${CC-cc} needs -traditional" >&5 if eval "test \"`echo '$''{'ac_cv_prog_gcc_traditional'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 *************** *** 1374,1378 **** ac_pattern="Autoconf.*'x'" cat > conftest.$ac_ext < --- 1513,1517 ---- ac_pattern="Autoconf.*'x'" cat > conftest.$ac_ext < *************** *** 1392,1396 **** if test $ac_cv_prog_gcc_traditional = no; then cat > conftest.$ac_ext < --- 1531,1535 ---- if test $ac_cv_prog_gcc_traditional = no; then cat > conftest.$ac_ext < *************** *** 1425,1429 **** # ./install, which can be erroneously created by make from ./install.sh. echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6 ! echo "configure:1428: checking for a BSD compatible install" >&5 if test -z "$INSTALL"; then if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then --- 1564,1568 ---- # ./install, which can be erroneously created by make from ./install.sh. echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6 ! echo "configure:1567: checking for a BSD compatible install" >&5 if test -z "$INSTALL"; then if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then *************** *** 1477,1481 **** set dummy ar; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 ! echo "configure:1480: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_AR'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 --- 1616,1620 ---- set dummy ar; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 ! echo "configure:1619: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_AR'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 *************** *** 1505,1509 **** set dummy ranlib; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 ! echo "configure:1508: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 --- 1644,1648 ---- set dummy ranlib; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 ! echo "configure:1647: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 *************** *** 1536,1540 **** set dummy $ac_prog; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 ! echo "configure:1539: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_YACC'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 --- 1675,1679 ---- set dummy $ac_prog; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 ! echo "configure:1678: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_YACC'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 *************** *** 1566,1570 **** echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6 ! echo "configure:1569: checking whether ${MAKE-make} sets \${MAKE}" >&5 set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_prog_make_${ac_make}_set'+set}'`\" = set"; then --- 1705,1709 ---- echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6 ! echo "configure:1708: checking whether ${MAKE-make} sets \${MAKE}" >&5 set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_prog_make_${ac_make}_set'+set}'`\" = set"; then *************** *** 1596,1605 **** # for constant arguments. Useless! echo $ac_n "checking for working alloca.h""... $ac_c" 1>&6 ! echo "configure:1599: checking for working alloca.h" >&5 if eval "test \"`echo '$''{'ac_cv_header_alloca_h'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < --- 1735,1744 ---- # for constant arguments. Useless! echo $ac_n "checking for working alloca.h""... $ac_c" 1>&6 ! echo "configure:1738: checking for working alloca.h" >&5 if eval "test \"`echo '$''{'ac_cv_header_alloca_h'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < *************** *** 1608,1612 **** ; return 0; } EOF ! if { (eval echo configure:1611: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* ac_cv_header_alloca_h=yes --- 1747,1751 ---- ; return 0; } EOF ! if { (eval echo configure:1750: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* ac_cv_header_alloca_h=yes *************** *** 1629,1638 **** echo $ac_n "checking for alloca""... $ac_c" 1>&6 ! echo "configure:1632: checking for alloca" >&5 if eval "test \"`echo '$''{'ac_cv_func_alloca_works'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&6 ! echo "configure:1771: checking for alloca" >&5 if eval "test \"`echo '$''{'ac_cv_func_alloca_works'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* ac_cv_func_alloca_works=yes --- 1796,1800 ---- ; return 0; } EOF ! if { (eval echo configure:1799: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* ac_cv_func_alloca_works=yes *************** *** 1689,1698 **** echo $ac_n "checking whether alloca needs Cray hooks""... $ac_c" 1>&6 ! echo "configure:1692: checking whether alloca needs Cray hooks" >&5 if eval "test \"`echo '$''{'ac_cv_os_cray'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&6 ! echo "configure:1831: checking whether alloca needs Cray hooks" >&5 if eval "test \"`echo '$''{'ac_cv_os_cray'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&6 ! echo "configure:1722: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&6 ! echo "configure:1861: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" --- 1886,1890 ---- ; return 0; } EOF ! if { (eval echo configure:1889: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" *************** *** 1774,1778 **** echo $ac_n "checking stack direction for C alloca""... $ac_c" 1>&6 ! echo "configure:1777: checking stack direction for C alloca" >&5 if eval "test \"`echo '$''{'ac_cv_c_stack_direction'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 --- 1913,1917 ---- echo $ac_n "checking stack direction for C alloca""... $ac_c" 1>&6 ! echo "configure:1916: checking stack direction for C alloca" >&5 if eval "test \"`echo '$''{'ac_cv_c_stack_direction'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 *************** *** 1782,1786 **** else cat > conftest.$ac_ext < conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null then ac_cv_c_stack_direction=1 --- 1940,1944 ---- } EOF ! if { (eval echo configure:1943: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null then ac_cv_c_stack_direction=1 *************** *** 1823,1827 **** echo $ac_n "checking whether getpgrp takes no argument""... $ac_c" 1>&6 ! echo "configure:1826: checking whether getpgrp takes no argument" >&5 if eval "test \"`echo '$''{'ac_cv_func_getpgrp_void'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 --- 1962,1966 ---- echo $ac_n "checking whether getpgrp takes no argument""... $ac_c" 1>&6 ! echo "configure:1965: checking whether getpgrp takes no argument" >&5 if eval "test \"`echo '$''{'ac_cv_func_getpgrp_void'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 *************** *** 1831,1835 **** else cat > conftest.$ac_ext < conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null then ac_cv_func_getpgrp_void=yes --- 2025,2029 ---- EOF ! if { (eval echo configure:2028: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null then ac_cv_func_getpgrp_void=yes *************** *** 1910,1914 **** echo $ac_n "checking whether setvbuf arguments are reversed""... $ac_c" 1>&6 ! echo "configure:1913: checking whether setvbuf arguments are reversed" >&5 if eval "test \"`echo '$''{'ac_cv_func_setvbuf_reversed'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 --- 2049,2053 ---- echo $ac_n "checking whether setvbuf arguments are reversed""... $ac_c" 1>&6 ! echo "configure:2052: checking whether setvbuf arguments are reversed" >&5 if eval "test \"`echo '$''{'ac_cv_func_setvbuf_reversed'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 *************** *** 1918,1922 **** else cat > conftest.$ac_ext < --- 2057,2061 ---- else cat > conftest.$ac_ext < *************** *** 1932,1936 **** } EOF ! if { (eval echo configure:1935: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null then ac_cv_func_setvbuf_reversed=yes --- 2071,2075 ---- } EOF ! if { (eval echo configure:2074: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null then ac_cv_func_setvbuf_reversed=yes *************** *** 1956,1965 **** echo $ac_n "checking for vprintf""... $ac_c" 1>&6 ! echo "configure:1959: checking for vprintf" >&5 if eval "test \"`echo '$''{'ac_cv_func_vprintf'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&6 ! echo "configure:2098: checking for vprintf" >&5 if eval "test \"`echo '$''{'ac_cv_func_vprintf'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_func_vprintf=yes" --- 2123,2127 ---- ; return 0; } EOF ! if { (eval echo configure:2126: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_func_vprintf=yes" *************** *** 2008,2017 **** if test "$ac_cv_func_vprintf" != yes; then echo $ac_n "checking for _doprnt""... $ac_c" 1>&6 ! echo "configure:2011: checking for _doprnt" >&5 if eval "test \"`echo '$''{'ac_cv_func__doprnt'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&6 ! echo "configure:2150: checking for _doprnt" >&5 if eval "test \"`echo '$''{'ac_cv_func__doprnt'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_func__doprnt=yes" --- 2175,2179 ---- ; return 0; } EOF ! if { (eval echo configure:2178: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_func__doprnt=yes" *************** *** 2061,2065 **** echo $ac_n "checking for wait3 that fills in rusage""... $ac_c" 1>&6 ! echo "configure:2064: checking for wait3 that fills in rusage" >&5 if eval "test \"`echo '$''{'ac_cv_func_wait3_rusage'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 --- 2200,2204 ---- echo $ac_n "checking for wait3 that fills in rusage""... $ac_c" 1>&6 ! echo "configure:2203: checking for wait3 that fills in rusage" >&5 if eval "test \"`echo '$''{'ac_cv_func_wait3_rusage'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 *************** *** 2069,2073 **** else cat > conftest.$ac_ext < --- 2208,2212 ---- else cat > conftest.$ac_ext < *************** *** 2100,2104 **** } EOF ! if { (eval echo configure:2103: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null then ac_cv_func_wait3_rusage=yes --- 2239,2243 ---- } EOF ! if { (eval echo configure:2242: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null then ac_cv_func_wait3_rusage=yes *************** *** 2123,2127 **** echo $ac_n "checking for working strcoll""... $ac_c" 1>&6 ! echo "configure:2126: checking for working strcoll" >&5 if eval "test \"`echo '$''{'ac_cv_func_strcoll_works'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 --- 2262,2266 ---- echo $ac_n "checking for working strcoll""... $ac_c" 1>&6 ! echo "configure:2265: checking for working strcoll" >&5 if eval "test \"`echo '$''{'ac_cv_func_strcoll_works'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 *************** *** 2131,2135 **** else cat > conftest.$ac_ext < --- 2270,2274 ---- else cat > conftest.$ac_ext < *************** *** 2141,2145 **** } EOF ! if { (eval echo configure:2144: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null then ac_cv_func_strcoll_works=yes --- 2280,2284 ---- } EOF ! if { (eval echo configure:2283: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null then ac_cv_func_strcoll_works=yes *************** *** 2166,2172 **** if test "$ac_cv_func_vprintf" = no; then echo $ac_n "checking for declaration of vprintf in stdio.h""... $ac_c" 1>&6 ! echo "configure:2169: checking for declaration of vprintf in stdio.h" >&5 cat > conftest.$ac_ext < --- 2305,2311 ---- if test "$ac_cv_func_vprintf" = no; then echo $ac_n "checking for declaration of vprintf in stdio.h""... $ac_c" 1>&6 ! echo "configure:2308: checking for declaration of vprintf in stdio.h" >&5 cat > conftest.$ac_ext < *************** *** 2189,2198 **** echo $ac_n "checking return type of signal handlers""... $ac_c" 1>&6 ! echo "configure:2192: checking return type of signal handlers" >&5 if eval "test \"`echo '$''{'ac_cv_type_signal'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < --- 2328,2337 ---- echo $ac_n "checking return type of signal handlers""... $ac_c" 1>&6 ! echo "configure:2331: checking return type of signal handlers" >&5 if eval "test \"`echo '$''{'ac_cv_type_signal'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < *************** *** 2211,2215 **** ; return 0; } EOF ! if { (eval echo configure:2214: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_type_signal=void --- 2350,2354 ---- ; return 0; } EOF ! if { (eval echo configure:2353: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_type_signal=void *************** *** 2231,2240 **** echo $ac_n "checking for __setostype""... $ac_c" 1>&6 ! echo "configure:2234: checking for __setostype" >&5 if eval "test \"`echo '$''{'ac_cv_func___setostype'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&6 ! echo "configure:2373: checking for __setostype" >&5 if eval "test \"`echo '$''{'ac_cv_func___setostype'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_func___setostype=yes" --- 2398,2402 ---- ; return 0; } EOF ! if { (eval echo configure:2401: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_func___setostype=yes" *************** *** 2282,2291 **** echo $ac_n "checking for wait3""... $ac_c" 1>&6 ! echo "configure:2285: checking for wait3" >&5 if eval "test \"`echo '$''{'ac_cv_func_wait3'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&6 ! echo "configure:2424: checking for wait3" >&5 if eval "test \"`echo '$''{'ac_cv_func_wait3'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_func_wait3=yes" --- 2449,2453 ---- ; return 0; } EOF ! if { (eval echo configure:2452: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_func_wait3=yes" *************** *** 2334,2343 **** echo $ac_n "checking for mkfifo""... $ac_c" 1>&6 ! echo "configure:2337: checking for mkfifo" >&5 if eval "test \"`echo '$''{'ac_cv_func_mkfifo'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&6 ! echo "configure:2476: checking for mkfifo" >&5 if eval "test \"`echo '$''{'ac_cv_func_mkfifo'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_func_mkfifo=yes" --- 2501,2505 ---- ; return 0; } EOF ! if { (eval echo configure:2504: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_func_mkfifo=yes" *************** *** 2394,2403 **** do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 ! echo "configure:2397: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&6 ! echo "configure:2536: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" --- 2561,2565 ---- ; return 0; } EOF ! if { (eval echo configure:2564: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" *************** *** 2448,2461 **** for ac_func in bcopy bzero confstr getcwd strcasecmp setenv putenv \ ! setlinebuf setlocale strchr strerror tcgetattr uname \ ! sysconf ulimit times tzset siginterrupt memmove do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 ! echo "configure:2455: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&6 ! echo "configure:2595: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" --- 2620,2624 ---- ; return 0; } EOF ! if { (eval echo configure:2623: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" *************** *** 2509,2523 **** ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 ! echo "configure:2512: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" ! { (eval echo configure:2522: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then --- 2649,2663 ---- ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 ! echo "configure:2652: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" ! { (eval echo configure:2662: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then *************** *** 2548,2557 **** do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 ! echo "configure:2551: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&6 ! echo "configure:2691: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" --- 2716,2720 ---- ; return 0; } EOF ! if { (eval echo configure:2719: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" *************** *** 2603,2607 **** if test "$ac_cv_func_bindtextdomain" = "no"; then echo $ac_n "checking for bindtextdomain in -lintl""... $ac_c" 1>&6 ! echo "configure:2606: checking for bindtextdomain in -lintl" >&5 ac_lib_var=`echo intl'_'bindtextdomain | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then --- 2743,2747 ---- if test "$ac_cv_func_bindtextdomain" = "no"; then echo $ac_n "checking for bindtextdomain in -lintl""... $ac_c" 1>&6 ! echo "configure:2746: checking for bindtextdomain in -lintl" >&5 ac_lib_var=`echo intl'_'bindtextdomain | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then *************** *** 2611,2615 **** LIBS="-lintl $LIBS" cat > conftest.$ac_ext < conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" --- 2762,2766 ---- ; return 0; } EOF ! if { (eval echo configure:2765: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" *************** *** 2653,2662 **** do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 ! echo "configure:2656: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&6 ! echo "configure:2796: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" --- 2821,2825 ---- ; return 0; } EOF ! if { (eval echo configure:2824: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" *************** *** 2708,2713 **** fi echo $ac_n "checking for dlopen in -ldl""... $ac_c" 1>&6 ! echo "configure:2712: checking for dlopen in -ldl" >&5 ac_lib_var=`echo dl'_'dlopen | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then --- 2848,2854 ---- fi + if test "$opt_static_link" != yes; then echo $ac_n "checking for dlopen in -ldl""... $ac_c" 1>&6 ! echo "configure:2853: checking for dlopen in -ldl" >&5 ac_lib_var=`echo dl'_'dlopen | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then *************** *** 2717,2721 **** LIBS="-ldl $LIBS" cat > conftest.$ac_ext < conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" --- 2869,2873 ---- ; return 0; } EOF ! if { (eval echo configure:2872: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" *************** *** 2758,2767 **** do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 ! echo "configure:2761: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&6 ! echo "configure:2902: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" --- 2927,2931 ---- ; return 0; } EOF ! if { (eval echo configure:2930: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" *************** *** 2810,2821 **** done echo $ac_n "checking for sys_siglist declaration in signal.h or unistd.h""... $ac_c" 1>&6 ! echo "configure:2815: checking for sys_siglist declaration in signal.h or unistd.h" >&5 if eval "test \"`echo '$''{'ac_cv_decl_sys_siglist'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < --- 2951,2963 ---- done + fi echo $ac_n "checking for sys_siglist declaration in signal.h or unistd.h""... $ac_c" 1>&6 ! echo "configure:2957: checking for sys_siglist declaration in signal.h or unistd.h" >&5 if eval "test \"`echo '$''{'ac_cv_decl_sys_siglist'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < *************** *** 2829,2833 **** ; return 0; } EOF ! if { (eval echo configure:2832: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_decl_sys_siglist=yes --- 2971,2975 ---- ; return 0; } EOF ! if { (eval echo configure:2974: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_decl_sys_siglist=yes *************** *** 2855,2864 **** ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr that defines DIR""... $ac_c" 1>&6 ! echo "configure:2858: checking for $ac_hdr that defines DIR" >&5 if eval "test \"`echo '$''{'ac_cv_header_dirent_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < --- 2997,3006 ---- ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr that defines DIR""... $ac_c" 1>&6 ! echo "configure:3000: checking for $ac_hdr that defines DIR" >&5 if eval "test \"`echo '$''{'ac_cv_header_dirent_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < *************** *** 2868,2872 **** ; return 0; } EOF ! if { (eval echo configure:2871: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* eval "ac_cv_header_dirent_$ac_safe=yes" --- 3010,3014 ---- ; return 0; } EOF ! if { (eval echo configure:3013: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* eval "ac_cv_header_dirent_$ac_safe=yes" *************** *** 2893,2897 **** if test $ac_header_dirent = dirent.h; then echo $ac_n "checking for opendir in -ldir""... $ac_c" 1>&6 ! echo "configure:2896: checking for opendir in -ldir" >&5 ac_lib_var=`echo dir'_'opendir | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then --- 3035,3039 ---- if test $ac_header_dirent = dirent.h; then echo $ac_n "checking for opendir in -ldir""... $ac_c" 1>&6 ! echo "configure:3038: checking for opendir in -ldir" >&5 ac_lib_var=`echo dir'_'opendir | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then *************** *** 2901,2905 **** LIBS="-ldir $LIBS" cat > conftest.$ac_ext < conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" --- 3054,3058 ---- ; return 0; } EOF ! if { (eval echo configure:3057: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" *************** *** 2934,2938 **** else echo $ac_n "checking for opendir in -lx""... $ac_c" 1>&6 ! echo "configure:2937: checking for opendir in -lx" >&5 ac_lib_var=`echo x'_'opendir | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then --- 3076,3080 ---- else echo $ac_n "checking for opendir in -lx""... $ac_c" 1>&6 ! echo "configure:3079: checking for opendir in -lx" >&5 ac_lib_var=`echo x'_'opendir | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then *************** *** 2942,2946 **** LIBS="-lx $LIBS" cat > conftest.$ac_ext < conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" --- 3095,3099 ---- ; return 0; } EOF ! if { (eval echo configure:3098: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" *************** *** 2976,2985 **** echo $ac_n "checking whether time.h and sys/time.h may both be included""... $ac_c" 1>&6 ! echo "configure:2979: checking whether time.h and sys/time.h may both be included" >&5 if eval "test \"`echo '$''{'ac_cv_header_time'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < --- 3118,3127 ---- echo $ac_n "checking whether time.h and sys/time.h may both be included""... $ac_c" 1>&6 ! echo "configure:3121: checking whether time.h and sys/time.h may both be included" >&5 if eval "test \"`echo '$''{'ac_cv_header_time'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < *************** *** 2990,2994 **** ; return 0; } EOF ! if { (eval echo configure:2993: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_header_time=yes --- 3132,3136 ---- ; return 0; } EOF ! if { (eval echo configure:3135: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_header_time=yes *************** *** 3012,3030 **** for ac_hdr in unistd.h stdlib.h stdarg.h varargs.h limits.h string.h \ ! memory.h locale.h termcap.h termio.h termios.h dlfcn.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 ! echo "configure:3019: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" ! { (eval echo configure:3029: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then --- 3154,3173 ---- for ac_hdr in unistd.h stdlib.h stdarg.h varargs.h limits.h string.h \ ! memory.h locale.h termcap.h termio.h termios.h dlfcn.h \ ! stddef.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 ! echo "configure:3162: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" ! { (eval echo configure:3172: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then *************** *** 3058,3072 **** ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 ! echo "configure:3061: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" ! { (eval echo configure:3071: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then --- 3201,3215 ---- ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 ! echo "configure:3204: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" ! { (eval echo configure:3214: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then *************** *** 3101,3105 **** else echo $ac_n "checking for socket library""... $ac_c" 1>&6 ! echo "configure:3104: checking for socket library" >&5 _bash_needmsg=yes fi --- 3244,3248 ---- else echo $ac_n "checking for socket library""... $ac_c" 1>&6 ! echo "configure:3247: checking for socket library" >&5 _bash_needmsg=yes fi *************** *** 3108,3112 **** else echo $ac_n "checking for getpeername in -lsocket""... $ac_c" 1>&6 ! echo "configure:3111: checking for getpeername in -lsocket" >&5 ac_lib_var=`echo socket'_'getpeername | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then --- 3251,3255 ---- else echo $ac_n "checking for getpeername in -lsocket""... $ac_c" 1>&6 ! echo "configure:3254: checking for getpeername in -lsocket" >&5 ac_lib_var=`echo socket'_'getpeername | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then *************** *** 3116,3120 **** LIBS="-lsocket -lnsl $LIBS" cat > conftest.$ac_ext < conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" --- 3270,3274 ---- ; return 0; } EOF ! if { (eval echo configure:3273: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" *************** *** 3160,3164 **** else echo $ac_n "checking for libnsl""... $ac_c" 1>&6 ! echo "configure:3163: checking for libnsl" >&5 _bash_needmsg=yes fi --- 3303,3307 ---- else echo $ac_n "checking for libnsl""... $ac_c" 1>&6 ! echo "configure:3306: checking for libnsl" >&5 _bash_needmsg=yes fi *************** *** 3167,3171 **** else echo $ac_n "checking for t_open in -lnsl""... $ac_c" 1>&6 ! echo "configure:3170: checking for t_open in -lnsl" >&5 ac_lib_var=`echo nsl'_'t_open | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then --- 3310,3314 ---- else echo $ac_n "checking for t_open in -lnsl""... $ac_c" 1>&6 ! echo "configure:3313: checking for t_open in -lnsl" >&5 ac_lib_var=`echo nsl'_'t_open | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then *************** *** 3175,3179 **** LIBS="-lnsl $LIBS" cat > conftest.$ac_ext < conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" --- 3329,3333 ---- ; return 0; } EOF ! if { (eval echo configure:3332: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" *************** *** 3231,3240 **** echo $ac_n "checking for uid_t in sys/types.h""... $ac_c" 1>&6 ! echo "configure:3234: checking for uid_t in sys/types.h" >&5 if eval "test \"`echo '$''{'ac_cv_type_uid_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < --- 3374,3383 ---- echo $ac_n "checking for uid_t in sys/types.h""... $ac_c" 1>&6 ! echo "configure:3377: checking for uid_t in sys/types.h" >&5 if eval "test \"`echo '$''{'ac_cv_type_uid_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < *************** *** 3265,3269 **** echo $ac_n "checking type of array argument to getgroups""... $ac_c" 1>&6 ! echo "configure:3268: checking type of array argument to getgroups" >&5 if eval "test \"`echo '$''{'ac_cv_type_getgroups'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 --- 3408,3412 ---- echo $ac_n "checking type of array argument to getgroups""... $ac_c" 1>&6 ! echo "configure:3411: checking type of array argument to getgroups" >&5 if eval "test \"`echo '$''{'ac_cv_type_getgroups'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 *************** *** 3273,3277 **** else cat > conftest.$ac_ext < conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null then ac_cv_type_getgroups=gid_t --- 3441,3445 ---- EOF ! if { (eval echo configure:3444: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null then ac_cv_type_getgroups=gid_t *************** *** 3312,3316 **** if test $ac_cv_type_getgroups = cross; then cat > conftest.$ac_ext < --- 3455,3459 ---- if test $ac_cv_type_getgroups = cross; then cat > conftest.$ac_ext < *************** *** 3336,3345 **** echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6 ! echo "configure:3339: checking for ANSI C header files" >&5 if eval "test \"`echo '$''{'ac_cv_header_stdc'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < --- 3479,3488 ---- echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6 ! echo "configure:3482: checking for ANSI C header files" >&5 if eval "test \"`echo '$''{'ac_cv_header_stdc'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < *************** *** 3349,3353 **** EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" ! { (eval echo configure:3352: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then --- 3492,3496 ---- EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" ! { (eval echo configure:3495: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then *************** *** 3366,3370 **** # SunOS 4.x string.h does not declare mem*, contrary to ANSI. cat > conftest.$ac_ext < --- 3509,3513 ---- # SunOS 4.x string.h does not declare mem*, contrary to ANSI. cat > conftest.$ac_ext < *************** *** 3384,3388 **** # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. cat > conftest.$ac_ext < --- 3527,3531 ---- # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. cat > conftest.$ac_ext < *************** *** 3405,3409 **** else cat > conftest.$ac_ext < --- 3548,3552 ---- else cat > conftest.$ac_ext < *************** *** 3416,3420 **** EOF ! if { (eval echo configure:3419: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null then : --- 3559,3563 ---- EOF ! if { (eval echo configure:3562: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null then : *************** *** 3440,3449 **** echo $ac_n "checking for off_t""... $ac_c" 1>&6 ! echo "configure:3443: checking for off_t" >&5 if eval "test \"`echo '$''{'ac_cv_type_off_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < --- 3583,3592 ---- echo $ac_n "checking for off_t""... $ac_c" 1>&6 ! echo "configure:3586: checking for off_t" >&5 if eval "test \"`echo '$''{'ac_cv_type_off_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < *************** *** 3473,3482 **** echo $ac_n "checking for mode_t""... $ac_c" 1>&6 ! echo "configure:3476: checking for mode_t" >&5 if eval "test \"`echo '$''{'ac_cv_type_mode_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < --- 3616,3625 ---- echo $ac_n "checking for mode_t""... $ac_c" 1>&6 ! echo "configure:3619: checking for mode_t" >&5 if eval "test \"`echo '$''{'ac_cv_type_mode_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < *************** *** 3506,3515 **** echo $ac_n "checking for uid_t in sys/types.h""... $ac_c" 1>&6 ! echo "configure:3509: checking for uid_t in sys/types.h" >&5 if eval "test \"`echo '$''{'ac_cv_type_uid_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < --- 3649,3658 ---- echo $ac_n "checking for uid_t in sys/types.h""... $ac_c" 1>&6 ! echo "configure:3652: checking for uid_t in sys/types.h" >&5 if eval "test \"`echo '$''{'ac_cv_type_uid_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < *************** *** 3540,3549 **** echo $ac_n "checking for pid_t""... $ac_c" 1>&6 ! echo "configure:3543: checking for pid_t" >&5 if eval "test \"`echo '$''{'ac_cv_type_pid_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < --- 3683,3692 ---- echo $ac_n "checking for pid_t""... $ac_c" 1>&6 ! echo "configure:3686: checking for pid_t" >&5 if eval "test \"`echo '$''{'ac_cv_type_pid_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < *************** *** 3573,3582 **** echo $ac_n "checking for size_t""... $ac_c" 1>&6 ! echo "configure:3576: checking for size_t" >&5 if eval "test \"`echo '$''{'ac_cv_type_size_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < --- 3716,3725 ---- echo $ac_n "checking for size_t""... $ac_c" 1>&6 ! echo "configure:3719: checking for size_t" >&5 if eval "test \"`echo '$''{'ac_cv_type_size_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < *************** *** 3606,3615 **** echo $ac_n "checking for time_t""... $ac_c" 1>&6 ! echo "configure:3609: checking for time_t" >&5 if eval "test \"`echo '$''{'ac_cv_type_time_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < --- 3749,3758 ---- echo $ac_n "checking for time_t""... $ac_c" 1>&6 ! echo "configure:3752: checking for time_t" >&5 if eval "test \"`echo '$''{'ac_cv_type_time_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < *************** *** 3640,3649 **** echo $ac_n "checking return type of signal handlers""... $ac_c" 1>&6 ! echo "configure:3643: checking return type of signal handlers" >&5 if eval "test \"`echo '$''{'ac_cv_type_signal'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < --- 3783,3792 ---- echo $ac_n "checking return type of signal handlers""... $ac_c" 1>&6 ! echo "configure:3786: checking return type of signal handlers" >&5 if eval "test \"`echo '$''{'ac_cv_type_signal'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < *************** *** 3662,3666 **** ; return 0; } EOF ! if { (eval echo configure:3665: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_type_signal=void --- 3805,3809 ---- ; return 0; } EOF ! if { (eval echo configure:3808: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_type_signal=void *************** *** 3681,3691 **** echo $ac_n "checking whether stat file-mode macros are broken""... $ac_c" 1>&6 ! echo "configure:3685: checking whether stat file-mode macros are broken" >&5 if eval "test \"`echo '$''{'ac_cv_header_stat_broken'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < --- 3824,4251 ---- + echo $ac_n "checking size of int""... $ac_c" 1>&6 + echo "configure:3828: checking size of int" >&5 + if eval "test \"`echo '$''{'ac_cv_sizeof_int'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else + if test "$cross_compiling" = yes; then + { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; } + else + cat > conftest.$ac_ext < + main() + { + FILE *f=fopen("conftestval", "w"); + if (!f) exit(1); + fprintf(f, "%d\n", sizeof(int)); + exit(0); + } + EOF + if { (eval echo configure:3847: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null + then + ac_cv_sizeof_int=`cat conftestval` + else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -fr conftest* + ac_cv_sizeof_int=0 + fi + rm -fr conftest* + fi + + fi + echo "$ac_t""$ac_cv_sizeof_int" 1>&6 + cat >> confdefs.h <&6 + echo "configure:3867: checking size of long" >&5 + if eval "test \"`echo '$''{'ac_cv_sizeof_long'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else + if test "$cross_compiling" = yes; then + { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; } + else + cat > conftest.$ac_ext < + main() + { + FILE *f=fopen("conftestval", "w"); + if (!f) exit(1); + fprintf(f, "%d\n", sizeof(long)); + exit(0); + } + EOF + if { (eval echo configure:3886: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null + then + ac_cv_sizeof_long=`cat conftestval` + else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -fr conftest* + ac_cv_sizeof_long=0 + fi + rm -fr conftest* + fi + + fi + echo "$ac_t""$ac_cv_sizeof_long" 1>&6 + cat >> confdefs.h <&6 + echo "configure:3906: checking size of char *" >&5 + if eval "test \"`echo '$''{'ac_cv_sizeof_char_p'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else + if test "$cross_compiling" = yes; then + { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; } + else + cat > conftest.$ac_ext < + main() + { + FILE *f=fopen("conftestval", "w"); + if (!f) exit(1); + fprintf(f, "%d\n", sizeof(char *)); + exit(0); + } + EOF + if { (eval echo configure:3925: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null + then + ac_cv_sizeof_char_p=`cat conftestval` + else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -fr conftest* + ac_cv_sizeof_char_p=0 + fi + rm -fr conftest* + fi + + fi + echo "$ac_t""$ac_cv_sizeof_char_p" 1>&6 + cat >> confdefs.h <&6 + echo "configure:3946: checking for int32_t" >&5 + if eval "test \"`echo '$''{'ac_cv_type_int32_t'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else + cat > conftest.$ac_ext < + #if STDC_HEADERS + #include + #include + #endif + EOF + if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + egrep "int32_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then + rm -rf conftest* + ac_cv_type_int32_t=yes + else + rm -rf conftest* + ac_cv_type_int32_t=no + fi + rm -f conftest* + + fi + echo "$ac_t""$ac_cv_type_int32_t" 1>&6 + if test $ac_cv_type_int32_t = no; then + cat >> confdefs.h <<\EOF + #define int32_t + EOF + + fi + + if test "$ac_cv_type_int32_t" = "no"; then + + if test "X$bash_cv_type_int32_t" = "X"; then + _bash_needmsg=yes + else + echo $ac_n "checking which builtin C type is 32 bits wide""... $ac_c" 1>&6 + echo "configure:3984: checking which builtin C type is 32 bits wide" >&5 + _bash_needmsg= + fi + if eval "test \"`echo '$''{'bash_cv_type_int32_t'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else + if test "$cross_compiling" = yes; then + { echo "configure: error: cannot check type sizes if cross-compiling -- defaulting to int" 1>&2; exit 1; } + bash_cv_type_int32_t=int + + else + cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null + then + bash_cv_type_int32_t=int + else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -fr conftest* + bash_cv_type_int32_t=long + fi + rm -fr conftest* + fi + + fi + + if test "X$_bash_needmsg" = "Xyes"; then + echo $ac_n "checking which builtin C type is 32 bits wide""... $ac_c" 1>&6 + echo "configure:4028: checking which builtin C type is 32 bits wide" >&5 + fi + echo "$ac_t""$bash_cv_type_int32_t" 1>&6; + if test "$bash_cv_type_int32_t" = "int"; then + cat >> confdefs.h <<\EOF + #define int32_t int + EOF + + else + cat >> confdefs.h <<\EOF + #define int32_t long + EOF + + fi + + fi + echo $ac_n "checking for u_int32_t""... $ac_c" 1>&6 + echo "configure:4045: checking for u_int32_t" >&5 + if eval "test \"`echo '$''{'ac_cv_type_u_int32_t'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else + cat > conftest.$ac_ext < + #if STDC_HEADERS + #include + #include + #endif + EOF + if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + egrep "u_int32_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then + rm -rf conftest* + ac_cv_type_u_int32_t=yes + else + rm -rf conftest* + ac_cv_type_u_int32_t=no + fi + rm -f conftest* + + fi + echo "$ac_t""$ac_cv_type_u_int32_t" 1>&6 + if test $ac_cv_type_u_int32_t = no; then + cat >> confdefs.h <<\EOF + #define u_int32_t + EOF + + fi + + if test "$ac_cv_type_u_int32_t" = "no"; then + + if test "X$bash_cv_type_u_int32_t" = "X"; then + _bash_needmsg=yes + else + echo $ac_n "checking which unsigned builtin C type is 32 bits wide""... $ac_c" 1>&6 + echo "configure:4083: checking which unsigned builtin C type is 32 bits wide" >&5 + _bash_needmsg= + fi + if eval "test \"`echo '$''{'bash_cv_type_u_int32_t'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else + if test "$cross_compiling" = yes; then + { echo "configure: error: cannot check type sizes if cross-compiling -- defaulting to int" 1>&2; exit 1; } + bash_cv_type_u_int32_t=int + + else + cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null + then + bash_cv_type_u_int32_t=int + else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -fr conftest* + bash_cv_type_u_int32_t=long + fi + rm -fr conftest* + fi + + fi + + if test "X$_bash_needmsg" = "Xyes"; then + echo $ac_n "checking which unsigned builtin C type is 32 bits wide""... $ac_c" 1>&6 + echo "configure:4127: checking which unsigned builtin C type is 32 bits wide" >&5 + fi + echo "$ac_t""$bash_cv_type_u_int32_t" 1>&6; + if test "$bash_cv_type_u_int32_t" = "int"; then + cat >> confdefs.h <<\EOF + #define u_int32_t unsigned int + EOF + + else + cat >> confdefs.h <<\EOF + #define u_int32_t unsigned long + EOF + + fi + + fi + + echo $ac_n "checking for ptrdiff_t""... $ac_c" 1>&6 + echo "configure:4145: checking for ptrdiff_t" >&5 + if eval "test \"`echo '$''{'ac_cv_type_ptrdiff_t'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else + cat > conftest.$ac_ext < + #if STDC_HEADERS + #include + #include + #endif + EOF + if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + egrep "ptrdiff_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then + rm -rf conftest* + ac_cv_type_ptrdiff_t=yes + else + rm -rf conftest* + ac_cv_type_ptrdiff_t=no + fi + rm -f conftest* + + fi + echo "$ac_t""$ac_cv_type_ptrdiff_t" 1>&6 + if test $ac_cv_type_ptrdiff_t = no; then + cat >> confdefs.h <<\EOF + #define ptrdiff_t + EOF + + fi + + if test "$ac_cv_type_ptrdiff_t" = "no"; then + + if test "X$bash_cv_type_ptrdiff_t" = "X"; then + _bash_needmsg=yes + else + echo $ac_n "checking which builtin C type is correct for ptrdiff_t""... $ac_c" 1>&6 + echo "configure:4183: checking which builtin C type is correct for ptrdiff_t" >&5 + _bash_needmsg= + fi + if eval "test \"`echo '$''{'bash_cv_type_ptrdiff_t'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else + if test "$cross_compiling" = yes; then + { echo "configure: error: cannot check type sizes if cross-compiling -- defaulting to int" 1>&2; exit 1; } + bash_cv_type_ptrdiff_t=int + + else + cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null + then + bash_cv_type_ptrdiff_t=int + else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -fr conftest* + bash_cv_type_ptrdiff_t=long + fi + rm -fr conftest* + fi + + fi + + if test "X$_bash_needmsg" = "Xyes"; then + echo $ac_n "checking which builtin C type is correct for ptrdiff_t""... $ac_c" 1>&6 + echo "configure:4227: checking which builtin C type is correct for ptrdiff_t" >&5 + fi + echo "$ac_t""$bash_cv_type_ptrdiff_t" 1>&6; + if test "$bash_cv_type_ptrdiff_t" = "int"; then + cat >> confdefs.h <<\EOF + #define ptrdiff_t int + EOF + + else + cat >> confdefs.h <<\EOF + #define ptrdiff_t long + EOF + + fi + + fi + echo $ac_n "checking whether stat file-mode macros are broken""... $ac_c" 1>&6 ! echo "configure:4245: checking whether stat file-mode macros are broken" >&5 if eval "test \"`echo '$''{'ac_cv_header_stat_broken'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < *************** *** 3738,3742 **** cat > conftest.$ac_ext < --- 4298,4302 ---- cat > conftest.$ac_ext < *************** *** 3751,3755 **** if test -z "$bash_cv_struct_timeval"; then cat > conftest.$ac_ext < --- 4311,4315 ---- if test -z "$bash_cv_struct_timeval"; then cat > conftest.$ac_ext < *************** *** 3774,3778 **** echo $ac_n "checking whether byte ordering is bigendian""... $ac_c" 1>&6 ! echo "configure:3777: checking whether byte ordering is bigendian" >&5 if eval "test \"`echo '$''{'ac_cv_c_bigendian'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 --- 4334,4338 ---- echo $ac_n "checking whether byte ordering is bigendian""... $ac_c" 1>&6 ! echo "configure:4337: checking whether byte ordering is bigendian" >&5 if eval "test \"`echo '$''{'ac_cv_c_bigendian'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 *************** *** 3781,3785 **** # See if sys/param.h defines the BYTE_ORDER macro. cat > conftest.$ac_ext < --- 4341,4345 ---- # See if sys/param.h defines the BYTE_ORDER macro. cat > conftest.$ac_ext < *************** *** 3792,3800 **** ; return 0; } EOF ! if { (eval echo configure:3795: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* # It does; now see whether it defined to BIG_ENDIAN or not. cat > conftest.$ac_ext < --- 4352,4360 ---- ; return 0; } EOF ! if { (eval echo configure:4355: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* # It does; now see whether it defined to BIG_ENDIAN or not. cat > conftest.$ac_ext < *************** *** 3807,3811 **** ; return 0; } EOF ! if { (eval echo configure:3810: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_c_bigendian=yes --- 4367,4371 ---- ; return 0; } EOF ! if { (eval echo configure:4370: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_c_bigendian=yes *************** *** 3827,3831 **** else cat > conftest.$ac_ext < conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null then ac_cv_c_bigendian=no --- 4400,4404 ---- } EOF ! if { (eval echo configure:4403: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null then ac_cv_c_bigendian=no *************** *** 3867,3871 **** ac_msg="whether #! works in shell scripts" echo $ac_n "checking $ac_msg""... $ac_c" 1>&6 ! echo "configure:3870: checking $ac_msg" >&5 if eval "test \"`echo '$''{'ac_cv_sys_interpreter'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 --- 4427,4431 ---- ac_msg="whether #! works in shell scripts" echo $ac_n "checking $ac_msg""... $ac_c" 1>&6 ! echo "configure:4430: checking $ac_msg" >&5 if eval "test \"`echo '$''{'ac_cv_sys_interpreter'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 *************** *** 3893,3897 **** fi echo $ac_n "checking for restartable system calls""... $ac_c" 1>&6 ! echo "configure:3896: checking for restartable system calls" >&5 if eval "test \"`echo '$''{'ac_cv_sys_restartable_syscalls'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 --- 4453,4457 ---- fi echo $ac_n "checking for restartable system calls""... $ac_c" 1>&6 ! echo "configure:4456: checking for restartable system calls" >&5 if eval "test \"`echo '$''{'ac_cv_sys_restartable_syscalls'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 *************** *** 3901,3905 **** else cat > conftest.$ac_ext < conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null then ac_cv_sys_restartable_syscalls=yes --- 4479,4483 ---- EOF ! if { (eval echo configure:4482: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null then ac_cv_sys_restartable_syscalls=yes *************** *** 3944,3953 **** if test "$ac_cv_func_lstat" = "no"; then echo $ac_n "checking for lstat""... $ac_c" 1>&6 ! echo "configure:3947: checking for lstat" >&5 if eval "test \"`echo '$''{'bash_cv_func_lstat'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&6 ! echo "configure:4507: checking for lstat" >&5 if eval "test \"`echo '$''{'bash_cv_func_lstat'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* bash_cv_func_lstat=yes --- 4516,4523 ---- int main() { ! lstat(".",(struct stat *)0); ; return 0; } EOF ! if { (eval echo configure:4522: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* bash_cv_func_lstat=yes *************** *** 3982,3994 **** echo $ac_n "checking if dup2 fails to clear the close-on-exec flag""... $ac_c" 1>&6 ! echo "configure:3985: checking if dup2 fails to clear the close-on-exec flag" >&5 if eval "test \"`echo '$''{'bash_cv_dup2_broken'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else if test "$cross_compiling" = yes; then ! { echo "configure: error: cannot check dup2 if cross compiling" 1>&2; exit 1; } else cat > conftest.$ac_ext <&6 ! echo "configure:4545: checking if dup2 fails to clear the close-on-exec flag" >&5 if eval "test \"`echo '$''{'bash_cv_dup2_broken'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else if test "$cross_compiling" = yes; then ! { echo "configure: error: cannot check dup2 if cross compiling -- defaulting to no" 1>&2; exit 1; } ! bash_cv_dup2_broken=no else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null then bash_cv_dup2_broken=yes --- 4571,4575 ---- EOF ! if { (eval echo configure:4574: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null then bash_cv_dup2_broken=yes *************** *** 4035,4047 **** echo $ac_n "checking whether pgrps need synchronization""... $ac_c" 1>&6 ! echo "configure:4038: checking whether pgrps need synchronization" >&5 if eval "test \"`echo '$''{'bash_cv_pgrp_pipe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else if test "$cross_compiling" = yes; then ! { echo "configure: error: cannot check pgrp synchronization if cross compiling" 1>&2; exit 1; } else cat > conftest.$ac_ext <&6 ! echo "configure:4599: checking whether pgrps need synchronization" >&5 if eval "test \"`echo '$''{'bash_cv_pgrp_pipe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else if test "$cross_compiling" = yes; then ! { echo "configure: error: cannot check pgrp synchronization if cross compiling -- defaulting to no" 1>&2; exit 1; } ! bash_cv_pgrp_pipe=no else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null then bash_cv_pgrp_pipe=no --- 4657,4661 ---- EOF ! if { (eval echo configure:4660: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null then bash_cv_pgrp_pipe=no *************** *** 4120,4124 **** echo $ac_n "checking for type of signal functions""... $ac_c" 1>&6 ! echo "configure:4123: checking for type of signal functions" >&5 if eval "test \"`echo '$''{'bash_cv_signal_vintage'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 --- 4682,4686 ---- echo $ac_n "checking for type of signal functions""... $ac_c" 1>&6 ! echo "configure:4685: checking for type of signal functions" >&5 if eval "test \"`echo '$''{'bash_cv_signal_vintage'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 *************** *** 4126,4130 **** cat > conftest.$ac_ext < --- 4688,4692 ---- cat > conftest.$ac_ext < *************** *** 4139,4143 **** ; return 0; } EOF ! if { (eval echo configure:4142: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* bash_cv_signal_vintage=posix --- 4701,4705 ---- ; return 0; } EOF ! if { (eval echo configure:4704: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* bash_cv_signal_vintage=posix *************** *** 4148,4152 **** cat > conftest.$ac_ext < --- 4710,4714 ---- cat > conftest.$ac_ext < *************** *** 4158,4162 **** ; return 0; } EOF ! if { (eval echo configure:4161: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* bash_cv_signal_vintage=4.2bsd --- 4720,4724 ---- ; return 0; } EOF ! if { (eval echo configure:4723: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* bash_cv_signal_vintage=4.2bsd *************** *** 4167,4171 **** cat > conftest.$ac_ext < conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* bash_cv_signal_vintage=svr3 --- 4742,4746 ---- ; return 0; } EOF ! if { (eval echo configure:4745: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* bash_cv_signal_vintage=svr3 *************** *** 4219,4229 **** echo $ac_n "checking for sys_errlist and sys_nerr""... $ac_c" 1>&6 ! echo "configure:4223: checking for sys_errlist and sys_nerr" >&5 if eval "test \"`echo '$''{'bash_cv_sys_errlist'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < --- 4781,4861 ---- + if test "$ac_cv_sys_restartable_syscalls" = "no"; then + + echo $ac_n "checking for restartable system calls with posix sigaction""... $ac_c" 1>&6 + echo "configure:4787: checking for restartable system calls with posix sigaction" >&5 + if eval "test \"`echo '$''{'bash_cv_sys_restartable_syscalls'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else + if test "$cross_compiling" = yes; then + { echo "configure: error: cannot check restartable syscalls if cross compiling" 1>&2; exit 1; } + else + cat > conftest.$ac_ext < + #include + static int caught = 0; + void ucatch (isig) int isig; { caught = 1; } + main () + { + #if !defined (_POSIX_VERSION) || !defined (HAVE_POSIX_SIGNALS) + exit (1); + #else + struct sigaction act, oact; + int i, status; + + act.sa_handler = ucatch; + /* Might want to add SA_RESTART here, but bash's set_signal_handler + does not. */ + act.sa_flags = 0; + sigemptyset(&act.sa_mask); + sigemptyset(&oact.sa_mask); + i = fork (); + /* A possible race condition here, but in practice it never happens. */ + if (i == 0) { sleep (3); kill (getppid (), SIGINT); sleep (3); exit (0); } + sigaction(SIGINT, &act, &oact); + status = wait(&i); + if (status == -1) wait(&i); + exit (status == -1); + #endif + } + + EOF + if { (eval echo configure:4829: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null + then + bash_cv_sys_restartable_syscalls=yes + else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -fr conftest* + bash_cv_sys_restartable_syscalls=no + fi + rm -fr conftest* + fi + + + fi + + echo "$ac_t""$bash_cv_sys_restartable_syscalls" 1>&6 + if test $bash_cv_sys_restartable_syscalls = yes; then + cat >> confdefs.h <<\EOF + #define HAVE_RESTARTABLE_SYSCALLS 1 + EOF + + fi + + fi + echo $ac_n "checking for sys_errlist and sys_nerr""... $ac_c" 1>&6 ! echo "configure:4855: checking for sys_errlist and sys_nerr" >&5 if eval "test \"`echo '$''{'bash_cv_sys_errlist'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < *************** *** 4234,4238 **** ; return 0; } EOF ! if { (eval echo configure:4237: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* bash_cv_sys_errlist=yes --- 4866,4870 ---- ; return 0; } EOF ! if { (eval echo configure:4869: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* bash_cv_sys_errlist=yes *************** *** 4255,4267 **** echo $ac_n "checking for sys_siglist in system C library""... $ac_c" 1>&6 ! echo "configure:4258: checking for sys_siglist in system C library" >&5 if eval "test \"`echo '$''{'bash_cv_sys_siglist'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else if test "$cross_compiling" = yes; then ! { echo "configure: error: cannot check for sys_siglist if cross compiling" 1>&2; exit 1; } else cat > conftest.$ac_ext <&6 ! echo "configure:4890: checking for sys_siglist in system C library" >&5 if eval "test \"`echo '$''{'bash_cv_sys_siglist'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else if test "$cross_compiling" = yes; then ! { echo "configure: error: cannot check for sys_siglist if cross compiling -- defaulting to no" 1>&2; exit 1; } ! bash_cv_sys_siglist=no else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null then bash_cv_sys_siglist=yes --- 4913,4917 ---- } EOF ! if { (eval echo configure:4916: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null then bash_cv_sys_siglist=yes *************** *** 4293,4296 **** --- 4926,4930 ---- fi + echo "$ac_t""$bash_cv_sys_siglist" 1>&6 if test $bash_cv_sys_siglist = yes; then *************** *** 4302,4311 **** echo $ac_n "checking for _sys_siglist in signal.h or unistd.h""... $ac_c" 1>&6 ! echo "configure:4305: checking for _sys_siglist in signal.h or unistd.h" >&5 if eval "test \"`echo '$''{'bash_cv_decl_under_sys_siglist'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&6 ! echo "configure:4939: checking for _sys_siglist in signal.h or unistd.h" >&5 if eval "test \"`echo '$''{'bash_cv_decl_under_sys_siglist'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bash_cv_decl_under_sys_siglist=yes --- 4953,4957 ---- ; return 0; } EOF ! if { (eval echo configure:4956: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bash_cv_decl_under_sys_siglist=yes *************** *** 4340,4352 **** echo $ac_n "checking for _sys_siglist in system C library""... $ac_c" 1>&6 ! echo "configure:4343: checking for _sys_siglist in system C library" >&5 if eval "test \"`echo '$''{'bash_cv_under_sys_siglist'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else if test "$cross_compiling" = yes; then ! { echo "configure: error: cannot check for _sys_siglist if cross compiling" 1>&2; exit 1; } else cat > conftest.$ac_ext <&6 ! echo "configure:4977: checking for _sys_siglist in system C library" >&5 if eval "test \"`echo '$''{'bash_cv_under_sys_siglist'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else if test "$cross_compiling" = yes; then ! { echo "configure: error: cannot check for _sys_siglist if cross compiling -- defaulting to no" 1>&2; exit 1; } ! bash_cv_under_sys_siglist=no else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null then bash_cv_under_sys_siglist=yes --- 5000,5004 ---- } EOF ! if { (eval echo configure:5003: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null then bash_cv_under_sys_siglist=yes *************** *** 4378,4381 **** --- 5013,5017 ---- fi + echo "$ac_t""$bash_cv_under_sys_siglist" 1>&6 if test $bash_cv_under_sys_siglist = yes; then *************** *** 4388,4397 **** echo $ac_n "checking whether signal handlers are of type void""... $ac_c" 1>&6 ! echo "configure:4391: checking whether signal handlers are of type void" >&5 if eval "test \"`echo '$''{'bash_cv_void_sighandler'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < --- 5024,5033 ---- echo $ac_n "checking whether signal handlers are of type void""... $ac_c" 1>&6 ! echo "configure:5027: checking whether signal handlers are of type void" >&5 if eval "test \"`echo '$''{'bash_cv_void_sighandler'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < *************** *** 4408,4412 **** ; return 0; } EOF ! if { (eval echo configure:4411: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bash_cv_void_sighandler=yes --- 5044,5048 ---- ; return 0; } EOF ! if { (eval echo configure:5047: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bash_cv_void_sighandler=yes *************** *** 4428,4437 **** echo $ac_n "checking for clock_t""... $ac_c" 1>&6 ! echo "configure:4431: checking for clock_t" >&5 if eval "test \"`echo '$''{'bash_cv_type_clock_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < --- 5064,5073 ---- echo $ac_n "checking for clock_t""... $ac_c" 1>&6 ! echo "configure:5067: checking for clock_t" >&5 if eval "test \"`echo '$''{'bash_cv_type_clock_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < *************** *** 4464,4473 **** echo $ac_n "checking for sigset_t""... $ac_c" 1>&6 ! echo "configure:4467: checking for sigset_t" >&5 if eval "test \"`echo '$''{'bash_cv_type_sigset_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < --- 5100,5109 ---- echo $ac_n "checking for sigset_t""... $ac_c" 1>&6 ! echo "configure:5103: checking for sigset_t" >&5 if eval "test \"`echo '$''{'bash_cv_type_sigset_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < *************** *** 4500,4509 **** echo $ac_n "checking for quad_t""... $ac_c" 1>&6 ! echo "configure:4503: checking for quad_t" >&5 if eval "test \"`echo '$''{'bash_cv_type_quad_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < --- 5136,5145 ---- echo $ac_n "checking for quad_t""... $ac_c" 1>&6 ! echo "configure:5139: checking for quad_t" >&5 if eval "test \"`echo '$''{'bash_cv_type_quad_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < *************** *** 4541,4557 **** echo $ac_n "checking for size and type of struct rlimit fields""... $ac_c" 1>&6 ! echo "configure:4544: checking for size and type of struct rlimit fields" >&5 if eval "test \"`echo '$''{'bash_cv_type_rlimit'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < int main() { rlim_t xxx; ; return 0; } EOF ! if { (eval echo configure:4556: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bash_cv_type_rlimit=rlim_t --- 5177,5194 ---- echo $ac_n "checking for size and type of struct rlimit fields""... $ac_c" 1>&6 ! echo "configure:5180: checking for size and type of struct rlimit fields" >&5 if eval "test \"`echo '$''{'bash_cv_type_rlimit'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < + #include int main() { rlim_t xxx; ; return 0; } EOF ! if { (eval echo configure:5193: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bash_cv_type_rlimit=rlim_t *************** *** 4562,4569 **** if test "$cross_compiling" = yes; then ! { echo "configure: error: cannot check quad_t if cross compiling" 1>&2; exit 1; } else cat > conftest.$ac_ext <&2; exit 1; } ! bash_cv_type_rlimit=long else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null then bash_cv_type_rlimit=quad_t --- 5219,5223 ---- } EOF ! if { (eval echo configure:5222: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null then bash_cv_type_rlimit=quad_t *************** *** 4613,4622 **** echo $ac_n "checking for a c_line member of struct termios""... $ac_c" 1>&6 ! echo "configure:4616: checking for a c_line member of struct termios" >&5 if eval "test \"`echo '$''{'bash_cv_termios_ldisc'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < --- 5251,5260 ---- echo $ac_n "checking for a c_line member of struct termios""... $ac_c" 1>&6 ! echo "configure:5254: checking for a c_line member of struct termios" >&5 if eval "test \"`echo '$''{'bash_cv_termios_ldisc'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < *************** *** 4626,4630 **** ; return 0; } EOF ! if { (eval echo configure:4629: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bash_cv_termios_ldisc=yes --- 5264,5268 ---- ; return 0; } EOF ! if { (eval echo configure:5267: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bash_cv_termios_ldisc=yes *************** *** 4646,4655 **** echo $ac_n "checking for a c_line member of struct termio""... $ac_c" 1>&6 ! echo "configure:4649: checking for a c_line member of struct termio" >&5 if eval "test \"`echo '$''{'bash_cv_termio_ldisc'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < --- 5284,5293 ---- echo $ac_n "checking for a c_line member of struct termio""... $ac_c" 1>&6 ! echo "configure:5287: checking for a c_line member of struct termio" >&5 if eval "test \"`echo '$''{'bash_cv_termio_ldisc'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < *************** *** 4659,4663 **** ; return 0; } EOF ! if { (eval echo configure:4662: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bash_cv_termio_ldisc=yes --- 5297,5301 ---- ; return 0; } EOF ! if { (eval echo configure:5300: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bash_cv_termio_ldisc=yes *************** *** 4680,4689 **** echo $ac_n "checking if struct dirent has a d_ino member""... $ac_c" 1>&6 ! echo "configure:4683: checking if struct dirent has a d_ino member" >&5 if eval "test \"`echo '$''{'bash_cv_dirent_has_dino'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&6 ! echo "configure:5321: checking if struct dirent has a d_ino member" >&5 if eval "test \"`echo '$''{'bash_cv_dirent_has_dino'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bash_cv_dirent_has_dino=yes --- 5352,5356 ---- ; return 0; } EOF ! if { (eval echo configure:5355: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bash_cv_dirent_has_dino=yes *************** *** 4736,4745 **** echo $ac_n "checking if struct dirent has a d_fileno member""... $ac_c" 1>&6 ! echo "configure:4739: checking if struct dirent has a d_fileno member" >&5 if eval "test \"`echo '$''{'bash_cv_dirent_has_d_fileno'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&6 ! echo "configure:5377: checking if struct dirent has a d_fileno member" >&5 if eval "test \"`echo '$''{'bash_cv_dirent_has_d_fileno'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bash_cv_dirent_has_d_fileno=yes --- 5408,5412 ---- ; return 0; } EOF ! if { (eval echo configure:5411: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bash_cv_dirent_has_d_fileno=yes *************** *** 4790,4800 **** fi ! echo $ac_n "checking for struct winsize in sys/ioctl.h""... $ac_c" 1>&6 ! echo "configure:4794: checking for struct winsize in sys/ioctl.h" >&5 ! if eval "test \"`echo '$''{'bash_cv_struct_winsize_in_ioctl'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < --- 5428,5438 ---- fi ! echo $ac_n "checking for struct winsize in sys/ioctl.h and termios.h""... $ac_c" 1>&6 ! echo "configure:5432: checking for struct winsize in sys/ioctl.h and termios.h" >&5 ! if eval "test \"`echo '$''{'bash_cv_struct_winsize_header'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < *************** *** 4804,4835 **** ; return 0; } EOF ! if { (eval echo configure:4807: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ! bash_cv_struct_winsize_in_ioctl=yes else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* ! bash_cv_struct_winsize_in_ioctl=no fi rm -f conftest* fi ! echo "$ac_t""$bash_cv_struct_winsize_in_ioctl" 1>&6 ! if test $bash_cv_struct_winsize_in_ioctl = yes; then ! cat >> confdefs.h <<\EOF #define STRUCT_WINSIZE_IN_SYS_IOCTL 1 EOF fi ! echo $ac_n "checking for the existance of strsignal""... $ac_c" 1>&6 ! echo "configure:4829: checking for the existance of strsignal" >&5 if eval "test \"`echo '$''{'bash_cv_have_strsignal'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < --- 5442,5500 ---- ; return 0; } EOF ! if { (eval echo configure:5445: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then ! rm -rf conftest* ! bash_cv_struct_winsize_header=ioctl_h ! else ! echo "configure: failed program was:" >&5 ! cat conftest.$ac_ext >&5 ! rm -rf conftest* ! cat > conftest.$ac_ext < ! #include ! int main() { ! struct winsize x; ! ; return 0; } ! EOF ! if { (eval echo configure:5461: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ! bash_cv_struct_winsize_header=termios_h else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* ! bash_cv_struct_winsize_header=other ! fi ! rm -f conftest* ! fi rm -f conftest* fi ! if test $bash_cv_struct_winsize_header = ioctl_h; then ! echo "$ac_t""sys/ioctl.h" 1>&6 ! cat >> confdefs.h <<\EOF #define STRUCT_WINSIZE_IN_SYS_IOCTL 1 EOF + elif test $bash_cv_struct_winsize_header = termios_h; then + echo "$ac_t""termios.h" 1>&6 + cat >> confdefs.h <<\EOF + #define STRUCT_WINSIZE_IN_TERMIOS 1 + EOF + + else + echo "$ac_t""not found" 1>&6 fi ! echo $ac_n "checking for the existence of strsignal""... $ac_c" 1>&6 ! echo "configure:5494: checking for the existence of strsignal" >&5 if eval "test \"`echo '$''{'bash_cv_have_strsignal'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < *************** *** 4839,4843 **** ; return 0; } EOF ! if { (eval echo configure:4842: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* bash_cv_have_strsignal=yes --- 5504,5508 ---- ; return 0; } EOF ! if { (eval echo configure:5507: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* bash_cv_have_strsignal=yes *************** *** 4860,4872 **** echo $ac_n "checking if opendir() opens non-directories""... $ac_c" 1>&6 ! echo "configure:4863: checking if opendir() opens non-directories" >&5 if eval "test \"`echo '$''{'bash_cv_opendir_not_robust'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else if test "$cross_compiling" = yes; then ! { echo "configure: error: cannot check opendir if cross compiling" 1>&2; exit 1; } else cat > conftest.$ac_ext <&6 ! echo "configure:5528: checking if opendir() opens non-directories" >&5 if eval "test \"`echo '$''{'bash_cv_opendir_not_robust'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else if test "$cross_compiling" = yes; then ! { echo "configure: error: cannot check opendir if cross compiling -- defaulting to no" 1>&2; exit 1; } ! bash_cv_opendir_not_robust=no ! else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null then bash_cv_opendir_not_robust=yes --- 5571,5575 ---- } EOF ! if { (eval echo configure:5574: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null then bash_cv_opendir_not_robust=yes *************** *** 4927,4939 **** echo $ac_n "checking for declaration of printf in ""... $ac_c" 1>&6 ! echo "configure:4930: checking for declaration of printf in " >&5 if eval "test \"`echo '$''{'bash_cv_printf_declared'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else if test "$cross_compiling" = yes; then ! { echo "configure: error: cannot check printf declaration if cross compiling" 1>&2; exit 1; } else cat > conftest.$ac_ext <""... $ac_c" 1>&6 ! echo "configure:5597: checking for declaration of printf in " >&5 if eval "test \"`echo '$''{'bash_cv_printf_declared'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else if test "$cross_compiling" = yes; then ! { echo "configure: error: cannot check printf declaration if cross compiling -- defaulting to yes" 1>&2; exit 1; } ! bash_cv_printf_declared=yes ! else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null then bash_cv_printf_declared=yes --- 5621,5625 ---- EOF ! if { (eval echo configure:5624: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null then bash_cv_printf_declared=yes *************** *** 4975,4987 **** echo $ac_n "checking whether ulimit can substitute for getdtablesize""... $ac_c" 1>&6 ! echo "configure:4978: checking whether ulimit can substitute for getdtablesize" >&5 if eval "test \"`echo '$''{'bash_cv_ulimit_maxfds'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else if test "$cross_compiling" = yes; then ! { echo "configure: error: cannot check ulimit if cross compiling" 1>&2; exit 1; } else cat > conftest.$ac_ext <&6 ! echo "configure:5647: checking whether ulimit can substitute for getdtablesize" >&5 if eval "test \"`echo '$''{'bash_cv_ulimit_maxfds'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else if test "$cross_compiling" = yes; then ! { echo "configure: error: cannot check ulimit if cross compiling -- defaulting to no" 1>&2; exit 1; } ! bash_cv_ulimit_maxfds=no ! else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null then bash_cv_ulimit_maxfds=yes --- 5664,5668 ---- EOF ! if { (eval echo configure:5667: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null then bash_cv_ulimit_maxfds=yes *************** *** 5016,5028 **** echo $ac_n "checking to see if getenv can be redefined""... $ac_c" 1>&6 ! echo "configure:5019: checking to see if getenv can be redefined" >&5 if eval "test \"`echo '$''{'bash_cv_getenv_redef'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else if test "$cross_compiling" = yes; then ! { echo "configure: error: cannot check getenv redefinition if cross compiling" 1>&2; exit 1; } else cat > conftest.$ac_ext <&6 ! echo "configure:5690: checking to see if getenv can be redefined" >&5 if eval "test \"`echo '$''{'bash_cv_getenv_redef'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else if test "$cross_compiling" = yes; then ! { echo "configure: error: cannot check getenv redefinition if cross compiling -- defaulting to yes" 1>&2; exit 1; } ! bash_cv_getenv_redef=yes ! else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null then bash_cv_getenv_redef=yes --- 5732,5736 ---- EOF ! if { (eval echo configure:5735: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null then bash_cv_getenv_redef=yes *************** *** 5082,5094 **** echo $ac_n "checking if getcwd() calls popen()""... $ac_c" 1>&6 ! echo "configure:5085: checking if getcwd() calls popen()" >&5 if eval "test \"`echo '$''{'bash_cv_getcwd_calls_popen'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else if test "$cross_compiling" = yes; then ! { echo "configure: error: cannot check whether getcwd calls popen if cross compiling" 1>&2; exit 1; } else cat > conftest.$ac_ext <&6 ! echo "configure:5758: checking if getcwd() calls popen()" >&5 if eval "test \"`echo '$''{'bash_cv_getcwd_calls_popen'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else if test "$cross_compiling" = yes; then ! { echo "configure: error: cannot check whether getcwd calls popen if cross compiling -- defaulting to no" 1>&2; exit 1; } ! bash_cv_getcwd_calls_popen=no ! else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null then bash_cv_getcwd_calls_popen=no --- 5820,5824 ---- EOF ! if { (eval echo configure:5823: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null then bash_cv_getcwd_calls_popen=no *************** *** 5168,5177 **** echo $ac_n "checking for declaration of sbrk in ""... $ac_c" 1>&6 ! echo "configure:5171: checking for declaration of sbrk in " >&5 if eval "test \"`echo '$''{'bash_cv_sbrk_declared'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < --- 5843,5852 ---- echo $ac_n "checking for declaration of sbrk in ""... $ac_c" 1>&6 ! echo "configure:5846: checking for declaration of sbrk in " >&5 if eval "test \"`echo '$''{'bash_cv_sbrk_declared'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < *************** *** 5199,5211 **** echo $ac_n "checking for presence of POSIX-style sigsetjmp/siglongjmp""... $ac_c" 1>&6 ! echo "configure:5202: checking for presence of POSIX-style sigsetjmp/siglongjmp" >&5 if eval "test \"`echo '$''{'bash_cv_func_sigsetjmp'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else if test "$cross_compiling" = yes; then ! { echo "configure: error: cannot check for sigsetjmp/siglongjmp if cross-compiling" 1>&2; exit 1; } else cat > conftest.$ac_ext <&6 ! echo "configure:5877: checking for presence of POSIX-style sigsetjmp/siglongjmp" >&5 if eval "test \"`echo '$''{'bash_cv_func_sigsetjmp'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else if test "$cross_compiling" = yes; then ! { echo "configure: error: cannot check for sigsetjmp/siglongjmp if cross-compiling -- defaulting to missing" 1>&2; exit 1; } ! bash_cv_func_sigsetjmp=missing ! else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null then bash_cv_func_sigsetjmp=present --- 5925,5929 ---- } EOF ! if { (eval echo configure:5928: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null then bash_cv_func_sigsetjmp=present *************** *** 5260,5264 **** fi - fi --- 5937,5940 ---- *************** *** 5273,5285 **** echo $ac_n "checking whether or not strcoll and strcmp differ""... $ac_c" 1>&6 ! echo "configure:5276: checking whether or not strcoll and strcmp differ" >&5 if eval "test \"`echo '$''{'bash_cv_func_strcoll_broken'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else if test "$cross_compiling" = yes; then ! { echo "configure: error: cannot check strcoll if cross compiling" 1>&2; exit 1; } else cat > conftest.$ac_ext <&6 ! echo "configure:5952: checking whether or not strcoll and strcmp differ" >&5 if eval "test \"`echo '$''{'bash_cv_func_strcoll_broken'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else if test "$cross_compiling" = yes; then ! { echo "configure: error: cannot check strcoll if cross compiling -- defaulting to no" 1>&2; exit 1; } ! bash_cv_func_strcoll_broken=no ! else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null then bash_cv_func_strcoll_broken=yes --- 5998,6002 ---- EOF ! if { (eval echo configure:6001: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null then bash_cv_func_strcoll_broken=yes *************** *** 5332,5336 **** fi - fi --- 6010,6013 ---- *************** *** 5347,5359 **** echo $ac_n "checking if signal handlers must be reinstalled when invoked""... $ac_c" 1>&6 ! echo "configure:5350: checking if signal handlers must be reinstalled when invoked" >&5 if eval "test \"`echo '$''{'bash_cv_must_reinstall_sighandlers'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else if test "$cross_compiling" = yes; then ! { echo "configure: error: cannot check signal handling if cross compiling" 1>&2; exit 1; } else cat > conftest.$ac_ext <&6 ! echo "configure:6027: checking if signal handlers must be reinstalled when invoked" >&5 if eval "test \"`echo '$''{'bash_cv_must_reinstall_sighandlers'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else if test "$cross_compiling" = yes; then ! { echo "configure: error: cannot check signal handling if cross compiling -- defaulting to no" 1>&2; exit 1; } ! bash_cv_must_reinstall_sighandlers=no ! else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null then bash_cv_must_reinstall_sighandlers=no --- 6081,6085 ---- EOF ! if { (eval echo configure:6084: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null then bash_cv_must_reinstall_sighandlers=no *************** *** 5426,5438 **** echo $ac_n "checking for presence of necessary job control definitions""... $ac_c" 1>&6 ! echo "configure:5429: checking for presence of necessary job control definitions" >&5 if eval "test \"`echo '$''{'bash_cv_job_control_missing'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else if test "$cross_compiling" = yes; then ! { echo "configure: error: cannot check job control if cross-compiling" 1>&2; exit 1; } else cat > conftest.$ac_ext <&6 ! echo "configure:6108: checking for presence of necessary job control definitions" >&5 if eval "test \"`echo '$''{'bash_cv_job_control_missing'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else if test "$cross_compiling" = yes; then ! { echo "configure: error: cannot check job control if cross-compiling -- defaulting to missing" 1>&2; exit 1; } ! bash_cv_job_control_missing=missing ! else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null then bash_cv_job_control_missing=present --- 6162,6166 ---- } EOF ! if { (eval echo configure:6165: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null then bash_cv_job_control_missing=present *************** *** 5493,5497 **** fi - fi --- 6174,6177 ---- *************** *** 5505,5517 **** echo $ac_n "checking for presence of named pipes""... $ac_c" 1>&6 ! echo "configure:5508: checking for presence of named pipes" >&5 if eval "test \"`echo '$''{'bash_cv_sys_named_pipes'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else if test "$cross_compiling" = yes; then ! { echo "configure: error: cannot check for named pipes if cross-compiling" 1>&2; exit 1; } else cat > conftest.$ac_ext <&6 ! echo "configure:6188: checking for presence of named pipes" >&5 if eval "test \"`echo '$''{'bash_cv_sys_named_pipes'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else if test "$cross_compiling" = yes; then ! { echo "configure: error: cannot check for named pipes if cross-compiling -- defaulting to missing" 1>&2; exit 1; } ! bash_cv_sys_named_pipes=missing ! else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null then bash_cv_sys_named_pipes=present --- 6229,6233 ---- } EOF ! if { (eval echo configure:6232: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null then bash_cv_sys_named_pipes=present *************** *** 5559,5563 **** fi - fi --- 6241,6244 ---- *************** *** 5572,5581 **** echo $ac_n "checking for TIOCGWINSZ in sys/ioctl.h""... $ac_c" 1>&6 ! echo "configure:5575: checking for TIOCGWINSZ in sys/ioctl.h" >&5 if eval "test \"`echo '$''{'bash_cv_tiocgwinsz_in_ioctl'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < --- 6253,6262 ---- echo $ac_n "checking for TIOCGWINSZ in sys/ioctl.h""... $ac_c" 1>&6 ! echo "configure:6256: checking for TIOCGWINSZ in sys/ioctl.h" >&5 if eval "test \"`echo '$''{'bash_cv_tiocgwinsz_in_ioctl'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < *************** *** 5585,5589 **** ; return 0; } EOF ! if { (eval echo configure:5588: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bash_cv_tiocgwinsz_in_ioctl=yes --- 6266,6270 ---- ; return 0; } EOF ! if { (eval echo configure:6269: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bash_cv_tiocgwinsz_in_ioctl=yes *************** *** 5606,5615 **** echo $ac_n "checking for TIOCSTAT in sys/ioctl.h""... $ac_c" 1>&6 ! echo "configure:5609: checking for TIOCSTAT in sys/ioctl.h" >&5 if eval "test \"`echo '$''{'bash_cv_tiocstat_in_ioctl'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < --- 6287,6296 ---- echo $ac_n "checking for TIOCSTAT in sys/ioctl.h""... $ac_c" 1>&6 ! echo "configure:6290: checking for TIOCSTAT in sys/ioctl.h" >&5 if eval "test \"`echo '$''{'bash_cv_tiocstat_in_ioctl'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < *************** *** 5619,5623 **** ; return 0; } EOF ! if { (eval echo configure:5622: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bash_cv_tiocstat_in_ioctl=yes --- 6300,6304 ---- ; return 0; } EOF ! if { (eval echo configure:6303: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bash_cv_tiocstat_in_ioctl=yes *************** *** 5640,5649 **** echo $ac_n "checking for FIONREAD in sys/ioctl.h""... $ac_c" 1>&6 ! echo "configure:5643: checking for FIONREAD in sys/ioctl.h" >&5 if eval "test \"`echo '$''{'bash_cv_fionread_in_ioctl'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < --- 6321,6330 ---- echo $ac_n "checking for FIONREAD in sys/ioctl.h""... $ac_c" 1>&6 ! echo "configure:6324: checking for FIONREAD in sys/ioctl.h" >&5 if eval "test \"`echo '$''{'bash_cv_fionread_in_ioctl'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < *************** *** 5653,5657 **** ; return 0; } EOF ! if { (eval echo configure:5656: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bash_cv_fionread_in_ioctl=yes --- 6334,6338 ---- ; return 0; } EOF ! if { (eval echo configure:6337: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bash_cv_fionread_in_ioctl=yes *************** *** 5675,5684 **** echo $ac_n "checking for speed_t in sys/types.h""... $ac_c" 1>&6 ! echo "configure:5678: checking for speed_t in sys/types.h" >&5 if eval "test \"`echo '$''{'bash_cv_speed_t_in_sys_types'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < --- 6356,6365 ---- echo $ac_n "checking for speed_t in sys/types.h""... $ac_c" 1>&6 ! echo "configure:6359: checking for speed_t in sys/types.h" >&5 if eval "test \"`echo '$''{'bash_cv_speed_t_in_sys_types'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < *************** *** 5687,5691 **** ; return 0; } EOF ! if { (eval echo configure:5690: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bash_cv_speed_t_in_sys_types=yes --- 6368,6372 ---- ; return 0; } EOF ! if { (eval echo configure:6371: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bash_cv_speed_t_in_sys_types=yes *************** *** 5708,5717 **** echo $ac_n "checking whether programs are able to redeclare getpw functions""... $ac_c" 1>&6 ! echo "configure:5711: checking whether programs are able to redeclare getpw functions" >&5 if eval "test \"`echo '$''{'bash_cv_can_redecl_getpw'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < --- 6389,6398 ---- echo $ac_n "checking whether programs are able to redeclare getpw functions""... $ac_c" 1>&6 ! echo "configure:6392: checking whether programs are able to redeclare getpw functions" >&5 if eval "test \"`echo '$''{'bash_cv_can_redecl_getpw'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < *************** *** 5724,5728 **** ; return 0; } EOF ! if { (eval echo configure:5727: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bash_cv_can_redecl_getpw=yes --- 6405,6409 ---- ; return 0; } EOF ! if { (eval echo configure:6408: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bash_cv_can_redecl_getpw=yes *************** *** 5747,5756 **** case "$host_os" in hpux*) echo $ac_n "checking whether $host_os needs _KERNEL for RLIMIT defines""... $ac_c" 1>&6 ! echo "configure:5750: checking whether $host_os needs _KERNEL for RLIMIT defines" >&5 if eval "test \"`echo '$''{'bash_cv_kernel_rlimit'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&6 ! echo "configure:6431: checking whether $host_os needs _KERNEL for RLIMIT defines" >&5 if eval "test \"`echo '$''{'bash_cv_kernel_rlimit'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bash_cv_kernel_rlimit=no --- 6446,6450 ---- ; return 0; } EOF ! if { (eval echo configure:6449: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bash_cv_kernel_rlimit=no *************** *** 5773,5792 **** rm -rf conftest* cat > conftest.$ac_ext < ! #define _KERNEL ! #include ! #undef _KERNEL ! int main() { int f; f = RLIMIT_DATA; ! ; return 0; } EOF ! if { (eval echo configure:5791: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bash_cv_kernel_rlimit=yes --- 6454,6473 ---- rm -rf conftest* cat > conftest.$ac_ext < ! #define _KERNEL ! #include ! #undef _KERNEL ! int main() { int f; f = RLIMIT_DATA; ! ; return 0; } EOF ! if { (eval echo configure:6472: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bash_cv_kernel_rlimit=yes *************** *** 5822,5826 **** else echo $ac_n "checking which library has the termcap functions""... $ac_c" 1>&6 ! echo "configure:5825: checking which library has the termcap functions" >&5 _bash_needmsg= fi --- 6503,6507 ---- else echo $ac_n "checking which library has the termcap functions""... $ac_c" 1>&6 ! echo "configure:6506: checking which library has the termcap functions" >&5 _bash_needmsg= fi *************** *** 5829,5833 **** else echo $ac_n "checking for tgetent in -ltermcap""... $ac_c" 1>&6 ! echo "configure:5832: checking for tgetent in -ltermcap" >&5 ac_lib_var=`echo termcap'_'tgetent | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then --- 6510,6514 ---- else echo $ac_n "checking for tgetent in -ltermcap""... $ac_c" 1>&6 ! echo "configure:6513: checking for tgetent in -ltermcap" >&5 ac_lib_var=`echo termcap'_'tgetent | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then *************** *** 5837,5841 **** LIBS="-ltermcap $LIBS" cat > conftest.$ac_ext < conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" --- 6529,6533 ---- ; return 0; } EOF ! if { (eval echo configure:6532: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" *************** *** 5867,5871 **** echo "$ac_t""no" 1>&6 echo $ac_n "checking for tgetent in -lcurses""... $ac_c" 1>&6 ! echo "configure:5870: checking for tgetent in -lcurses" >&5 ac_lib_var=`echo curses'_'tgetent | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then --- 6548,6552 ---- echo "$ac_t""no" 1>&6 echo $ac_n "checking for tgetent in -lcurses""... $ac_c" 1>&6 ! echo "configure:6551: checking for tgetent in -lcurses" >&5 ac_lib_var=`echo curses'_'tgetent | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then *************** *** 5875,5879 **** LIBS="-lcurses $LIBS" cat > conftest.$ac_ext < conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" --- 6567,6571 ---- ; return 0; } EOF ! if { (eval echo configure:6570: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" *************** *** 5905,5909 **** echo "$ac_t""no" 1>&6 echo $ac_n "checking for tgetent in -lncurses""... $ac_c" 1>&6 ! echo "configure:5908: checking for tgetent in -lncurses" >&5 ac_lib_var=`echo ncurses'_'tgetent | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then --- 6586,6590 ---- echo "$ac_t""no" 1>&6 echo $ac_n "checking for tgetent in -lncurses""... $ac_c" 1>&6 ! echo "configure:6589: checking for tgetent in -lncurses" >&5 ac_lib_var=`echo ncurses'_'tgetent | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then *************** *** 5913,5917 **** LIBS="-lncurses $LIBS" cat > conftest.$ac_ext < conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" --- 6605,6609 ---- ; return 0; } EOF ! if { (eval echo configure:6608: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" *************** *** 5953,5960 **** if test "X$_bash_needmsg" = "Xyes"; then echo $ac_n "checking which library has the termcap functions""... $ac_c" 1>&6 ! echo "configure:5956: checking which library has the termcap functions" >&5 fi echo "$ac_t""using $bash_cv_termcap_lib" 1>&6 ! if test $bash_cv_termcap_lib = gnutermcap; then LDFLAGS="$LDFLAGS -L./lib/termcap" TERMCAP_LIB="./lib/termcap/libtermcap.a" --- 6634,6641 ---- if test "X$_bash_needmsg" = "Xyes"; then echo $ac_n "checking which library has the termcap functions""... $ac_c" 1>&6 ! echo "configure:6637: checking which library has the termcap functions" >&5 fi echo "$ac_t""using $bash_cv_termcap_lib" 1>&6 ! if test $bash_cv_termcap_lib = gnutermcap && test -z "$prefer_curses"; then LDFLAGS="$LDFLAGS -L./lib/termcap" TERMCAP_LIB="./lib/termcap/libtermcap.a" *************** *** 5976,5980 **** echo $ac_n "checking whether /dev/fd is available""... $ac_c" 1>&6 ! echo "configure:5979: checking whether /dev/fd is available" >&5 if eval "test \"`echo '$''{'bash_cv_dev_fd'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 --- 6657,6661 ---- echo $ac_n "checking whether /dev/fd is available""... $ac_c" 1>&6 ! echo "configure:6660: checking whether /dev/fd is available" >&5 if eval "test \"`echo '$''{'bash_cv_dev_fd'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 *************** *** 6012,6016 **** echo $ac_n "checking for default mail directory""... $ac_c" 1>&6 ! echo "configure:6015: checking for default mail directory" >&5 if eval "test \"`echo '$''{'bash_cv_mail_dir'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 --- 6693,6697 ---- echo $ac_n "checking for default mail directory""... $ac_c" 1>&6 ! echo "configure:6696: checking for default mail directory" >&5 if eval "test \"`echo '$''{'bash_cv_mail_dir'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 *************** *** 6104,6107 **** --- 6785,6789 ---- *qnx*) LOCAL_CFLAGS="-Dqnx -F -3s" LOCAL_LDFLAGS="-3s -lunix -lncurses" ;; powerux) LOCAL_LIBS="-lgen" ;; + cygwin32*) LOCAL_LIBS="-luser32" ;; esac *************** *** 6123,6132 **** case "$srcdir" in .) ;; ! *) for d in doc tests support lib ; do # dirs test -d $d || mkdir $d done ! for ld in readline glob tilde malloc termcap; do # libdirs test -d lib/$ld || mkdir lib/$ld done ;; esac --- 6805,6815 ---- case "$srcdir" in .) ;; ! *) for d in doc tests support lib examples; do # dirs test -d $d || mkdir $d done ! for ld in readline glob tilde malloc sh termcap; do # libdirs test -d lib/$ld || mkdir lib/$ld done + test -d examples/loadables || mkdir examples/loadables # loadable builtins ;; esac *************** *** 6151,6154 **** --- 6834,6839 ---- + + #AC_SUBST(ALLOCA_SOURCE) #AC_SUBST(ALLOCA_OBJECT) *************** *** 6256,6261 **** trap 'rm -fr `echo "Makefile builtins/Makefile lib/readline/Makefile lib/glob/Makefile \ ! lib/malloc/Makefile lib/termcap/Makefile lib/tilde/Makefile \ ! doc/Makefile config.h" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15 EOF cat >> $CONFIG_STATUS <> $CONFIG_STATUS <> $CONFIG_STATUS <<\EOF --- 7051,7057 ---- CONFIG_FILES=\${CONFIG_FILES-"Makefile builtins/Makefile lib/readline/Makefile lib/glob/Makefile \ ! lib/malloc/Makefile lib/sh/Makefile lib/termcap/Makefile \ ! lib/tilde/Makefile doc/Makefile support/Makefile \ ! examples/loadables/Makefile"} EOF cat >> $CONFIG_STATUS <<\EOF diff -Nrc2 bash-2.01.1/configure.in bash-2.02/configure.in *** bash-2.01.1/configure.in Tue Jul 29 10:55:31 1997 --- bash-2.02/configure.in Wed Mar 4 10:22:48 1998 *************** *** 1,4 **** dnl ! dnl Configure script for bash-2.01 dnl dnl report bugs to chet@po.cwru.edu --- 1,4 ---- dnl ! dnl Configure script for bash-2.02 dnl dnl report bugs to chet@po.cwru.edu *************** *** 7,11 **** dnl checks for version info ! AC_REVISION([for Bash 2.01, version 1.28, from autoconf version] AC_ACVERSION)dnl AC_INIT(shell.h) --- 7,11 ---- dnl checks for version info ! AC_REVISION([for Bash 2.02, version 2.19, from autoconf version] AC_ACVERSION)dnl AC_INIT(shell.h) *************** *** 35,39 **** case "${host_cpu}-${host_os}" in alpha-*) opt_gnu_malloc=no ;; # alpha running osf/1 or linux ! *cray*-*) opt_gnu_malloc=no ;; # Crays *-osf1*) opt_gnu_malloc=no ;; # other osf/1 machines sparc-svr4*) opt_gnu_malloc=no ;; # sparc SVR4, SVR4.2 --- 35,39 ---- case "${host_cpu}-${host_os}" in alpha-*) opt_gnu_malloc=no ;; # alpha running osf/1 or linux ! *[Cc]ray*-*) opt_gnu_malloc=no ;; # Crays *-osf1*) opt_gnu_malloc=no ;; # other osf/1 machines sparc-svr4*) opt_gnu_malloc=no ;; # sparc SVR4, SVR4.2 *************** *** 41,45 **** sgi-irix6*) opt_gnu_malloc=no ;; # needs 8-byte alignment sparc-linux*) opt_gnu_malloc=no ;; # sparc running linux; requires ELF ! *-freebsd*) opt_gnu_malloc=no ;; # they claim it's better *-aix*) opt_gnu_malloc=no ;; # AIX machines *-nextstep*) opt_gnu_malloc=no ;; # NeXT machines running NeXTstep --- 41,45 ---- sgi-irix6*) opt_gnu_malloc=no ;; # needs 8-byte alignment sparc-linux*) opt_gnu_malloc=no ;; # sparc running linux; requires ELF ! #*-freebsd*) opt_gnu_malloc=no ;; # they claim it's better *-aix*) opt_gnu_malloc=no ;; # AIX machines *-nextstep*) opt_gnu_malloc=no ;; # NeXT machines running NeXTstep *************** *** 47,51 **** *-qnx*) opt_gnu_malloc=no ;; # QNX 4.2 *-machten4) opt_gnu_malloc=no ;; # MachTen 4.x ! *-bsdi2.1|*-bsdi3.0) opt_gnu_malloc=no ; : ${CC:=shlicc2} ;; # for loadable builtins esac --- 47,52 ---- *-qnx*) opt_gnu_malloc=no ;; # QNX 4.2 *-machten4) opt_gnu_malloc=no ;; # MachTen 4.x ! *-bsdi2.1|*-bsdi3.?) opt_gnu_malloc=no ; : ${CC:=shlicc2} ;; # for loadable builtins ! *-cygwin32*) opt_gnu_malloc=no ;; # Cygnus's CYGWIN32 environment esac *************** *** 105,112 **** --- 106,119 ---- opt_array_variables=yes opt_dparen_arith=yes + opt_extended_glob=yes opt_brace_expansion=yes opt_disabled_builtins=no opt_command_timing=yes opt_usg_echo=no + opt_cond_command=yes + + dnl options that affect how bash is compiled and linked + opt_static_link=no + opt_profiling=no dnl argument parsing for optional features *************** *** 121,124 **** --- 128,132 ---- opt_select=no opt_help=no opt_array_variables=no opt_dparen_arith=no opt_brace_expansion=no opt_disabled_builtins=no opt_command_timing=no + opt_extended_glob=no opt_cond_command=no fi *************** *** 128,134 **** --- 136,144 ---- AC_ARG_ENABLE(brace-expansion, --enable-brace-expansion include brace expansion, opt_brace_expansion=$enableval) AC_ARG_ENABLE(command-timing, --enable-command-timing enable the time reserved word and command timing, opt_command_timing=$enableval) + AC_ARG_ENABLE(cond-command, --enable-cond-command enable the conditional command, opt_cond_command=$enableval) AC_ARG_ENABLE(directory-stack, --enable-directory-stack enable builtins pushd/popd/dirs, opt_dirstack=$enableval) AC_ARG_ENABLE(disabled-builtins, --enable-disabled-builtins allow disabled builtins to still be invoked, opt_disabled_builtins=$enableval) AC_ARG_ENABLE(dparen-arithmetic, [--enable-dparen-arithmetic include ((...)) command], opt_dparen_arith=$enableval) + AC_ARG_ENABLE(extended-glob, --enable-extended-glob include ksh-style extended pattern matching, opt_extended_glob=$enableval) AC_ARG_ENABLE(help-builtin, --enable-help-builtin include the help builtin, opt_help=$enableval) AC_ARG_ENABLE(history, --enable-history turn on command history, opt_history=$enableval) *************** *** 141,144 **** --- 151,158 ---- AC_ARG_ENABLE(usg-echo-default, --enable-usg-echo-default make the echo builtin expand escape sequences by default, opt_usg_echo=$enableval) + dnl options that alter how bash is compiled and linked + AC_ARG_ENABLE(profiling, --enable-profiling allow profiling with gprof, opt_profiling=$enableval) + AC_ARG_ENABLE(static-link, --enable-static-link [link bash statically, for use as a root shell], opt_static_link=$enableval) + dnl opt_job_control is handled later, after BASH_JOB_CONTROL_MISSING runs *************** *** 203,206 **** --- 217,226 ---- AC_DEFINE(DEFAULT_ECHO_TO_USG) fi + if test $opt_extended_glob = yes ; then + AC_DEFINE(EXTENDED_GLOB) + fi + if test $opt_cond_command = yes ; then + AC_DEFINE(COND_COMMAND) + fi if test "$opt_minimal_config" = yes; then *************** *** 227,237 **** esyscmd(cat _patchlevel)dnl ! echo "Beginning configuration for bash-$BASHVERS" dnl compilation checks AC_PROG_CC AC_ISC_POSIX AC_MINIX dnl We want these before the checks, so the checks can modify their values. test -z "$CFLAGS" && CFLAGS=-g auto_cflags=1 --- 247,298 ---- esyscmd(cat _patchlevel)dnl ! echo "Beginning configuration for bash-$BASHVERS for ${host_cpu}-${host_vendor}-${host_os}" dnl compilation checks + dnl AC_PROG_CC sets $cross_compiling to `yes' if cross-compiling for a + dnl different environment AC_PROG_CC + BASH_LARGE_FILE_SUPPORT AC_ISC_POSIX AC_MINIX + dnl BEGIN changes for CYGNUS cross-building for cygwin32 + + dnl load up the cross-building cache file -- add more cases and cache + dnl files as necessary + if test "x$cross_compiling" = "xyes"; then + case "${host}" in + *-cygwin32*) + cross_cache=${srcdir}/cross-build/cygwin32.cache + if test -r "${cross_cache}"; then + echo "loading cross-build cache file ${cross_cache}" + . ${cross_cache} + fi + unset cross_cache + ;; + *) echo "configure: cross-compiling for a non-cygwin32 target is not supported" >&2 + ;; + esac + fi + + if test -z "$CC_FOR_BUILD"; then + if test "x$cross_compiling" = "xno"; then + CC_FOR_BUILD='$(CC)' + else + CC_FOR_BUILD=gcc + fi + fi + AC_SUBST(CC_FOR_BUILD) + + dnl Set SIGNAMES_H based on whether or not we're cross-compiling + if test "x$cross_compiling" = "xno"; then + SIGNAMES_H=lsignames.h + else + SIGNAMES_H='$(srcdir)/cross-build/win32sig.h' + fi + AC_SUBST(SIGNAMES_H) + + dnl END changes for CYGNUS cross-building for cygwin32 + dnl We want these before the checks, so the checks can modify their values. test -z "$CFLAGS" && CFLAGS=-g auto_cflags=1 *************** *** 240,243 **** --- 301,318 ---- test -n "$GCC" && test -n "$auto_cflags" && CFLAGS="$CFLAGS -O2" + dnl handle options that alter how bash is compiled and linked + dnl these must come after the test for cc/gcc + if test "$opt_profiling" = "yes"; then + PROFILE_FLAGS=-pg + opt_static_link=yes + fi + + if test "$opt_static_link" = yes; then + # if we're using gcc, add `-static' to LDFLAGS + if test -n "$GCC" || test "$ac_cv_prog_gcc" = "yes"; then + LDFLAGS="$LDFLAGS -static" + fi + fi + AC_SUBST(CFLAGS) AC_SUBST(CPPFLAGS) *************** *** 288,293 **** dnl checks for c library functions AC_CHECK_FUNCS(bcopy bzero confstr getcwd strcasecmp setenv putenv \ ! setlinebuf setlocale strchr strerror tcgetattr uname \ ! sysconf ulimit times tzset siginterrupt memmove) dnl checks for locale functions --- 363,369 ---- dnl checks for c library functions AC_CHECK_FUNCS(bcopy bzero confstr getcwd strcasecmp setenv putenv \ ! setlinebuf setlocale strchr strerror strtod strtol \ ! strtoul tcgetattr uname sysconf ulimit times tzset \ ! siginterrupt memmove) dnl checks for locale functions *************** *** 305,310 **** --- 381,388 ---- dnl checks for the dynamic loading library functions in libc and libdl + if test "$opt_static_link" != yes; then AC_CHECK_LIB(dl, dlopen) AC_CHECK_FUNCS(dlopen dlclose dlsym) + fi dnl this defines SYS_SIGLIST_DECLARED *************** *** 316,320 **** AC_CHECK_HEADERS(unistd.h stdlib.h stdarg.h varargs.h limits.h string.h \ ! memory.h locale.h termcap.h termio.h termios.h dlfcn.h) AC_CHECK_HEADERS(sys/ptem.h sys/pte.h sys/stream.h sys/select.h sys/file.h \ sys/resource.h sys/param.h sys/socket.h \ --- 394,399 ---- AC_CHECK_HEADERS(unistd.h stdlib.h stdarg.h varargs.h limits.h string.h \ ! memory.h locale.h termcap.h termio.h termios.h dlfcn.h \ ! stddef.h) AC_CHECK_HEADERS(sys/ptem.h sys/pte.h sys/stream.h sys/select.h sys/file.h \ sys/resource.h sys/param.h sys/socket.h \ *************** *** 340,343 **** --- 419,440 ---- AC_TYPE_SIGNAL + AC_CHECK_SIZEOF(int) + AC_CHECK_SIZEOF(long) + AC_CHECK_SIZEOF(char *) + + AC_CHECK_TYPE(int32_t) + if test "$ac_cv_type_int32_t" = "no"; then + BASH_TYPE_INT32_T + fi + AC_CHECK_TYPE(u_int32_t) + if test "$ac_cv_type_u_int32_t" = "no"; then + BASH_TYPE_U_INT32_T + fi + + AC_CHECK_TYPE(ptrdiff_t) + if test "$ac_cv_type_ptrdiff_t" = "no"; then + BASH_TYPE_PTRDIFF_T + fi + dnl structures AC_HEADER_STAT *************** *** 371,374 **** --- 468,475 ---- BASH_SIGNAL_CHECK + if test "$ac_cv_sys_restartable_syscalls" = "no"; then + BASH_SYS_RESTARTABLE_SYSCALLS + fi + dnl checking for the presence of certain library symbols BASH_SYS_ERRLIST *************** *** 472,475 **** --- 573,577 ---- *qnx*) LOCAL_CFLAGS="-Dqnx -F -3s" LOCAL_LDFLAGS="-3s -lunix -lncurses" ;; powerux) LOCAL_LIBS="-lgen" ;; + cygwin32*) LOCAL_LIBS="-luser32" ;; esac *************** *** 491,500 **** case "$srcdir" in .) ;; ! *) for d in doc tests support lib ; do # dirs test -d $d || mkdir $d done ! for ld in readline glob tilde malloc termcap; do # libdirs test -d lib/$ld || mkdir lib/$ld done ;; esac --- 593,603 ---- case "$srcdir" in .) ;; ! *) for d in doc tests support lib examples; do # dirs test -d $d || mkdir $d done ! for ld in readline glob tilde malloc sh termcap; do # libdirs test -d lib/$ld || mkdir lib/$ld done + test -d examples/loadables || mkdir examples/loadables # loadable builtins ;; esac *************** *** 502,505 **** --- 605,610 ---- BUILD_DIR=`pwd` + AC_SUBST(PROFILE_FLAGS) + AC_SUBST(incdir) AC_SUBST(BUILD_DIR) *************** *** 523,528 **** AC_OUTPUT([Makefile builtins/Makefile lib/readline/Makefile lib/glob/Makefile \ ! lib/malloc/Makefile lib/termcap/Makefile lib/tilde/Makefile \ ! doc/Makefile], [ # Makefile uses this timestamp file to record whether config.h is up to date. --- 628,634 ---- AC_OUTPUT([Makefile builtins/Makefile lib/readline/Makefile lib/glob/Makefile \ ! lib/malloc/Makefile lib/sh/Makefile lib/termcap/Makefile \ ! lib/tilde/Makefile doc/Makefile support/Makefile \ ! examples/loadables/Makefile], [ # Makefile uses this timestamp file to record whether config.h is up to date. diff -Nrc2 bash-2.01.1/copy_cmd.c bash-2.02/copy_cmd.c *** bash-2.01.1/copy_cmd.c Mon Feb 17 14:24:15 1997 --- bash-2.02/copy_cmd.c Thu Jan 29 14:49:11 1998 *************** *** 23,27 **** #include "config.h" ! #include #if defined (HAVE_UNISTD_H) --- 23,27 ---- #include "config.h" ! #include "bashtypes.h" #if defined (HAVE_UNISTD_H) *************** *** 29,43 **** #endif #include "shell.h" WORD_DESC * ! copy_word (word) ! WORD_DESC *word; { WORD_DESC *new_word; new_word = (WORD_DESC *)xmalloc (sizeof (WORD_DESC)); ! FASTCOPY ((char *)word, (char *)new_word, sizeof (WORD_DESC)); ! new_word->word = savestring (word->word); return (new_word); } --- 29,45 ---- #endif + #include + #include "shell.h" WORD_DESC * ! copy_word (w) ! WORD_DESC *w; { WORD_DESC *new_word; new_word = (WORD_DESC *)xmalloc (sizeof (WORD_DESC)); ! FASTCOPY ((char *)w, (char *)new_word, sizeof (WORD_DESC)); ! new_word->word = savestring (w->word); return (new_word); } *************** *** 202,211 **** } static SIMPLE_COM * copy_simple_command (com) SIMPLE_COM *com; { ! SIMPLE_COM *new_simple = (SIMPLE_COM *)xmalloc (sizeof (SIMPLE_COM)); new_simple->flags = com->flags; new_simple->words = copy_word_list (com->words); --- 204,248 ---- } + #if defined (DPAREN_ARITHMETIC) + static ARITH_COM * + copy_arith_command (com) + ARITH_COM *com; + { + ARITH_COM *new_arith; + + new_arith = (ARITH_COM *)xmalloc (sizeof (ARITH_COM)); + new_arith->flags = com->flags; + new_arith->exp = copy_word_list (com->exp); + new_arith->line = com->line; + + return (new_arith); + } + #endif + + #if defined (COND_COMMAND) + static COND_COM * + copy_cond_command (com) + COND_COM *com; + { + COND_COM *new_cond; + + new_cond = (COND_COM *)xmalloc (sizeof (COND_COM)); + new_cond->flags = com->flags; + new_cond->line = com->line; + new_cond->op = copy_word (com->op); + new_cond->left = com->left ? copy_cond_command (com->left) : (COND_COM *)NULL; + new_cond->right = com->right ? copy_cond_command (com->right) : (COND_COM *)NULL; + + return (new_cond); + } + #endif + static SIMPLE_COM * copy_simple_command (com) SIMPLE_COM *com; { ! SIMPLE_COM *new_simple; + new_simple = (SIMPLE_COM *)xmalloc (sizeof (SIMPLE_COM)); new_simple->flags = com->flags; new_simple->words = copy_word_list (com->words); *************** *** 276,279 **** --- 313,328 ---- new_command->value.If = copy_if_command (command->value.If); break; + + #if defined (DPAREN_ARITHMETIC) + case cm_arith: + new_command->value.Arith = copy_arith_command (command->value.Arith); + break; + #endif + + #if defined (COND_COMMAND) + case cm_cond: + new_command->value.Cond = copy_cond_command (command->value.Cond); + break; + #endif case cm_simple: diff -Nrc2 bash-2.01.1/cross-build/cygwin32.cache bash-2.02/cross-build/cygwin32.cache *** bash-2.01.1/cross-build/cygwin32.cache Wed Dec 31 19:00:00 1969 --- bash-2.02/cross-build/cygwin32.cache Fri Jan 30 12:44:53 1998 *************** *** 0 **** --- 1,39 ---- + # This file is a shell script that caches the results of configure + # tests for CYGWIN32 so they don't need to be done when cross-compiling. + + # AC_FUNC_GETPGRP should also define GETPGRP_VOID + ac_cv_func_getpgrp_void=${ac_cv_func_getpgrp_void='yes'} + # AC_FUNC_SETVBUF_REVERSED should not define anything else + ac_cv_func_setvbuf_reversed=${ac_cv_func_setvbuf_reversed='no'} + # on CYGWIN32, system calls do not restart + ac_cv_sys_restartable_syscalls=${ac_cv_sys_restartable_syscalls='no'} + bash_cv_sys_restartable_syscalls=${bash_cv_sys_restartable_syscalls='no'} + + # these may be necessary, but they are currently commented out + #ac_cv_c_bigendian=${ac_cv_c_bigendian='no'} + ac_cv_sizeof_char_p=${ac_cv_sizeof_char_p='4'} + ac_cv_sizeof_int=${ac_cv_sizeof_int='4'} + ac_cv_sizeof_long=${ac_cv_sizeof_long='4'} + + bash_cv_dup2_broken=${bash_cv_dup2_broken='no'} + bash_cv_pgrp_pipe=${bash_cv_pgrp_pipe='no'} + bash_cv_type_rlimit=${bash_cv_type_rlimit='long'} + bash_cv_decl_under_sys_siglist=${bash_cv_decl_under_sys_siglist='no'} + bash_cv_under_sys_siglist=${bash_cv_under_sys_siglist='no'} + bash_cv_sys_siglist=${bash_cv_sys_siglist='no'} + bash_cv_opendir_not_robust=${bash_cv_opendir_not_robust='no'} + bash_cv_getenv_redef=${bash_cv_getenv_redef='yes'} + bash_cv_printf_declared=${bash_cv_printf_declared='yes'} + bash_cv_ulimit_maxfds=${bash_cv_ulimit_maxfds='no'} + bash_cv_getcwd_calls_popen=${bash_cv_getcwd_calls_popen='no'} + bash_cv_must_reinstall_sighandlers=${bash_cv_must_reinstall_sighandlers='no'} + bash_cv_job_control_missing=${bash_cv_job_control_missing='present'} + bash_cv_sys_named_pipes=${bash_cv_sys_named_pipes='missing'} + bash_cv_func_sigsetjmp=${bash_cv_func_sigsetjmp='missing'} + bash_cv_mail_dir=${bash_cv_mail_dir='unknown'} + bash_cv_func_strcoll_broken=${bash_cv_func_strcoll_broken='no'} + + bash_cv_type_int32_t=${bash_cv_type_int32_t='int'} + bash_cv_type_u_int32_t=${bash_cv_type_u_int32_t='int'} + + # end of cross-build/cygwin32.cache diff -Nrc2 bash-2.01.1/cross-build/win32sig.h bash-2.02/cross-build/win32sig.h *** bash-2.01.1/cross-build/win32sig.h Wed Dec 31 19:00:00 1969 --- bash-2.02/cross-build/win32sig.h Tue Oct 14 12:25:43 1997 *************** *** 0 **** --- 1,254 ---- + /* This file is used when cross-compiling for the CYGWIN32 environment on + a Unix machine. */ + #include + #include + + #ifndef __GNUC__ + # error cross compiling requires gcc + #endif + + /* A translation list so we can be polite to our users. Use gcc + labelled initializers to set up the array. Note that some entries + might wind up being NULL. */ + + char *signal_names[NSIG + 2] = { + [0] "EXIT", + + #ifdef SIGLOST + [SIGLOST] "SIGLOST", + #endif + + #ifdef SIGMSG + [SIGMSG] "SIGMSG", + #endif + + #ifdef SIGDANGER + [SIGDANGER] "SIGDANGER", + #endif + + #ifdef SIGMIGRATE + [SIGMIGRATE] "SIGMIGRATE", + #endif + + #ifdef SIGPRE + [SIGPRE] "SIGPRE", + #endif + + #ifdef SIGVIRT + [SIGVIRT] "SIGVIRT", + #endif + + #ifdef SIGALRM1 + [SIGALRM1] "SIGALRM1", + #endif + + #ifdef SIGWAITING + [SIGWAITING] "SIGWAITING", + #endif + + #ifdef SIGGRANT + [SIGGRANT] "SIGGRANT", + #endif + + #ifdef SIGKAP + [SIGKAP] "SIGKAP", + #endif + + #ifdef SIGRETRACT + [SIGRETRACT] "SIGRETRACT", + #endif + + #ifdef SIGSOUND + [SIGSOUND] "SIGSOUND", + #endif + + #ifdef SIGSAK + [SIGSAK] "SIGSAK", + #endif + + #ifdef SIGLWP + [SIGLWP] "SIGLWP", + #endif + + #ifdef SIGFREEZE + [SIGFREEZE] "SIGFREEZE", + #endif + + #ifdef SIGTHAW + [SIGTHAW] "SIGTHAW", + #endif + + #ifdef SIGCANCEL + [SIGCANCEL] "SIGCANCEL", + #endif + + #ifdef SIGDIL + [SIGDIL] "SIGDIL", + #endif + + #ifdef SIGCLD + #ifndef SIGCHLD + [SIGCLD] "SIGCLD", + #else + #if SIGCHLD != SIGCLD + [SIGCLD] "SIGCLD", + #endif + #endif + #endif + + #ifdef SIGPWR + [SIGPWR] "SIGPWR", + #endif + + #ifdef SIGPOLL + #ifndef SIGIO + [SIGPOLL] "SIGPOLL", + #else + #if SIGIO != SIGPOLL + [SIGPOLL] "SIGPOLL", + #endif + #endif + #endif + + #ifdef SIGWINDOW + [SIGWINDOW] "SIGWINDOW", + #endif + + #ifdef SIGHUP + [SIGHUP] "SIGHUP", + #endif + + #ifdef SIGINT + [SIGINT] "SIGINT", + #endif + + #ifdef SIGQUIT + [SIGQUIT] "SIGQUIT", + #endif + + #ifdef SIGILL + [SIGILL] "SIGILL", + #endif + + #ifdef SIGTRAP + [SIGTRAP] "SIGTRAP", + #endif + + #ifdef SIGIOT + #ifndef SIGABRT + [SIGIOT] "SIGIOT", + #else + #if SIGABRT != SIGIOT + [SIGIOT] "SIGIOT", + #endif + #endif + #endif + + #ifdef SIGABRT + [SIGABRT] "SIGABRT", + #endif + + #ifdef SIGEMT + [SIGEMT] "SIGEMT", + #endif + + #ifdef SIGFPE + [SIGFPE] "SIGFPE", + #endif + + #ifdef SIGKILL + [SIGKILL] "SIGKILL", + #endif + + #ifdef SIGBUS + [SIGBUS] "SIGBUS", + #endif + + #ifdef SIGSEGV + [SIGSEGV] "SIGSEGV", + #endif + + #ifdef SIGSYS + [SIGSYS] "SIGSYS", + #endif + + #ifdef SIGPIPE + [SIGPIPE] "SIGPIPE", + #endif + + #ifdef SIGALRM + [SIGALRM] "SIGALRM", + #endif + + #ifdef SIGTERM + [SIGTERM] "SIGTERM", + #endif + + #ifdef SIGURG + [SIGURG] "SIGURG", + #endif + + #ifdef SIGSTOP + [SIGSTOP] "SIGSTOP", + #endif + + #ifdef SIGTSTP + [SIGTSTP] "SIGTSTP", + #endif + + #ifdef SIGCONT + [SIGCONT] "SIGCONT", + #endif + + #ifdef SIGCHLD + [SIGCHLD] "SIGCHLD", + #endif + + #ifdef SIGTTIN + [SIGTTIN] "SIGTTIN", + #endif + + #ifdef SIGTTOU + [SIGTTOU] "SIGTTOU", + #endif + + #ifdef SIGIO + [SIGIO] "SIGIO", + #endif + + #ifdef SIGXCPU + [SIGXCPU] "SIGXCPU", + #endif + + #ifdef SIGXFSZ + [SIGXFSZ] "SIGXFSZ", + #endif + + #ifdef SIGVTALRM + [SIGVTALRM] "SIGVTALRM", + #endif + + #ifdef SIGPROF + [SIGPROF] "SIGPROF", + #endif + + #ifdef SIGWINCH + [SIGWINCH] "SIGWINCH", + #endif + + #ifdef SIGINFO + [SIGINFO] "SIGINFO", + #endif + + #ifdef SIGUSR1 + [SIGUSR1] "SIGUSR1", + #endif + + #ifdef SIGUSR2 + [SIGUSR2] "SIGUSR2", + #endif + + [NSIG] "DEBUG", + + [NSIG + 1] (char *)0x0 + }; diff -Nrc2 bash-2.01.1/dispose_cmd.c bash-2.02/dispose_cmd.c *** bash-2.01.1/dispose_cmd.c Tue Feb 25 12:17:14 1997 --- bash-2.02/dispose_cmd.c Thu Jan 29 14:52:25 1998 *************** *** 21,24 **** --- 21,26 ---- #include "config.h" + #include "bashtypes.h" + #if defined (HAVE_UNISTD_H) # include *************** *** 133,136 **** --- 135,161 ---- } + #if defined (DPAREN_ARITHMETIC) + case cm_arith: + { + register ARITH_COM *c; + + c = command->value.Arith; + dispose_words (c->exp); + free (c); + break; + } + #endif /* DPAREN_ARITHMETIC */ + + #if defined (COND_COMMAND) + case cm_cond: + { + register COND_COM *c; + + c = command->value.Cond; + dispose_cond_node (c); + break; + } + #endif /* COND_COMMAND */ + case cm_function_def: { *************** *** 151,161 **** } /* How to free a WORD_DESC. */ void ! dispose_word (word) ! WORD_DESC *word; { ! FREE (word->word); ! free (word); } --- 176,205 ---- } + #if defined (COND_COMMAND) + /* How to free a node in a conditional command. */ + void + dispose_cond_node (cond) + COND_COM *cond; + { + if (cond) + { + if (cond->left) + dispose_cond_node (cond->left); + if (cond->right) + dispose_cond_node (cond->right); + if (cond->op) + dispose_word (cond->op); + free (cond); + } + } + #endif /* COND_COMMAND */ + /* How to free a WORD_DESC. */ void ! dispose_word (w) ! WORD_DESC *w; { ! FREE (w->word); ! free (w); } diff -Nrc2 bash-2.01.1/dispose_cmd.h bash-2.02/dispose_cmd.h *** bash-2.01.1/dispose_cmd.h Sun Dec 19 15:08:01 1993 --- bash-2.02/dispose_cmd.h Fri Sep 12 13:14:51 1997 *************** *** 30,32 **** --- 30,36 ---- extern void dispose_redirects __P((REDIRECT *)); + #if defined (COND_COMMAND) + extern void dispose_cond_node __P((COND_COM *)); + #endif + #endif /* !_DISPOSE_CMD_H_ */ diff -Nrc2 bash-2.01.1/doc/FAQ bash-2.02/doc/FAQ *** bash-2.01.1/doc/FAQ Thu Jun 5 10:59:13 1997 --- bash-2.02/doc/FAQ Thu Apr 16 13:31:25 1998 *************** *** 1,3 **** ! This is the Bash FAQ, version 2.5, for Bash version 2.01. This document contains a set of frequently-asked questions concerning --- 1,3 ---- ! This is the Bash FAQ, version 2.11, for Bash version 2.02. This document contains a set of frequently-asked questions concerning *************** *** 14,18 **** This document is available for anonymous FTP with the URL ! ftp://slc2.ins.cwru.edu/pub/bash/FAQ ---------- --- 14,18 ---- This document is available for anonymous FTP with the URL ! ftp://ftp.cwru.edu/pub/bash/FAQ ---------- *************** *** 35,40 **** Section B: The latest version ! 11) What's new in version 2.01? ! 12) Are there any user-visible incompatibilities between bash-2.01 and bash-1.14.7? --- 35,40 ---- Section B: The latest version ! 11) What's new in version 2.02? ! 12) Are there any user-visible incompatibilities between bash-2.02 and bash-1.14.7? *************** *** 121,125 **** 2) What's the latest version? ! The latest version is 2.01, first made available on June 6, 1997. 3) Where can I get it? --- 121,125 ---- 2) What's the latest version? ! The latest version is 2.02, first made available on Monday, 20 April, 1998. 3) Where can I get it? *************** *** 127,141 **** Bash is the GNU project's shell, and so is available from the master GNU archive site, prep.ai.mit.edu, and its mirrors. The ! latest version is also available for FTP from slc2.ins.cwru.edu, ! the maintainer's machine. The following URLs tell how to get ! version 2.01: ! ftp://prep.ai.mit.edu/pub/gnu/bash-2.01.tar.gz ! ftp://slc2.ins.cwru.edu/pub/dist/bash-2.01.tar.gz Formatted versions of the documentation are available with the URLs: ! ftp://prep.ai.mit.edu/pub/gnu/bash-doc-2.01.tar.gz ! ftp://slc2.ins.cwru.edu/pub/dist/bash-doc-2.01.tar.gz 4) On what machines will bash run? --- 127,140 ---- Bash is the GNU project's shell, and so is available from the master GNU archive site, prep.ai.mit.edu, and its mirrors. The ! latest version is also available for FTP from ftp.cwru.edu. ! The following URLs tell how to get version 2.02: ! ftp://prep.ai.mit.edu/pub/gnu/bash-2.02.tar.gz ! ftp://ftp.cwru.edu/pub/bash/bash-2.02.tar.gz Formatted versions of the documentation are available with the URLs: ! ftp://prep.ai.mit.edu/pub/gnu/bash-doc-2.02.tar.gz ! ftp://ftp.cwru.edu/pub/bash/bash-doc-2.02.tar.gz 4) On what machines will bash run? *************** *** 163,168 **** http://www.cygnus.com/misc/gnu-win32 ! Cygnus has ported bash-1.14.7. Maybe someday they (or I) will port ! bash-2.01 (or later) to the GNU-Win32 environment. D. J. Delorie has ported bash-1.14.7 to run under MS-DOS, as part of --- 162,181 ---- http://www.cygnus.com/misc/gnu-win32 ! Cygnus has ported bash-1.14.7, and their port is part of the current ! gnu-win32 release. Cygnus has also done a port of bash-2.01 to the ! GNU-Win32 environment, and it should be available as part of their next ! release. ! ! Bash-2.02 should require no local Cygnus changes to build and run under ! GNU-WIN32. ! ! The Cygnus port works only on Intel machines. There is a port of bash ! (I don't know which version) to the alpha/NT environment available from ! ! ftp://ftp.gnustep.org//pub/win32/bash-alpha-nt-1.01.tar.gz ! ! Softway Systems has ported bash-2.01.1 to their OpenNT system, a ! Unix subsystem for NT that replaces the Microsoft POSIX subsystem. ! Check out http://www.opennt.com for more information. D. J. Delorie has ported bash-1.14.7 to run under MS-DOS, as part of *************** *** 180,188 **** ftp://ftp.simtel.net/pub/simtelnet/gnu/djgpp/v2gnu/bsh1147s.zip ! A port of bash-1.12 is available for OS/2 from ! ftp://hobbes.nmsu.edu/os2/unix/bash_112.zip ! I haven't looked at it. 6) How can I build bash with gcc? --- 193,203 ---- ftp://ftp.simtel.net/pub/simtelnet/gnu/djgpp/v2gnu/bsh1147s.zip ! Ports of bash-1.12 and bash-2.0 are available for OS/2 from ! ftp://hobbes.nmsu.edu/pub/os2/util/shell/bash_112.zip ! ftp://hobbes.nmsu.edu/pub/os2/util/shell/bash-2.0(253).zip ! I haven't looked at either, but the second appears to be a binary-only ! distribution. Beware. 6) How can I build bash with gcc? *************** *** 194,202 **** Some machines let you use `chsh' to change your login shell. Other ! systems use `passwd -s'. If one of these works for you, that's all ! you need. Note that many systems require the full pathname to a shell ! to appear in /etc/shells before you can make it your login shell. For ! this, you may need the assistance of your friendly local system ! administrator. If you cannot do this, you can still use bash as your login shell, but --- 209,217 ---- Some machines let you use `chsh' to change your login shell. Other ! systems use `passwd -s' or `passwd -e'. If one of these works for ! you, that's all you need. Note that many systems require the full ! pathname to a shell to appear in /etc/shells before you can make it ! your login shell. For this, you may need the assistance of your ! friendly local system administrator. If you cannot do this, you can still use bash as your login shell, but *************** *** 299,305 **** Section B: The latest version ! 11) What's new in version 2.01? ! Bash-2.01 contains only a few new features. new `GROUPS' builtin array variable containing the user's group list --- 314,342 ---- Section B: The latest version ! 11) What's new in version 2.02? ! Bash-2.02 has a number of new features. Here's a short list: ! ! a new version of malloc (based on the old GNU malloc code in previous ! bash versions) that is more page-oriented, more conservative ! with memory usage, does not `orphan' large blocks when they ! are freed, is usable on 64-bit machines, and has allocation ! checking turned on unconditionally ! POSIX.2-style globbing character classes ([:alpha:], [:alnum:], etc.) ! POSIX.2-style globbing equivalence classes ! POSIX.2-style globbing collating symbols ! the ksh [[...]] extended conditional command ! the ksh egrep-style extended pattern matching operators ! a new `printf' builtin ! the ksh-like $( $@ + .1.html: + $(RM) $@ + -${MAN2HTML} $< | ${HTMLPOST} > $@ + .ms.ps: $(RM) $@ *************** *** 72,75 **** --- 78,85 ---- -${NROFF} -man $< > $@ + .3.html: + $(RM) $@ + -${MAN2HTML} $< > $@ + all: ps info dvi text html nodvi: ps info text html *************** *** 79,83 **** info: bashref.info text: bash.0 bashbug.0 builtins.0 readline.0 ! html: bashref.html bashref.dvi: $(srcdir)/bashref.texi $(HSUSER) $(RLUSER) --- 89,93 ---- info: bashref.info text: bash.0 bashbug.0 builtins.0 readline.0 ! html: bashref.html bash.html bashref.dvi: $(srcdir)/bashref.texi $(HSUSER) $(RLUSER) *************** *** 103,106 **** --- 113,117 ---- bash.txt: bash.1 bash.ps: bash.1 + bash.html: bash.1 $(MAN2HTML) bashbug.ps: bashbug.1 builtins.ps: builtins.1 bash.1 *************** *** 111,114 **** --- 122,128 ---- readline.ps: readline.3 article.ps: article.ms + + $(MAN2HTML): ${topdir}/support/man2html.c + -( cd ${BUILD_DIR}/support ; ${MAKE} ${MFLAGS} man2html) faq: faq.news faq.news2 faq.mail faq.version diff -Nrc2 bash-2.01.1/doc/bash.1 bash-2.02/doc/bash.1 *** bash-2.01.1/doc/bash.1 Mon May 19 12:56:34 1997 --- bash-2.02/doc/bash.1 Wed Apr 1 12:25:56 1998 *************** *** 7,15 **** .\" chet@ins.CWRU.Edu .\" ! .\" Last Change: Mon May 19 12:45:24 EDT 1997 .\" .\" bash_builtins, strip all but Built-Ins section .if \n(zZ=1 .ig zZ ! .TH BASH 1 "1997 May 19" GNU .\" .\" There's some problem with having a `@' --- 7,15 ---- .\" chet@ins.CWRU.Edu .\" ! .\" Last Change: Wed Apr 1 12:16:09 EST 1998 .\" .\" bash_builtins, strip all but Built-Ins section .if \n(zZ=1 .ig zZ ! .TH BASH 1 "1998 Apr 1" GNU .\" .\" There's some problem with having a `@' *************** *** 62,71 **** .PP .B Bash ! is ultimately intended to be a conformant implementation of the IEEE POSIX Shell and Tools specification (IEEE Working Group 1003\.2). .SH OPTIONS In addition to the single-character shell options documented in the description of the \fBset\fR builtin command, \fBbash\fR ! interprets the following flags when it is invoked: .PP .PD 0 --- 62,71 ---- .PP .B Bash ! is intended to be a conformant implementation of the IEEE POSIX Shell and Tools specification (IEEE Working Group 1003\.2). .SH OPTIONS In addition to the single-character shell options documented in the description of the \fBset\fR builtin command, \fBbash\fR ! interprets the following options when it is invoked: .PP .PD 0 *************** *** 74,78 **** If the .B \-c ! flag is present, then commands are read from .IR string . If there are arguments after the --- 74,78 ---- If the .B \-c ! option is present, then commands are read from .IR string . If there are arguments after the *************** *** 84,88 **** If the .B \-r ! flag is present, the shell becomes .I restricted (see --- 84,88 ---- If the .B \-r ! option is present, the shell becomes .I restricted (see *************** *** 94,98 **** If the .B \-i ! flag is present, the shell is .IR interactive . .TP --- 94,98 ---- If the .B \-i ! option is present, the shell is .IR interactive . .TP *************** *** 100,104 **** If the .B \-s ! flag is present, or if no arguments remain after option processing, then commands are read from the standard input. This option allows the positional parameters to be set --- 100,104 ---- If the .B \-s ! option is present, or if no arguments remain after option processing, then commands are read from the standard input. This option allows the positional parameters to be set *************** *** 131,134 **** --- 131,138 ---- .PD 0 .TP + .B \-\-dump\-po\-strings + Equivalent to \fB\-D\fP, but the output is in the GNU \fIgettext\fP + \fBpo\fP (portable object) file format. + .TP .B \-\-dump\-strings Equivalent to \fB\-D\fP. *************** *** 310,315 **** as closely as possible, while conforming to the POSIX standard as well. ! When invoked as a login shell, it first attempts to read and execute ! commands from .I /etc/profile and --- 314,319 ---- as closely as possible, while conforming to the POSIX standard as well. ! When invoked as an interactive login shell, it first attempts to ! read and execute commands from .I /etc/profile and *************** *** 350,360 **** .B \-\-posix command line option, it follows the POSIX standard for startup files. ! In this mode, the .SM .B ENV ! variable is expanded and commands are read and executed from the file whose name is the expanded value. No other startup files are read. - This is done by interactive shells only. .PP .B Bash --- 354,363 ---- .B \-\-posix command line option, it follows the POSIX standard for startup files. ! In this mode, interactive shells expand the .SM .B ENV ! variable and commands are read and executed from the file whose name is the expanded value. No other startup files are read. .PP .B Bash *************** *** 428,433 **** .PP .B ! .if n ! case do done elif else esac fi for function if in select then until while { } time ! .if t ! case do done elif else esac fi for function if in select then until while { } time .if t .RE .RE --- 431,436 ---- .PP .B ! .if n ! case do done elif else esac fi for function if in select then until while { } time [[ ]] ! .if t ! case do done elif else esac fi for function if in select then until while { } time [[ ]] .if t .RE .RE *************** *** 583,586 **** --- 586,650 ---- \fBlet "\fIexpression\fP"\fR. .TP + \fB[[\fP \fIexpression\fP \fB]]\fP + Return a status of 0 or 1 depending on the evaluation of + the conditional expression \fIexpression\fP. + Expressions are composed of the primaries described below under + .SM + .BR "CONDITIONAL EXPRESSIONS" . + Word splitting and pathname expansion are not performed on the words + between the \fB[[\fP and \fB]]\fP; tilde expansion, parameter and + variable expansion, arithmetic expansion, command substitution, process + substitution, and quote removal are performed. + .if t .sp 0.5 + .if n .sp 1 + When the \fB==\fP and \fB!=\fP operators are used, the string to the + right of the operator is considered a pattern and matched according + to the rules described below under \fBPattern Matching\fP. + The return value is 0 if the string matches or does not match + the pattern, respectively, and 1 otherwise. + Any part of the pattern may be quoted to force it to be matched as a + string. + .if t .sp 0.5 + .if n .sp 1 + Expressions may be combined using the following operators, listed + in decreasing order of precedence: + .if t .sp 0.5 + .if n .sp 1 + .RS + .PD 0 + .TP + .B ( \fIexpression\fP ) + Returns the value of \fIexpression\fP. + This may be used to override the normal precedence of operators. + .TP + .B ! \fIexpression\fP + True if + .I expression + is false. + .TP + \fIexpression1\fP \fB&&\fP \fIexpression2\fP + True if both + .I expression1 + and + .I expression2 + are true. + .TP + .if t \fIexpression1\fP \fB\(bv\(bv\fP \fIexpression2\fP + .if n \fIexpression1\fP \fB||\fP \fIexpression2\fP + True if either + .I expression1 + or + .I expression2 + is true. + .PD + .RE + .LP + The \fB&&\fP and + .if t \fB\(bv\(bv\fP + .if n \fB||\fP + operators do not execute \fIexpression2\fP if the value of + \fIexpression1\fP is sufficient to determine the return value of + the entire conditional expression. + .TP \fBfor\fP \fIname\fP [ \fBin\fP \fIword\fP; ] \fBdo\fP \fIlist\fP ; \fBdone\fP The list of words following \fBin\fP is expanded, generating a list *************** *** 592,595 **** --- 656,662 ---- .B PARAMETERS below). + The return status is the exit status of the last command that executes. + If the expansion of the items following \fBin\fP results in an empty + list, no commands are executed, and the return status is 0. .TP \fBselect\fP \fIname\fP [ \fBin\fP \fIword\fP; ] \fBdo\fP \fIlist\fP ; \fBdone\fP *************** *** 695,699 **** be ignored. An interactive shell without the .B interactive_comments - .B shopt option enabled does not allow comments. The .B interactive_comments --- 762,765 ---- *************** *** 718,723 **** It preserves the literal value of the next character that follows, with the exception of . If a \fB\e\fP pair ! appears, and the backslash is not quoted, the \fB\e\fP ! is treated as a line continuation (that is, it is effectively ignored). .PP Enclosing characters in single quotes preserves the literal value --- 784,790 ---- It preserves the literal value of the next character that follows, with the exception of . If a \fB\e\fP pair ! appears, and the backslash is not itself quoted, the \fB\e\fP ! is treated as a line continuation (that is, it is removed from the ! input stream and effectively ignored). .PP Enclosing characters in single quotes preserves the literal value *************** *** 792,796 **** .TP .B \e\fInnn\fP ! the character whose ASCII code is \fInnn\fP (octal) .PD .RE --- 859,868 ---- .TP .B \e\fInnn\fP ! the character whose ASCII code is the octal value \fInnn\fP ! (one to three digits) ! .TP ! .B \ex\fInnn\fP ! the character whose ASCII code is the hexadecimal value \fInnn\fP ! (one to three digits) .PD .RE *************** *** 845,849 **** .B EXPANSION below). If the variable has its ! .B \-i attribute set (see .B declare --- 917,921 ---- .B EXPANSION below). If the variable has its ! .B integer attribute set (see .B declare *************** *** 853,858 **** then .I value ! is subject to arithmetic expansion even if the $((...)) syntax does ! not appear (see .B "Arithmetic Expansion" below). --- 925,930 ---- then .I value ! is subject to arithmetic expansion even if the $((...)) expansion is ! not used (see .B "Arithmetic Expansion" below). *************** *** 895,900 **** .SM .B IFS ! special variable. That is, ``\fB$*\fP'' is equivalent ! to ``\fB$1\fP\fIc\fP\fB$2\fP\fIc\fP\fB...\fP'', where .I c is the first character of the value of the --- 967,972 ---- .SM .B IFS ! special variable. That is, "\fB$*\fP" is equivalent ! to "\fB$1\fP\fIc\fP\fB$2\fP\fIc\fP\fB...\fP", where .I c is the first character of the value of the *************** *** 912,921 **** .B @ Expands to the positional parameters, starting from one. When the ! expansion occurs within double quotes, each parameter expands as a ! separate word. That is, `` ! .BR $@ '' ! is equivalent to ! ``\fB$1\fP'' ``\fB$2\fP'' ... ! When there are no positional parameters, ``\fB$@\fP'' and .B $@ expand to nothing (i.e., they are removed). --- 984,991 ---- .B @ Expands to the positional parameters, starting from one. When the ! expansion occurs within double quotes, each parameter expands to a ! separate word. That is, "\fB$@\fP" is equivalent to ! "\fB$1\fP" "\fB$2\fP" ... ! When there are no positional parameters, "\fB$@\fP" and .B $@ expand to nothing (i.e., they are removed). *************** *** 935,939 **** (such as the .B \-i ! flag). .TP .B $ --- 1005,1009 ---- (such as the .B \-i ! option). .TP .B $ *************** *** 981,985 **** .TP .B PPID ! The process ID of the shell's parent. .TP .B PWD --- 1051,1055 ---- .TP .B PPID ! The process ID of the shell's parent. This variable is readonly. .TP .B PWD *************** *** 1000,1011 **** .B UID Expands to the user ID of the current user, initialized at shell startup. .TP .B EUID Expands to the effective user ID of the current user, initialized at ! shell startup. .TP .B GROUPS An array variable containing the list of groups of which the current ! user is a member. .TP .B BASH --- 1070,1082 ---- .B UID Expands to the user ID of the current user, initialized at shell startup. + This variable is readonly. .TP .B EUID Expands to the effective user ID of the current user, initialized at ! shell startup. This variable is readonly. .TP .B GROUPS An array variable containing the list of groups of which the current ! user is a member. This variable is readonly. .TP .B BASH *************** *** 1018,1023 **** .TP .B BASH_VERSINFO ! An array variable whose members hold version information for this ! instance of .BR bash . The values assigned to the array members are as follows: --- 1089,1094 ---- .TP .B BASH_VERSINFO ! A readonly array variable whose members hold version information for ! this instance of .BR bash . The values assigned to the array members are as follows: *************** *** 1220,1233 **** The home directory of the current user; the default argument for the \fBcd\fP builtin command. .TP .B CDPATH The search path for the .B cd ! command. This is a colon-separated ! list of directories in which the shell looks for destination directories ! specified by the .B cd ! command. A sample value is ! ``.:~:/usr''. .TP .B BASH_ENV --- 1291,1305 ---- The home directory of the current user; the default argument for the \fBcd\fP builtin command. + The value of this variable is also used when performing tilde expansion. .TP .B CDPATH The search path for the .B cd ! command. ! This is a colon-separated list of directories in which the shell looks ! for destination directories specified by the .B cd ! command. ! A sample value is ``.:~:/usr''. .TP .B BASH_ENV *************** *** 1235,1239 **** its value is interpreted as a filename containing commands to initialize the shell, as in ! .IR .bashrc . The value of .SM --- 1307,1311 ---- its value is interpreted as a filename containing commands to initialize the shell, as in ! .IR ~/.bashrc . The value of .SM *************** *** 1263,1268 **** .B MAILPATH A colon-separated list of file names to be checked for mail. ! The message to be printed may be specified by separating the file name from ! the message with a `?'. $_ stands for the name of the current mailfile. Example: .RS --- 1335,1342 ---- .B MAILPATH A colon-separated list of file names to be checked for mail. ! The message to be printed when mail arrives in a particular file ! may be specified by separating the file name from the message with a `?'. ! When used in the text of the message, \fB$_\fP expands to the name of ! the current mailfile. Example: .RS *************** *** 1398,1402 **** .B LC_COLLATE This variable determines the collation order used when sorting the ! results of pathname expansion. .TP .B LC_MESSAGES --- 1472,1483 ---- .B LC_COLLATE This variable determines the collation order used when sorting the ! results of pathname expansion, and determines the behavior of range ! expressions, equivalence classes, and collating sequences within ! pathname expansion and pattern matching. ! .TP ! .B LC_CTYPE ! This variable determines the interpretation of characters and the ! behavior of character classes within pathname expansion and pattern ! matching. .TP .B LC_MESSAGES *************** *** 1488,1491 **** --- 1569,1575 ---- This variable's function is superseded by .BR HISTIGNORE . + The second and subsequent lines of a multi-line compound command are + not tested, and are added to the history regardless of the value of + .BR HISTCONTROL . .TP .B HISTIGNORE *************** *** 1500,1503 **** --- 1584,1590 ---- matches the previous history line. `\fB&\fP' may be escaped using a backslash. The backslash is removed before attempting a match. + The second and subsequent lines of a multi-line compound command are + not tested, and are added to the history regardless of the value of + .BR HISTIGNORE . .TP .B histchars *************** *** 1508,1512 **** below). The first character is the .IR "history expansion character" , ! that is, the character which signals the start of a history expansion, normally `\fB!\fP'. The second character is the --- 1595,1599 ---- below). The first character is the .IR "history expansion character" , ! the character which signals the start of a history expansion, normally `\fB!\fP'. The second character is the *************** *** 1516,1520 **** The default is `\fB^\fP'. The optional third character is the character ! which signifies that the remainder of the line is a comment when found as the first character of a word, normally `\fB#\fP'. The history comment character causes history substitution to be skipped for the --- 1603,1607 ---- The default is `\fB^\fP'. The optional third character is the character ! which indicates that the remainder of the line is a comment when found as the first character of a word, normally `\fB#\fP'. The history comment character causes history substitution to be skipped for the *************** *** 1624,1628 **** The .B unset ! builtin is used to destroy arrays. \fBunset\fP \fIname\fP[\fIsubscript\fP] destroys the array element at index \fIsubscript\fP. \fBunset\fP \fIname\fP, where \fIname\fP is an array, or --- 1711,1715 ---- The .B unset ! builtin is used to destroy arrays. \fBunset\fP \fBname\fP[\fIsubscript\fP] destroys the array element at index \fIsubscript\fP. \fBunset\fP \fIname\fP, where \fIname\fP is an array, or *************** *** 1673,1677 **** expand a single word to a single word. The only exceptions to this are the expansions of ! ``\fB$@\fP'' and ``\fB${\fP\fIname\fP\fB[@]}\fP'' as explained above (see .SM --- 1760,1764 ---- expand a single word to a single word. The only exceptions to this are the expansions of ! "\fB$@\fP" and "\fB${\fP\fIname\fP\fB[@]}\fP" as explained above (see .SM *************** *** 1688,1694 **** followed by a series of comma-separated strings between a pair of braces, followed by an optional ! .IR postamble . The preamble is prefixed to each string contained ! within the braces, and the postamble is then appended to each resulting string, expanding left to right. .PP --- 1775,1781 ---- followed by a series of comma-separated strings between a pair of braces, followed by an optional ! .IR postscript . The preamble is prefixed to each string contained ! within the braces, and the postscript is then appended to each resulting string, expanding left to right. .PP *************** *** 1754,1762 **** .SS Tilde Expansion .PP ! If a word begins with a tilde character (`\fB~\fP'), all of the characters ! preceding the first slash (or all characters, if there is no slash) ! are treated as a possible \fIlogin name\fP. If this \fIlogin name\fP ! is the null string, the tilde is replaced with the value of the ! parameter .SM .BR HOME . --- 1841,1852 ---- .SS Tilde Expansion .PP ! If a word begins with an unquoted tilde character (`\fB~\fP'), all of ! the characters preceding the first unquoted slash (or all characters, ! if there is no unquoted slash) are considered a \fItilde-prefix\fP. ! If none of the characters in the tilde-prefix are quoted, the ! characters in the tilde-prefix following the tilde are treated as a ! possible \fIlogin name\fP. ! If this login name is the null string, the tilde is replaced with the ! value of the shell parameter .SM .BR HOME . *************** *** 1764,1790 **** .SM .B HOME ! is unset, the home directory of ! the user executing the shell is substituted instead. .PP ! If a `+' follows the tilde, the value of .SM .B PWD ! replaces the tilde and `+'. If ! a `\-' follows, the value of .SM ! .B OLDPWD ! is substituted. ! If the value following the tilde is a valid \fIlogin name\fP, ! the tilde and \fIlogin name\fP are replaced with the home directory ! associated with that name. If the name is invalid, or the tilde ! expansion fails, the word is unchanged. .PP ! Each variable assignment is checked for unquoted ! tildes immediately following a .B : or .BR = . ! In these cases, tilde substitution is also performed. Consequently, one ! may use file names with tildes in assignments to .SM .BR PATH , --- 1854,1889 ---- .SM .B HOME ! is unset, the home directory of the user executing the shell is ! substituted instead. ! Otherwise, the tilde-prefix is replaced with the home directory ! associated with the specified login name. .PP ! If the tilde-prefix is a `~+', the value of the shell variable .SM .B PWD ! replaces the tilde-prefix. ! If the tilde-prefix is a `~\-', the value of the shell variable .SM ! .BR OLDPWD , ! if it is set, is substituted. ! If the characters following the tilde in the tilde-prefix consist ! of a number \fIN\fP, optionally prefixed ! by a `+' or a `\-', the tilde-prefix is replaced with the corresponding ! element from the directory stack, as it would be displayed by the ! .B dirs ! builtin invoked with the tilde-prefix as an argument. ! If the characters following the tilde in the tilde-prefix consist of a ! number without a leading `+' or `\-', `+' is assumed. .PP ! If the login name is invalid, or the tilde expansion fails, the word ! is unchanged. ! .PP ! Each variable assignment is checked for unquoted tilde-prefixes immediately ! following a .B : or .BR = . ! In these cases, tilde expansion is also performed. ! Consequently, one may use file names with tildes in assignments to .SM .BR PATH , *************** *** 1804,1807 **** --- 1903,1911 ---- interpreted as part of the name. .PP + When braces are used, the matching ending brace is the first `\fB}\fP' + not escaped by a backslash or within a quoted string, and not within an + embedded arithmetic expansion, command substitution, or paramter + expansion. + .PP .PD 0 .TP *************** *** 1881,1885 **** \fBSubstring Expansion.\fP Expands to up to \fIlength\fP characters of \fIparameter\fP, ! starting at \fIoffset\fP. If \fIlength\fP is omitted, expands to the substring of \fIparameter\fP, starting at the character specified by \fIoffset\fP. --- 1985,1989 ---- \fBSubstring Expansion.\fP Expands to up to \fIlength\fP characters of \fIparameter\fP, ! starting at the characters specified by \fIoffset\fP. If \fIlength\fP is omitted, expands to the substring of \fIparameter\fP, starting at the character specified by \fIoffset\fP. *************** *** 1897,1902 **** the result is the \fIlength\fP members of the array beginning with ${\fIparameter\fP[\fIoffset\fP]}. ! Substring indexing is zero-based unless the positional parameters are ! used, in which case the indexing starts at 1. .TP ${\fB#\fP\fIparameter\fP} --- 2001,2006 ---- the result is the \fIlength\fP members of the array beginning with ${\fIparameter\fP[\fIoffset\fP]}. ! Substring indexing is zero-based unless the positional parameters ! are used, in which case the indexing starts at 1. .TP ${\fB#\fP\fIparameter\fP} *************** *** 1908,1912 **** or .BR @ , ! the length substituted is the number of positional parameters. If .I parameter --- 2012,2016 ---- or .BR @ , ! the value substituted is the number of positional parameters. If .I parameter *************** *** 1915,1919 **** or .BR @ , ! the length substituted is the number of elements in the array. .TP .PD 0 --- 2019,2023 ---- or .BR @ , ! the value substituted is the number of elements in the array. .TP .PD 0 *************** *** 1928,1932 **** the value of .IR parameter , ! then the expansion is the value of .I parameter with the shortest matching pattern (the ``\fB#\fP'' case) or the --- 2032,2036 ---- the value of .IR parameter , ! then the result of the expansion is the expanded value of .I parameter with the shortest matching pattern (the ``\fB#\fP'' case) or the *************** *** 1956,1962 **** The \fIword\fP is expanded to produce a pattern just as in pathname expansion. ! If the pattern matches a trailing portion of the value of .IR parameter , ! then the expansion is the value of .I parameter with the shortest matching pattern (the ``\fB%\fP'' case) or the --- 2060,2066 ---- The \fIword\fP is expanded to produce a pattern just as in pathname expansion. ! If the pattern matches a trailing portion of the expanded value of .IR parameter , ! then the result of the expansion is the expanded value of .I parameter with the shortest matching pattern (the ``\fB%\fP'' case) or the *************** *** 2015,2019 **** .SS Command Substitution .PP ! \fICommand substitution\fP allows the output of a command to replace the command name. There are two forms: .PP --- 2119,2123 ---- .SS Command Substitution .PP ! \fICommand substitution\fP allows the output of a command to replace the command name. There are two forms: .PP *************** *** 2031,2034 **** --- 2135,2142 ---- replacing the command substitution with the standard output of the command, with any trailing newlines deleted. + Embedded newlines are not deleted, but they may be removed during + word splitting. + The command substitution \fB$(cat \fIfile\fP)\fR can be replaced by + the equivalent but faster \fB$(< \fIfile\fP)\fR. .PP When the old-style backquote form of substitution is used, *************** *** 2038,2045 **** or .BR \e . When using the $(\^\fIcommand\fP\|) form, all characters between the parentheses make up the command; none are treated specially. .PP ! Command substitutions may be nested. To nest when using the old form, escape the inner backquotes with backslashes. .PP --- 2146,2155 ---- or .BR \e . + The first backquote not preceded by a backslash terminates the + command substitution. When using the $(\^\fIcommand\fP\|) form, all characters between the parentheses make up the command; none are treated specially. .PP ! Command substitutions may be nested. To nest when using the backquoted form, escape the inner backquotes with backslashes. .PP *************** *** 2087,2091 **** argument should be read to obtain the output of \fIlist\fP. .PP ! On systems that support it, \fIprocess substitution\fP is performed simultaneously with parameter and variable expansion, command substitution, --- 2197,2201 ---- argument should be read to obtain the output of \fIlist\fP. .PP ! When available, \fIprocess substitution\fP is performed simultaneously with parameter and variable expansion, command substitution, *************** *** 2170,2173 **** --- 2280,2284 ---- .BR * , .BR ? , + .BR ( , and .BR [ . *************** *** 2181,2186 **** .B nullglob is disabled, the word is left unchanged. ! If the option is set, and no matches are found, the word is removed. When a pattern is used for pathname expansion, the character --- 2292,2303 ---- .B nullglob is disabled, the word is left unchanged. ! If the ! .B nullglob ! option is set, and no matches are found, the word is removed. + If the shell option + .B nocaseglob + is enabled, the match is performed without regard to the case + of alphabetic characters. When a pattern is used for pathname expansion, the character *************** *** 2190,2194 **** .B dotglob is set. ! The slash character must always be matched explicitly. In other cases, the .B ``.'' --- 2307,2312 ---- .B dotglob is set. ! When matching a pathname, the slash character must always be ! matched explicitly. In other cases, the .B ``.'' *************** *** 2200,2204 **** .B SHELL BUILTIN COMMANDS for a description of the ! .B nullglob and .B dotglob --- 2318,2323 ---- .B SHELL BUILTIN COMMANDS for a description of the ! .BR nocaseglob , ! .BR nullglob , and .B dotglob *************** *** 2246,2249 **** --- 2365,2375 ---- is unset. .PP + \fBPattern Matching\fP + .PP + Any character that appears in a pattern, other than the special pattern + characters described below, matches itself. The NUL character may not + occur in a pattern. The special pattern characters must be quoted if + they are to be matched literally. + .PP The special pattern characters have the following meanings: .PP *************** *** 2276,2279 **** --- 2402,2470 ---- may be matched by including it as the first character in the set. + .br + .if t .sp 0.5 + .if n .sp 1 + Within + .B [ + and + .BR ] , + \fIcharacter classes\fP can be specified using the syntax + \fB[:\fP\fIclass\fP\fB:]\fP, where \fIclass\fP is one of the + following classes defined in the POSIX.2 standard: + .PP + .RS + .B + .if n alnum alpha ascii blank cntrl digit graph lower print punct space upper xdigit + .if t alnum alpha ascii blank cntrl digit graph lower print punct space upper xdigit + .br + A character class matches any character belonging to that class. + .br + .if t .sp 0.5 + .if n .sp 1 + Within + .B [ + and + .BR ] , + an \fIequivalence class\fP can be specified using the syntax + \fB[=\fP\fIc\fP\fB=]\fP, which matches all characters with the + same collation weight (as defined by the current locale) as + the character \fIc\fP. + .br + .if t .sp 0.5 + .if n .sp 1 + Within + .B [ + and + .BR ] , + the syntax \fB[.\fP\fIsymbol\fP\fB.]\fP matches the collating symbol + \fIsymbol\fP. + .RE + .PD + .PP + If the \fBextglob\fP shell option is enabled using the \fBshopt\fP + builtin, several extended pattern matching operators are recognized. + In the following description, a \fIpattern\-list\fP is a list of one + or more patterns separated by a \fB|\fP. + Composite patterns may be formed using one or more of the following + sub-patterns: + .sp 1 + .PD 0 + .RS + .TP + \fB?(\fP\^\fIpattern-list\^\fP\fB)\fP + Matches zero or one occurrence of the given patterns + .TP + \fB*(\fP\^\fIpattern-list\^\fP\fB)\fP + Matches zero or more occurrences of the given patterns + .TP + \fB+(\fP\^\fIpattern-list\^\fP\fB)\fP + Matches one or more occurrences of the given patterns + .TP + \fB@(\fP\^\fIpattern-list\^\fP\fB)\fP + Matches exactly one of the given patterns + .TP + \fB!(\fP\^\fIpattern-list\^\fP\fB)\fP + Matches anything except one of the given patterns + .RE .PD .SS Quote Removal *************** *** 2282,2286 **** characters .BR \e , ! .BR ` , and \^\f3"\fP\^ that did not result from one of the above expansions are removed. --- 2473,2477 ---- characters .BR \e , ! .BR ' , and \^\f3"\fP\^ that did not result from one of the above expansions are removed. *************** *** 2308,2316 **** 1). .PP ! The word that follows the redirection operator in the following ! descriptions is subjected to brace expansion, tilde expansion, ! parameter expansion, command substitution, arithmetic expansion, ! quote removal, and pathname expansion. If it expands to more ! than one word, .B bash reports an error. --- 2499,2507 ---- 1). .PP ! The word following the redirection operator in the following ! descriptions, unless otherwise noted, is subjected to brace expansion, ! tilde expansion, parameter expansion, command substitution, arithmetic ! expansion, quote removal, and pathname expansion. ! If it expands to more than one word, .B bash reports an error. *************** *** 2336,2339 **** --- 2527,2532 ---- before the standard output was redirected to .IR dirlist . + .PP + A failure to open or create a file causes the redirection to fail. .SS Redirecting Input .PP *************** *** 2373,2388 **** .BR > , and the ! .B \-C option to the .B set builtin has been enabled, the redirection will fail if the filename ! whose name results from the expansion of \fIword\fP exists. If the redirection operator is .BR >| , ! then the value of the ! .B \-C option to the .B set ! builtin command is not tested, and the redirection is attempted even if the file named by \fIword\fP exists. .SS Appending Redirected Output --- 2566,2584 ---- .BR > , and the ! .B noclobber option to the .B set builtin has been enabled, the redirection will fail if the filename ! whose name results from the expansion of \fIword\fP exists and is ! a regular file. If the redirection operator is .BR >| , ! or the redirection operator is ! .B > ! and the ! .B noclobber option to the .B set ! builtin command is not enabled, the redirection is attempted even if the file named by \fIword\fP exists. .SS Appending Redirected Output *************** *** 2461,2465 **** is the result of quote removal on .IR word , ! and the lines in the here-document are not expanded. Otherwise, all lines of the here-document are subjected to parameter expansion, command substitution, and arithmetic expansion. In the latter --- 2657,2662 ---- is the result of quote removal on .IR word , ! and the lines in the here-document are not expanded. ! If \fIword\fP is unquoted, all lines of the here-document are subjected to parameter expansion, command substitution, and arithmetic expansion. In the latter *************** *** 2495,2499 **** expands to one or more digits, the file descriptor denoted by .I n ! is made to be a copy of that file descriptor. If .I word evaluates to --- 2692,2700 ---- expands to one or more digits, the file descriptor denoted by .I n ! is made to be a copy of that file descriptor. ! If the digits in ! .I word ! do not specify a file descriptor open for input, a redirection error occurs. ! If .I word evaluates to *************** *** 2514,2517 **** --- 2715,2721 ---- .I n is not specified, the standard output (file descriptor 1) is used. + If the digits in + .I word + do not specify a file descriptor open for output, a redirection error occurs. As a special case, if \fIn\fP is omitted, and \fIword\fP does not expand to one or more digits, the standard output and standard *************** *** 2533,2536 **** --- 2737,2742 ---- is not specified. If the file does not exist, it is created. .SH ALIASES + Aliases allow a string to be substituted for a word when it is used + as the first word of a simple command. The shell maintains a list of .I aliases *************** *** 2597,2601 **** on that line are not affected by the new alias. This behavior is also an issue when functions are executed. ! Aliases are expanded when the function definition is read, not when the function is executed, because a function definition is itself a compound command. As a consequence, aliases --- 2803,2807 ---- on that line are not affected by the new alias. This behavior is also an issue when functions are executed. ! Aliases are expanded when a function definition is read, not when the function is executed, because a function definition is itself a compound command. As a consequence, aliases *************** *** 2606,2610 **** in compound commands. .PP ! Note that for almost every purpose, aliases are superseded by shell functions. .SH FUNCTIONS --- 2812,2816 ---- in compound commands. .PP ! For almost every purpose, aliases are superseded by shell functions. .SH FUNCTIONS *************** *** 2645,2649 **** positional parameters and the special parameter .B # ! are restored to the values they had prior to function execution. .PP --- 2851,2855 ---- positional parameters and the special parameter .B # ! are restored to the values they had prior to the function's execution. .PP *************** *** 2670,2673 **** --- 2876,3131 ---- Functions may be recursive. No limit is imposed on the number of recursive calls. + .SH "ARITHMETIC EVALUATION" + The shell allows arithmetic expressions to be evaluated, under + certain circumstances (see the \fBlet\fP builtin command and + \fBArithmetic Expansion\fP). + Evaluation is done in long integers with no check for overflow, + though division by 0 is trapped and flagged as an error. + The following list of operators is grouped into levels of + equal-precedence operators. + The levels are listed in order of decreasing precedence. + .PP + .PD 0 + .TP + .B \- + + unary minus and plus + .TP + .B ! ~ + logical and bitwise negation + .TP + .B ** + exponentiation + .TP + .B * / % + multiplication, division, remainder + .TP + .B + \- + addition, subtraction + .TP + .B << >> + left and right bitwise shifts + .TP + .B <= >= < > + comparison + .TP + .B == != + equality and inequality + .TP + .B & + bitwise AND + .TP + .B ^ + bitwise exclusive OR + .TP + .B | + bitwise OR + .TP + .B && + logical AND + .TP + .B || + logical OR + .TP + .B \fIexpr\fP?\fIexpr\fP:\fIexpr\fP + conditional evaluation + .TP + .B = *= /= %= += \-= <<= >>= &= ^= |= + assignment + .PD + .PP + Shell variables are allowed as operands; parameter expansion is + performed before the expression is evaluated. + The value of a parameter is coerced to a long integer within + an expression. A shell variable need not have its integer attribute + turned on to be used in an expression. + .PP + Constants with a leading 0 are interpreted as octal numbers. + A leading 0x or 0X denotes hexadecimal. + Otherwise, numbers take the form [\fIbase#\fP]n, where \fIbase\fP + is a decimal number between 2 and 64 representing the arithmetic + base, and \fIn\fP is a number in that base. + If \fIbase\fP is omitted, then base 10 is used. + The digits greater than 9 are represented by the lowercase letters, + the uppercase letters, _, and @, in that order. + If \fIbase\fP is less than or equal to 36, lowercase and uppercase + letters may be used interchangably to represent numbers between 10 + and 35. + .PP + Operators are evaluated in order of precedence. Sub-expressions in + parentheses are evaluated first and may override the precedence + rules above. + .SH "CONDITIONAL EXPRESSIONS" + Conditional expressions are used by the \fB[[\fP compound command and + the \fBtest\fP and \fB[\fP builtin commands to test file attributes + and perform string and arithmetic comparisons. + Expressions are formed from the following unary or binary primaries. + If any \fIfile\fP argument to one of the primaries is of the form + /dev/fd/\fIn\fP, then file descriptor \fIn\fP is checked. + .sp 1 + .PD 0 + .TP + .B \-a \fIfile\fP + True if \fIfile\fP exists. + .TP + .B \-b \fIfile\fP + True if \fIfile\fP exists and is a block special file. + .TP + .B \-c \fIfile\fP + True if \fIfile\fP exists and is a character special file. + .TP + .B \-d \fIfile\fP + True if \fIfile\fP exists and is a directory. + .TP + .B \-e \fIfile\fP + True if \fIfile\fP exists. + .TP + .B \-f \fIfile\fP + True if \fIfile\fP exists and is a regular file. + .TP + .B \-g \fIfile\fP + True if \fIfile\fP exists and is set-group-id. + .TP + .B \-k \fIfile\fP + True if \fIfile\fP exists and its ``sticky'' bit is set. + .TP + .B \-p \fIfile\fP + True if \fIfile\fP exists and is a named pipe (FIFO). + .TP + .B \-r \fIfile\fP + True if \fIfile\fP exists and is readable. + .TP + .B \-s \fIfile\fP + True if \fIfile\fP exists and has a size greater than zero. + .TP + .B \-t \fIfd\fP + True if file descriptor + .I fd + is open and refers to a terminal. + .TP + .B \-u \fIfile\fP + True if \fIfile\fP exists and its set-user-id bit is set. + .TP + .B \-w \fIfile\fP + True if \fIfile\fP exists and is writable. + .TP + .B \-x \fIfile\fP + True if \fIfile\fP exists and is executable. + .TP + .B \-O \fIfile\fP + True if \fIfile\fP exists and is owned by the effective user id. + .TP + .B \-G \fIfile\fP + True if \fIfile\fP exists and is owned by the effective group id. + .TP + .B \-L \fIfile\fP + True if \fIfile\fP exists and is a symbolic link. + .TP + .B \-S \fIfile\fP + True if \fIfile\fP exists and is a socket. + .TP + .B \-N \fIfile\fP + True if \fIfile\fP exists and has been modified since it was last read. + .TP + \fIfile1\fP \-\fBnt\fP \fIfile2\fP + True if \fIfile1\fP is newer (according to + modification date) than \fIfile2\fP. + .TP + \fIfile1\fP \-\fBot\fP \fIfile2\fP + True if \fIfile1\fP is older than \fIfile2\fP. + .TP + \fIfile1\fP \fB\-ef\fP \fIfile2\fP + True if \fIfile1\fP and \fIfile2\fP have the same device and + inode numbers. + .TP + .B \-o \fIoptname\fP + True if shell option + .I optname + is enabled. + See the list of options under the description of the + .B \-o + option to the + .B set + builtin below. + .TP + .B \-z \fIstring\fP + True if the length of \fIstring\fP is zero. + .TP + .B \-n \fIstring\fP + .TP + \fIstring\fP + True if the length of + .I string + is non-zero. + .TP + \fIstring1\fP \fB==\fP \fIstring2\fP + True if the strings are equal. \fB=\fP may be used in place of + \fB==\fP. + .TP + \fIstring1\fP \fB!=\fP \fIstring2\fP + True if the strings are not equal. + .TP + \fIstring1\fP \fB<\fP \fIstring2\fP + True if \fIstring1\fP sorts before \fIstring2\fP lexicographically + in the current locale. + .TP + \fIstring1\fP \fB>\fP \fIstring2\fP + True if \fIstring1\fP sorts after \fIstring2\fP lexicographically + in the current locale. + .TP + .I \fIarg1\fP \fBOP\fP \fIarg2\fP + .SM + .B OP + is one of + .BR \-eq , + .BR \-ne , + .BR \-lt , + .BR \-le , + .BR \-gt , + or + .BR \-ge . + These arithmetic binary operators return true if \fIarg1\fP + is equal to, not equal to, less than, less than or equal to, + greater than, or greater than or equal to \fIarg2\fP, respectively. + .I Arg1 + and + .I arg2 + may be positive or negative integers. + .PD + .SH "SIMPLE COMMAND EXPANSION" + When a simple command is executed, the shell performs the following + expansions, assignments, and redirections, from left to right. + .IP 1. + The words that the parser has marked as variable assignments (those + preceding the command name) and redirections are saved for later + processing. + .IP 2. + The words that are not variable assignments or redirections are + expanded. If any words remain after expansion, the first word + is taken to be the name of the command and the remaining words are + the arguments. + .IP 3. + Redirections are performed as described above under + .SM + .BR REDIRECTION . + .IP 4. + The text after the \fB=\fP in each variable assignment undergoes tilde + expansion, parameter expansion, command substitution, arithmetic expansion, + and quote removal before being assigned to the variable. + .PP + If no command name results, the variable assignments affect the current + shell environment. Otherwise, the variables are added to the environment + of the executed command and do not affect the current shell environment. + If any of the assignments attempts to assign a value to a readonly variable, + an error occurs, and the command exits with a non-zero status. + .PP + If no command name results, redirections are performed, but do not + affect the current shell environment. A redirection error causes the + command to exit with a non-zero status. + .PP + If there is a command name left after expansion, execution proceeds as + described below. Otherwise, the command exits. If one of the expansions + contained a command substitution, the exit status of the command is + the exit status of the last command substitution performed. If there + were no command substitutions, the command exits with a status of zero. .SH "COMMAND EXECUTION" After a command has been split into words, if it results in a *************** *** 2704,2711 **** is performed only if the command is not found in the hash table. If the search is unsuccessful, the shell prints an error ! message and returns a non-zero exit status. .PP If the search is successful, or if the command name contains ! one or more slashes, the shell executes the named program. Argument 0 is set to the name given, and the remaining arguments to the command are set to the arguments given, if any. --- 3162,3170 ---- is performed only if the command is not found in the hash table. If the search is unsuccessful, the shell prints an error ! message and returns an exit status of 127. .PP If the search is successful, or if the command name contains ! one or more slashes, the shell executes the named program in a ! separate execution environment. Argument 0 is set to the name given, and the remaining arguments to the command are set to the arguments given, if any. *************** *** 2735,2738 **** --- 3194,3259 ---- by the name of the program, followed by the command arguments, if any. + .SH COMMAND EXECUTION ENVIRONMENT + The shell has an \fIexecution environment\fP, which consists of the + following: + .sp 1 + .IP \(bu + open files inherited by the shell at invocation, as modified by + redirections supplied to the \fBexec\fP builtin + .IP \(bu + the current working directory as set by \fBcd\fP, \fBpushd\fP, or + \fBpopd\fP, or inherited by the shell at invocation + .IP \(bu + the file creation mode mask as set by \fBumask\fP or inherited from + the shell's parent + .IP \(bu + current traps set by \fBtrap\fP + .IP \(bu + shell parameters that are set by variable assignment or with \fBset\fP + or inherited from the shell's parent in the environment + .IP \(bu + shell functions defined during execution or inherited from the shell's + parent in the environment + .IP \(bu + options enabled at invocation (either by default or with command-line + arguments) or by \fBset\fP + .IP \(bu + options enabled by \fBshopt\fP + .IP \(bu + shell aliases defined with \fBalias\fP + .IP \(bu + various process IDs, including those of background jobs, the value + of \fB$$\fP, and the value of \fB$PPID\fP + .PP + When a simple command other than a builtin or shell function + is to be executed, it + is invoked in a separate execution environment that consists of + the following. Unless otherwise noted, the values are inherited + from the shell. + .sp 1 + .IP \(bu + the shell's open files, plus any modifications and additions specified + by redirections to the command + .IP \(bu + the current working directory + .IP \(bu + the file creation mode mask + .IP \(bu + shell variables marked for export, along with variables exported for + the command, passed in the environment + .IP \(bu + traps caught by the shell are reset to the values the inherited + from the shell's parent, and traps ignored by the shell are ignored + .PP + A command invoked in this separate environment cannot affect the + shell's execution environment. + .PP + Command substitution and asynchronous commands are invoked in a + subshell environment that is a duplicate of the shell environment, + except that traps caught by the shell are reset to the values + that the shell inherited from its parent at invocation. Builtin + commands that are invoked as part of a pipeline are also executed in a + subshell environment. Changes made to the subshell environment + cannot affect the shell's execution environment. .SH ENVIRONMENT When a program is invoked it is given an array of strings *************** *** 2778,2782 **** If the .B \-k ! flag is set (see the .B set builtin command below), then --- 3299,3303 ---- If the .B \-k ! option is set (see the .B set builtin command below), then *************** *** 2792,2796 **** command in its environment. .SH "EXIT STATUS" ! For the purposes of the shell, a command which exits with a zero exit status has succeeded. An exit status of zero indicates success. A non-zero exit status indicates failure. --- 3313,3317 ---- command in its environment. .SH "EXIT STATUS" ! For the shell's purposes, a command which exits with a zero exit status has succeeded. An exit status of zero indicates success. A non-zero exit status indicates failure. *************** *** 2802,2805 **** --- 3323,3329 ---- but is not executable, the return status is 126. .PP + If a command fails because of an error during expansion or redirection, + the exit status is greater than zero. + .PP Shell builtin commands return a status of 0 (\fItrue\fP) if successful, and non-zero (\fIfalse\fP) if an error occurs *************** *** 2812,2816 **** command below. .SH SIGNALS ! When \fBbash\fP is interactive, it ignores .SM .B SIGTERM --- 3336,3340 ---- command below. .SH SIGNALS ! When \fBbash\fP is interactive, in the absence of any traps, it ignores .SM .B SIGTERM *************** *** 2834,2841 **** .BR SIGTSTP . .PP ! Synchronous jobs started by \fBbash\fP have signals set to the ! values inherited by the shell from its parent. When job control ! is not in effect, background jobs (jobs started with ! .BR & ) ignore .SM --- 3358,3364 ---- .BR SIGTSTP . .PP ! Synchronous jobs started by \fBbash\fP have signal handlers ! set to the values inherited by the shell from its parent. ! When job control is not in effect, asynchronous commands ignore .SM *************** *** 2843,2847 **** and .SM ! .BR SIGQUIT . Commands run as a result of command substitution ignore the keyboard-generated job control signals --- 3366,3371 ---- and .SM ! .B SIGQUIT ! as well. Commands run as a result of command substitution ignore the keyboard-generated job control signals *************** *** 2860,2865 **** .SM .B SIGHUP ! to all jobs, running or stopped. To prevent the shell from ! sending the signal to a particular job, remove it from the jobs table with the .B disown --- 3384,3396 ---- .SM .B SIGHUP ! to all jobs, running or stopped. ! Stopped jobs are sent ! .SM ! .B SIGCONT ! to ensure that they receive the ! .SM ! .BR SIGHUP . ! To prevent the shell from ! sending the signal to a particular job, it should be removed from the jobs table with the .B disown *************** *** 2867,2875 **** .SM .B "SHELL BUILTIN COMMANDS" ! below) or use ! .B "disown \-h" ! to mark it to not receive .SM ! .BR SIGHUP . .SH "JOB CONTROL" .I Job control --- 3398,3425 ---- .SM .B "SHELL BUILTIN COMMANDS" ! below) or marked ! to not receive .SM ! .B SIGHUP ! using ! .BR "disown \-h" . ! .PP ! If the ! .B huponexit ! shell option has been set with ! .BR shopt , ! .B bash ! sends a ! .SM ! .B SIGHUP ! to all jobs when an interactive login shell exits. ! .PP ! When \fBbash\fP receives a signal for which a trap has been set while ! waiting for a command to complete, the trap will not be executed until ! the command completes. ! When \fBbash\fP is waiting for an asynchronous command via the \fBwait\fP ! builtin, the reception of a signal for which a trap has been set will ! cause the \fBwait\fP builtin to return immediately with an exit status ! greater than 128, immediately after which the trap is executed. .SH "JOB CONTROL" .I Job control *************** *** 2945,2949 **** be returned to .BR bash . ! You may then manipulate the state of this job, using the .B bg command to continue it in the background, the --- 3495,3499 ---- be returned to .BR bash . ! The user may then manipulate the state of this job, using the .B bg command to continue it in the background, the *************** *** 2984,2988 **** .IR "current job" , which is the last job stopped while it was in ! the foreground. The .I "previous job" --- 3534,3538 ---- .IR "current job" , which is the last job stopped while it was in ! the foreground or started in the background. The .I "previous job" *************** *** 3017,3021 **** .B set builtin command ! is set, .B bash reports such changes immediately. --- 3567,3571 ---- .B set builtin command ! is enabled, .B bash reports such changes immediately. *************** *** 3063,3066 **** --- 3613,3619 ---- newline .TP + .B \er + carriage return + .TP .B \es the name of the shell, the basename of *************** *** 3246,3250 **** .PP The syntax for controlling key bindings in the ! .I ~/.inputrc file is simple. All that is required is the name of the command or the text of a macro and a key sequence to which --- 3799,3803 ---- .PP The syntax for controlling key bindings in the ! .I inputrc file is simple. All that is required is the name of the command or the text of a macro and a key sequence to which *************** *** 3252,3256 **** as a symbolic key name, possibly with \fIMeta\-\fP or \fIControl\-\fP prefixes, or as a key sequence. ! When using the form \fBkeyname\fP:\fIfunction\-name\fP or \fImacro\fP, .I keyname is the name of a key spelled out in English. For example: --- 3805,3809 ---- as a symbolic key name, possibly with \fIMeta\-\fP or \fIControl\-\fP prefixes, or as a key sequence. ! When using the form \fBkeyname\fP:\^\fIfunction\-name\fP or \fImacro\fP, .I keyname is the name of a key spelled out in English. For example: *************** *** 3278,3282 **** into the line). .PP ! In the second form, \fB"keyseq"\fP:\fIfunction\-name\fP or \fImacro\fP, .B keyseq differs from --- 3831,3835 ---- into the line). .PP ! In the second form, \fB"keyseq"\fP:\^\fIfunction\-name\fP or \fImacro\fP, .B keyseq differs from *************** *** 3306,3311 **** is bound to insert the text .BR "Function Key 1" . ! The full set of escape sequences is .RS .TP .B \eC\- --- 3859,3865 ---- is bound to insert the text .BR "Function Key 1" . ! The full set of GNU Emacs style escape sequences is .RS + .PD 0 .TP .B \eC\- *************** *** 3327,3335 **** literal ' .RE .PP ! When entering the text of a macro, single or double quotes should ! be used to indicate a macro definition. Unquoted text ! is assumed to be a function name. Backslash ! will quote any character in the macro text, including " and '. .PP .B Bash --- 3881,3931 ---- literal ' .RE + .PD .PP ! In addition to the GNU Emacs style escape sequences, a second ! set of backslash escapes is available: ! .RS ! .PD 0 ! .TP ! .B \ea ! alert (bell) ! .TP ! .B \eb ! backspace ! .TP ! .B \ed ! delete ! .TP ! .B \ef ! form feed ! .TP ! .B \en ! newline ! .TP ! .B \er ! carriage return ! .TP ! .B \et ! horizontal tab ! .TP ! .B \ev ! vertical tab ! .TP ! .B \e\fInnn\fP ! the character whose ASCII code is the octal value \fInnn\fP ! (one to three digits) ! .TP ! .B \ex\fInnn\fP ! the character whose ASCII code is the hexadecimal value \fInnn\fP ! (one to three digits) ! .RE ! .PD ! .PP ! When entering the text of a macro, single or double quotes must ! be used to indicate a macro definition. ! Unquoted text is assumed to be a function name. ! In the macro body, the backslash escapes described above are expanded. ! Backslash will quote any other character in the macro text, ! including " and '. .PP .B Bash *************** *** 3382,3385 **** --- 3978,3985 ---- in vi command mode. .TP + .B completion\-ignore\-case (Off) + If set to \fBOn\fP, readline performs filename matching and completion + in a case\-insensitive fashion. + .TP .B completion\-query\-items (100) This determines when the user is queried about viewing *************** *** 3434,3438 **** .TP .B keymap (emacs) ! Set the current readline keymap. The set of legal keymap names is \fIemacs, emacs\-standard, emacs\-meta, emacs\-ctlx, vi, vi\-command\fP, and --- 4034,4038 ---- .TP .B keymap (emacs) ! Set the current readline keymap. The set of valid keymap names is \fIemacs, emacs\-standard, emacs\-meta, emacs\-ctlx, vi, vi\-command\fP, and *************** *** 3458,3461 **** --- 4058,4065 ---- sequence. .TP + .B print\-completions\-horizontally (Off) + If set to \fBOn\fP, readline will display completions with matches + sorted horizontally in alphabetical order, rather than down the screen. + .TP .B show\-all\-if\-ambiguous (Off) This alters the default behavior of the completion functions. If *************** *** 3475,3479 **** compilation features of the C preprocessor which allows key bindings and variable settings to be performed as the result ! of tests. There are three parser directives used. .IP \fB$if\fP The --- 4079,4083 ---- compilation features of the C preprocessor which allows key bindings and variable settings to be performed as the result ! of tests. There are four parser directives used. .IP \fB$if\fP The *************** *** 3496,3500 **** terminal's function keys. The word on the right side of the .B = ! is tested against the full name of the terminal and the portion of the terminal name before the first \fB\-\fP. This allows .I sun --- 4100,4104 ---- terminal's function keys. The word on the right side of the .B = ! is tested against the both full name of the terminal and the portion of the terminal name before the first \fB\-\fP. This allows .I sun *************** *** 3512,3515 **** --- 4116,4120 ---- a specific program. For instance, the following command adds a key sequence that quotes the current or previous word in Bash: + .sp 1 .RS .nf *************** *** 3522,3530 **** .RE .IP \fB$endif\fP ! This command, as you saw in the previous example, terminates an \fB$if\fP command. .IP \fB$else\fP Commands in this branch of the \fB$if\fP directive are executed if the test fails. .SS Searching .PP --- 4127,4145 ---- .RE .IP \fB$endif\fP ! This command, as seen in the previous example, terminates an \fB$if\fP command. .IP \fB$else\fP Commands in this branch of the \fB$if\fP directive are executed if the test fails. + .IP \fB$include\fP + This directive takes a single filename as an argument and reads commands + and bindings from that file. For example, the following directive + would read \fI/etc/inputrc\fP: + .sp 1 + .RS + .nf + \fB$include\fP \^ \fI/etc/inputrc\fP + .fi + .RE .SS Searching .PP *************** *** 3562,3566 **** Non-incremental searches read the entire search string before starting to search for matching history lines. The search string may be ! typed by the user or part of the contents of the current line. .SS "Readline Command Names" .PP --- 4177,4181 ---- Non-incremental searches read the entire search string before starting to search for matching history lines. The search string may be ! typed by the user or be part of the contents of the current line. .SS "Readline Command Names" .PP *************** *** 3668,3674 **** the previous history entry). With an argument, behave exactly like \fByank\-nth\-arg\fP. .TP .B shell\-expand\-line (M\-C\-e) ! Expand the line the way the shell does when it reads it. This performs alias and history expansion as well as all of the shell word expansions. See --- 4283,4291 ---- the previous history entry). With an argument, behave exactly like \fByank\-nth\-arg\fP. + Successive calls to \fByank\-last\-arg\fP move back through the history + list, inserting the last argument of each line in turn. .TP .B shell\-expand\-line (M\-C\-e) ! Expand the line as the shell does. This performs alias and history expansion as well as all of the shell word expansions. See *************** *** 3684,3687 **** --- 4301,4311 ---- below for a description of history expansion. .TP + .B magic\-space + Perform history expansion on the current line and insert a space. + See + .SM + .B HISTORY EXPANSION + below for a description of history expansion. + .TP .B alias\-expand\-line Perform alias expansion on the current line. *************** *** 3709,3714 **** Delete the character under the cursor. If point is at the beginning of the line, there are no characters in the line, and ! the last character typed was not ! .BR C\-d , then return .SM --- 4333,4337 ---- Delete the character under the cursor. If point is at the beginning of the line, there are no characters in the line, and ! the last character typed was not bound to \fBdelete\-char\fP, then return .SM *************** *** 3720,3724 **** .TP .B quoted\-insert (C\-q, C\-v) ! Add the next character that you type to the line verbatim. This is how to insert characters like \fBC\-q\fP, for example. .TP --- 4343,4347 ---- .TP .B quoted\-insert (C\-q, C\-v) ! Add the next character typed to the line verbatim. This is how to insert characters like \fBC\-q\fP, for example. .TP *************** *** 3740,3752 **** .B upcase\-word (M\-u) Uppercase the current (or following) word. With a negative argument, ! do the previous word, but do not move point. .TP .B downcase\-word (M\-l) Lowercase the current (or following) word. With a negative argument, ! do the previous word, but do not move point. .TP .B capitalize\-word (M\-c) Capitalize the current (or following) word. With a negative argument, ! do the previous word, but do not move point. .PD .SS Killing and Yanking --- 4363,4375 ---- .B upcase\-word (M\-u) Uppercase the current (or following) word. With a negative argument, ! uppercase the previous word, but do not move point. .TP .B downcase\-word (M\-l) Lowercase the current (or following) word. With a negative argument, ! lowercase the previous word, but do not move point. .TP .B capitalize\-word (M\-c) Capitalize the current (or following) word. With a negative argument, ! capitalize the previous word, but do not move point. .PD .SS Killing and Yanking *************** *** 3762,3766 **** .B unix\-line\-discard (C\-u) Kill backward from point to the beginning of the line. ! .\" There is no real difference between this and backward-kill-line .TP .B kill\-whole\-line --- 4385,4390 ---- .B unix\-line\-discard (C\-u) Kill backward from point to the beginning of the line. ! The killed text is saved on the kill-ring. ! \" There is no real difference between this and backward-kill-line .TP .B kill\-whole\-line *************** *** 3793,3799 **** --- 4417,4425 ---- .B copy\-backward\-word Copy the word before point to the kill buffer. + The word boundaries are the same as \fBbackward\-word\fP. .TP .B copy\-forward\-word Copy the word following point to the kill buffer. + The word boundaries are the same as \fBforward\-word\fP. .TP .B yank (C\-y) *************** *** 3849,3852 **** --- 4475,4491 ---- \fBpossible\-completions\fP. .TP + .B menu\-complete + Similar to \fBcomplete\fP, but replaces the word to be completed + with a single match from the list of possible completions. + Repeated execution of \fBmenu\-complete\fP steps through the list + of possible completions, inserting each match in turn. + At the end of the list of completions, the bell is rung and the + original text is restored. + An argument of \fIn\fP moves \fIn\fP positions forward in the list + of matches; a negative argument may be used to move backward + through the list. + This command is intended to be bound to \fBTAB\fP, but is unbound + by default. + .TP .B complete\-filename (M\-/) Attempt filename completion on the text before point. *************** *** 3884,3888 **** it as a command name. Command completion attempts to match the text against aliases, reserved words, shell ! functions, builtins, and finally executable filenames, in that order. .TP --- 4523,4527 ---- it as a command name. Command completion attempts to match the text against aliases, reserved words, shell ! functions, shell builtins, and finally executable filenames, in that order. .TP *************** *** 3946,3950 **** .TP .B revert\-line (M\-r) ! Undo all changes made to this line. This is like typing the .B undo command enough times to return the line to its initial state. --- 4585,4589 ---- .TP .B revert\-line (M\-r) ! Undo all changes made to this line. This is like executing the .B undo command enough times to return the line to its initial state. *************** *** 4133,4146 **** is read, before the shell breaks it into words. It takes place in two parts. ! The first is to determine which line from the previous history to use during substitution. The second is to select portions of that line for inclusion into the current one. ! The line selected from the previous history is the \fIevent\fP, and the portions of that line that are acted upon are \fIwords\fP. Various \fImodifiers\fP are available to manipulate the selected words. The line is broken into words in the same fashion as when reading input, so that several \fImetacharacter\fP-separated words surrounded by ! quotes are considered as one word. History expansions are introduced by the appearance of the history expansion character, which is \^\fB!\fP\^ by default. --- 4772,4785 ---- is read, before the shell breaks it into words. It takes place in two parts. ! The first is to determine which line from the history list to use during substitution. The second is to select portions of that line for inclusion into the current one. ! The line selected from the history is the \fIevent\fP, and the portions of that line that are acted upon are \fIwords\fP. Various \fImodifiers\fP are available to manipulate the selected words. The line is broken into words in the same fashion as when reading input, so that several \fImetacharacter\fP-separated words surrounded by ! quotes are considered one word. History expansions are introduced by the appearance of the history expansion character, which is \^\fB!\fP\^ by default. *************** *** 4241,4245 **** .B : separates the event specification from the word designator. ! It can be omitted if the word designator begins with a .BR ^ , .BR $ , --- 4880,4884 ---- .B : separates the event specification from the word designator. ! It may be omitted if the word designator begins with a .BR ^ , .BR $ , *************** *** 4360,4439 **** if it is the last character of the event line. .PD - .SH "ARITHMETIC EVALUATION" - The shell allows arithmetic expressions to be evaluated, under - certain circumstances (see the \fBlet\fP builtin command and - \fBArithmetic Expansion\fP). - Evaluation - is done in long integers with no check for overflow, though division - by 0 is trapped and flagged as an error. The following list of - operators is grouped into levels of equal-precedence operators. - The levels are listed in order of decreasing precedence. - .PP - .PD 0 - .TP - .B \- + - unary minus and plus - .TP - .B ! ~ - logical and bitwise negation - .TP - .B * / % - multiplication, division, remainder - .TP - .B + \- - addition, subtraction - .TP - .B << >> - left and right bitwise shifts - .TP - .B <= >= < > - comparison - .TP - .B == != - equality and inequality - .TP - .B & - bitwise AND - .TP - .B ^ - bitwise exclusive OR - .TP - .B | - bitwise OR - .TP - .B && - logical AND - .TP - .B || - logical OR - .TP - .B \fIexpr\fP?\fIexpr\fP:\fIexpr\fP - conditional evaluation - .TP - .B = *= /= %= += \-= <<= >>= &= ^= |= - assignment - .PD - .PP - Shell variables are allowed as operands; parameter expansion is - performed before the expression is evaluated. - The value of a parameter is coerced to a long integer within - an expression. A shell variable need not have its integer attribute - turned on to be used in an expression. - .PP - Constants with a leading 0 are interpreted as octal numbers. - A leading 0x or 0X denotes hexadecimal. - Otherwise, numbers take the form [\fIbase#\fP]n, where \fIbase\fP - is a decimal number between 2 and 64 representing the arithmetic - base, and \fIn\fP is a number in that base. - If \fIbase\fP is omitted, then base 10 is used. - The digits greater than 9 are represented by the lowercase letters, - the uppercase letters, _, and @, in that order. - If \fIbase\fP is less than or equal to 36, lowercase and uppercase - letters may be used interchangably to represent numbers between 10 - and 35. - .PP - Operators are evaluated in order of precedence. Sub-expressions in - parentheses are evaluated first and may override the precedence - rules above. .SH "SHELL BUILTIN COMMANDS" .\" start of bash_builtins --- 4999,5002 ---- *************** *** 4495,4499 **** the script (0 if no commands are executed), and false if .I filename ! is not found. .TP \fBalias\fP [\fB\-p\fP] [\fIname\fP[=\fIvalue\fP] ...] --- 5058,5062 ---- the script (0 if no commands are executed), and false if .I filename ! is not found or cannot be read. .TP \fBalias\fP [\fB\-p\fP] [\fIname\fP[=\fIvalue\fP] ...] *************** *** 4512,4516 **** .TP \fBbg\fP [\fIjobspec\fP] ! Place \fIjobspec\fP in the background, as if it had been started with .BR & . If \fIjobspec\fP is not present, the shell's notion of the --- 5075,5080 ---- .TP \fBbg\fP [\fIjobspec\fP] ! Resume the suspended job \fIjobspec\fP in the background, as if it ! had been started with .BR & . If \fIjobspec\fP is not present, the shell's notion of the *************** *** 4523,4527 **** .TP .PD 0 ! \fBbind\fP [\fB\-m\fP \fIkeymap\fP] [\fB\-lpsvPSV\fP] [\fB\-q\fP \fIname\fP] [\fB\-r\fP \fIkeyseq\fP] .TP \fBbind\fP [\fB\-m\fP \fIkeymap\fP] \fB\-f\fP \fIfilename\fP --- 5087,5093 ---- .TP .PD 0 ! \fBbind\fP [\fB\-m\fP \fIkeymap\fP] [\fB\-lpsvPSV\fP] ! .TP ! \fBbind\fP [\fB\-m\fP \fIkeymap\fP] [\fB\-q\fP \fIfunction\fP] [\fB\-u\fP \fIfunction\fP] [\fB\-r\fP \fIkeyseq\fP] .TP \fBbind\fP [\fB\-m\fP \fIkeymap\fP] \fB\-f\fP \fIfilename\fP *************** *** 4585,4588 **** --- 5151,5157 ---- Query about which keys invoke the named \fIfunction\fP. .TP + .B \-u \fIfunction\fP + Unbind all keys bound to the named \fIfunction\fP. + .TP .B \-r \fIkeyseq\fP Remove any current binding for \fIkeyseq\fP. *************** *** 4614,4622 **** .IR arguments , and return its exit status. ! This is useful when you wish to define a function whose name is the same as a shell builtin, ! but need the functionality of the ! builtin within the function itself. The \fBcd\fP builtin is ! commonly redefined this way. The return status is false if .I shell\-builtin is not a shell builtin command. --- 5183,5191 ---- .IR arguments , and return its exit status. ! This is useful when defining a function whose name is the same as a shell builtin, ! retaining the functionality of the builtin within the function. ! The \fBcd\fP builtin is commonly redefined this way. ! The return status is false if .I shell\-builtin is not a shell builtin command. *************** *** 4690,4694 **** used to invoke .I command ! to be printed; the .B \-V option produces a more verbose description. --- 5259,5263 ---- used to invoke .I command ! to be displayed; the .B \-V option produces a more verbose description. *************** *** 4771,4775 **** .B \-r Make \fIname\fPs readonly. These names cannot then be assigned values ! by subsequent assignment statements. .TP .B \-x --- 5340,5344 ---- .B \-r Make \fIname\fPs readonly. These names cannot then be assigned values ! by subsequent assignment statements or unset. .TP .B \-x *************** *** 4783,4787 **** \fIname\fP local, as with the .B local ! command. The return value is 0 unless an illegal option is encountered, an attempt is made to define a function using "\-f foo=bar", an attempt is made to assign a value to a readonly variable, --- 5352,5356 ---- \fIname\fP local, as with the .B local ! command. The return value is 0 unless an invalid option is encountered, an attempt is made to define a function using "\-f foo=bar", an attempt is made to assign a value to a readonly variable, *************** *** 4789,4793 **** using the compound assignment syntax (see .B Arrays ! above), one of the \fInames\fP is not a legal shell variable name, an attempt is made to turn off readonly status for a readonly variable, an attempt is made to turn off array status for an array variable, --- 5358,5362 ---- using the compound assignment syntax (see .B Arrays ! above), one of the \fInames\fP is not a valid shell variable name, an attempt is made to turn off readonly status for a readonly variable, an attempt is made to turn off array status for an array variable, *************** *** 4835,4848 **** .PP The return value is 0 unless an ! illegal option is supplied or \fIn\fP indexes beyond the end of the directory stack. .RE .TP ! \fBdisown\fP [\fB\-h\fP] [\fIjobspec\fP ...] Without options, each .I jobspec is removed from the table of active jobs. ! If the \fB\-h\fP option is given, the job is not removed from the table, ! but is marked so that .SM .B SIGHUP --- 5404,5418 ---- .PP The return value is 0 unless an ! invalid option is supplied or \fIn\fP indexes beyond the end of the directory stack. .RE .TP ! \fBdisown\fP [\fB\-ar\fP] [\fB\-h\fP] [\fIjobspec\fP ...] Without options, each .I jobspec is removed from the table of active jobs. ! If the \fB\-h\fP option is given, each ! .I jobspec ! is not removed from the table, but is marked so that .SM .B SIGHUP *************** *** 4852,4857 **** If no .I jobspec ! is present, the \fIcurrent job\fP is used. The return value is ! 0 unless a .I jobspec does not specify a valid job. --- 5422,5440 ---- If no .I jobspec ! is present, and neither the ! .B \-a ! nor the ! .B \-r ! option is supplied, the \fIcurrent job\fP is used. ! If no ! .I jobspec ! is supplied, the ! .B \-a ! option means to remove or mark all jobs; the ! .B \-r ! option without a ! .I jobspec ! argument restricts operation to running jobs. ! The return value is 0 unless a .I jobspec does not specify a valid job. *************** *** 4905,4917 **** backslash .TP ! .B \ennn ! the character whose ASCII code is \fInnn\fP (octal) .PD .RE .TP \fBenable\fP [\fB\-adnps\fP] [\fB\-f\fP \fIfilename\fP] [\fIname\fP ...] ! Enable and disable builtin shell commands. This allows ! the execution of a disk command which has the same name as a shell ! builtin without specifying a full file name. If \fB\-n\fP is used, each \fIname\fP is disabled; otherwise, --- 5488,5506 ---- backslash .TP ! .B \e\fInnn\fP ! the character whose ASCII code is the octal value \fInnn\fP ! (one to three digits) ! .TP ! .B \ex\fInnn\fP ! the character whose ASCII code is the hexadecimal value \fInnn\fP ! (one to three digits) .PD .RE .TP \fBenable\fP [\fB\-adnps\fP] [\fB\-f\fP \fIfilename\fP] [\fIname\fP ...] ! Enable and disable builtin shell commands. ! Disabling a builtin allows a disk command which has the same name ! as a shell builtin to be executed with specifying a full pathname, ! even though the shell normally searches for builtins before disk commands. If \fB\-n\fP is used, each \fIname\fP is disabled; otherwise, *************** *** 4959,4963 **** returns 0. .TP ! \fBexec\fP [\fB\-cl\fP] [\fB\-a\fP \fIname\fP] [\fIcommand\fP] [\fIarguments\fP] If .I command --- 5548,5552 ---- returns 0. .TP ! \fBexec\fP [\fB\-cl\fP] [\fB\-a\fP \fIname\fP] [\fIcommand\fP [\fIarguments\fP]] If .I command *************** *** 4991,4995 **** .I command is not specified, any redirections take effect in the current shell, ! and the return status is 0. .TP \fBexit\fP [\fIn\fP] --- 5580,5585 ---- .I command is not specified, any redirections take effect in the current shell, ! and the return status is 0. If there is a redirection error, the ! return status is 1. .TP \fBexit\fP [\fIn\fP] *************** *** 5029,5035 **** named variables. .B export ! returns an exit status of 0 unless an illegal option is encountered, ! one of the \fInames\fP is not a legal shell variable name, or .B \-f is supplied with a --- 5619,5625 ---- named variables. .B export ! returns an exit status of 0 unless an invalid option is encountered, ! one of the \fInames\fP is not a valid shell variable name, or .B \-f is supplied with a *************** *** 5068,5078 **** The .B \-n ! flag suppresses the command numbers when listing. The .B \-r ! flag reverses the order of the commands. If the .B \-l ! flag is given, the commands are listed on standard output. Otherwise, the editor given by --- 5658,5668 ---- The .B \-n ! option suppresses the command numbers when listing. The .B \-r ! option reverses the order of the commands. If the .B \-l ! option is given, the commands are listed on standard output. Otherwise, the editor given by *************** *** 5113,5117 **** re-executes the last command. .sp 1 ! If the first form is used, the return value is 0 unless an illegal option is encountered or .I first --- 5703,5707 ---- re-executes the last command. .sp 1 ! If the first form is used, the return value is 0 unless an invalid option is encountered or .I first *************** *** 5131,5137 **** .TP \fBfg\fP [\fIjobspec\fP] ! Place .I jobspec ! in the foreground, and make it the current job. If .I jobspec is not present, the shell's notion of the \fIcurrent job\fP is used. --- 5721,5728 ---- .TP \fBfg\fP [\fIjobspec\fP] ! Resume .I jobspec ! in the foreground, and make it the current job. ! If .I jobspec is not present, the shell's notion of the \fIcurrent job\fP is used. *************** *** 5179,5182 **** --- 5770,5785 ---- is to be used. .sp 1 + When the end of options is encountered, \fBgetopts\fP exits with a + return value greater than zero. + \fBOPTIND\fP is set to the index of the first non-option argument, + and \fBname\fP is set to ?. + .sp 1 + .B getopts + normally parses the positional parameters, but if more arguments are + given in + .IR args , + .B getopts + parses those instead. + .sp 1 .B getopts can report errors in two ways. If the first character of *************** *** 5185,5199 **** .I silent error reporting is used. In normal operation diagnostic messages ! are printed when illegal options or missing option arguments are encountered. If the variable .SM .B OPTERR ! is set to 0, no error message will be displayed, even if the first character of .I optstring is not a colon. .sp 1 ! If an illegal option is seen, .B getopts places ? into --- 5788,5802 ---- .I silent error reporting is used. In normal operation diagnostic messages ! are printed when invalid options or missing option arguments are encountered. If the variable .SM .B OPTERR ! is set to 0, no error messages will be displayed, even if the first character of .I optstring is not a colon. .sp 1 ! If an invalid option is seen, .B getopts places ? into *************** *** 5228,5237 **** .sp 1 .B getopts - normally parses the positional parameters, but if more arguments are - given in - .IR args , - .B getopts - parses those instead. - .B getopts returns true if an option, specified or unspecified, is found. It returns false if the end of options is encountered or an --- 5831,5834 ---- *************** *** 5257,5261 **** The return status is true unless a .I name ! is not found or an illegal option is supplied. .TP \fBhelp\fP [\fIpattern\fP] --- 5854,5858 ---- The return status is true unless a .I name ! is not found or an invalid option is supplied. .TP \fBhelp\fP [\fIpattern\fP] *************** *** 5331,5335 **** .PD .PP ! The return value is 0 unless an illegal option is encountered or an error occurs while reading or writing the history file. .RE --- 5928,5932 ---- .PD .PP ! The return value is 0 unless an invalid option is encountered or an error occurs while reading or writing the history file. .RE *************** *** 5367,5372 **** .I jobspec is given, output is restricted to information about that job. ! The return status is 0 unless an illegal option is encountered ! or an illegal .I jobspec is supplied. --- 5964,5969 ---- .I jobspec is given, output is restricted to information about that job. ! The return status is 0 unless an invalid option is encountered ! or an invalid .I jobspec is supplied. *************** *** 5392,5396 **** \fBkill\fP [\fB\-s\fP \fIsigspec\fP | \fB\-n\fP \fIsignum\fP | \fB\-\fP\fIsigspec\fP] [\fIpid\fP | \fIjobspec\fP] ... .TP ! \fBkill\fP \fB\-l\fP [\fIsignum\fP | \fIsigspec\fP] .PD Send the signal named by --- 5989,5993 ---- \fBkill\fP [\fB\-s\fP \fIsigspec\fP | \fB\-n\fP \fIsignum\fP | \fB\-\fP\fIsigspec\fP] [\fIpid\fP | \fIjobspec\fP] ... .TP ! \fBkill\fP \fB\-l\fP [\fIsigspec\fP | \fIexit_status\fP] .PD Send the signal named by *************** *** 5420,5435 **** .SM .B SIGTERM ! is assumed. An argument of .B \-l ! lists the signal names. If any arguments are supplied when .B \-l ! is given, the names of the specified signals are listed, and ! the return status is 0. The arguments to .B \-l ! may be either signal names or signal numbers; if signal names ! are given, the corresponding signal number is displayed. .B kill returns true if at least one signal was successfully sent, or false ! if an error occurs or an illegal option is encountered. .TP \fBlet\fP \fIarg\fP [\fIarg\fP ...] --- 6017,6035 ---- .SM .B SIGTERM ! is assumed. ! An argument of .B \-l ! lists the signal names. ! If any arguments are supplied when .B \-l ! is given, the names of the signals corresponding to the arguments are ! listed, and the return status is 0. ! The \fIexit_status\fP argument to .B \-l ! is a number specifying either a signal number or the exit status of ! a process terminated by a signal. .B kill returns true if at least one signal was successfully sent, or false ! if an error occurs or an invalid option is encountered. .TP \fBlet\fP \fIarg\fP [\fIarg\fP ...] *************** *** 5446,5452 **** .TP \fBlocal\fP [\fIname\fP[=\fIvalue\fP] ...] ! For each argument, create a local variable named ! .IR name , ! and assign it .IR value . When --- 6046,6052 ---- .TP \fBlocal\fP [\fIname\fP[=\fIvalue\fP] ...] ! For each argument, a local variable named ! .I name ! is created, and assigned .IR value . When *************** *** 5462,5466 **** when not within a function. The return status is 0 unless .B local ! is used outside a function, or an illegal .I name is supplied. --- 6062,6066 ---- when not within a function. The return status is 0 unless .B local ! is used outside a function, or an invalid .I name is supplied. *************** *** 5503,5511 **** is performed as well, and the return status is 0. .B popd ! returns false if an illegal option is encountered, the directory stack is empty, a non-existent directory stack entry is specified, or the directory change fails. .RE .TP .PD 0 \fBpushd\fP [\fB\-n\fP] [\fIdir\fP] --- 6103,6129 ---- is performed as well, and the return status is 0. .B popd ! returns false if an invalid option is encountered, the directory stack is empty, a non-existent directory stack entry is specified, or the directory change fails. .RE .TP + \fBprintf\fP \fIformat\fP [\fIarguments\fP] + Write the formatted \fIarguments\fP to the standard output under the + control of the \fIformat\fP. + The \fIformat\fP is a character string which contains three types of objects: + plain characters, which are simply copied to standard output, character + escape sequences, which are converted and copied to the standard output, and + format specifications, each of which causes printing of the next successive + \fIargument\fP. + In addition to the standard \fIprintf\fP(1) formats, %b causes + \fBprintf\fP to expand backslash escape sequences in the corresponding + \fIargument\fP, and %q causes \fBprintf\fP to output the corresponding + \fIargument\fP in a format that can be reused as shell input. + .sp 1 + The \fIformat\fP is reused as necessary to consume all of the \fIarguments\fP. + If the \fIformat\fP requires more \fIarguments\fP than are supplied, the + extra format specifications behave as if a zero value or null string, as + appropriate, had been supplied. + .TP .PD 0 \fBpushd\fP [\fB\-n\fP] [\fIdir\fP] *************** *** 5575,5579 **** option is used, symbolic links are followed. The return status is 0 unless an error occurs while ! reading the name of the current directory. .TP \fBread\fP [\fB\-er\fP] [\fB\-a\fP \fIaname\fP] [\fB\-p\fP \fIprompt\fP] [\fIname\fP ...] --- 6193,6198 ---- option is used, symbolic links are followed. The return status is 0 unless an error occurs while ! reading the name of the current directory or an ! invalid option is supplied. .TP \fBread\fP [\fB\-er\fP] [\fB\-a\fP \fIaname\fP] [\fB\-p\fP \fIprompt\fP] [\fIname\fP ...] *************** *** 5583,5593 **** the second word to the second .IR name , ! and so on, with leftover words assigned to the last .IR name . ! Only the characters in .SM .B IFS ! are recognized as word delimiters. Options, if supplied, have the ! following meanings: .RS .PD 0 --- 6202,6215 ---- the second word to the second .IR name , ! and so on, with leftover words and their intervening separators assigned ! to the last .IR name . ! If there are fewer words read from the standard input than names, ! the remaining names are assigned empty values. ! The characters in .SM .B IFS ! are used to split the line into words. ! Options, if supplied, have the following meanings: .RS .PD 0 *************** *** 5609,5612 **** --- 6231,6235 ---- .I aname is unset before any new values are assigned. + Other \fIname\fP arguments are ignored. .TP .B \-e *************** *** 5647,5654 **** .B \-p option is supplied, a list of all readonly names is printed. ! The return status is 0 unless an illegal option is encountered, one of the .I names ! is not a legal shell variable name, or .B \-f is supplied with a --- 6270,6280 ---- .B \-p option is supplied, a list of all readonly names is printed. ! The ! .B \-p ! option causes output to be displayed in a format thatmay be reused as input. ! The return status is 0 unless an invalid option is encountered, one of the .I names ! is not a valid shell variable name, or .B \-f is supplied with a *************** *** 5675,5679 **** \fBset\fP [\fB\-\-abefhkmnptuvxBCHP\fP] [\fB\-o\fP \fIoption\fP] [\fIarg\fP ...] Without options, the name and value of each shell variable are displayed ! in a format that can be re-used as input. When options are specified, they set or unset shell attributes. Any arguments remaining after the options are processed are treated --- 6301,6306 ---- \fBset\fP [\fB\-\-abefhkmnptuvxBCHP\fP] [\fB\-o\fP \fIoption\fP] [\fIarg\fP ...] Without options, the name and value of each shell variable are displayed ! in a format that can be reused as input. ! The output is sorted according to the current locale. When options are specified, they set or unset shell attributes. Any arguments remaining after the options are processed are treated *************** *** 5721,5725 **** .B \-h Remember the location of commands as they are looked up for execution. ! This is on by default. .TP 8 .B \-k --- 6348,6352 ---- .B \-h Remember the location of commands as they are looked up for execution. ! This is enabled by default. .TP 8 .B \-k *************** *** 5729,5733 **** .TP 8 .B \-m ! Monitor mode. Job control is enabled. This flag is on by default for interactive shells on systems that support it (see --- 6356,6360 ---- .TP 8 .B \-m ! Monitor mode. Job control is enabled. This option is on by default for interactive shells on systems that support it (see *************** *** 5861,5868 **** mode. In this mode, the .B $ENV ! file is not processed, and shell functions ! are not inherited from the environment. This is enabled automatically ! on startup if the effective user (group) id is not equal to the real ! user (group) id. Turning this option off causes the effective user and group ids to be set to the real user and group ids. .TP 8 --- 6488,6497 ---- mode. In this mode, the .B $ENV ! file is not processed, shell functions are not inherited from the ! environment, and the variable ! The \fBSHELLOPTS\fP variable, if it appears in the environment, is ignored. ! This is enabled automatically on startup if the effective user (group) ! id is not equal to the real user (group) id. ! Turning this option off causes the effective user and group ids to be set to the real user and group ids. .TP 8 *************** *** 5908,5912 **** Enable .B ! ! style history substitution. This flag is on by default when the shell is interactive. .TP 8 --- 6537,6541 ---- Enable .B ! ! style history substitution. This option is on by default when the shell is interactive. .TP 8 *************** *** 5922,5926 **** .TP 8 .B \-\- ! If no arguments follow this flag, then the positional parameters are unset. Otherwise, the positional parameters are set to the \fIarg\fPs, even if some of them begin with a --- 6551,6555 ---- .TP 8 .B \-\- ! If no arguments follow this option, then the positional parameters are unset. Otherwise, the positional parameters are set to the \fIarg\fPs, even if some of them begin with a *************** *** 5938,5951 **** .PD .PP ! The flags are off by default ! unless otherwise noted. ! Using + rather than \- causes these flags ! to be turned off. The ! flags can also be specified as options to an ! invocation of the shell. The current ! set of flags may be found in .BR $\- . ! The return status is always true ! unless an illegal option is encountered. .RE .TP --- 6567,6577 ---- .PD .PP ! The options are off by default unless otherwise noted. ! Using + rather than \- causes these options to be turned off. ! The options can also be specified as arguments to an invocation of ! the shell. ! The current set of options may be found in .BR $\- . ! The return status is always true unless an invalid option is encountered. .RE .TP *************** *** 5978,5983 **** .B \-p option, a list of all settable options is displayed, with ! an indication of whether or not each is set. Other options have ! the following meanings: .RS .PD 0 --- 6604,6611 ---- .B \-p option, a list of all settable options is displayed, with ! an indication of whether or not each is set. ! The \fB\-p\fP option causes output to be displayed in a form that ! may be reused as input. ! Other options have the following meanings: .RS .PD 0 *************** *** 6016,6020 **** The return status when listing options is zero if all \fIoptnames\fP are enabled, non-zero otherwise. When setting or unsetting options, ! the return status is zero unless an \fIoptname\fP is not a legal shell option. .PP --- 6644,6648 ---- The return status when listing options is zero if all \fIoptnames\fP are enabled, non-zero otherwise. When setting or unsetting options, ! the return status is zero unless an \fIoptname\fP is not a valid shell option. .PP *************** *** 6082,6085 **** --- 6710,6717 ---- This option is enabled by default for interactive shells. .TP 8 + .B extglob + If set, the extended pattern matching features described above under + \fBPathname Expansion\fP are enabled. + .TP 8 .B histappend If set, the history list is appended to the file named by the value *************** *** 6104,6109 **** If set, and .B readline ! is being used, bash will attempt to perform hostname completion when a ! word beginning with \fB@\fP is being completed (see .B Completing under --- 6736,6741 ---- If set, and .B readline ! is being used, \fBbash\fP will attempt to perform hostname completion when a ! word containing a \fB@\fP is being completed (see .B Completing under *************** *** 6113,6116 **** --- 6745,6754 ---- This is enabled by default. .TP 8 + .B huponexit + If set, \fBbash\fP will send + .SM + .B SIGHUP + to all jobs when an interactive login shell exits. + .TP 8 .B interactive_comments If set, allow a word beginning with *************** *** 6133,6136 **** --- 6771,6782 ---- \fImailfile\fP has been read'' is displayed. .TP 8 + .B nocaseglob + If set, + .B bash + matches filenames in a case\-insensitive fashion when performing pathname + expansion (see + .B Pathname Expansion + above). + .TP 8 .B nullglob If set, *************** *** 6161,6165 **** .B PATH to find the directory containing the file supplied as an argument. ! This is enabled by default. .RE .TP --- 6807,6811 ---- .B PATH to find the directory containing the file supplied as an argument. ! This option is enabled by default. .RE .TP *************** *** 6183,6295 **** the evaluation of the conditional expression .IR expr . ! Expressions may be unary or binary. Unary ! expressions are often used to examine the status of a file. There ! are string operators and numeric comparison operators as well. Each ! operator and operand must be a separate argument. If \fIfile\fP ! is of the form /dev/fd/\fIn\fP, then file descriptor \fIn\fP is ! checked. Expressions are composed of the following primaries: .RS .PD 0 .TP - .B \-b \fIfile\fP - True if \fIfile\fP exists and is a block special file. - .TP - .B \-c \fIfile\fP - True if \fIfile\fP exists and is a character special file. - .TP - .B \-d \fIfile\fP - True if \fIfile\fP exists and is a directory. - .TP - .B \-e \fIfile\fP - True if \fIfile\fP exists. - .TP - .B \-f \fIfile\fP - True if \fIfile\fP exists and is a regular file. - .TP - .B \-g \fIfile\fP - True if \fIfile\fP exists and is set-group-id. - .TP - .B \-k \fIfile\fP - True if \fIfile\fP has its ``sticky'' bit set. - .TP - .B \-L \fIfile\fP - True if \fIfile\fP exists and is a symbolic link. - .TP - .B \-p \fIfile\fP - True if \fIfile\fP exists and is a named pipe. - .TP - .B \-r \fIfile\fP - True if \fIfile\fP exists and is readable. - .TP - .B \-s \fIfile\fP - True if \fIfile\fP exists and has a size greater than zero. - .TP - .B \-S \fIfile\fP - True if \fIfile\fP exists and is a socket. - .TP - .B \-t \fIfd\fP - True if - .I fd - is opened on a terminal. - .TP - .B \-u \fIfile\fP - True if \fIfile\fP exists and its set-user-id bit is set. - .TP - .B \-w \fIfile\fP - True if \fIfile\fP exists and is writable. - .TP - .B \-x \fIfile\fP - True if \fIfile\fP exists and is executable. - .TP - .B \-O \fIfile\fP - True if \fIfile\fP exists and is owned by the effective user id. - .TP - .B \-G \fIfile\fP - True if \fIfile\fP exists and is owned by the effective group id. - .TP - \fIfile1\fP \-\fBnt\fP \fIfile2\fP - True if \fIfile1\fP is newer (according to - modification date) than \fIfile2\fP. - .TP - \fIfile1\fP \-\fBot\fP \fIfile2\fP - True if \fIfile1\fP is older than \fIfile2\fP. - .TP - \fIfile1\fP \fB\-ef\fP \fIfile2\fP - True if \fIfile1\fP and \fIfile2\fP have the same device and - inode numbers. - .TP - .B \-o \fIoptname\fP - True if shell option - .I optname - is enabled. - See the list of options under the description of the - .B \-o - option to the - .B set - builtin above. - .TP - .B \-z \fIstring\fP - True if the length of \fIstring\fP is zero. - .TP - .B \-n \fIstring\fP - .TP - \fIstring\fP - True if the length of - .I string - is non-zero. - .TP - \fIstring1\fP \fB=\fP \fIstring2\fP - True if the strings are equal. \fB==\fP may be used in place of - \fB=\fP. - .TP - \fIstring1\fP \fB!=\fP \fIstring2\fP - True if the strings are not equal. - .TP - \fIstring1\fP \fB<\fP \fIstring2\fP - True if \fIstring1\fP sorts before \fIstring2\fP lexicographically. - .TP - \fIstring1\fP \fB>\fP \fIstring2\fP - True if \fIstring1\fP sorts after \fIstring2\fP lexicographically. - .TP .B ! \fIexpr\fP True if --- 6829,6843 ---- the evaluation of the conditional expression .IR expr . ! Each operator and operand must be a separate argument. ! Expressions are composed of the primaries described above under ! .SM ! .BR "CONDITIONAL EXPRESSIONS" . ! .if t .sp 0.5 ! .if n .sp 1 ! Expressions may be combined using the following operators, listed ! in decreasing order of precedence. .RS .PD 0 .TP .B ! \fIexpr\fP True if *************** *** 6297,6304 **** is false. .TP \fIexpr1\fP \-\fBa\fP \fIexpr2\fP True if both .I expr1 ! AND .I expr2 are true. --- 6845,6856 ---- is false. .TP + .B ( \fIexpr\fP ) + Returns the value of \fIexpr\fP. + This may be used to override the normal precedence of operators. + .TP \fIexpr1\fP \-\fBa\fP \fIexpr2\fP True if both .I expr1 ! and .I expr2 are true. *************** *** 6307,6334 **** True if either .I expr1 ! OR .I expr2 is true. .TP ! .I \fIarg1\fP \fBOP\fP \fIarg2\fP .SM ! .B OP ! is one of ! .BR \-eq , ! .BR \-ne , ! .BR \-lt , ! .BR \-le , ! .BR \-gt , ! or ! .BR \-ge . ! These arithmetic binary operators return true if \fIarg1\fP ! is equal to, not equal to, less than, less than or equal to, ! greater than, or greater than or equal to \fIarg2\fP, respectively. ! .I Arg1 ! and ! .I arg2 ! may be positive or negative integers. ! .PD .RE .TP .B times --- 6859,6917 ---- True if either .I expr1 ! or .I expr2 is true. + .PD + .PP + \fBtest\fP and \fB[\fP evaluate conditional + expressions using a set of rules based on the number of arguments. + .if t .sp 0.5 + .if n .sp 1 + .PD 0 + .TP + 0 arguments + The expression is false. + .TP + 1 argument + The expression is true if and only if the argument is not null. + .TP + 2 arguments + If the first argument is \fB!\fP, the expression is true if and + only if the second argument is null. + If the first argument is one of the unary conditional operators listed above + under + .SM + .BR "CONDITIONAL EXPRESSIONS" , + the expression is true if the unary test is true. + If the first argument is not a valid unary conditional operator, the expression + is false. .TP ! 3 arguments ! If the second argument is one of the binary conditional operators listed above ! under .SM ! .BR "CONDITIONAL EXPRESSIONS" , ! the result of the expression is the result of the binary test using ! the first and third arguments as operands. ! If the first argument is \fB!\fP, the value is the negation of ! the two-argument test using the second and third arguments. ! If the first argument is exactly \fB(\fP and the third argument is ! exactly \fB)\fP, the result is the one-argument test of the second ! argument. ! Otherwise, the expression is false. ! The \fB\-a\fP and \fB\-o\fP operators are considered binary operators ! in this case. ! .TP ! 4 arguments ! If the first argument is \fB!\fP, the result is the negation of ! the three-argument expression composed of the remaining arguments. ! Otherwise, the expression is parsed and evaluated according to ! precedence using the rules listed above. ! .TP ! 5 or more arguments ! The expression is parsed and evaluated according to precedence ! using the rules listed above. .RE + .PD .TP .B times *************** *** 6402,6406 **** returns true. .TP ! \fBtype\fP [\fB\-all\fP] [\fB\-type\fP | \fB\-path\fP] \fIname\fP [\fIname\fP ...] With no options, indicate how each --- 6985,6989 ---- returns true. .TP ! \fBtype\fP [\fB\-atp\fP] \fIname\fP [\fIname\fP ...] With no options, indicate how each *************** *** 6408,6413 **** would be interpreted if used as a command name. If the ! .B \-type ! flag is used, .B type prints a string which is one of --- 6991,6996 ---- would be interpreted if used as a command name. If the ! .B \-t ! option is used, .B type prints a string which is one of *************** *** 6427,6432 **** is returned. If the ! .B \-path ! flag is used, .B type either returns the name of the disk file --- 7010,7015 ---- is returned. If the ! .B \-p ! option is used, .B type either returns the name of the disk file *************** *** 6434,6443 **** .I name were specified as a command name, ! or nothing if ! .B \-type would not return .IR file . If a command is hashed, ! .B \-path prints the hashed value, not necessarily the file that appears first in --- 7017,7025 ---- .I name were specified as a command name, ! or nothing if \f(CWtype -t name\fP would not return .IR file . If a command is hashed, ! .B \-p prints the hashed value, not necessarily the file that appears first in *************** *** 6445,6450 **** .BR PATH . If the ! .B \-all ! flag is used, .B type prints all of the places that contain --- 7027,7032 ---- .BR PATH . If the ! .B \-a ! option is used, .B type prints all of the places that contain *************** *** 6453,6473 **** This includes aliases and functions, if and only if the ! .B \-path ! flag is not also used. The table of hashed commands is not consulted when using ! .BR \-all . ! .B type ! accepts ! .BR \-a , ! .BR \-t , ! and ! .B \-p ! in place of ! .BR \-all , ! .BR \-type , ! and ! .BR \-path , ! respectively. .B type returns true if any of the arguments are found, false if --- 7035,7043 ---- This includes aliases and functions, if and only if the ! .B \-p ! option is not also used. The table of hashed commands is not consulted when using ! .BR \-a . .B type returns true if any of the arguments are found, false if *************** *** 6551,6560 **** .BR \-u , which are unscaled values. The return status is 0 ! unless an illegal option is encountered, a non-numeric argument other than \fBunlimited\fP is supplied as \fIlimit\fP, or an error occurs while setting a new limit. .RE .TP ! \fBumask\fP [\fB\-S\fP] [\fImode\fP] The user file-creation mask is set to .IR mode . --- 7121,7130 ---- .BR \-u , which are unscaled values. The return status is 0 ! unless an invalid option is encountered, a non-numeric argument other than \fBunlimited\fP is supplied as \fIlimit\fP, or an error occurs while setting a new limit. .RE .TP ! \fBumask\fP [\fB\-p\fP] [\fB\-S\fP] [\fImode\fP] The user file-creation mask is set to .IR mode . *************** *** 6576,6579 **** --- 7146,7154 ---- option causes the mask to be printed in symbolic form; the default output is an octal number. + If the + .B \-p + option is supplied, and + .I mode + is omitted, the output is in a form that may be reused as input. The return status is 0 if the mode was successfully changed or if no \fImode\fP argument was supplied, and false otherwise. *************** *** 6653,6657 **** It behaves identically to .B bash ! with the exception that the following are disallowed: .IP \(bu changing directories with \fBcd\fP --- 7228,7232 ---- It behaves identically to .B bash ! with the exception that the following are disallowed or not performed: .IP \(bu changing directories with \fBcd\fP *************** *** 6673,6676 **** --- 7248,7253 ---- importing function definitions from the shell environment at startup .IP \(bu + parsing the value of \fBSHELLOPTS\fP from the shell environment at startup + .IP \(bu redirecting output using the >, >|, <>, >&, &>, and >> redirection operators .IP \(bu *************** *** 6694,6698 **** .IP \(bu turning off restricted mode with ! .BR "set +r" . .PP These restrictions are enforced after any startup files are read. --- 7271,7275 ---- .IP \(bu turning off restricted mode with ! \fBset +r\fP or \fBset +o restricted\fP. .PP These restrictions are enforced after any startup files are read. *************** *** 6762,6766 **** If you have a fix, you are encouraged to mail that as well! Suggestions and `philosophical' bug reports may be mailed ! to \fPbug-bash\fP@\fIprep.ai.MIT.Edu\fP or posted to the Usenet newsgroup .BR gnu.bash.bug . --- 7339,7343 ---- If you have a fix, you are encouraged to mail that as well! Suggestions and `philosophical' bug reports may be mailed ! to \fIbug-bash@gnu.org\fP or posted to the Usenet newsgroup .BR gnu.bash.bug . diff -Nrc2 bash-2.01.1/doc/bashref.info bash-2.02/doc/bashref.info *** bash-2.01.1/doc/bashref.info Mon Jul 21 13:58:25 1997 --- bash-2.02/doc/bashref.info Thu Apr 2 16:53:42 1998 *************** *** 1,8 **** This is Info file bashref.info, produced by Makeinfo version 1.67 from ! the input file /usr/homes/chet/src/bash/bash-2.01.1/doc/bashref.texi. INFO-DIR-SECTION Utilities START-INFO-DIR-ENTRY ! * Bash: (bash). GNU Bourne-Again SHell END-INFO-DIR-ENTRY --- 1,8 ---- This is Info file bashref.info, produced by Makeinfo version 1.67 from ! the input file /usr/homes/chet/src/bash/src/doc/bashref.texi. INFO-DIR-SECTION Utilities START-INFO-DIR-ENTRY ! * Bash: (bash). The GNU Bourne-Again SHell. END-INFO-DIR-ENTRY *************** *** 10,18 **** the Bash shell. ! This is Edition 2.0, last updated 19 May 1997, of `The GNU Bash Reference Manual', ! for `Bash', Version 2.01. ! Copyright (C) 1991, 1993, 1996 Free Software Foundation, Inc. Permission is granted to make and distribute verbatim copies of --- 10,18 ---- the Bash shell. ! This is Edition 2.2, last updated 1 April 1998, of `The GNU Bash Reference Manual', ! for `Bash', Version 2.02. ! Copyright (C) 1991, 1993, 1996, 1997 Free Software Foundation, Inc. Permission is granted to make and distribute verbatim copies of *************** *** 28,32 **** into another language, under the above conditions for modified versions, except that this permission notice may be stated in a translation approved ! by the Foundation.  --- 28,32 ---- into another language, under the above conditions for modified versions, except that this permission notice may be stated in a translation approved ! by the Free Software Foundation.  *************** *** 39,44 **** the Bash shell. ! This is Edition 2.0, last updated 19 May 1997, of `The GNU Bash ! Reference Manual', for `Bash', Version 2.01. Copyright (C) 1991, 1993, 1996 Free Software Foundation, Inc. --- 39,44 ---- the Bash shell. ! This is Edition 2.2, last updated 1 April 1998, of `The GNU Bash ! Reference Manual', for `Bash', Version 2.02. Copyright (C) 1991, 1993, 1996 Free Software Foundation, Inc. *************** *** 67,76 **** Bourne shell. - * Csh Features:: Features originally found in the - Berkeley C-Shell. - - * Korn Shell Features:: Features originally found in the Korn - Shell. - * Bash Features:: Features found only in Bash. --- 67,70 ---- *************** *** 125,131 **** Bash is an `sh'-compatible shell that incorporates useful features ! from the Korn shell `ksh' and the C shell `csh'. It is ultimately ! intended to be a conformant implementation of the IEEE POSIX Shell and ! Tools specification (IEEE Working Group 1003.2). It offers functional improvements over `sh' for both interactive and programming use. --- 119,125 ---- Bash is an `sh'-compatible shell that incorporates useful features ! from the Korn shell `ksh' and the C shell `csh'. It is intended to be ! a conformant implementation of the IEEE POSIX Shell and Tools ! specification (IEEE Working Group 1003.2). It offers functional improvements over `sh' for both interactive and programming use. *************** *** 133,138 **** will be the default shell. Like other GNU software, Bash is quite portable. It currently runs on nearly every version of Unix and a few ! other operating systems - independently-supported ports exist for OS/2 ! and Windows NT.  --- 127,132 ---- will be the default shell. Like other GNU software, Bash is quite portable. It currently runs on nearly every version of Unix and a few ! other operating systems - independently-supported ports exist for ! MS-DOS, OS/2, Windows 95, and Windows NT.  *************** *** 145,162 **** commands. A Unix shell is both a command interpreter, which provides the user interface to the rich set of Unix utilities, and a programming ! language, allowing these utilitites to be combined. The shell reads ! commands either from a terminal or a file. Files containing commands ! can be created, and become commands themselves. These new commands ! have the same status as system commands in directories like `/bin', ! allowing users or groups to establish custom environments. A shell allows execution of Unix commands, both synchronously and ! asynchronously. The "redirection" constructs permit fine-grained ! control of the input and output of those commands, and the shell allows ! control over the contents of their environment. Unix shells also ! provide a small set of built-in commands ("builtins") implementing ! functionality impossible (e.g., `cd', `break', `continue', and `exec'), ! or inconvenient (`history', `getopts', `kill', or `pwd', for example) ! to obtain via separate utilities. Shells may be used interactively or non-interactively: they accept input typed from the keyboard or from a file. All of the shell builtins are described in subsequent sections. --- 139,158 ---- commands. A Unix shell is both a command interpreter, which provides the user interface to the rich set of Unix utilities, and a programming ! language, allowing these utilitites to be combined. Files containing ! commands can be created, and become commands themselves. These new ! commands have the same status as system commands in directories like ! `/bin', allowing users or groups to establish custom environments. A shell allows execution of Unix commands, both synchronously and ! asynchronously. The shell waits for synchronous commands to complete ! before accepting more input; asynchronous commands continue to execute ! in parallel with the shell while it reads and executes additional ! commands. The "redirection" constructs permit fine-grained control of ! the input and output of those commands, and the shell allows control ! over the contents of their environment. Unix shells also provide a ! small set of built-in commands ("builtins") implementing functionality ! impossible (e.g., `cd', `break', `continue', and `exec'), or ! inconvenient (`history', `getopts', `kill', or `pwd', for example) to ! obtain via separate utilities. Shells may be used interactively or non-interactively: they accept input typed from the keyboard or from a file. All of the shell builtins are described in subsequent sections. *************** *** 272,276 **** specification for the `standard' Unix shell. ! This chapter briefly summarizes the shell's "building blocks": commands, control structures, shell functions, shell parameters, shell expansions, redirections, which are a way to direct input and output --- 268,272 ---- specification for the `standard' Unix shell. ! This chapter briefly summarizes the shell's `building blocks': commands, control structures, shell functions, shell parameters, shell expansions, redirections, which are a way to direct input and output *************** *** 280,290 **** * Shell Syntax:: What your input means to the shell. ! * Simple Commands:: The most common type of command. ! * Pipelines:: Connecting the input and output of several ! commands. ! * Lists:: How to execute commands sequentially. ! * Looping Constructs:: Shell commands for iterative action. ! * Conditional Constructs:: Shell commands for conditional execution. ! * Command Grouping:: Ways to group commands. * Shell Functions:: Grouping commands by name. * Shell Parameters:: Special shell variables. --- 276,280 ---- * Shell Syntax:: What your input means to the shell. ! * Shell Commands:: The types of commands you can use. * Shell Functions:: Grouping commands by name. * Shell Parameters:: Special shell variables. *************** *** 296,300 ****  ! File: bashref.info, Node: Shell Syntax, Next: Simple Commands, Up: Basic Shell Features Shell Syntax --- 286,290 ----  ! File: bashref.info, Node: Shell Syntax, Next: Shell Commands, Up: Basic Shell Features Shell Syntax *************** *** 323,331 **** 2. Breaks the input into words and operators, obeying the quoting ! rules described in *Note Quoting::. Tokens are separated by `metacharacters'. Alias expansion is performed by this step (*note Aliases::.). ! 3. Parses the tokens into simple and compound commands. 4. Performs the various shell expansions (*note Shell Expansions::.), --- 313,322 ---- 2. Breaks the input into words and operators, obeying the quoting ! rules described in *Note Quoting::. These tokens are separated by `metacharacters'. Alias expansion is performed by this step (*note Aliases::.). ! 3. Parses the tokens into simple and compound commands (*note Shell ! Commands::.). 4. Performs the various shell expansions (*note Shell Expansions::.), *************** *** 340,344 **** 7. Optionally waits for the command to complete and collects its exit ! status. --- 331,335 ---- 7. Optionally waits for the command to complete and collects its exit ! status (*note Exit Status::.). *************** *** 366,373 **** recognized as such, and to prevent parameter expansion. ! Each of the shell `metacharacters' (*note Definitions::.) has ! special meaning to the shell and must be quoted if they are to ! represent themselves. There are three quoting mechanisms: the ESCAPE ! CHARACTER, single quotes, and double quotes.  --- 357,364 ---- recognized as such, and to prevent parameter expansion. ! Each of the shell metacharacters (*note Definitions::.) has special ! meaning to the shell and must be quoted if it is to represent itself. ! There are three quoting mechanisms: the ESCAPE CHARACTER, single ! quotes, and double quotes.  *************** *** 380,385 **** preserves the literal value of the next character that follows, with the exception of `newline'. If a `\newline' pair appears, and the ! backslash is not quoted, the `\newline' is treated as a line ! continuation (that is, it is effectively ignored).  --- 371,377 ---- preserves the literal value of the next character that follows, with the exception of `newline'. If a `\newline' pair appears, and the ! backslash itself is not quoted, the `\newline' is treated as a line ! continuation (that is, it is removed from the input stream and ! effectively ignored).  *************** *** 402,409 **** all characters within the quotes, with the exception of `$', ``', and `\'. The characters `$' and ``' retain their special meaning within ! double quotes. The backslash retains its special meaning only when ! followed by one of the following characters: `$', ``', `"', `\', or ! `newline'. A double quote may be quoted within double quotes by ! preceding it with a backslash. The special parameters `*' and `@' have special meaning when in --- 394,404 ---- all characters within the quotes, with the exception of `$', ``', and `\'. The characters `$' and ``' retain their special meaning within ! double quotes (*note Shell Expansions::.). The backslash retains its ! special meaning only when followed by one of the following characters: ! `$', ``', `"', `\', or `newline'. Within double quotes, backslashes ! that are followed by one of these characters are removed. Backslashes ! preceding characters without a special meaning are left unmodified. A ! double quote may be quoted within double quotes by preceding it with a ! backslash. The special parameters `*' and `@' have special meaning when in *************** *** 449,453 **** `\NNN' ! the character whose `ASCII' code is NNN in octal The result is single-quoted, as if the dollar sign had not been present. --- 444,453 ---- `\NNN' ! the character whose `ASCII' code is the octal value NNN (one to ! three digits) ! ! `\xNNN' ! the character whose `ASCII' code is the hexadecimal value NNN (one ! to three digits) The result is single-quoted, as if the dollar sign had not been present. *************** *** 476,491 **** without the `interactive_comments' option enabled does not allow comments. The `interactive_comments' option is on by default in ! interactive shells.  ! File: bashref.info, Node: Simple Commands, Next: Pipelines, Prev: Shell Syntax, Up: Basic Shell Features Simple Commands ! =============== ! A simple command is the kind of command you'll encounter most often. It's just a sequence of words separated by `blank's, terminated by one ! of the shell control operators (*note Definitions::.). The first word ! generally specifies a command to be executed. The return status (*note Exit Status::.) of a simple command is its --- 476,508 ---- without the `interactive_comments' option enabled does not allow comments. The `interactive_comments' option is on by default in ! interactive shells. *Note Is This Shell Interactive?::, for a ! description of what makes a shell interactive. ! !  ! File: bashref.info, Node: Shell Commands, Next: Shell Functions, Prev: Shell Syntax, Up: Basic Shell Features ! ! Shell Commands ! ============== ! ! * Menu: ! ! * Simple Commands:: The most common type of command. ! * Pipelines:: Connecting the input and output of several ! commands. ! * Lists:: How to execute commands sequentially. ! * Looping Constructs:: Shell commands for iterative action. ! * Conditional Constructs:: Shell commands for conditional execution. ! * Command Grouping:: Ways to group commands.  ! File: bashref.info, Node: Simple Commands, Next: Pipelines, Up: Shell Commands Simple Commands ! --------------- ! A simple command is the kind of command encountered most often. It's just a sequence of words separated by `blank's, terminated by one ! of the shell's control operators (*note Definitions::.). The first ! word generally specifies a command to be executed. The return status (*note Exit Status::.) of a simple command is its *************** *** 494,501 ****  ! File: bashref.info, Node: Pipelines, Next: Lists, Prev: Simple Commands, Up: Basic Shell Features Pipelines ! ========= A `pipeline' is a sequence of simple commands separated by `|'. --- 511,518 ----  ! File: bashref.info, Node: Pipelines, Next: Lists, Prev: Simple Commands, Up: Shell Commands Pipelines ! --------- A `pipeline' is a sequence of simple commands separated by `|'. *************** *** 509,528 **** The reserved word `time' causes timing statistics to be printed for ! the pipeline once it finishes. The `-p' option changes the output ! format to that specified by POSIX. The `TIMEFORMAT' variable may be ! set to a format string that specifies how the timing information should ! be displayed. *Note Bash Variables::, for a description of the ! available formats. ! ! Each command in a pipeline is executed in its own subshell. The exit ! status of a pipeline is the exit status of the last command in the ! pipeline. If the reserved word `!' precedes the pipeline, the exit ! status is the logical NOT of the exit status of the last command.  ! File: bashref.info, Node: Lists, Next: Looping Constructs, Prev: Pipelines, Up: Basic Shell Features Lists of Commands ! ================= A `list' is a sequence of one or more pipelines separated by one of --- 526,553 ---- The reserved word `time' causes timing statistics to be printed for ! the pipeline once it finishes. The statistics currently consist of ! elapsed (wall-clock) time and user and system time consumed by the ! command's execution. The `-p' option changes the output format to that ! specified by POSIX. The `TIMEFORMAT' variable may be set to a format ! string that specifies how the timing information should be displayed. ! *Note Bash Variables::, for a description of the available formats. ! The use of `time' as a reserved word permits the timing of shell ! builtins, shell functions, and pipelines. An external `time' command ! cannot time these easily. ! ! If the pipeline is not executed asynchronously (*note Lists::.), the ! shell waits for all commands in the pipeline to complete. ! ! Each command in a pipeline is executed in its own subshell (*note ! Command Execution Environment::.). The exit status of a pipeline is ! the exit status of the last command in the pipeline. If the reserved ! word `!' precedes the pipeline, the exit status is the logical negation ! of the exit status of the last command.  ! File: bashref.info, Node: Lists, Next: Looping Constructs, Prev: Pipelines, Up: Shell Commands Lists of Commands ! ----------------- A `list' is a sequence of one or more pipelines separated by one of *************** *** 534,542 **** If a command is terminated by the control operator `&', the shell ! executes the command in the BACKGROUND in a subshell. The shell does ! not wait for the command to finish, and the return status is 0 (true). ! Commands separated by a `;' are executed sequentially; the shell waits ! for each command to terminate in turn. The return status is the exit ! status of the last command executed. The control operators `&&' and `||' denote AND lists and OR lists, --- 559,571 ---- If a command is terminated by the control operator `&', the shell ! executes the command asynchronously in a subshell. This is known as ! executing the command in the BACKGROUND. The shell does not wait for ! the command to finish, and the return status is 0 (true). The standard ! input for asynchronous commands, in the absence of any explicit ! redirections, is redirected from `/dev/null'. ! ! Commands separated by a `;' are executed sequentially; the shell ! waits for each command to terminate in turn. The return status is the ! exit status of the last command executed. The control operators `&&' and `||' denote AND lists and OR lists, *************** *** 550,554 **** COMMAND || COMMAND2 ! COMMAND2 is executed if and only if COMMAND returns a non-zero exit status. --- 579,583 ---- COMMAND || COMMAND2 ! COMMAND2 is executed if, and only if, COMMAND returns a non-zero exit status. *************** *** 557,575 ****  ! File: bashref.info, Node: Looping Constructs, Next: Conditional Constructs, Prev: Lists, Up: Basic Shell Features Looping Constructs ! ================== ! ! Note that wherever you see a `;' in the description of a command's ! syntax, it may be replaced indiscriminately with one or more newlines. Bash supports the following looping constructs. `until' The syntax of the `until' command is: until TEST-COMMANDS; do CONSEQUENT-COMMANDS; done ! Execute CONSEQUENT-COMMANDS as long as the final command in ! TEST-COMMANDS has an exit status which is not zero. `while' --- 586,606 ----  ! File: bashref.info, Node: Looping Constructs, Next: Conditional Constructs, Prev: Lists, Up: Shell Commands Looping Constructs ! ------------------ Bash supports the following looping constructs. + Note that wherever you see a `;' in the description of a command's + syntax, it may be replaced with one or more newlines. + `until' The syntax of the `until' command is: until TEST-COMMANDS; do CONSEQUENT-COMMANDS; done ! Execute CONSEQUENT-COMMANDS as long as TEST-COMMANDS has an exit ! status which is not zero. The return status is the exit status of ! the last command executed in CONSEQUENT-COMMANDS, or zero if none ! was executed. `while' *************** *** 577,582 **** while TEST-COMMANDS; do CONSEQUENT-COMMANDS; done ! Execute CONSEQUENT-COMMANDS as long as the final command in ! TEST-COMMANDS has an exit status of zero. `for' --- 608,615 ---- while TEST-COMMANDS; do CONSEQUENT-COMMANDS; done ! Execute CONSEQUENT-COMMANDS as long as TEST-COMMANDS has an exit ! status of zero. The return status is the exit status of the last ! command executed in CONSEQUENT-COMMANDS, or zero if none was ! executed. `for' *************** *** 584,590 **** for NAME [in WORDS ...]; do COMMANDS; done ! Execute COMMANDS for each member in WORDS, with NAME bound to the ! current member. If `in WORDS' is not present, `in "$@"' is ! assumed. The `break' and `continue' builtins (*note Bourne Shell Builtins::.) --- 617,626 ---- for NAME [in WORDS ...]; do COMMANDS; done ! Expand WORDS, and execute COMMANDS once for each member in the ! resultant list, with NAME bound to the current member. If `in ! WORDS' is not present, `in "$@"' is assumed. The return status is ! the exit status of the last command that executes. If there are ! no items in the expansion of WORDS, no commands are executed, and ! the return status is zero. The `break' and `continue' builtins (*note Bourne Shell Builtins::.) *************** *** 592,599 ****  ! File: bashref.info, Node: Conditional Constructs, Next: Command Grouping, Prev: Looping Constructs, Up: Basic Shell Features Conditional Constructs ! ====================== `if' --- 628,635 ----  ! File: bashref.info, Node: Conditional Constructs, Next: Command Grouping, Prev: Looping Constructs, Up: Shell Commands Conditional Constructs ! ---------------------- `if' *************** *** 607,625 **** fi ! Execute CONSEQUENT-COMMANDS only if the final command in ! TEST-COMMANDS has an exit status of zero. Otherwise, each `elif' ! list is executed in turn, and if its exit status is zero, the ! corresponding MORE-CONSEQUENTS is executed and the command ! completes. If `else ALTERNATE-CONSEQUENTS' is present, and the ! final command in the final `if' or `elif' clause has a non-zero ! exit status, then execute ALTERNATE-CONSEQUENTS. `case' The syntax of the `case' command is: ! `case WORD in [ ( PATTERN [| PATTERN]...) COMMANDS ;;]... esac' ! Selectively execute COMMANDS based upon WORD matching PATTERN. ! The `|' is used to separate multiple patterns. Here is an example using `case' in a script that could be used to --- 643,676 ---- fi ! The TEST-COMMANDS list is executed, and if its return status is ! zero, the CONSEQUENT-COMMANDS list is executed. If TEST-COMMANDS ! returns a non-zero status, each `elif' list is executed in turn, ! and if its exit status is zero, the corresponding MORE-CONSEQUENTS ! is executed and the command completes. If `else ! ALTERNATE-CONSEQUENTS' is present, and the final command in the ! final `if' or `elif' clause has a non-zero exit status, then ! ALTERNATE-CONSEQUENTS is executed. The return status is the exit ! status of the last command executed, or zero if no condition ! tested true. `case' The syntax of the `case' command is: ! `case WORD in [ [(] PATTERN [| PATTERN]...) COMMAND-LIST ;;]... esac' ! `case' will selectively execute the COMMAND-LIST corresponding to ! the first PATTERN that matches WORD. The `|' is used to separate ! multiple patterns, and the `)' operator terminates a pattern list. ! A list of patterns and an associated command-list is known as a ! CLAUSE. Each clause must be terminated with `;;'. The WORD ! undergoes tilde expansion, parameter expansion, command ! substitution, arithmetic expansion, and quote removal before ! matching is attempted. Each PATTERN undergoes tilde expansion, ! parameter expansion, command substitution, and arithmetic ! expansion. ! ! There may be an arbitrary number of `case' clauses, each terminated ! by a `;;'. The first pattern that matches determines the ! command-list that is executed. Here is an example using `case' in a script that could be used to *************** *** 636,657 **** echo " legs." `((...))' (( EXPRESSION )) ! The EXPRESSION is evaluated according to the rules described below ! (*note Arithmetic Evaluation::.). If the value of the expression ! is non-zero, the return status is 0; otherwise the return status ! is 1. This is exactly equivalent to let "EXPRESSION" ! The `select' construct, which allows users to choose from a list of ! items presented as a menu, is also available. *Note Korn Shell ! Constructs::, for a full description of `select'.  ! File: bashref.info, Node: Command Grouping, Next: Shell Functions, Prev: Conditional Constructs, Up: Basic Shell Features Grouping Commands ! ================= Bash provides two ways to group a list of commands to be executed as --- 687,780 ---- echo " legs." + The return status is zero if no PATTERN is matched. Otherwise, the + return status is the exit status of the COMMAND-LIST executed. + + `select' + The `select' construct allows the easy generation of menus. It + has almost the same syntax as the `for' command: + + select NAME [in WORDS ...]; do COMMANDS; done + + The list of words following `in' is expanded, generating a list of + items. The set of expanded words is printed on the standard error + output stream, each preceded by a number. If the `in WORDS' is + omitted, the positional parameters are printed, as if `in "$@"' + had been specifed. The `PS3' prompt is then displayed and a line + is read from the standard input. If the line consists of a number + corresponding to one of the displayed words, then the value of + NAME is set to that word. If the line is empty, the words and + prompt are displayed again. If `EOF' is read, the `select' + command completes. Any other value read causes NAME to be set to + null. The line read is saved in the variable `REPLY'. + + The COMMANDS are executed after each selection until a `break' or + `return' command is executed, at which point the `select' command + completes. + + Here is an example that allows the user to pick a filename from the + current directory, and displays the name and index of the file + selected. + + select fname in *; + do + echo you picked $fname \($REPLY\) + break; + done + `((...))' (( EXPRESSION )) ! The arithmetic EXPRESSION is evaluated according to the rules ! described below (*note Shell Arithmetic::.). If the value of the ! expression is non-zero, the return status is 0; otherwise the ! return status is 1. This is exactly equivalent to let "EXPRESSION" ! *Note Bash Builtins::, for a full description of the `let' builtin. ! ! `[[...]]' ! [[ EXPRESSION ]] ! ! Return a status of 0 or 1 depending on the evaluation of the ! conditional expression EXPRESSION. Expressions are composed of ! the primaries described below in *Note Bash Conditional ! Expressions::. Word splitting and filename expansion are not ! performed on the words between the `[[' and `]]'; tilde expansion, ! parameter and variable expansion, arithmetic expansion, command ! substitution, process substitution, and quote removal are ! performed. ! ! When the `==' and `!=' operators are used, the string to the right ! of the operator is considered a pattern and matched according to ! the rules described below in *Note Pattern Matching::. The return ! value is 0 if the string matches or does not match the pattern, ! respectively, and 1 otherwise. Any part of the pattern may be ! quoted to force it to be matched as a string. ! ! Expressions may be combined using the following operators, listed ! in decreasing order of precedence: ! ! `( EXPRESSION )' ! Returns the value of EXPRESSION. This may be used to ! override the normal precedence of operators. ! ! `! EXPRESSION' ! True if EXPRESSION is false. ! ! `EXPRESSION1 && EXPRESSION2' ! True if both EXPRESSION1 and EXPRESSION2 are true. ! ! `EXPRESSION1 || EXPRESSION2' ! True if either EXPRESSION1 or EXPRESSION2 is true. ! ! The && and || commands do not execute EXPRESSION2 if the value of ! EXPRESSION1 is sufficient to determine the return value of the ! entire conditional expression.  ! File: bashref.info, Node: Command Grouping, Prev: Conditional Constructs, Up: Shell Commands Grouping Commands ! ----------------- Bash provides two ways to group a list of commands to be executed as *************** *** 664,669 **** Placing a list of commands between parentheses causes a subshell ! to be created, and each of the commands to be executed in that ! subshell. Since the LIST is executed in a subshell, variable assignments do not remain in effect after the subshell completes. --- 787,792 ---- Placing a list of commands between parentheses causes a subshell ! to be created, and each of the commands in LIST to be executed in ! that subshell. Since the LIST is executed in a subshell, variable assignments do not remain in effect after the subshell completes. *************** *** 673,677 **** Placing a list of commands between curly braces causes the list to be executed in the current shell context. No subshell is created. ! The semicolon following LIST is required. In addition to the creation of a subshell, there is a subtle --- 796,800 ---- Placing a list of commands between curly braces causes the list to be executed in the current shell context. No subshell is created. ! The semicolon (or newline) following LIST is required. In addition to the creation of a subshell, there is a subtle *************** *** 686,690 ****  ! File: bashref.info, Node: Shell Functions, Next: Shell Parameters, Prev: Command Grouping, Up: Basic Shell Features Shell Functions --- 809,813 ----  ! File: bashref.info, Node: Shell Functions, Next: Shell Parameters, Prev: Shell Commands, Up: Basic Shell Features Shell Functions *************** *** 700,707 **** This defines a shell function named NAME. The reserved word ! `function' is optional. The BODY of the function is the COMMAND-LIST ! between { and }. This list is executed whenever NAME is specified as ! the name of a command. The exit status of a function is the exit ! status of the last command executed in the body. When a function is executed, the arguments to the function become --- 823,831 ---- This defines a shell function named NAME. The reserved word ! `function' is optional. If the `function' reserved word is supplied, ! the parentheses are optional. The BODY of the function is the ! COMMAND-LIST between { and }. This list is executed whenever NAME is ! specified as the name of a command. The exit status of a function is ! the exit status of the last command executed in the body. When a function is executed, the arguments to the function become *************** *** 715,720 **** the function call. When a function completes, the values of the positional parameters and the special parameter `#' are restored to the ! values they had prior to function execution. If a numeric argument is ! given to `return', that is the function return status. Variables local to the function may be declared with the `local' --- 839,846 ---- the function call. When a function completes, the values of the positional parameters and the special parameter `#' are restored to the ! values they had prior to the function's execution. If a numeric ! argument is given to `return', that is the function's return status; ! otherwise the functions's return status is the exit status of the last ! command executed before the `return'. Variables local to the function may be declared with the `local' *************** *** 750,759 **** VALUEs undergo tilde expansion, parameter and variable expansion, command substitution, arithmetic expansion, and quote removal (detailed ! below). If the variable has its `-i' attribute set (see the description of the `declare' builtin in *Note Bash Builtins::), then ! VALUE is subject to arithmetic expansion even if the `$((...))' syntax ! does not appear (*note Arithmetic Expansion::.). Word splitting is not ! performed, with the exception of `"$@"' as explained below. Filename ! expansion is not performed.  --- 876,885 ---- VALUEs undergo tilde expansion, parameter and variable expansion, command substitution, arithmetic expansion, and quote removal (detailed ! below). If the variable has its `integer' attribute set (see the description of the `declare' builtin in *Note Bash Builtins::), then ! VALUE is subject to arithmetic expansion even if the `$((...))' ! expansion is not used (*note Arithmetic Expansion::.). Word splitting ! is not performed, with the exception of `"$@"' as explained below. ! Filename expansion is not performed.  *************** *** 766,773 **** other than the single digit `0'. Positional parameters are assigned from the shell's arguments when it is invoked, and may be reassigned ! using the `set' builtin command. Positional parameters may not be ! assigned to with assignment statements. The positional parameters are ! temporarily replaced when a shell function is executed (*note Shell ! Functions::.). When a positional parameter consisting of more than a single digit --- 892,899 ---- other than the single digit `0'. Positional parameters are assigned from the shell's arguments when it is invoked, and may be reassigned ! using the `set' builtin command. Positional parameter `N' may be ! referenced as `${N}'. Positional parameters may not be assigned to ! with assignment statements. The positional parameters are temporarily ! replaced when a shell function is executed (*note Shell Functions::.). When a positional parameter consisting of more than a single digit *************** *** 795,799 **** `@' Expands to the positional parameters, starting from one. When the ! expansion occurs within double quotes, each parameter expands as a separate word. That is, `"$@"' is equivalent to `"$1" "$2" ...'. When there are no positional parameters, `"$@"' and `$@' expand to --- 921,925 ---- `@' Expands to the positional parameters, starting from one. When the ! expansion occurs within double quotes, each parameter expands to a separate word. That is, `"$@"' is equivalent to `"$1" "$2" ...'. When there are no positional parameters, `"$@"' and `$@' expand to *************** *** 814,818 **** `$' Expands to the process ID of the shell. In a `()' subshell, it ! expands to the process ID of the current shell, not the subshell. `!' --- 940,944 ---- `$' Expands to the process ID of the shell. In a `()' subshell, it ! expands to the process ID of the invoking shell, not the subshell. `!' *************** *** 822,830 **** `0' Expands to the name of the shell or shell script. This is set at ! shell initialization. If Bash is invoked with a file of commands, ! `$0' is set to the name of that file. If Bash is started with the ! `-c' option, then `$0' is set to the first argument after the ! string to be executed, if one is present. Otherwise, it is set to ! the filename used to invoke Bash, as given by argument zero. `_' --- 948,957 ---- `0' Expands to the name of the shell or shell script. This is set at ! shell initialization. If Bash is invoked with a file of commands ! (*note Shell Scripts::.), `$0' is set to the name of that file. ! If Bash is started with the `-c' option (*note Invoking Bash::.), ! then `$0' is set to the first argument after the string to be ! executed, if one is present. Otherwise, it is set to the filename ! used to invoke Bash, as given by argument zero. `_' *************** *** 832,836 **** shell script being executed as passed in the argument list. Subsequently, expands to the last argument to the previous command, ! after expansion. Also set to the full filename of each command executed and placed in the environment exported to that command. When checking mail, this parameter holds the name of the mail file. --- 959,963 ---- shell script being executed as passed in the argument list. Subsequently, expands to the last argument to the previous command, ! after expansion. Also set to the full pathname of each command executed and placed in the environment exported to that command. When checking mail, this parameter holds the name of the mail file. *************** *** 860,865 **** --- 987,995 ---- * Menu: + * Brace Expansion:: Expansion of expressions within braces. + * Tilde Expansion:: Expansion of the ~ character. * Shell Parameter Expansion:: How Bash expands variables to their values. * Command Substitution:: Using the output of a command as an argument. + * Arithmetic Expansion:: How to use arithmetic in shell expansions. * Process Substitution:: A way to write and read to and from a command. *************** *** 870,878 **** words. - Brace expansion, tilde expansion, and arithmetic expansion are - described in other sections. For brace expansion, see *Note Brace - Expansion::; for tilde expansion, see *Note Tilde Expansion::; and for - arithmetic expansion, see *Note Arithmetic Expansion::. - The order of expansions is: brace expansion, tilde expansion, parameter, variable, and arithmetic expansion and command substitution --- 1000,1003 ---- *************** *** 882,886 **** On systems that can support it, there is an additional expansion available: PROCESS SUBSTITUTION. This is performed at the same time as ! parameter, variable, and arithemtic expansion and command substitution. Only brace expansion, word splitting, and filename expansion can --- 1007,1011 ---- On systems that can support it, there is an additional expansion available: PROCESS SUBSTITUTION. This is performed at the same time as ! parameter, variable, and arithmetic expansion and command substitution. Only brace expansion, word splitting, and filename expansion can *************** *** 894,898 ****  ! File: bashref.info, Node: Shell Parameter Expansion, Next: Command Substitution, Up: Shell Expansions Shell Parameter Expansion --- 1019,1122 ----  ! File: bashref.info, Node: Brace Expansion, Next: Tilde Expansion, Up: Shell Expansions ! ! Brace Expansion ! --------------- ! ! Brace expansion is a mechanism by which arbitrary strings may be ! generated. This mechanism is similar to FILENAME EXPANSION (*note ! Filename Expansion::.), but the file names generated need not exist. ! Patterns to be brace expanded take the form of an optional PREAMBLE, ! followed by a series of comma-separated strings between a pair of ! braces, followed by an optional POSTSCRIPT. The preamble is prepended ! to each string contained within the braces, and the postscript is then ! appended to each resulting string, expanding left to right. ! ! Brace expansions may be nested. The results of each expanded string ! are not sorted; left to right order is preserved. For example, ! bash$ echo a{d,c,b}e ! ade ace abe ! ! Brace expansion is performed before any other expansions, and any ! characters special to other expansions are preserved in the result. It ! is strictly textual. Bash does not apply any syntactic interpretation ! to the context of the expansion or the text between the braces. ! ! A correctly-formed brace expansion must contain unquoted opening and ! closing braces, and at least one unquoted comma. Any incorrectly ! formed brace expansion is left unchanged. ! ! This construct is typically used as shorthand when the common prefix ! of the strings to be generated is longer than in the above example: ! mkdir /usr/local/src/bash/{old,new,dist,bugs} ! or ! chown root /usr/{ucb/{ex,edit},lib/{ex?.?*,how_ex}} ! !  ! File: bashref.info, Node: Tilde Expansion, Next: Shell Parameter Expansion, Prev: Brace Expansion, Up: Shell Expansions ! ! Tilde Expansion ! --------------- ! ! If a word begins with an unquoted tilde character (`~'), all of the ! characters up to the first unquoted slash (or all characters, if there ! is no unquoted slash) are considered a TILDE-PREFIX. If none of the ! characters in the tilde-prefix are quoted, the characters in the ! tilde-prefix following the tilde are treated as a possible LOGIN NAME. ! If this login name is the null string, the tilde is replaced with the ! value of the `HOME' shell variable. If `HOME' is unset, the home ! directory of the user executing the shell is substituted instead. ! Otherwise, the tilde-prefix is replaced with the home directory ! associated with the specified login name. ! ! If the tilde-prefix is `~+', the value of the shell variable `PWD' ! replaces the tilde-prefix. If the tilde-prefix is `~-', the value of ! the shell variable `OLDPWD', if it is set, is substituted. ! ! If the characters following the tilde in the tilde-prefix consist of ! a number N, optionally prefixed by a `+' or a `-', the tilde-prefix is ! replaced with the corresponding element from the directory stack, as it ! would be displayed by the `dirs' builtin invoked with the characters ! following tilde in the tilde-prefix as an argument (*note The Directory ! Stack::.). If the tilde-prefix, sans the tilde, consists of a number ! without a leading `+' or `-', `+' is assumed. ! ! If the login name is invalid, or the tilde expansion fails, the word ! is left unchanged. ! ! Each variable assignment is checked for unquoted tilde-prefixes ! immediately following a `:' or `='. In these cases, tilde expansion is ! also performed. Consequently, one may use file names with tildes in ! assignments to `PATH', `MAILPATH', and `CDPATH', and the shell assigns ! the expanded value. ! ! The following table shows how Bash treats unquoted tilde-prefixes: ! ! `~' ! The value of `$HOME' ! ! `~/foo' ! `$HOME/foo' ! ! `~fred/foo' ! The subdirectory `foo' of the home directory of the user `fred' ! ! `~+/foo' ! `$PWD/foo' ! ! `~-/foo' ! `${OLDPWD-'~-'}/foo' ! ! `~N' ! The string that would be displayed by `dirs +N' ! ! `~+N' ! The string that would be displayed by `dirs +N' ! ! `~-N' ! The string that would be displayed by `dirs -N' ! !  ! File: bashref.info, Node: Shell Parameter Expansion, Next: Command Substitution, Prev: Tilde Expansion, Up: Shell Expansions Shell Parameter Expansion *************** *** 905,908 **** --- 1129,1137 ---- following it which could be interpreted as part of the name. + When braces are used, the matching ending brace is the first `}' not + escaped by a backslash or within a quoted string, and not within an + embedded arithmetic expansion, command substitution, or parameter + expansion. + The basic form of parameter expansion is ${PARAMETER}. The value of PARAMETER is substituted. The braces are required when PARAMETER is a *************** *** 946,954 **** `${PARAMETER:OFFSET}' `${PARAMETER:OFFSET:LENGTH}' ! Expands to up to LENGTH characters of PARAMETER, starting at ! OFFSET. If LENGTH is omitted, expands to the substring of ! PARAMETER, starting at the character specified by OFFSET. LENGTH ! and OFFSET are arithmetic expressions (*note Arithmetic ! Evaluation::.). This is referred to as Substring Expansion. LENGTH must evaluate to a number greater than or equal to zero. --- 1175,1183 ---- `${PARAMETER:OFFSET}' `${PARAMETER:OFFSET:LENGTH}' ! Expands to up to LENGTH characters of PARAMETER, starting at the ! character specified by OFFSET. If LENGTH is omitted, expands to ! the substring of PARAMETER, starting at the character specified by ! OFFSET. LENGTH and OFFSET are arithmetic expressions (*note Shell ! Arithmetic::.). This is referred to as Substring Expansion. LENGTH must evaluate to a number greater than or equal to zero. *************** *** 958,971 **** OFFSET. If PARAMETER is an array name indexed by `@' or `*', the result is the LENGTH members of the array beginning with ! ${PARAMETER[OFFSET]}. Substring indexing is zero-based unless the ! positional parameters are used, in which case the indexing starts ! at 1. `${#PARAMETER}' ! The length in characters of the value of PARAMETER is substituted. ! If PARAMETER is `*' or `@', the length substituted is the number ! of positional parameters. If PARAMETER is an array name ! subscripted by `*' or `@', the length substituted is the number of ! elements in the array. `${PARAMETER#WORD}' --- 1187,1200 ---- OFFSET. If PARAMETER is an array name indexed by `@' or `*', the result is the LENGTH members of the array beginning with ! `${PARAMETER[OFFSET]}'. Substring indexing is zero-based unless ! the positional parameters are used, in which case the indexing ! starts at 1. `${#PARAMETER}' ! The length in characters of the expanded value of PARAMETER is ! substituted. If PARAMETER is `*' or `@', the value substituted is ! the number of positional parameters. If PARAMETER is an array ! name subscripted by `*' or `@', the value substituted is the ! number of elements in the array. `${PARAMETER#WORD}' *************** *** 973,998 **** The WORD is expanded to produce a pattern just as in filename expansion (*note Filename Expansion::.). If the pattern matches ! the beginning of the value of PARAMETER, then the expansion is the ! value of PARAMETER with the shortest matching pattern (the `#' ! case) or the longest matching pattern (the `##' case) deleted. If ! PARAMETER is `@' or `*', the pattern removal operation is applied ! to each positional parameter in turn, and the expansion is the ! resultant list. If PARAMETER is an array variable subscripted with ! `@' or `*', the pattern removal operation is applied to each ! member of the array in turn, and the expansion is the resultant ! list. `${PARAMETER%WORD}' `${PARAMETER%%WORD}' The WORD is expanded to produce a pattern just as in filename ! expansion. If the pattern matches a trailing portion of the value ! of PARAMETER, then the expansion is the value of PARAMETER with ! the shortest matching pattern (the `%' case) or the longest ! matching pattern (the `%%' case) deleted. If PARAMETER is `@' or ! `*', the pattern removal operation is applied to each positional ! parameter in turn, and the expansion is the resultant list. If ! PARAMETER is an array variable subscripted with `@' or `*', the ! pattern removal operation is applied to each member of the array ! in turn, and the expansion is the resultant list. `${PARAMETER/PATTERN/STRING}' --- 1202,1228 ---- The WORD is expanded to produce a pattern just as in filename expansion (*note Filename Expansion::.). If the pattern matches ! the beginning of the expanded value of PARAMETER, then the result ! of the expansion is the expanded value of PARAMETER with the ! shortest matching pattern (the `#' case) or the longest matching ! pattern (the `##' case) deleted. If PARAMETER is `@' or `*', the ! pattern removal operation is applied to each positional parameter ! in turn, and the expansion is the resultant list. If PARAMETER is ! an array variable subscripted with `@' or `*', the pattern removal ! operation is applied to each member of the array in turn, and the ! expansion is the resultant list. `${PARAMETER%WORD}' `${PARAMETER%%WORD}' The WORD is expanded to produce a pattern just as in filename ! expansion. If the pattern matches a trailing portion of the ! expanded value of PARAMETER, then the result of the expansion is ! the value of PARAMETER with the shortest matching pattern (the `%' ! case) or the longest matching pattern (the `%%' case) deleted. If ! PARAMETER is `@' or `*', the pattern removal operation is applied ! to each positional parameter in turn, and the expansion is the ! resultant list. If PARAMETER is an array variable subscripted ! with `@' or `*', the pattern removal operation is applied to each ! member of the array in turn, and the expansion is the resultant ! list. `${PARAMETER/PATTERN/STRING}' *************** *** 1014,1018 ****  ! File: bashref.info, Node: Command Substitution, Next: Process Substitution, Prev: Shell Parameter Expansion, Up: Shell Expansions Command Substitution --- 1244,1248 ----  ! File: bashref.info, Node: Command Substitution, Next: Arithmetic Expansion, Prev: Shell Parameter Expansion, Up: Shell Expansions Command Substitution *************** *** 1028,1040 **** Bash performs the expansion by executing COMMAND and replacing the command substitution with the standard output of the command, with any ! trailing newlines deleted. When the old-style backquote form of substitution is used, backslash retains its literal meaning except when followed by `$', ``', or `\'. ! When using the `$(COMMAND)' form, all characters between the ! parentheses make up the command; none are treated specially. ! Command substitutions may be nested. To nest when using the old ! form, escape the inner backquotes with backslashes. If the substitution appears within double quotes, word splitting and --- 1258,1273 ---- Bash performs the expansion by executing COMMAND and replacing the command substitution with the standard output of the command, with any ! trailing newlines deleted. Embedded newlines are not deleted, but they ! may be removed during word splitting. The command substitution `$(cat ! FILE)' can be replaced by the equivalent but faster `$(< FILE)'. When the old-style backquote form of substitution is used, backslash retains its literal meaning except when followed by `$', ``', or `\'. ! The first backquote not preceded by a backslash terminates the command ! substitution. When using the `$(COMMAND)' form, all characters between ! the parentheses make up the command; none are treated specially. ! Command substitutions may be nested. To nest when using the ! backquoted form, escape the inner backquotes with backslashes. If the substitution appears within double quotes, word splitting and *************** *** 1042,1046 ****  ! File: bashref.info, Node: Process Substitution, Next: Word Splitting, Prev: Command Substitution, Up: Shell Expansions Process Substitution --- 1275,1302 ----  ! File: bashref.info, Node: Arithmetic Expansion, Next: Process Substitution, Prev: Command Substitution, Up: Shell Expansions ! ! Arithmetic Expansion ! -------------------- ! ! Arithmetic expansion allows the evaluation of an arithmetic ! expression and the substitution of the result. The format for ! arithmetic expansion is: ! ! $(( EXPRESSION )) ! ! The expression is treated as if it were within double quotes, but a ! double quote inside the parentheses is not treated specially. All ! tokens in the expression undergo parameter expansion, command ! substitution, and quote removal. Arithmetic substitutions may be ! nested. ! ! The evaluation is performed according to the rules listed below ! (*note Shell Arithmetic::.). If the expression is invalid, Bash prints ! a message indicating failure to the standard error and no substitution ! occurs. ! !  ! File: bashref.info, Node: Process Substitution, Next: Word Splitting, Prev: Arithmetic Expansion, Up: Shell Expansions Process Substitution *************** *** 1062,1068 **** should be read to obtain the output of LIST. ! On systems that support it, process substitution is performed ! simultaneously with parameter and variable expansion, command ! substitution, and arithmetic expansion.  --- 1318,1324 ---- should be read to obtain the output of LIST. ! When available, process substitution is performed simultaneously with ! parameter and variable expansion, command substitution, and arithmetic ! expansion.  *************** *** 1102,1125 **** ------------------ After word splitting, unless the `-f' option has been set (*note The ! Set Builtin::.), Bash scans each word for the characters `*', `?', and ! `['. If one of these characters appears, then the word is regarded as ! a PATTERN, and replaced with an alphabetically sorted list of file names matching the pattern. If no matching file names are found, and ! the shell option `nullglob' is disabled, the word is left unchanged. If ! the option is set, and no matches are found, the word is removed. When ! a pattern is used for filename generation, the character `.' at the ! start of a filename or immediately following a slash must be matched ! explicitly, unless the shell option `dotglob' is set. The slash ! character must always be matched explicitly. In other cases, the `.' ! character is not treated specially. See the description of `shopt' in ! *Note Bash Builtins::, for a description of the `nullglob' and ! `dotglob' options. The `GLOBIGNORE' shell variable may be used to restrict the set of ! filenames matching a PATTERN. If `GLOBIGNORE' is set, each matching filename that also matches one of the patterns in `GLOBIGNORE' is removed from the list of matches. The filenames `.' and `..' are ! always ignored, even when `GLOBIGNORE'. is set. However, setting `GLOBIGNORE' has the effect of enabling the `dotglob' shell option, so all other filenames beginning with a `.' will match. To get the old --- 1358,1389 ---- ------------------ + * Menu: + + * Pattern Matching:: How the shell matches patterns. + After word splitting, unless the `-f' option has been set (*note The ! Set Builtin::.), Bash scans each word for the characters `*', `?', `(', ! and `['. If one of these characters appears, then the word is regarded ! as a PATTERN, and replaced with an alphabetically sorted list of file names matching the pattern. If no matching file names are found, and ! the shell option `nullglob' is disabled, the word is left unchanged. ! If the `nullglob' option is set, and no matches are found, the word is ! removed. If the shell option `nocaseglob' is enabled, the match is ! performed without regard to the case of alphabetic characters. ! ! When a pattern is used for filename generation, the character `.' at ! the start of a filename or immediately following a slash must be ! matched explicitly, unless the shell option `dotglob' is set. When ! matching a file name, the slash character must always be matched ! explicitly. In other cases, the `.' character is not treated specially. ! ! See the description of `shopt' in *Note Bash Builtins::, for a ! description of the `nocaseglob', `nullglob', and `dotglob' options. The `GLOBIGNORE' shell variable may be used to restrict the set of ! filenames matching a pattern. If `GLOBIGNORE' is set, each matching filename that also matches one of the patterns in `GLOBIGNORE' is removed from the list of matches. The filenames `.' and `..' are ! always ignored, even when `GLOBIGNORE' is set. However, setting `GLOBIGNORE' has the effect of enabling the `dotglob' shell option, so all other filenames beginning with a `.' will match. To get the old *************** *** 1128,1131 **** --- 1392,1406 ---- `GLOBIGNORE' is unset. +  + File: bashref.info, Node: Pattern Matching, Up: Filename Expansion + + Pattern Matching + ................ + + Any character that appears in a pattern, other than the special + pattern characters described below, matches itself. The NUL character + may not occur in a pattern. The special pattern characters must be + quoted if they are to be matched literally. + The special pattern characters have the following meanings: `*' *************** *** 1144,1147 **** --- 1419,1459 ---- including it as the first character in the set. + Within `[' and `]', CHARACTER CLASSES can be specified using the + syntax `[:'CLASS`:]', where CLASS is one of the following classes + defined in the POSIX.2 standard: + alnum alpha ascii blank cntrl digit graph lower + print punct space upper xdigit + + A character class matches any character belonging to that class. + + Within `[' and `]', an EQUIVALENCE CLASS can be specified using + the syntax `[='C`=]', which matches all characters with the same + collation weight (as defined by the current locale) as the + character C. + + Within `[' and `]', the syntax `[.'SYMBOL`.]' matches the + collating symbol SYMBOL. + + If the `extglob' shell option is enabled using the `shopt' builtin, + several extended pattern matching operators are recognized. In the + following description, a PATTERN-LIST is a list of one or more patterns + separated by a `|'. Composite patterns may be formed using one or more + of the following sub-patterns: + + `?(PATTERN-LIST)' + Matches zero or one occurrence of the given patterns. + + `*(PATTERN-LIST)' + Matches zero or more occurrences of the given patterns. + + `+(PATTERN-LIST)' + Matches one or more occurrences of the given patterns. + + `@(PATTERN-LIST)' + Matches exactly one of the given patterns. + + `!(PATTERN-LIST)' + Matches anything except one of the given patterns. +  File: bashref.info, Node: Quote Removal, Prev: Filename Expansion, Up: Shell Expansions *************** *** 1173,1181 **** refers to the standard output (file descriptor 1). ! The word that follows the redirection operator in the following ! descriptions is subjected to brace expansion, tilde expansion, ! parameter expansion, command substitution, arithmetic expansion, quote ! removal, and filename expansion. If it expands to more than one word, ! Bash reports an error. Note that the order of redirections is significant. For example, --- 1485,1493 ---- refers to the standard output (file descriptor 1). ! The word following the redirection operator in the following ! descriptions, unless otherwise noted, is subjected to brace expansion, ! tilde expansion, parameter expansion, command substitution, arithmetic ! expansion, quote removal, and filename expansion. If it expands to ! more than one word, Bash reports an error. Note that the order of redirections is significant. For example, *************** *** 1191,1194 **** --- 1503,1508 ---- redirected to DIRLIST. + A failure to open or create a file causes the redirection to fail. + Redirecting Input ----------------- *************** *** 1213,1222 **** [n]>[|]WORD ! If the redirection operator is `>', and the `-C' option to the `set' ! builtin has been enabled, the redirection will fail if the filename ! whose name results from the expansion of WORD exists. If the ! redirection operator is `>|', then the value of the `-C' option to the ! `set' builtin command is not tested, and the redirection is attempted ! even if the file named by WORD exists. Appending Redirected Output --- 1527,1536 ---- [n]>[|]WORD ! If the redirection operator is `>', and the `noclobber' option to ! the `set' builtin has been enabled, the redirection will fail if the ! filename whose name results from the expansion of WORD exists and is a ! regular file. If the redirection operator is `>|', or the redirection ! operator is `>' and the `noclobber' option is not enabled, the ! redirection is attempted even if the file named by WORD exists. Appending Redirected Output *************** *** 1265,1273 **** arithmetic expansion is performed on WORD. If any characters in WORD are quoted, the DELIMITER is the result of quote removal on WORD, and ! the lines in the here-document are not expanded. Otherwise, all lines ! of the here-document are subjected to parameter expansion, command ! substitution, and arithmetic expansion. In the latter case, the pair ! `\newline' is ignored, and `\' must be used to quote the characters ! `\', `$', and ``'. If the redirection operator is `<<-', then all leading tab --- 1579,1587 ---- arithmetic expansion is performed on WORD. If any characters in WORD are quoted, the DELIMITER is the result of quote removal on WORD, and ! the lines in the here-document are not expanded. If WORD is unquoted, ! all lines of the here-document are subjected to parameter expansion, ! command substitution, and arithmetic expansion. In the latter case, ! the pair `\newline' is ignored, and `\' must be used to quote the ! characters `\', `$', and ``'. If the redirection operator is `<<-', then all leading tab *************** *** 1284,1290 **** is used to duplicate input file descriptors. If WORD expands to one or more digits, the file descriptor denoted by `n' is made to be a copy of ! that file descriptor. If WORD evaluates to `-', file descriptor `n' is ! closed. If `n' is not specified, the standard input (file descriptor ! 0) is used. The operator --- 1598,1605 ---- is used to duplicate input file descriptors. If WORD expands to one or more digits, the file descriptor denoted by `n' is made to be a copy of ! that file descriptor. If the digits in WORD do not specify a file ! descriptor open for input, a redirection error occurs. If WORD ! evaluates to `-', file descriptor `n' is closed. If `n' is not ! specified, the standard input (file descriptor 0) is used. The operator *************** *** 1292,1299 **** is used similarly to duplicate output file descriptors. If `n' is not ! specified, the standard output (file descriptor 1) is used. As a ! special case, if `n' is omitted, and WORD does not expand to one or ! more digits, the standard output and standard error are redirected as ! described previously. Opening File Descriptors for Reading and Writing --- 1607,1615 ---- is used similarly to duplicate output file descriptors. If `n' is not ! specified, the standard output (file descriptor 1) is used. If the ! digits in WORD do not specify a file descriptor open for output, a ! redirection error occurs. As a special case, if `n' is omitted, and ! WORD does not expand to one or more digits, the standard output and ! standard error are redirected as described previously. Opening File Descriptors for Reading and Writing *************** *** 1315,1320 **** --- 1631,1643 ---- * Menu: + * Simple Command Expansion:: How Bash expands simple commands before + executing them. + * Command Search and Execution:: How Bash finds commands and runs them. + * Command Execution Environment:: The environment in which Bash + executes commands that are not + shell builtins. + * Environment:: The environment given to a command. *************** *** 1326,1330 ****  ! File: bashref.info, Node: Command Search and Execution, Next: Environment, Up: Executing Commands Command Search and Execution --- 1649,1696 ----  ! File: bashref.info, Node: Simple Command Expansion, Next: Command Search and Execution, Up: Executing Commands ! ! Simple Command Expansion ! ------------------------ ! ! When a simple command is executed, the shell performs the following ! expansions, assignments, and redirections, from left to right. ! ! 1. The words that the parser has marked as variable assignments (those ! preceding the command name) and redirections are saved for later ! processing. ! ! 2. The words that are not variable assignments or redirections are ! expanded (*note Shell Expansions::.). If any words remain after ! expansion, the first word is taken to be the name of the command ! and the remaining words are the arguments. ! ! 3. Redirections are performed as described above (*note ! Redirections::.). ! ! 4. The text after the `=' in each variable assignment undergoes tilde ! expansion, parameter expansion, command substitution, arithmetic ! expansion, and quote removal before being assigned to the variable. ! ! If no command name results, the variable assignments affect the ! current shell environment. Otherwise, the variables are added to the ! environment of the executed command and do not affect the current shell ! environment. If any of the assignments attempts to assign a value to a ! readonly variable, an error occurs, and the command exits with a ! non-zero status. ! ! If no command name results, redirections are performed, but do not ! affect the current shell environment. A redirection error causes the ! command to exit with a non-zero status. ! ! If there is a command name left after expansion, execution proceeds ! as described below. Otherwise, the command exits. If one of the ! expansions contained a command substitution, the exit status of the ! command is the exit status of the last command substitution performed. ! If there were no command substitutions, the command exits with a status ! of zero. ! !  ! File: bashref.info, Node: Command Search and Execution, Next: Command Execution Environment, Prev: Simple Command Expansion, Up: Executing Commands Command Search and Execution *************** *** 1346,1367 **** contains no slashes, Bash searches each element of `$PATH' for a directory containing an executable file by that name. Bash uses a ! hash table to remember the full filenames of executable files (see ! the description of `hash' in *Note Bourne Shell Builtins::) to ! avoid multiple `PATH' searches. A full search of the directories in `$PATH' is performed only if the command is not found in the hash table. If the search is unsuccessful, the shell prints an ! error message and returns a nonzero exit status. 4. If the search is successful, or if the command name contains one ! or more slashes, the shell executes the named program. Argument 0 ! is set to the name given, and the remaining arguments to the ! command are set to the arguments supplied, if any. 5. If this execution fails because the file is not in executable ! format, and the file is not a directory, it is assumed to be SHELL ! SCRIPT (*note Shell Scripts::.).  ! File: bashref.info, Node: Environment, Next: Exit Status, Prev: Command Search and Execution, Up: Executing Commands Environment --- 1712,1804 ---- contains no slashes, Bash searches each element of `$PATH' for a directory containing an executable file by that name. Bash uses a ! hash table to remember the full pathnames of executable files to ! avoid multiple `PATH' searches (see the description of `hash' in ! *Note Bourne Shell Builtins::). A full search of the directories in `$PATH' is performed only if the command is not found in the hash table. If the search is unsuccessful, the shell prints an ! error message and returns an exit status of 127. 4. If the search is successful, or if the command name contains one ! or more slashes, the shell executes the named program in a ! separate execution environment. Argument 0 is set to the name ! given, and the remaining arguments to the command are set to the ! arguments supplied, if any. 5. If this execution fails because the file is not in executable ! format, and the file is not a directory, it is assumed to be a ! SHELL SCRIPT and the shell executes it as described in *Note Shell ! Scripts::. ! ! 6. If the command was not begun asynchronously, the shell waits for ! the command to complete and collects its exit status. ! ! !  ! File: bashref.info, Node: Command Execution Environment, Next: Environment, Prev: Command Search and Execution, Up: Executing Commands ! ! Command Execution Environment ! ----------------------------- ! ! The shell has an EXECUTION ENVIRONMENT, which consists of the ! following: ! ! * open files inherited by the shell at invocation, as modified by ! redirections supplied to the `exec' builtin ! ! * the current working directory as set by `cd', `pushd', or `popd', ! or inherited by the shell at invocation ! ! * the file creation mode mask as set by `umask' or inherited from ! the shell's parent ! ! * current traps set by `trap' ! ! * shell parameters that are set by variable assignment or with `set' ! or inherited from the shell's parent in the environment ! ! * shell functions defined during execution or inherited from the ! shell's parent in the environment ! ! * options enabled at invocation (either by default or with ! command-line arguments) or by `set' ! ! * options enabled by `shopt' ! ! * shell aliases defined with `alias' (*note Aliases::.) ! ! * various process IDs, including those of background jobs (*note ! Lists::.), the value of `$$', and the value of `$PPID' ! ! When a simple command other than a builtin or shell function is to ! be executed, it is invoked in a separate execution environment that ! consists of the following. Unless otherwise noted, the values are ! inherited from the shell. ! ! * the shell's open files, plus any modifications and additions ! specified by redirections to the command ! ! * the current working directory ! ! * the file creation mode mask ! ! * shell variables marked for export, along with variables exported ! for the command, passed in the environment (*note Environment::.) ! ! * traps caught by the shell are reset to the values inherited from ! the shell's parent, and traps ignored by the shell are ignored ! ! A command invoked in this separate environment cannot affect the ! shell's execution environment. ! ! Command substitution and asynchronous commands are invoked in a ! subshell environment that is a duplicate of the shell environment, ! except that traps caught by the shell are reset to the values that the ! shell inherited from its parent at invocation. Builtin commands that ! are invoked as part of a pipeline are also executed in a subshell ! environment. Changes made to the subshell environment cannot affect ! the shell's execution environment.  ! File: bashref.info, Node: Environment, Next: Exit Status, Prev: Command Execution Environment, Up: Executing Commands Environment *************** *** 1381,1386 **** replacing the old. The environment inherited by any executed command consists of the shell's initial environment, whose values may be ! modified in the shell, less any pairs removed by the `unset' command, ! plus any additions via the `export' and `declare -x' commands. The environment for any simple command or function may be augmented --- 1818,1824 ---- replacing the old. The environment inherited by any executed command consists of the shell's initial environment, whose values may be ! modified in the shell, less any pairs removed by the `unset' and ! `export -n' commands, plus any additions via the `export' and `declare ! -x' commands. The environment for any simple command or function may be augmented *************** *** 1389,1393 **** environment seen by that command. ! If the `-k' flag is set (*note The Set Builtin::., then all parameter assignments are placed in the environment for a command, not just those that precede the command name. --- 1827,1831 ---- environment seen by that command. ! If the `-k' option is set (*note The Set Builtin::.), then all parameter assignments are placed in the environment for a command, not just those that precede the command name. *************** *** 1403,1412 **** ----------- ! For the purposes of the shell, a command which exits with a zero ! exit status has succeeded. A non-zero exit status indicates failure. ! This seemingly counter-intuitive scheme is used so there is one ! well-defined way to indicate success and a variety of ways to indicate ! various failure modes. When a command terminates on a fatal signal ! whose number is N, Bash uses the value 128+N as the exit status. If a command is not found, the child process created to execute it --- 1841,1850 ---- ----------- ! For the shell's purposes, a command which exits with a zero exit ! status has succeeded. A non-zero exit status indicates failure. This ! seemingly counter-intuitive scheme is used so there is one well-defined ! way to indicate success and a variety of ways to indicate various ! failure modes. When a command terminates on a fatal signal whose ! number is N, Bash uses the value 128+N as the exit status. If a command is not found, the child process created to execute it *************** *** 1414,1417 **** --- 1852,1858 ---- the return status is 126. + If a command fails because of an error during expansion or + redirection, the exit status is greater than zero. + The exit status is used by the Bash conditional commands (*note Conditional Constructs::.) and some of the list constructs (*note *************** *** 1420,1424 **** All of the Bash builtins return an exit status of zero if they succeed and a non-zero status on failure, so they may be used by the ! conditional and list constructs.  --- 1861,1866 ---- All of the Bash builtins return an exit status of zero if they succeed and a non-zero status on failure, so they may be used by the ! conditional and list constructs. All builtins return an exit status of ! 2 to indicate incorrect usage.  *************** *** 1428,1451 **** ------- ! When Bash is interactive, it ignores `SIGTERM' (so that `kill 0' ! does not kill an interactive shell), and `SIGINT' is caught and handled ! (so that the `wait' builtin is interruptible). When Bash receives a ! `SIGINT', it breaks out of any executing loops. In all cases, Bash ! ignores `SIGQUIT'. If job control is in effect (*note Job Control::.), ! Bash ignores `SIGTTIN', `SIGTTOU', and `SIGTSTP'. ! Synchronous jobs started by Bash have signals set to the values inherited by the shell from its parent. When job control is not in ! effect, background jobs (commands terminated with `&') ignore `SIGINT' ! and `SIGQUIT'. Commands run as a result of command substitution ignore ! the keyboard-generated job control signals `SIGTTIN', `SIGTTOU', and `SIGTSTP'. The shell exits by default upon receipt of a `SIGHUP'. Before ! exiting, it resends the `SIGHUP' to all jobs, running or stopped. To ! prevent the shell from sending the `SIGHUP' signal to a particular job, ! remove it from the jobs table with the `disown' builtin (*note Job ! Control Builtins::.) or use `disown -h' to mark it to not receive ! `SIGHUP'.  --- 1870,1907 ---- ------- ! When Bash is interactive, in the absence of any traps, it ignores ! `SIGTERM' (so that `kill 0' does not kill an interactive shell), and ! `SIGINT' is caught and handled (so that the `wait' builtin is ! interruptible). When Bash receives a `SIGINT', it breaks out of any ! executing loops. In all cases, Bash ignores `SIGQUIT'. If job control ! is in effect (*note Job Control::.), Bash ignores `SIGTTIN', `SIGTTOU', ! and `SIGTSTP'. ! Commands started by Bash have signal handlers set to the values inherited by the shell from its parent. When job control is not in ! effect, asynchronous commands ignore `SIGINT' and `SIGQUIT' as well. ! Commands run as a result of command substitution ignore the ! keyboard-generated job control signals `SIGTTIN', `SIGTTOU', and `SIGTSTP'. The shell exits by default upon receipt of a `SIGHUP'. Before ! exiting, it resends the `SIGHUP' to all jobs, running or stopped. ! Stopped jobs are sent `SIGCONT' to ensure that they receive the ! `SIGHUP'. To prevent the shell from sending the `SIGHUP' signal to a ! particular job, it should be removed from the jobs table with the ! `disown' builtin (*note Job Control Builtins::.) or marked to not ! receive `SIGHUP' using `disown -h'. ! ! If the `huponexit' shell option has been set with `shopt' (*note ! Bash Builtins::.), Bash sends a `SIGHUP' to all jobs when an ! interactive login shell exits. ! ! When Bash receives a signal for which a trap has been set while ! waiting for a command to complete, the trap will not be executed until ! the command completes. When Bash is waiting for an asynchronous ! command via the `wait' builtin, the reception of a signal for which a ! trap has been set will cause the `wait' builtin to return immediately ! with an exit status greater than 128, immediately after which the trap ! is executed.  *************** *** 1476,1480 **** if `filename' is an executable shell script. This subshell reinitializes itself, so that the effect is as if a new shell had been ! invoked to interpret the script. Most versions of Unix make this a part of the kernel's command --- 1932,1938 ---- if `filename' is an executable shell script. This subshell reinitializes itself, so that the effect is as if a new shell had been ! invoked to interpret the script, with the exception that the locations ! of commands remembered by the parent (see the description of `hash' in ! *Note Bourne Shell Builtins::) are retained by the child. Most versions of Unix make this a part of the kernel's command *************** *** 1490,1494 ****  ! File: bashref.info, Node: Bourne Shell Features, Next: Csh Features, Prev: Basic Shell Features, Up: Top Bourne Shell Style Features --- 1948,1952 ----  ! File: bashref.info, Node: Bourne Shell Features, Next: Bash Features, Prev: Basic Shell Features, Up: Top Bourne Shell Style Features *************** *** 1506,1510 **** This section briefly summarizes things which Bash inherits from the Bourne Shell: builtins, variables, and other features. It also lists ! the significant differences between Bash and the Bourne Shell.  --- 1964,1969 ---- This section briefly summarizes things which Bash inherits from the Bourne Shell: builtins, variables, and other features. It also lists ! the significant differences between Bash and the Bourne Shell. Many of ! the builtins have been extended by POSIX or Bash.  *************** *** 1521,1534 **** : [ARGUMENTS] Do nothing beyond expanding ARGUMENTS and performing redirections. `.' . FILENAME Read and execute commands from the FILENAME argument in the ! current shell context. `break' break [N] Exit from a `for', `while', `until', or `select' loop. If N is ! supplied, the Nth enclosing loop is exited. `cd' --- 1980,2001 ---- : [ARGUMENTS] Do nothing beyond expanding ARGUMENTS and performing redirections. + The return status is zero. `.' . FILENAME Read and execute commands from the FILENAME argument in the ! current shell context. If FILENAME does not contain a slash, the ! `$PATH' variable is used to find FILENAME. The current directory ! is searched if FILENAME is not found in `$PATH'. The return ! status is the exit status of the last command executed, or zero if ! no commands are executed. If FILENAME is not found, or cannot be ! read, the return status is non-zero. `break' break [N] Exit from a `for', `while', `until', or `select' loop. If N is ! supplied, the Nth enclosing loop is exited. N must be greater ! than or equal to 1. The return status is zero unless N is not ! greater than or equal to 1. `cd' *************** *** 1538,1543 **** the shell variable `CDPATH' exists, it is used as a search path. If DIRECTORY begins with a slash, `CDPATH' is not used. The `-P' ! option means to not follow symbolic links; symlinks are followed ! by default or with the `-L' option. `continue' --- 2005,2012 ---- the shell variable `CDPATH' exists, it is used as a search path. If DIRECTORY begins with a slash, `CDPATH' is not used. The `-P' ! option means to not follow symbolic links; symbolic links are ! followed by default or with the `-L' option. If DIRECTORY is `-', ! it is equivalent to `$OLDPWD'. The return status is zero if the ! directory is successfully changed, non-zero otherwise. `continue' *************** *** 1545,1568 **** Resume the next iteration of an enclosing `for', `while', `until', or `select' loop. If N is supplied, the execution of the Nth ! enclosing loop is resumed. `eval' eval [ARGUMENTS] The arguments are concatenated together into a single command, ! which is then read and executed. `exec' ! exec [-cl] [-a NAME] [COMMAND] [ARGUMENTS] ! If COMMAND is supplied, it replaces the shell. If the `-l' option ! is supplied, the shell places a dash in the zeroth arg passed to ! COMMAND. This is what the `login' program does. The `-c' option ! causes COMMAND to be executed with an empty environment. If `-a' ! is supplied, the shell passes NAME as the zeroth argument to ! COMMAND. If no COMMAND is specified, redirections may be used to ! affect the current shell environment. `exit' exit [N] Exit the shell, returning a status of N to the shell's parent. `export' --- 2014,2044 ---- Resume the next iteration of an enclosing `for', `while', `until', or `select' loop. If N is supplied, the execution of the Nth ! enclosing loop is resumed. N must be greater than or equal to 1. ! The return status is zero unless N is not greater than or equal to ! 1. `eval' eval [ARGUMENTS] The arguments are concatenated together into a single command, ! which is then read and executed, and its exit status returned as ! the exit status of `eval'. If there are no arguments or only ! empty arguments, the return status is zero. `exec' ! exec [-cl] [-a NAME] [COMMAND [ARGUMENTS]] ! If COMMAND is supplied, it replaces the shell without creating a ! new process. If the `-l' option is supplied, the shell places a ! dash in the zeroth arg passed to COMMAND. This is what the ! `login' program does. The `-c' option causes COMMAND to be ! executed with an empty environment. If `-a' is supplied, the ! shell passes NAME as the zeroth argument to COMMAND. If no ! COMMAND is specified, redirections may be used to affect the ! current shell environment. If there are no redirection errors, the ! return status is zero; otherwise the return status is non-zero. `exit' exit [N] Exit the shell, returning a status of N to the shell's parent. + Any trap on `EXIT' is executed before the shell terminates. `export' *************** *** 1570,1576 **** Mark each NAME to be passed to child processes in the environment. If the `-f' option is supplied, the NAMEs refer to shell ! functions. The `-n' option means to no longer mark each NAME for ! export. If no NAMES are supplied, or if the `-p' option is given, ! a list of exported names is displayed. `getopts' --- 2046,2057 ---- Mark each NAME to be passed to child processes in the environment. If the `-f' option is supplied, the NAMEs refer to shell ! functions; otherwise the names refer to shell variables. The `-n' ! option means to no longer mark each NAME for export. If no NAMES ! are supplied, or if the `-p' option is given, a list of exported ! names is displayed. The `-p' option displays output in a form ! that may be reused as input. The return status is zero unless an ! invalid option is supplied, one of the names is not a valid shell ! variable name, or `-f' is supplied with a name that is not a shell ! function. `getopts' *************** *** 1590,1601 **** invocation if a new set of parameters is to be used. `getopts' can report errors in two ways. If the first character of OPTSTRING is a colon, SILENT error reporting is used. In normal ! operation diagnostic messages are printed when illegal options or missing option arguments are encountered. If the variable `OPTERR' ! is set to 0, no error message will be displayed, even if the first character of `optstring' is not a colon. ! If an illegal option is seen, `getopts' places `?' into NAME and, if not silent, prints an error message and unsets `OPTARG'. If `getopts' is silent, the option character found is placed in --- 2071,2089 ---- invocation if a new set of parameters is to be used. + When the end of options is encountered, `getopts' exits with a + return value greater than zero. `OPTIND' is set to the index of + the first non-option argument, and `name' is set to `?'. + + `getopts' normally parses the positional parameters, but if more + arguments are given in ARGS, `getopts' parses those instead. + `getopts' can report errors in two ways. If the first character of OPTSTRING is a colon, SILENT error reporting is used. In normal ! operation diagnostic messages are printed when invalid options or missing option arguments are encountered. If the variable `OPTERR' ! is set to 0, no error messages will be displayed, even if the first character of `optstring' is not a colon. ! If an invalid option is seen, `getopts' places `?' into NAME and, if not silent, prints an error message and unsets `OPTARG'. If `getopts' is silent, the option character found is placed in *************** *** 1608,1623 **** character found. - `getopts' normally parses the positional parameters, but if more - arguments are given in ARGS, `getopts' parses those instead. - `hash' hash [-r] [-p FILENAME] [NAME] ! Remember the full filenames of commands specified as arguments, so ! they need not be searched for on subsequent invocations. The ! commands are found by searching through the directories listed in ! `$PATH'. The `-p' option inhibits the path search, and FILENAME ! is used as the location of NAME. The `-r' option causes the shell ! to forget all remembered locations. If no arguments are given, ! information about remembered commands is printed. `pwd' --- 2096,2110 ---- character found. `hash' hash [-r] [-p FILENAME] [NAME] ! Remember the full pathnames of commands specified as NAME ! arguments, so they need not be searched for on subsequent ! invocations. The commands are found by searching through the ! directories listed in `$PATH'. The `-p' option inhibits the path ! search, and FILENAME is used as the location of NAME. The `-r' ! option causes the shell to forget all remembered locations. If no ! arguments are given, information about remembered commands is ! printed. The return status is zero unless a NAME is not found or ! an invalid option is supplied. `pwd' *************** *** 1626,1662 **** supplied, the path printed will not contain symbolic links. If the `-L' option is supplied, the path printed may contain symbolic ! links. `readonly' readonly [-apf] [NAME] ... ! Mark each NAME as unchangable. The values of these names may not ! be changed by subsequent assignment. If the `-f' option is ! supplied, each NAME refers to a shell function. The `-a' option ! means each NAME refers to an array variable. If no NAME arguments ! are given, or if the `-p' option is supplied, a list of all ! readonly names is printed. `return' return [N] ! Cause a shell function to exit with value N. This may also be used ! to terminate execution of a script being executed with the `.' ! builtin. `shift' shift [N] ! Shift positional parameters to the left by N. The positional ! parameters from N+1 ... are renamed to `$1' ... . Parameters ! represented by the numbers `$#' to N+1 are unset. N must be a ! non-negative number less than or equal to `$#'. `test' `[' ! Evaluate a conditional expression (*note Bash Conditional ! Expressions::.). `times' times Print out the user and system times used by the shell and its ! children. `trap' --- 2113,2218 ---- supplied, the path printed will not contain symbolic links. If the `-L' option is supplied, the path printed may contain symbolic ! links. The return status is zero unless an error is encountered ! while determining the name of the current directory or an invalid ! option is supplied. `readonly' readonly [-apf] [NAME] ... ! Mark each NAME as readonly. The values of these names may not be ! changed by subsequent assignment. If the `-f' option is supplied, ! each NAME refers to a shell function. The `-a' option means each ! NAME refers to an array variable. If no NAME arguments are given, ! or if the `-p' option is supplied, a list of all readonly names is ! printed. The `-p' option causes output to be displayed in a ! format that may be reused as input. The return status is zero ! unless an invalid option is supplied, one of the NAME arguments is ! not a valid shell variable or function name, or the `-f' option is ! supplied with a name that is not a shell function. `return' return [N] ! Cause a shell function to exit with the return value N. This may ! also be used to terminate execution of a script being executed ! with the `.' builtin, returning either N or the exit status of the ! last command executed within the script as the exit status of the ! script. The return status is false if `return' is used outside a ! function and not during the execution of a script by `.'. `shift' shift [N] ! Shift the positional parameters to the left by N. The positional ! parameters from N+1 ... `$#' are renamed to `$1' ... `$#'-N+1. ! Parameters represented by the numbers `$#' to N+1 are unset. N ! must be a non-negative number less than or equal to `$#'. If N is ! zero or greater than `$#', the positional parameters are not ! changed. The return status is zero unless N is greater than `$#' ! or less than zero, non-zero otherwise. `test' `[' ! Evaluate a conditional expression EXPR. Each operator and operand ! must be a separate argument. Expressions are composed of the ! primaries described below in *Note Bash Conditional Expressions::. ! ! Expressions may be combined using the following operators, listed ! in decreasing order of precedence. ! ! `! EXPR' ! True if EXPR is false. ! ! `( EXPR )' ! Returns the value of EXPR. This may be used to override the ! normal precedence of operators. ! ! `EXPR1 -a EXPR2' ! True if both EXPR1 and EXPR2 are true. ! ! `EXPR1 -o EXPR2' ! True if either EXPR1 or EXPR2 is true. ! ! The `test' and `[' builtins evaluate conditional expressions using ! a set of rules based on the number of arguments. ! ! 0 arguments ! The expression is false. ! ! 1 argument ! The expression is true if and only if the argument is not ! null. ! ! 2 arguments ! If the first argument is `!', the expression is true if and ! only if the second argument is null. If the first argument ! is one of the unary conditional operators (*note Bash ! Conditional Expressions::.), the expression is true if the ! unary test is true. If the first argument is not a valid ! unary operator, the expression is false. ! ! 3 arguments ! If the second argument is one of the binary conditional ! operators (*note Bash Conditional Expressions::.), the result ! of the expression is the result of the binary test using the ! first and third arguments as operands. If the first argument ! is `!', the value is the negation of the two-argument test ! using the second and third arguments. If the first argument ! is exactly `(' and the third argument is exactly `)', the ! result is the one-argument test of the second argument. ! Otherwise, the expression is false. The `-a' and `-o' ! operators are considered binary operators in this case. ! ! 4 arguments ! If the first argument is `!', the result is the negation of ! the three-argument expression composed of the remaining ! arguments. Otherwise, the expression is parsed and evaluated ! according to precedence using the rules listed above. ! ! 5 or more arguments ! The expression is parsed and evaluated according to precedence ! using the rules listed above. `times' times Print out the user and system times used by the shell and its ! children. The return status is zero. `trap' *************** *** 1670,1679 **** with each SIGSPEC. If no arguments are supplied, or only `-p' is given, `trap' prints the list of commands associated with each ! signal number. Each SIGSPEC is either a signal name such as ! `SIGINT' (with or without the `SIG' prefix) or a signal number. ! If a SIGSPEC is `0' or `EXIT', ARG is executed when the shell ! exits. If a SIGSPEC is `DEBUG', the command ARG is executed after ! every simple command. The `-l' option causes the shell to print a ! list of signal names and their corresponding numbers. Signals ignored upon entry to the shell cannot be trapped or reset. --- 2226,2236 ---- with each SIGSPEC. If no arguments are supplied, or only `-p' is given, `trap' prints the list of commands associated with each ! signal number in a form that may be reused as shell input. Each ! SIGSPEC is either a signal name such as `SIGINT' (with or without ! the `SIG' prefix) or a signal number. If a SIGSPEC is `0' or ! `EXIT', ARG is executed when the shell exits. If a SIGSPEC is ! `DEBUG', the command ARG is executed after every simple command. ! The `-l' option causes the shell to print a list of signal names ! and their corresponding numbers. Signals ignored upon entry to the shell cannot be trapped or reset. *************** *** 1681,1686 **** process when it is created. `umask' ! umask [-S] [MODE] Set the shell process's file creation mask to MODE. If MODE begins with a digit, it is interpreted as an octal number; if not, --- 2238,2246 ---- process when it is created. + The return status is zero unless a SIGSPEC does not specify a + valid signal. + `umask' ! umask [-p] [-S] [MODE] Set the shell process's file creation mask to MODE. If MODE begins with a digit, it is interpreted as an octal number; if not, *************** *** 1688,1692 **** by the `chmod' command. If MODE is omitted, the current value of the mask is printed. If the `-S' option is supplied without a ! MODE argument, the mask is printed in a symbolic format. `unset' --- 2248,2256 ---- by the `chmod' command. If MODE is omitted, the current value of the mask is printed. If the `-S' option is supplied without a ! MODE argument, the mask is printed in a symbolic format. If the ! `-p' option is supplied, and MODE is omitted, the output is in a ! form that may be reused as input. The return status is zero if ! the mode is successfully changed or if no MODE argument is ! supplied, and non-zero otherwise. `unset' *************** *** 1695,1700 **** supplied, or the `-v' option is given, each NAME refers to a shell variable. If the `-f' option is given, the NAMEs refer to shell ! functions, and the function definition is removed. Read-only ! variables and functions may not be unset.  --- 2259,2265 ---- supplied, or the `-v' option is given, each NAME refers to a shell variable. If the `-f' option is given, the NAMEs refer to shell ! functions, and the function definition is removed. Readonly ! variables and functions may not be unset. The return status is ! zero unless a NAME does not exist or is readonly.  *************** *** 1707,1732 **** shell. In some cases, Bash assigns a default value to the variable. ! `IFS' ! A list of characters that separate fields; used when the shell ! splits words as part of expansion. ! ! `PATH' ! A colon-separated list of directories in which the shell looks for ! commands. `HOME' The current user's home directory; the default for the `cd' builtin ! command. ! ! `CDPATH' ! A colon-separated list of directories used as a search path for ! the `cd' command. ! `MAILPATH' ! A colon-separated list of files which the shell periodically checks ! for new mail. You can also specify what message is printed by ! separating the file name from the message with a `?'. When used ! in the text of the message, `$_' stands for the name of the ! current mailfile. `MAIL' --- 2272,2287 ---- shell. In some cases, Bash assigns a default value to the variable. ! `CDPATH' ! A colon-separated list of directories used as a search path for ! the `cd' builtin command. `HOME' The current user's home directory; the default for the `cd' builtin ! command. The value of this variable is also used by tilde ! expansion (*note Tilde Expansion::.). ! `IFS' ! A list of characters that separate fields; used when the shell ! splits words as part of expansion. `MAIL' *************** *** 1735,1738 **** --- 2290,2312 ---- specified file. + `MAILPATH' + A colon-separated list of filenames which the shell periodically + checks for new mail. Each list entry can specify the message that + is printed when new mail arrives in the mail file by separating + the file name from the message with a `?'. When used in the text + of the message, `$_' expands to the name of the current mail file. + + `OPTARG' + The value of the last option argument processed by the `getopts' + builtin. + + `OPTIND' + The index of the last option argument processed by the `getopts' + builtin. + + `PATH' + A colon-separated list of directories in which the shell looks for + commands. + `PS1' The primary prompt string. The default value is `\s-\v\$ '. *************** *** 1741,1751 **** The secondary prompt string. The default value is `> '. - `OPTIND' - The index of the last option processed by the `getopts' builtin. - - `OPTARG' - The value of the last option argument processed by the `getopts' - builtin. -  File: bashref.info, Node: Other Bourne Shell Features, Prev: Bourne Shell Variables, Up: Bourne Shell Features --- 2315,2318 ---- *************** *** 1763,1769 **** POSIX 1003.2 standard as the specification of how these features are to be implemented. There are some differences between the traditional ! Bourne shell and the POSIX standard; this section quickly details the ! differences of significance. A number of these differences are ! explained in greater depth in subsequent sections.  --- 2330,2336 ---- POSIX 1003.2 standard as the specification of how these features are to be implemented. There are some differences between the traditional ! Bourne shell and Bash; this section quickly details the differences of ! significance. A number of these differences are explained in greater ! depth in subsequent sections.  *************** *** 1773,1972 **** ---------------------------------------------- ! Bash is POSIX-conformant, even where the POSIX specification differs ! from traditional `sh' behavior. ! Bash has multi-character invocation options (*note Invoking Bash::.). ! Bash has command-line editing (*note Command Line Editing::.) and ! the `bind' builtin. ! Bash has command history (*note Bash History Facilities::.) and the ! `history' and `fc' builtins to manipulate it. ! Bash implements `csh'-like history expansion (*note History ! Interaction::.). ! Bash has one-dimensional array variables (*note Arrays::.), and the ! appropriate variable expansions and assignment syntax to use them. ! Some of the Bash builtins take options to act on arrays. Bash provides ! some built-in array variables. ! Bash implements the `!' keyword to negate the return value of a ! pipeline (*note Pipelines::.). Very useful when an `if' statement ! needs to act only if a test fails. ! Bash includes the `select' compound command, which allows the ! generation of simple menus (*note Korn Shell Constructs::.). ! Bash includes brace expansion (*note Brace Expansion::.) and tilde ! expansion (*note Tilde Expansion::.). ! Bash implements command aliases and the `alias' and `unalias' ! builtins (*note Aliases::.). ! Bash provides shell arithmetic and arithmetic expansion (*note Shell ! Arithmetic::.). ! The POSIX and `ksh'-style `$()' form of command substitution is ! implemented (*note Command Substitution::.), and preferred to the ! Bourne shell's ```' (which is also implemented for backwards ! compatibility). ! Variables present in the shell's initial environment are ! automatically exported to child processes. The Bourne shell does not ! normally do this unless the variables are explicitly marked using the ! `export' command. ! Bash includes the POSIX and `ksh'-style pattern removal `%', `#', ! `%%' and `##' constructs to remove leading or trailing substrings from ! variable values (*note Shell Parameter Expansion::.). ! The expansion `${#xx}', which returns the length of `$xx', is ! supported (*note Shell Parameter Expansion::.). ! The `$'...'' quoting syntax, which expands ANSI-C backslash-escaped ! characters in the text between the single quotes, is supported (*note ! ANSI-C Quoting::.). ! Bash supports the `$"..."' quoting syntax to do locale-specific ! translation of the characters between the double quotes. The `-D' and ! `--dump-strings' invocation options list the translatable strings found ! in a script (*note Locale Translation::.). ! The expansion `${var:'OFFSET`[:'LENGTH`]}', which expands to the ! substring of `var''s value of length LENGTH, optionally beginning at ! OFFSET, is present (*note Shell Parameter Expansion::.). ! The expansion `${var/[/]'PATTERN`[/'REPLACEMENT`]}', which matches ! PATTERN and replaces it with REPLACEMENT in the value of `var', is ! available (*note Shell Parameter Expansion::.). ! Bash has INDIRECT variable expansion using `${!word}' (*note Shell ! Parameter Expansion::.). ! Bash can expand positional parameters beyond `$9' using `${NUM}'. ! Bash has process substitution (*note Process Substitution::.). ! Bash automatically assigns variables that provide information about ! the current user (`UID', `EUID', and `GROUPS'), the current host ! (`HOSTTYPE', `OSTYPE', `MACHTYPE', and `HOSTNAME'), and the instance of ! Bash that is running (`BASH', `BASH_VERSION', and `BASH_VERSINFO'. ! *Note Bash Variables::, for details. ! The `IFS' variable is used to split only the results of expansion, ! not all words (*note Word Splitting::.). This closes a longstanding ! shell security hole. ! It is possible to have a variable and a function with the same name; ! `sh' does not separate the two name spaces. ! Bash functions are permitted to have local variables using the ! `local' builtin, and thus useful recursive functions may be written. ! Variable assignments preceding commands affect only that command, ! even builtins and functions (*note Environment::.). In `sh', all ! variable assignments preceding commands are global unless the command ! is executed from the file system. ! Bash performs filename expansion on filenames specified as operands ! to output redirection operators. ! Bash contains the `<>' redirection operator, allowing a file to be ! opened for both reading and writing, and the `&>' redirection operator, ! for directing standard output and standard error to the same file ! (*note Redirections::.). ! The `noclobber' option is available to avoid overwriting existing ! files with output redirection (*note The Set Builtin::.). The `>|' ! redirection operator may be used to override `noclobber'. ! Bash interprets special backslash-escaped characters in the prompt ! strings when interactive (*note Printing a Prompt::.). ! Bash allows you to write a function to override a builtin, and ! provides access to that builtin's functionality within the function via ! the `builtin' and `command' builtins (*note Bash Builtins::.). ! The `command' builtin allows selective disabling of functions when ! command lookup is performed (*note Bash Builtins::.). ! Individual builtins may be enabled or disabled using the `enable' ! builtin (*note Bash Builtins::.). ! The Bash `hash' builtin allows a name to be associated with an ! arbitrary filename, even when that filename cannot be found by ! searching the `$PATH', using `hash -p'. ! Shell functions may be exported to children via the environment ! (*note Shell Functions::.). ! Bash includes a `help' builtin for quick reference to shell ! facilities (*note Bash Builtins::.). ! The Bash `read' builtin (*note Bash Builtins::.) will read a line ! ending in `\' with the `-r' option, and will use the `REPLY' variable ! as a default if no arguments are supplied. The Bash `read' builtin ! also accepts a prompt string with the `-p' option and will use Readline ! to obtain the line when given the `-e' option. ! ! Bash includes the `shopt' builtin, for finer control of shell ! optional capabilities (*note Bash Builtins::.). ! Bash has much more optional behavior controllable with the `set' ! builtin (*note The Set Builtin::.). ! The `disown' builtin can remove a job from the internal shell job ! table (*note Job Control Builtins::.). ! The `return' builtin may be used to abort execution of scripts ! executed with the `.' or `source' builtins (*note Bourne Shell ! Builtins::.). ! The `test' builtin (*note Bourne Shell Builtins::.) is slightly ! different, as it implements the POSIX 1003.2 algorithm, which specifies ! the behavior based on the number of arguments. ! The `trap' builtin (*note Bourne Shell Builtins::.) allows a `DEBUG' ! pseudo-signal specification, similar to `EXIT'. Commands specified ! with a `DEBUG' trap are executed after every simple command. The ! `DEBUG' trap is not inherited by shell functions. ! The Bash `export', `readonly', and `declare' builtins can take a ! `-f' option to act on shell functions, a `-p' option to display ! variables with various attributes set in a format that can be used as ! shell input, a `-n' option to remove various variable attributes, and ! `name=value' arguments to set variable attributes and values ! simultaneously. ! The Bash `cd' and `pwd' builtins (*note Bourne Shell Builtins::.) ! each take `-L' and `-P' builtins to switch between logical and physical ! modes. ! The Bash `type' builtin is more extensive and gives more information ! about the names it finds (*note Bash Builtins::.). ! Bash implements a `csh'-like directory stack, and provides the ! `pushd', `popd', and `dirs' builtins to manipulate it (*note C Shell ! Builtins::.). Bash also makes the directory stack visible as the value ! of the `DIRSTACK' shell variable. ! The Bash restricted mode is more useful (*note The Restricted ! Shell::.); the SVR4.2 shell restricted mode is too limited. ! Bash has the `time' reserved word and command timing (*note ! Pipelines::.). The display of the timing statistics may be controlled ! with the `TIMEFORMAT' variable. ! The SVR4.2 shell has two privilege-related builtins (`mldmode' and ! `priv') not present in Bash. ! Bash does not have the `stop' or `newgrp' builtins. ! Bash does not use the `SHACCT' variable or perform shell accounting. ! The SVR4.2 `sh' uses a `TIMEOUT' variable like Bash uses `TMOUT'. ! More features unique to Bash may be found in *Note Bash Features::. Implementation Differences From The SVR4.2 Shell --- 2340,2570 ---- ---------------------------------------------- ! * Bash is POSIX-conformant, even where the POSIX specification ! differs from traditional `sh' behavior. ! * Bash has multi-character invocation options (*note Invoking ! Bash::.). ! * Bash has command-line editing (*note Command Line Editing::.) and ! the `bind' builtin. ! * Bash has command history (*note Bash History Facilities::.) and the ! `history' and `fc' builtins to manipulate it. ! * Bash implements `csh'-like history expansion (*note History ! Interaction::.). ! * Bash has one-dimensional array variables (*note Arrays::.), and the ! appropriate variable expansions and assignment syntax to use them. ! Several of the Bash builtins take options to act on arrays. Bash ! provides a number of built-in array variables. ! * The `$'...'' quoting syntax, which expands ANSI-C ! backslash-escaped characters in the text between the single quotes, ! is supported (*note ANSI-C Quoting::.). ! * Bash supports the `$"..."' quoting syntax to do locale-specific ! translation of the characters between the double quotes. The ! `-D', `--dump-strings', and `--dump-po-strings' invocation options ! list the translatable strings found in a script (*note Locale ! Translation::.). ! * Bash implements the `!' keyword to negate the return value of a ! pipeline (*note Pipelines::.). Very useful when an `if' statement ! needs to act only if a test fails. ! * Bash has the `time' reserved word and command timing (*note ! Pipelines::.). The display of the timing statistics may be ! controlled with the `TIMEFORMAT' variable. ! * Bash includes the `select' compound command, which allows the ! generation of simple menus (*note Conditional Constructs::.). ! * Bash includes the `[[' compound command, which makes conditional ! testing part of the shell grammar (*note Conditional ! Constructs::.). ! * Bash includes brace expansion (*note Brace Expansion::.) and tilde ! expansion (*note Tilde Expansion::.). ! * Bash implements command aliases and the `alias' and `unalias' ! builtins (*note Aliases::.). ! * Bash provides shell arithmetic, the `((' compound command (*note ! Conditional Constructs::.), and arithmetic expansion (*note Shell ! Arithmetic::.). ! * Variables present in the shell's initial environment are ! automatically exported to child processes. The Bourne shell does ! not normally do this unless the variables are explicitly marked ! using the `export' command. ! * Bash includes the POSIX pattern removal `%', `#', `%%' and `##' ! expansions to remove leading or trailing substrings from variable ! values (*note Shell Parameter Expansion::.). ! * The expansion `${#xx}', which returns the length of `${xx}', is ! supported (*note Shell Parameter Expansion::.). ! * The expansion `${var:'OFFSET`[:'LENGTH`]}', which expands to the ! substring of `var''s value of length LENGTH, beginning at OFFSET, ! is present (*note Shell Parameter Expansion::.). ! * The expansion `${var/[/]'PATTERN`[/'REPLACEMENT`]}', which matches ! PATTERN and replaces it with REPLACEMENT in the value of `var', is ! available (*note Shell Parameter Expansion::.). ! * Bash has INDIRECT variable expansion using `${!word}' (*note Shell ! Parameter Expansion::.). ! * Bash can expand positional parameters beyond `$9' using `${NUM}'. ! * The POSIX `$()' form of command substitution is implemented (*note ! Command Substitution::.), and preferred to the Bourne shell's ```' ! (which is also implemented for backwards compatibility). ! * Bash has process substitution (*note Process Substitution::.). ! * Bash automatically assigns variables that provide information ! about the current user (`UID', `EUID', and `GROUPS'), the current ! host (`HOSTTYPE', `OSTYPE', `MACHTYPE', and `HOSTNAME'), and the ! instance of Bash that is running (`BASH', `BASH_VERSION', and ! `BASH_VERSINFO'). *Note Bash Variables::, for details. ! * The `IFS' variable is used to split only the results of expansion, ! not all words (*note Word Splitting::.). This closes a ! longstanding shell security hole. ! * Bash implements the full set of POSIX.2 filename expansion ! operators, including CHARACTER CLASSES, EQUIVALENCE CLASSES, and ! COLLATING SYMBOLS (*note Filename Expansion::.). ! * Bash implements extended pattern matching features when the ! `extglob' shell option is enabled (*note Pattern Matching::.). ! * It is possible to have a variable and a function with the same ! name; `sh' does not separate the two name spaces. ! * Bash functions are permitted to have local variables using the ! `local' builtin, and thus useful recursive functions may be ! written. ! * Variable assignments preceding commands affect only that command, ! even builtins and functions (*note Environment::.). In `sh', all ! variable assignments preceding commands are global unless the ! command is executed from the file system. ! * Bash performs filename expansion on filenames specified as operands ! to input and output redirection operators. ! * Bash contains the `<>' redirection operator, allowing a file to be ! opened for both reading and writing, and the `&>' redirection ! operator, for directing standard output and standard error to the ! same file (*note Redirections::.). ! * The `noclobber' option is available to avoid overwriting existing ! files with output redirection (*note The Set Builtin::.). The ! `>|' redirection operator may be used to override `noclobber'. ! * The Bash `cd' and `pwd' builtins (*note Bourne Shell Builtins::.) ! each take `-L' and `-P' builtins to switch between logical and ! physical modes. ! * Bash allows a function to override a builtin with the same name, ! and provides access to that builtin's functionality within the ! function via the `builtin' and `command' builtins (*note Bash ! Builtins::.). ! * The `command' builtin allows selective disabling of functions when ! command lookup is performed (*note Bash Builtins::.). ! * Individual builtins may be enabled or disabled using the `enable' ! builtin (*note Bash Builtins::.). ! * The Bash `exec' builtin takes additional options that allow users ! to control the contents of the environment passed to the executed ! command, and what the zeroth argument to the command is to be ! (*note Bourne Shell Builtins::.). ! * Shell functions may be exported to children via the environment ! using `export -f' (*note Shell Functions::.). ! * The Bash `export', `readonly', and `declare' builtins can take a ! `-f' option to act on shell functions, a `-p' option to display ! variables with various attributes set in a format that can be used ! as shell input, a `-n' option to remove various variable ! attributes, and `name=value' arguments to set variable attributes ! and values simultaneously. ! ! * The Bash `hash' builtin allows a name to be associated with an ! arbitrary filename, even when that filename cannot be found by ! searching the `$PATH', using `hash -p' (*note Bourne Shell ! Builtins::.). ! ! * Bash includes a `help' builtin for quick reference to shell ! facilities (*note Bash Builtins::.). ! ! * The `printf' builtin is available to display formatted output ! (*note Bash Builtins::.). ! ! * The Bash `read' builtin (*note Bash Builtins::.) will read a line ! ending in `\' with the `-r' option, and will use the `REPLY' ! variable as a default if no arguments are supplied. The Bash ! `read' builtin also accepts a prompt string with the `-p' option ! and will use Readline to obtain the line when given the `-e' ! option. ! * The `return' builtin may be used to abort execution of scripts ! executed with the `.' or `source' builtins (*note Bourne Shell ! Builtins::.). ! * Bash includes the `shopt' builtin, for finer control of shell ! optional capabilities (*note Bash Builtins::.). ! * Bash has much more optional behavior controllable with the `set' ! builtin (*note The Set Builtin::.). ! * The `test' builtin (*note Bourne Shell Builtins::.) is slightly ! different, as it implements the POSIX algorithm, which specifies ! the behavior based on the number of arguments. ! * The `trap' builtin (*note Bourne Shell Builtins::.) allows a ! `DEBUG' pseudo-signal specification, similar to `EXIT'. Commands ! specified with a `DEBUG' trap are executed after every simple ! command. The `DEBUG' trap is not inherited by shell functions. ! * The Bash `type' builtin is more extensive and gives more ! information about the names it finds (*note Bash Builtins::.). ! * The Bash `umask' builtin permits a `-p' option to cause the output ! to be displayed in the form of a `umask' command that may be ! reused as input (*note Bourne Shell Builtins::.). ! * Bash implements a `csh'-like directory stack, and provides the ! `pushd', `popd', and `dirs' builtins to manipulate it (*note The ! Directory Stack::.). Bash also makes the directory stack visible ! as the value of the `DIRSTACK' shell variable. ! * Bash interprets special backslash-escaped characters in the prompt ! strings when interactive (*note Printing a Prompt::.). ! * The Bash restricted mode is more useful (*note The Restricted ! Shell::.); the SVR4.2 shell restricted mode is too limited. ! * The `disown' builtin can remove a job from the internal shell job ! table (*note Job Control Builtins::.) or suppress the sending of ! `SIGHUP' to a job when the shell exits as the result of a `SIGHUP'. ! * The SVR4.2 shell has two privilege-related builtins (`mldmode' and ! `priv') not present in Bash. ! * Bash does not have the `stop' or `newgrp' builtins. ! ! * Bash does not use the `SHACCT' variable or perform shell ! accounting. ! ! * The SVR4.2 `sh' uses a `TIMEOUT' variable like Bash uses `TMOUT'. ! ! More features unique to Bash may be found in *Note Bash Features::. Implementation Differences From The SVR4.2 Shell *************** *** 1986,1990 **** trapping `SIGSEGV'. If the shell is started from a process with `SIGSEGV' blocked (e.g., by using the `system()' C library ! function call), the shell misbehaves badly. * In a questionable attempt at security, the SVR4.2 shell, when --- 2584,2588 ---- trapping `SIGSEGV'. If the shell is started from a process with `SIGSEGV' blocked (e.g., by using the `system()' C library ! function call), it misbehaves badly. * In a questionable attempt at security, the SVR4.2 shell, when *************** *** 1993,2001 **** commonly 100. This can lead to unexpected results. ! * The SVR4.2 shell does not allow users to trap `SIGALRM' or ! `SIGCHLD'. ! * For some reason, the SVR4.2 shell does not allow the `MAILCHECK' ! variable to be unset. * The SVR4.2 shell treats `^' as the undocumented equivalent of `|'. --- 2591,2599 ---- commonly 100. This can lead to unexpected results. ! * The SVR4.2 shell does not allow users to trap `SIGSEGV', ! `SIGALRM', or `SIGCHLD'. ! * The SVR4.2 shell does not allow the `IFS', `MAILCHECK', `PATH', ! `PS1', or `PS2' variables to be unset. * The SVR4.2 shell treats `^' as the undocumented equivalent of `|'. *************** *** 2014,2486 ****  ! File: bashref.info, Node: Csh Features, Next: Korn Shell Features, Prev: Bourne Shell Features, Up: Top ! ! C-Shell Style Features ! ********************** ! The C-Shell ("`csh'") was created by Bill Joy at The University of ! California at Berkeley. It is generally considered to have better ! features for interactive use than the original Bourne shell. Some of ! the `csh' features present in Bash include job control, history ! expansion, `protected' redirection, and several variables to control ! the interactive behaviour of the shell (e.g., `IGNOREEOF'). ! *Note Using History Interactively::, for details on history ! expansion. ! ! * Menu: ! ! * Brace Expansion:: Expansion of expressions within braces. ! * Tilde Expansion:: Expansion of the ~ character. ! * C Shell Builtins:: Builtin commands adopted from the C Shell. ! * C Shell Variables:: Variables which Bash uses in essentially ! the same way as the C Shell. ! !  ! File: bashref.info, Node: Brace Expansion, Next: Tilde Expansion, Up: Csh Features ! ! Brace Expansion ! =============== ! ! Brace expansion is a mechanism by which arbitrary strings may be ! generated. This mechanism is similar to FILENAME EXPANSION (*note ! Filename Expansion::.), but the file names generated need not exist. ! Patterns to be brace expanded take the form of an optional PREAMBLE, ! followed by a series of comma-separated strings between a pair of ! braces, followed by an optional POSTAMBLE. The preamble is prepended ! to each string contained within the braces, and the postamble is then ! appended to each resulting string, expanding left to right. ! ! Brace expansions may be nested. The results of each expanded string ! are not sorted; left to right order is preserved. For example, ! bash$ echo a{d,c,b}e ! ade ace abe ! ! Brace expansion is performed before any other expansions, and any ! characters special to other expansions are preserved in the result. It ! is strictly textual. Bash does not apply any syntactic interpretation ! to the context of the expansion or the text between the braces. ! ! A correctly-formed brace expansion must contain unquoted opening and ! closing braces, and at least one unquoted comma. Any incorrectly ! formed brace expansion is left unchanged. ! ! This construct is typically used as shorthand when the common prefix ! of the strings to be generated is longer than in the above example: ! mkdir /usr/local/src/bash/{old,new,dist,bugs} ! or ! chown root /usr/{ucb/{ex,edit},lib/{ex?.?*,how_ex}} ! !  ! File: bashref.info, Node: Tilde Expansion, Next: C Shell Builtins, Prev: Brace Expansion, Up: Csh Features ! ! Tilde Expansion ! =============== ! ! Bash has tilde (~) expansion, similar, but not identical, to that of ! `csh'. The following table shows what unquoted words beginning with a ! tilde expand to. ! ! `~' ! The current value of `$HOME'. ! ! `~/foo' ! `$HOME/foo' ! ! `~fred/foo' ! The subdirectory `foo' of the home directory of the user `fred'. ! ! `~+/foo' ! `$PWD/foo' ! ! `~-/foo' ! `$OLDPWD/foo' ! ! Bash will also tilde expand words following redirection operators ! and words following `=' in assignment statements. ! !  ! File: bashref.info, Node: C Shell Builtins, Next: C Shell Variables, Prev: Tilde Expansion, Up: Csh Features ! ! C Shell Builtins ! ================ ! ! Bash has several builtin commands whose definition is very similar ! to `csh'. ! ! `pushd' ! pushd [DIR | +N | -N] [-n] ! ! Save the current directory on a list and then `cd' to DIR. With no ! arguments, exchanges the top two directories. ! ! `+N' ! Brings the Nth directory (counting from the left of the list ! printed by `dirs', starting with zero) to the top of the list ! by rotating the stack. ! ! `-N' ! Brings the Nth directory (counting from the right of the list ! printed by `dirs', starting with zero) to the top of the list ! by rotating the stack. ! ! `-n' ! Suppresses the normal change of directory when adding ! directories to the stack, so that only the stack is ! manipulated. ! ! `DIR' ! Makes the current working directory be the top of the stack, ! and then `cd's to DIR. You can see the saved directory list ! with the `dirs' command. ! ! `popd' ! popd [+N | -N] [-n] ! ! Pop the directory stack, and `cd' to the new top directory. When ! no arguments are given, `popd' removes the top directory from the ! stack and performs a `cd' to the new top directory. The elements ! are numbered from 0 starting at the first directory listed with ! `dirs'; i.e., `popd' is equivalent to `popd +0'. ! `+N' ! Removes the Nth directory (counting from the left of the list ! printed by `dirs'), starting with zero. ! ! `-N' ! Removes the Nth directory (counting from the right of the ! list printed by `dirs'), starting with zero. ! ! `-n' ! Suppresses the normal change of directory when removing ! directories from the stack, so that only the stack is ! manipulated. ! ! `dirs' ! dirs [+N | -N] [-clvp] ! Display the list of currently remembered directories. Directories ! find their way onto the list with the `pushd' command; you can get ! back up through the list with the `popd' command. ! `+N' ! Displays the Nth directory (counting from the left of the ! list printed by `dirs' when invoked without options), starting ! with zero. ! ! `-N' ! Displays the Nth directory (counting from the right of the ! list printed by `dirs' when invoked without options), starting ! with zero. ! ! `-c' ! Clears the directory stack by deleting all of the elements. ! ! `-l' ! Produces a longer listing; the default listing format uses a ! tilde to denote the home directory. ! ! `-p' ! Causes `dirs' to print the directory stack with one entry per ! line. ! ! `-v' ! Causes `dirs' to print the directory stack with one entry per ! line, prepending each entry with its index in the stack. ! ! `history' ! history [-c] [N] ! history [-anrw] [FILENAME] ! history -ps ARG ! ! Display the history list with line numbers. Lines prefixed with ! with a `*' have been modified. An argument of N says to list only ! the last N lines. Options, if supplied, have the following ! meanings: ! ! `-w' ! Write out the current history to the history file. ! ! `-r' ! Read the current history file and append its contents to the ! history list. ! ! `-a' ! Append the new history lines (history lines entered since the ! beginning of the current Bash session) to the history file. ! ! `-n' ! Append the history lines not already read from the history ! file to the current history list. These are lines appended ! to the history file since the beginning of the current Bash ! session. ! ! `-c' ! Clear the history list. This may be combined with the other ! options to replace the history list completely. ! ! `-s' ! The ARGs are added to the end of the history list as a single ! entry. ! ! `-p' ! Perform history substitution on the ARGs and display the ! result on the standard output, without storing the results in ! the history list. ! ! When the `-w', `-r', `-a', or `-n' option is used, if FILENAME is ! given, then it is used as the history file. If not, then the ! value of the `HISTFILE' variable is used. ! ! `logout' ! Exit a login shell. ! ! `source' ! A synonym for `.' (*note Bourne Shell Builtins::.). ! !  ! File: bashref.info, Node: C Shell Variables, Prev: C Shell Builtins, Up: Csh Features ! ! C Shell Variables ! ================= ! ! `IGNOREEOF' ! If this variable is set, its value is used the number of ! consecutive `EOF's Bash will read before exiting. By default, ! Bash will exit upon reading a single `EOF'. If `IGNOREEOF' is not ! set to a numeric value, Bash acts as if its value were 10. ! !  ! File: bashref.info, Node: Korn Shell Features, Next: Bash Features, Prev: Csh Features, Up: Top ! ! Korn Shell Style Features ! ************************* ! ! This section describes features primarily inspired by the Korn Shell ! (`ksh'). In some cases, the POSIX 1003.2 standard has adopted these ! commands and variables from the Korn Shell; Bash implements those ! features using the POSIX standard as a guide. ! ! * Menu: ! ! * Korn Shell Constructs:: Shell grammar constructs adopted from the ! Korn Shell ! * Korn Shell Builtins:: Builtin commands adopted from the Korn Shell. ! * Korn Shell Variables:: Variables which Bash uses in essentially ! the same way as the Korn Shell. ! * Aliases:: Substituting one command for another. ! !  ! File: bashref.info, Node: Korn Shell Constructs, Next: Korn Shell Builtins, Up: Korn Shell Features ! ! Korn Shell Constructs ! ===================== ! ! Bash includes the Korn Shell `select' construct. This construct ! allows the easy generation of menus. It has almost the same syntax as ! the `for' command. ! ! The syntax of the `select' command is: ! select NAME [in WORDS ...]; do COMMANDS; done ! ! The list of words following `in' is expanded, generating a list of ! items. The set of expanded words is printed on the standard error, ! each preceded by a number. If the `in WORDS' is omitted, the ! positional parameters are printed. The `PS3' prompt is then displayed ! and a line is read from the standard input. If the line consists of a ! number corresponding to one of the displayed words, then the value of ! NAME is set to that word. If the line is empty, the words and prompt ! are displayed again. If `EOF' is read, the `select' command completes. ! Any other value read causes NAME to be set to null. The line read is ! saved in the variable `REPLY'. ! ! The COMMANDS are executed after each selection until a `break' or ! `return' command is executed, at which point the `select' command ! completes. ! ! Bash also has adopted command timing from the Korn shell. If the ! `time' reserved word precedes a pipeline, which may consist of a single ! command, timing statistics for the pipeline are displayed when it ! completes. The statistics currently consist of elapsed (wall-clock) ! time and user and system time consumed by the command's execution. ! ! The use of `time' as a reserved word permits the timing of shell ! builtins, shell functions, and pipelines. An external `time' command ! cannot time these easily. ! !  ! File: bashref.info, Node: Korn Shell Builtins, Next: Korn Shell Variables, Prev: Korn Shell Constructs, Up: Korn Shell Features ! ! Korn Shell Builtins ! =================== ! ! This section describes Bash builtin commands taken from `ksh'. ! ! `fc' ! `fc [-e ENAME] [-nlr] [FIRST] [LAST]' ! `fc -s [PAT=REP] [COMMAND]' ! ! Fix Command. In the first form, a range of commands from FIRST to ! LAST is selected from the history list. Both FIRST and LAST may ! be specified as a string (to locate the most recent command ! beginning with that string) or as a number (an index into the ! history list, where a negative number is used as an offset from the ! current command number). If LAST is not specified it is set to ! FIRST. If FIRST is not specified it is set to the previous ! command for editing and -16 for listing. If the `-l' flag is ! given, the commands are listed on standard output. The `-n' flag ! suppresses the command numbers when listing. The `-r' flag ! reverses the order of the listing. Otherwise, the editor given by ! ENAME is invoked on a file containing those commands. If ENAME is ! not given, the value of the following variable expansion is used: ! `${FCEDIT:-${EDITOR:-vi}}'. This says to use the value of the ! `FCEDIT' variable if set, or the value of the `EDITOR' variable if ! that is set, or `vi' if neither is set. When editing is complete, ! the edited commands are echoed and executed. ! ! In the second form, COMMAND is re-executed after each instance of ! PAT in the selected command is replaced by REP. ! ! A useful alias to use with the `fc' command is `r='fc -s'', so ! that typing `r cc' runs the last command beginning with `cc' and ! typing `r' re-executes the last command (*note Aliases::.). ! ! `let' ! The `let' builtin allows arithmetic to be performed on shell ! variables. For details, refer to *Note Arithmetic Builtins::. ! ! `typeset' ! The `typeset' command is supplied for compatibility with the Korn ! shell; however, it has been deprecated in favor of the `declare' ! command (*note Bash Builtins::.). ! !  ! File: bashref.info, Node: Korn Shell Variables, Next: Aliases, Prev: Korn Shell Builtins, Up: Korn Shell Features ! ! Korn Shell Variables ! ==================== ! ! `REPLY' ! The default variable for the `read' builtin. ! ! `RANDOM' ! Each time this parameter is referenced, a random integer between 0 ! and 32767 is generated. Assigning a value to this variable seeds ! the random number generator. ! ! `SECONDS' ! This variable expands to the number of seconds since the shell was ! started. Assignment to this variable resets the count to the ! value assigned, and the expanded value becomes the value assigned ! plus the number of seconds since the assignment. ! ! `PS3' ! The value of this variable is used as the prompt for the `select' ! command. If this variable is not set, the `select' command ! prompts with `#? ' ! ! `PS4' ! This is the prompt printed before the command line is echoed when ! the `-x' option is set (*note The Set Builtin::.). The default is ! `+ '. ! ! `PWD' ! The current working directory as set by the `cd' builtin. ! ! `OLDPWD' ! The previous working directory as set by the `cd' builtin. ! ! `TMOUT' ! If set to a value greater than zero, the value is interpreted as ! the number of seconds to wait for input after issuing the primary ! prompt. Bash terminates after that number of seconds if input does ! not arrive. ! ! `LINENO' ! The line number in the script or shell function currently ! executing. ! ! `FCEDIT' ! The editor used as a default by the `fc' builtin command. ! !  ! File: bashref.info, Node: Aliases, Prev: Korn Shell Variables, Up: Korn Shell Features ! ! Aliases ! ======= ! ! * Menu: ! ! * Alias Builtins:: Builtins commands to maniuplate aliases. ! ! The shell maintains a list of ALIASES that may be set and unset with ! the `alias' and `unalias' builtin commands. ! ! The first word of each command, if unquoted, is checked to see if it ! has an alias. If so, that word is replaced by the text of the alias. ! The alias name and the replacement text may contain any valid shell ! input, including shell metacharacters, with the exception that the ! alias name may not contain <=>. The first word of the replacement text ! is tested for aliases, but a word that is identical to an alias being ! expanded is not expanded a second time. This means that one may alias ! `ls' to `"ls -F"', for instance, and Bash does not try to recursively ! expand the replacement text. If the last character of the alias value ! is a space or tab character, then the next command word following the ! alias is also checked for alias expansion. ! ! Aliases are created and listed with the `alias' command, and removed ! with the `unalias' command. ! ! There is no mechanism for using arguments in the replacement text, ! as in `csh'. If arguments are needed, a shell function should be used ! (*note Shell Functions::.). ! ! Aliases are not expanded when the shell is not interactive, unless ! the `expand_aliases' shell option is set using `shopt' (*note Bash ! Builtins::.). ! ! The rules concerning the definition and use of aliases are somewhat ! confusing. Bash always reads at least one complete line of input ! before executing any of the commands on that line. Aliases are ! expanded when a command is read, not when it is executed. Therefore, an ! alias definition appearing on the same line as another command does not ! take effect until the next line of input is read. The commands ! following the alias definition on that line are not affected by the new ! alias. This behavior is also an issue when functions are executed. ! Aliases are expanded when the function definition is read, not when the ! function is executed, because a function definition is itself a ! compound command. As a consequence, aliases defined in a function are ! not available until after that function is executed. To be safe, ! always put alias definitions on a separate line, and do not use `alias' ! in compound commands. ! ! Note that for almost every purpose, aliases are superseded by shell ! functions. ! !  ! File: bashref.info, Node: Alias Builtins, Up: Aliases ! ! Alias Builtins ! -------------- ! ! `alias' ! alias [`-p'] [NAME[=VALUE] ...] ! ! Without arguments or with the `-p' option, `alias' prints the list ! of aliases on the standard output in a form that allows them to be ! reused as input. If arguments are supplied, an alias is defined ! for each NAME whose VALUE is given. If no VALUE is given, the name ! and value of the alias is printed. ! ! `unalias' ! unalias [-a] [NAME ... ] ! ! Remove each NAME from the list of aliases. If `-a' is supplied, ! all aliases are removed. ! !  ! File: bashref.info, Node: Bash Features, Next: Job Control, Prev: Korn Shell Features, Up: Top ! ! Bash Features ! ************* ! ! This section describes features unique to Bash. * Menu: --- 2612,2621 ----  ! File: bashref.info, Node: Bash Features, Next: Job Control, Prev: Bourne Shell Features, Up: Top ! Bash Features ! ************* ! This section describes features unique to Bash. * Menu: *************** *** 2497,2501 **** * Bash Variables:: List of variables that exist in Bash. * Shell Arithmetic:: Arithmetic on shell variables. ! * Arrays:: Array Variables * Printing a Prompt:: Controlling the PS1 string. * The Restricted Shell:: A more controlled mode of shell execution. --- 2632,2638 ---- * Bash Variables:: List of variables that exist in Bash. * Shell Arithmetic:: Arithmetic on shell variables. ! * Aliases:: Substituting one command for another. ! * Arrays:: Array Variables. ! * The Directory Stack:: History of visited directories. * Printing a Prompt:: Controlling the PS1 string. * The Restricted Shell:: A more controlled mode of shell execution. *************** *** 2518,2521 **** --- 2655,2662 ---- the single-character options in order for them to be recognized. + `--dump-po-strings' + Equivalent to `-D', but the output is in the GNU `gettext' PO + (portable object) file format. + `--dump-strings' Equivalent to `-D'. *************** *** 2527,2532 **** Make this shell act as if it were directly invoked by login. This is equivalent to `exec -l bash' but can be issued from another ! shell, such as `csh'. If you wanted to replace your current login ! shell with a Bash login shell, you would say `exec bash --login'. `--noediting' --- 2668,2673 ---- Make this shell act as if it were directly invoked by login. This is equivalent to `exec -l bash' but can be issued from another ! shell, such as `csh'. `exec bash --login' will replace the ! current shell with a Bash login shell. `--noediting' *************** *** 2565,2570 **** output and exit successfully. ! There are several single-character options you can give which are ! not available with the `set' builtin. `-c STRING' --- 2706,2711 ---- output and exit successfully. ! There are several single-character options that may be supplied at ! invocation which are not available with the `set' builtin. `-c STRING' *************** *** 2577,2584 **** `-r' ! Make the shell restricted. `-s' ! If this flag is present, or if no arguments remain after option processing, then commands are read from the standard input. This option allows the positional parameters to be set when invoking an --- 2718,2725 ---- `-r' ! Make the shell a restricted shell (*note The Restricted Shell::.). `-s' ! If this option is present, or if no arguments remain after option processing, then commands are read from the standard input. This option allows the positional parameters to be set when invoking an *************** *** 2592,2597 **** commands will be executed. An *interactive* shell is one whose input and output are both ! connected to terminals (as determined by `isatty()'), or one started with the `-i' option. --- 2733,2743 ---- commands will be executed. + `--' + A `--' signals the end of options and disables further option + processing. Any arguments after the `--' are treated as filenames + and arguments. + An *interactive* shell is one whose input and output are both ! connected to terminals (as determined by `isatty(3)'), or one started with the `-i' option. *************** *** 2653,2660 **** conforming to the POSIX standard as well. ! When invoked as a login shell, it first attempts to read and execute ! commands from `/etc/profile' and `~/.profile', in that order. The ! `--noprofile' option may be used to inhibit this behavior. When ! invoked as an interactive shell with the name `sh', `bash' looks for the variable `ENV', expands its value if it is defined, and uses the expanded value as the name of a file to read and execute. Since a --- 2799,2806 ---- conforming to the POSIX standard as well. ! When invoked as an interactive login shell, it first attempts to read ! and execute commands from `/etc/profile' and `~/.profile', in that ! order. The `--noprofile' option may be used to inhibit this behavior. ! When invoked as an interactive shell with the name `sh', Bash looks for the variable `ENV', expands its value if it is defined, and uses the expanded value as the name of a file to read and execute. Since a *************** *** 2669,2675 **** When Bash is started in POSIX mode, as with the `--posix' command line option, it follows the POSIX standard for startup files. In this ! mode, the `ENV' variable is expanded and commands are read and executed ! from the file whose name is the expanded value. No other startup files ! are read. This is done by interactive shells only. Bash attempts to determine when it is being run by the remote shell --- 2815,2821 ---- When Bash is started in POSIX mode, as with the `--posix' command line option, it follows the POSIX standard for startup files. In this ! mode, interactive shells expand the `ENV' variable and commands are ! read and executed from the file whose name is the expanded value. No ! other startup files are read. Bash attempts to determine when it is being run by the remote shell *************** *** 2678,2682 **** is readable. It will not do this if invoked as `sh'. The `--norc' option may be used to inhibit this behavior, and the `--rcfile' option ! may be used to force another file to be read, but rshd does not generally invoke the shell with those options or allow them to be specified. --- 2824,2828 ---- is readable. It will not do this if invoked as `sh'. The `--norc' option may be used to inhibit this behavior, and the `--rcfile' option ! may be used to force another file to be read, but `rshd' does not generally invoke the shell with those options or allow them to be specified. *************** *** 2692,2699 **** by `isatty(3)'), or one started with the `-i' option. ! You may wish to determine within a startup script whether Bash is ! running interactively or not. To do this, examine the variable `$PS1'; ! it is unset in non-interactive shells, and set in interactive shells. ! Thus: if [ -z "$PS1" ]; then --- 2838,2844 ---- by `isatty(3)'), or one started with the `-i' option. ! To determine within a startup script whether Bash is running ! interactively or not, examine the variable `$PS1'; it is unset in ! non-interactive shells, and set in interactive shells. Thus: if [ -z "$PS1" ]; then *************** *** 2703,2708 **** fi ! Alternatively, you may test the value of the `-' special parameter. ! It contains `i' when the shell is interactive. For example: case "$-" in --- 2848,2853 ---- fi ! Alternatively, startup scripts may test the value of the `-' special ! parameter. It contains `i' when the shell is interactive. For example: case "$-" in *************** *** 2721,2725 **** `bind' ! bind [-m KEYMAP] [-lpsvPSV] [-q NAME] [-r KEYSEQ] bind [-m KEYMAP] -f FILENAME bind [-m KEYMAP] KEYSEQ:FUNCTION-NAME --- 2866,2871 ---- `bind' ! bind [-m KEYMAP] [-lpsvPSV] ! bind [-m KEYMAP] [-q FUNCTION] [-u FUNCTION] [-r KEYSEQ] bind [-m KEYMAP] -f FILENAME bind [-m KEYMAP] KEYSEQ:FUNCTION-NAME *************** *** 2741,2795 **** `-l' ! List the names of all Readline functions `-p' Display Readline function names and bindings in such a way ! that they can be re-read `-P' ! List current Readline function names and bindings `-v' Display Readline variable names and values in such a way that ! they can be re-read `-V' ! List current Readline variable names and values `-s' Display Readline key sequences bound to macros and the ! strings they output in such a way that they can be re-read `-S' Display Readline key sequences bound to macros and the ! strings they output `-f FILENAME' ! Read key bindings from FILENAME ! `-q' ! Query about which keys invoke the named FUNCTION `-r KEYSEQ' ! Remove any current binding for KEYSEQ `builtin' builtin [SHELL-BUILTIN [ARGS]] ! Run a shell builtin. This is useful when you wish to define a ! shell function with the same name as a shell builtin, but need the ! functionality of the builtin within the function itself. `command' ! command [-pVv] COMMAND [ARGS ...] ! Runs COMMAND with ARG ignoring shell functions. If you have a ! shell function called `ls', and you wish to call the command `ls', ! you can say `command ls'. The `-p' option means to use a default ! value for `$PATH' that is guaranteed to find all of the standard ! utilities. If either the `-V' or `-v' option is supplied, a description of COMMAND is printed. The `-v' option causes a single word indicating the command or file name used to invoke COMMAND to be ! printed; the `-V' option produces a more verbose description. `declare' --- 2887,2955 ---- `-l' ! List the names of all Readline functions. `-p' Display Readline function names and bindings in such a way ! that they can be re-read. `-P' ! List current Readline function names and bindings. `-v' Display Readline variable names and values in such a way that ! they can be re-read. `-V' ! List current Readline variable names and values. `-s' Display Readline key sequences bound to macros and the ! strings they output in such a way that they can be re-read. `-S' Display Readline key sequences bound to macros and the ! strings they output. `-f FILENAME' ! Read key bindings from FILENAME. ! `-q FUNCTION' ! Query about which keys invoke the named FUNCTION. ! ! `-u FUNCTION' ! Unbind all keys bound to the named FUNCTION. `-r KEYSEQ' ! Remove any current binding for KEYSEQ. ! ! The return status is zero unless an invalid option is supplied or ! an error occurs. `builtin' builtin [SHELL-BUILTIN [ARGS]] ! Run a shell builtin, passing it ARGS, and return its exit status. ! This is useful when defining a shell function with the same name ! as a shell builtin, retaining the functionality of the builtin ! within the function. The return status is non-zero if ! SHELL-BUILTIN is not a shell builtin command. `command' ! command [-pVv] COMMAND [ARGUMENTS ...] ! Runs COMMAND with ARGUMENTS ignoring any shell function named ! COMMAND. Only shell builtin commands or commands found by ! searching the `PATH' are executed. If there is a shell function ! named `ls', running `command ls' within the function will execute ! the external command `ls' instead of calling the function ! recursively. The `-p' option means to use a default value for ! `$PATH' that is guaranteed to find all of the standard utilities. ! The return status in this case is 127 if COMMAND cannot be found ! or an error occurred, and the exit status of COMMAND otherwise. If either the `-V' or `-v' option is supplied, a description of COMMAND is printed. The `-v' option causes a single word indicating the command or file name used to invoke COMMAND to be ! displayed; the `-V' option produces a more verbose description. ! In this case, the return status is zero if COMMAND is found, and ! non-zero if not. `declare' *************** *** 2819,2823 **** `-r' Make NAMEs readonly. These names cannot then be assigned ! values by subsequent assignment statements. `-x' --- 2979,2983 ---- `-r' Make NAMEs readonly. These names cannot then be assigned ! values by subsequent assignment statements or unset. `-x' *************** *** 2829,2837 **** `local' command. `echo' ! echo [-neE] [arg ...] ! Output the `arg's, separated by spaces, terminated with a newline. ! The return status is always 0. If `-n' is specified, the ! trailing newline is suppressed. If the `-e' option is given, interpretation of the following backslash-escaped characters is enabled. The `-E' option disables the interpretation of these --- 2989,3007 ---- `local' command. + The return status is zero unless an invalid option is encountered, + an attempt is made to define a function using `-f foo=bar', an + attempt is made to assign a value to a readonly variable, an + attempt is made to assign a value to an array variable without + using the compound assignment syntax (*note Arrays::.), one of the + NAMES is not a valid shell variable name, an attempt is made to + turn off readonly status for a readonly variable, an attempt is + made to turn off array status for an array variable, or an attempt + is made to display a non-existent function with `-f'. + `echo' ! echo [-neE] [ARG ...] ! Output the ARGs, separated by spaces, terminated with a newline. ! The return status is always 0. If `-n' is specified, the trailing ! newline is suppressed. If the `-e' option is given, interpretation of the following backslash-escaped characters is enabled. The `-E' option disables the interpretation of these *************** *** 2868,2878 **** backslash ! `\nnn' ! the character whose ASCII code is `nnn' (octal) `enable' enable [-n] [-p] [-f FILENAME] [-ads] [NAME ...] ! Enable and disable builtin shell commands. This allows you to use ! a disk command which has the same name as a shell builtin. If `-n' is used, the NAMEs become disabled. Otherwise NAMEs are enabled. For example, to use the `test' binary found via `$PATH' --- 3038,3055 ---- backslash ! `\NNN' ! the character whose `ASCII' code is the octal value NNN (one ! to three digits) ! ! `\xNNN' ! the character whose `ASCII' code is the hexadecimal value NNN ! (one to three digits) `enable' enable [-n] [-p] [-f FILENAME] [-ads] [NAME ...] ! Enable and disable builtin shell commands. Disabling a builtin ! allows a disk command which has the same name as a shell builtin ! to be executed with specifying a full pathname, even though the ! shell normally searches for builtins before disk commands. If `-n' is used, the NAMEs become disabled. Otherwise NAMEs are enabled. For example, to use the `test' binary found via `$PATH' *************** *** 2887,2908 **** The `-f' option means to load the new builtin command NAME from shared object FILENAME, on systems that support dynamic loading. ! The `-d' option will delete a builtin loaded with `-f'. If there ! are no options, a list of the shell builtins is displayed. The ! `-s' option restricts `enable' to the POSIX.2 special builtins. If `-s' is used with `-f', the new builtin becomes a special builtin. `help' help [PATTERN] Display helpful information about builtin commands. If PATTERN is specified, `help' gives detailed help on all commands matching ! PATTERN, otherwise a list of the builtins is printed. `local' local NAME[=VALUE] ! For each argument, create a local variable called NAME, and give ! it VALUE. `local' can only be used within a function; it makes ! the variable NAME have a visible scope restricted to that function ! and its children. `logout' --- 3064,3098 ---- The `-f' option means to load the new builtin command NAME from shared object FILENAME, on systems that support dynamic loading. ! The `-d' option will delete a builtin loaded with `-f'. ! ! If there are no options, a list of the shell builtins is displayed. ! The `-s' option restricts `enable' to the POSIX special builtins. If `-s' is used with `-f', the new builtin becomes a special builtin. + The return status is zero unless a NAME is not a shell builtin or + there is an error loading a new builtin from a shared object. + `help' help [PATTERN] Display helpful information about builtin commands. If PATTERN is specified, `help' gives detailed help on all commands matching ! PATTERN, otherwise a list of the builtins is printed. The return ! status is zero unless no command matches PATTERN. ! ! `let' ! let EXPRESSION [EXPRESSION] ! The `let' builtin allows arithmetic to be performed on shell ! variables. Each EXPRESSION is evaluated according to the rules ! given below in *Note Shell Arithmetic::. If the last EXPRESSION ! evaluates to 0, `let' returns 1; otherwise 0 is returned. `local' local NAME[=VALUE] ! For each argument, a local variable named NAME is created, and ! assigned VALUE. `local' can only be used within a function; it ! makes the variable NAME have a visible scope restricted to that ! function and its children. The return status is zero unless ! `local' is used outside a function or an invalid NAME is supplied. `logout' *************** *** 2910,2923 **** Exit a login shell, returning a status of N to the shell's parent. `read' read [-a ANAME] [-p PROMPT] [-er] [NAME ...] One line is read from the standard input, and the first word is assigned to the first NAME, the second word to the second NAME, ! and so on, with leftover words assigned to the last NAME. Only ! the characters in the value of the `IFS' variable are recognized ! as word delimiters. If no names are supplied, the line read is ! assigned to the variable `REPLY'. The return code is zero, unless ! end-of-file is encountered. Options, if supplied, have the ! following meanings: `-r' --- 3100,3134 ---- Exit a login shell, returning a status of N to the shell's parent. + `printf' + `printf' FORMAT [ARGUMENTS] + Write the formatted ARGUMENTS to the standard output under the + control of the FORMAT. The FORMAT is a character string which + contains three types of objects: plain characters, which are + simply copied to standard output, character escape sequences, + which are converted and copied to the standard output, and format + specifications, each of which causes printing of the next + successive ARGUMENT. In addition to the standard `printf(1)' + formats, `%b' causes `printf' to expand backslash escape sequences + in the corresponding ARGUMENT, and `%q' causes `printf' to output + the corresponding ARGUMENT in a format that can be reused as shell + input. + + The FORMAT is reused as necessary to consume all of the ARGUMENTS. + If the FORMAT requires more ARGUMENTS than are supplied, the extra + format specifications behave as if a zero value or null string, as + appropriate, had been supplied. + `read' read [-a ANAME] [-p PROMPT] [-er] [NAME ...] One line is read from the standard input, and the first word is assigned to the first NAME, the second word to the second NAME, ! and so on, with leftover words and their intervening separators ! assigned to the last NAME. If there are fewer words read from the ! standard input than names, the remaining names are assigned empty ! values. The characters in the value of the `IFS' variable are ! used to split the line into words. If no names are supplied, the ! line read is assigned to the variable `REPLY'. The return code is ! zero, unless end-of-file is encountered. Options, if supplied, ! have the following meanings: `-r' *************** *** 2927,2937 **** `-p PROMPT' ! Display `prompt', without a trailing newline, before ! attempting to read any input. The prompt is displayed only ! if input is coming from a terminal. `-a ANAME' The words are assigned to sequential indices of the array ! variable ANAME, starting at 0. `-e' --- 3138,3150 ---- `-p PROMPT' ! Display PROMPT, without a trailing newline, before attempting ! to read any input. The prompt is displayed only if input is ! coming from a terminal. `-a ANAME' The words are assigned to sequential indices of the array ! variable ANAME, starting at 0. All elements are removed from ! ANAME before the assignment. Other NAME arguments are ! ignored. `-e' *************** *** 2944,2951 **** With no options, or with the `-p' option, a list of all settable options is displayed, with an indication of whether or not each is ! set. Other options have the following meanings: `-s' ! Enable (set) each OPTNAME `-u' --- 3157,3165 ---- With no options, or with the `-p' option, a list of all settable options is displayed, with an indication of whether or not each is ! set. The `-p' option causes output to be displayed in a form that ! may be reused as input. Other options have the following meanings: `-s' ! Enable (set) each OPTNAME. `-u' *************** *** 2962,2966 **** `-o' option to the `set' builtin (*note The Set Builtin::.). ! If either of `-s' or `-u' is used with no OPTNAME arguments, the display is limited to those options which are set or unset, respectively. --- 3176,3180 ---- `-o' option to the `set' builtin (*note The Set Builtin::.). ! If either `-s' or `-u' is used with no OPTNAME arguments, the display is limited to those options which are set or unset, respectively. *************** *** 2971,2975 **** The return status when listing options is zero if all OPTNAMES are enabled, non-zero otherwise. When setting or unsetting options, ! the return status is zero unless an OPTNAME is not a legal shell option. --- 3185,3189 ---- The return status when listing options is zero if all OPTNAMES are enabled, non-zero otherwise. When setting or unsetting options, ! the return status is zero unless an OPTNAME is not a valid shell option. *************** *** 3012,3015 **** --- 3226,3238 ---- fails. + `expand_aliases' + If set, aliases are expanded as described below< under Aliases + (*note Aliases::.). This option is enabled by default for + interactive shells. + + `extglob' + If set, the extended pattern matching features described above + (*note Pattern Matching::.) are enabled. + `histappend' If set, the history list is appended to the file named by the *************** *** 3029,3036 **** `hostcomplete' If set, and Readline is being used, Bash will attempt to ! perform hostname completion when a word beginning with `@' is being completed (*note Commands For Completion::.). This option is enabled by default. `interactive_comments' Allow a word beginning with `#' to cause that word and all --- 3252,3263 ---- `hostcomplete' If set, and Readline is being used, Bash will attempt to ! perform hostname completion when a word containing a `@' is being completed (*note Commands For Completion::.). This option is enabled by default. + `huponexit' + If set, Bash will send `SIGHUP' to all jobs when an + interactive login shell exits (*note Signals::.). + `interactive_comments' Allow a word beginning with `#' to cause that word and all *************** *** 3048,3051 **** --- 3275,3282 ---- `"The mail in MAILFILE has been read"' is displayed. + `nocaseglob' + If set, Bash matches filenames in a case-insensitive fashion + when performing filename expansion. + `nullglob' If set, Bash allows filename patterns which match no files to *************** *** 3065,3076 **** If set, the `source' builtin uses the value of `PATH' to find the directory containing the file supplied as an argument. ! This is enabled by default. `type' ! type [-all] [-type | -path] [NAME ...] For each NAME, indicate how it would be interpreted if used as a command name. ! If the `-type' flag is used, `type' returns a single word which is one of `alias', `function', `builtin', `file' or `keyword', if NAME is an alias, shell function, shell builtin, disk file, or --- 3296,3316 ---- If set, the `source' builtin uses the value of `PATH' to find the directory containing the file supplied as an argument. ! This option is enabled by default. ! ! The return status when listing options is zero if all OPTNAMES are ! enabled, non-zero otherwise. When setting or unsetting options, ! the return status is zero unless an OPTNAME is not a valid shell ! option. ! ! `source' ! source FILENAME ! A synonym for `.' (*note Bourne Shell Builtins::.). `type' ! type [-atp] [NAME ...] For each NAME, indicate how it would be interpreted if used as a command name. ! If the `-t' option is used, `type' prints a single word which is one of `alias', `function', `builtin', `file' or `keyword', if NAME is an alias, shell function, shell builtin, disk file, or *************** *** 3078,3091 **** nothing is printed, and `type' returns a failure status. ! If the `-path' flag is used, `type' either returns the name of the ! disk file that would be executed, or nothing if `-type' would not return `file'. ! If the `-all' flag is used, returns all of the places that contain ! an executable named FILE. This includes aliases and functions, if ! and only if the `-path' flag is not also used. ! `type' accepts `-a', `-t', and `-p' as equivalent to `-all', ! `-type', and `-path', respectively. `ulimit' --- 3318,3337 ---- nothing is printed, and `type' returns a failure status. ! If the `-p' option is used, `type' either returns the name of the ! disk file that would be executed, or nothing if `-t' would not return `file'. ! If the `-a' option is used, `type' returns all of the places that ! contain an executable named FILE. This includes aliases and ! functions, if and only if the `-p' option is not also used. ! ! The return status is zero if any of the NAMES are found, non-zero ! if none are found. ! `typeset' ! typeset [-afFrxi] [-p] [NAME[=VALUE]] ! The `typeset' command is supplied for compatibility with the Korn ! shell; however, it has been deprecated in favor of the `declare' ! builtin command. `ulimit' *************** *** 3095,3114 **** option is given, it is interpreted as follows: `-S' ! change and report the soft limit associated with a resource. `-H' ! change and report the hard limit associated with a resource. `-a' ! all current limits are reported. `-c' ! the maximum size of core files created. `-d' ! the maximum size of a process's data segment. `-f' ! the maximum size of files created by the shell. `-l' --- 3341,3360 ---- option is given, it is interpreted as follows: `-S' ! Change and report the soft limit associated with a resource. `-H' ! Change and report the hard limit associated with a resource. `-a' ! All current limits are reported. `-c' ! The maximum size of core files created. `-d' ! The maximum size of a process's data segment. `-f' ! The maximum size of files created by the shell. `-l' *************** *** 3116,3138 **** `-m' ! the maximum resident set size. `-n' ! the maximum number of open file descriptors. `-p' ! the pipe buffer size. `-s' ! the maximum stack size. `-t' ! the maximum amount of cpu time in seconds. `-u' ! the maximum number of processes available to a single user. `-v' ! the maximum amount of virtual memory available to the process. If LIMIT is given, it is the new value of the specified resource. --- 3362,3384 ---- `-m' ! The maximum resident set size. `-n' ! The maximum number of open file descriptors. `-p' ! The pipe buffer size. `-s' ! The maximum stack size. `-t' ! The maximum amount of cpu time in seconds. `-u' ! The maximum number of processes available to a single user. `-v' ! The maximum amount of virtual memory available to the process. If LIMIT is given, it is the new value of the specified resource. *************** *** 3145,3148 **** --- 3391,3398 ---- and `-n' and `-u', which are unscaled values. + The return status is zero unless an invalid option is supplied, a + non-numeric argument other than `unlimited' is supplied as a + LIMIT, or an error occurs while setting a new limit. +  File: bashref.info, Node: The Set Builtin, Next: Bash Conditional Expressions, Prev: Bash Builtins, Up: Bash Features *************** *** 3151,3158 **** =============== ! This builtin is so overloaded that it deserves its own section. `set' ! set [-abefhkmnptuvxdBCHP] [-o OPTION] [ARGUMENT ...] `-a' --- 3401,3415 ---- =============== ! This builtin is so complicated that it deserves its own section. `set' ! set [--abefhkmnptuvxBCHP] [-o OPTION] [ARGUMENT ...] ! ! If no options or arguments are supplied, `set' displays the names ! and values of all shell variables and functions, sorted according ! to the current locale, in a format that may be reused as input. ! ! When options are supplied, they set or unset shell attributes. ! Options, if specified, have the following meanings: `-a' *************** *** 3165,3170 **** `-e' ! Exit immediately if a simple command exits with a non-zero ! status. `-f' --- 3422,3430 ---- `-e' ! Exit immediately if a simple command (*note Simple ! Commands::.) exits with a non-zero status, unless the command ! that fails is part of an `until' or `while' loop, part of an ! `if' statement, part of a `&&' or `||' list, or if the ! command's return status is being inverted using `!'. `-f' *************** *** 3173,3177 **** `-h' Locate and remember (hash) commands as they are looked up for ! execution. `-k' --- 3433,3437 ---- `-h' Locate and remember (hash) commands as they are looked up for ! execution. This option is enabled by default. `-k' *************** *** 3184,3210 **** `-n' ! Read commands but do not execute them. `-o OPTION-NAME' ! Set the flag corresponding to OPTION-NAME: `allexport' ! same as `-a'. `braceexpand' ! same as `-B'. `emacs' ! use an `emacs'-style line editing interface (*note Command Line Editing::.). `errexit' ! same as `-e'. `hashall' ! same as `-h'. `histexpand' ! same as `-H'. `history' --- 3444,3472 ---- `-n' ! Read commands but do not execute them; this may be used to ! check a script for syntax errors. This option is ignored by ! interactive shells. `-o OPTION-NAME' ! Set the option corresponding to OPTION-NAME: `allexport' ! Same as `-a'. `braceexpand' ! Same as `-B'. `emacs' ! Use an `emacs'-style line editing interface (*note Command Line Editing::.). `errexit' ! Same as `-e'. `hashall' ! Same as `-h'. `histexpand' ! Same as `-H'. `history' *************** *** 3214,3271 **** `ignoreeof' ! the shell will not exit upon reading EOF. `keyword' ! same as `-k'. `monitor' ! same as `-m'. `noclobber' ! same as `-C'. `noexec' ! same as `-n'. `noglob' ! same as `-f'. `notify' ! same as `-b'. `nounset' ! same as `-u'. `onecmd' ! same as `-t'. `physical' ! same as `-P'. `posix' ! change the behavior of Bash where the default operation differs from the POSIX 1003.2 standard to match the ! standard. This is intended to make Bash behave as a ! strict superset of that standard. `privileged' ! same as `-p'. `verbose' ! same as `-v'. `vi' ! use a `vi'-style line editing interface. `xtrace' ! same as `-x'. `-p' ! Turn on privileged mode. In this mode, the `$BASH_ENV' file ! is not processed, and shell functions are not inherited from ! the environment. This is enabled automatically on startup if ! the effective user (group) id is not equal to the real user ! (group) id. Turning this option off causes the effective user ! and group ids to be set to the real user and group ids. `-t' --- 3476,3536 ---- `ignoreeof' ! An interactive shell will not exit upon reading EOF. `keyword' ! Same as `-k'. `monitor' ! Same as `-m'. `noclobber' ! Same as `-C'. `noexec' ! Same as `-n'. `noglob' ! Same as `-f'. `notify' ! Same as `-b'. `nounset' ! Same as `-u'. `onecmd' ! Same as `-t'. `physical' ! Same as `-P'. `posix' ! Change the behavior of Bash where the default operation differs from the POSIX 1003.2 standard to match the ! standard (*note Bash POSIX Mode::.). This is intended ! to make Bash behave as a strict superset of that ! standard. `privileged' ! Same as `-p'. `verbose' ! Same as `-v'. `vi' ! Use a `vi'-style line editing interface. `xtrace' ! Same as `-x'. `-p' ! Turn on privileged mode. In this mode, the `$BASH_ENV' and ! `$ENV' files are not processed, shell functions are not ! inherited from the environment, and the `SHELLOPTS' variable, ! if it appears in the environment, is ignored. This is ! enabled automatically on startup if the effective user ! (group) id is not equal to the real user (group) id. Turning ! this option off causes the effective user and group ids to be ! set to the real user and group ids. `-t' *************** *** 3273,3277 **** `-u' ! Treat unset variables as an error when substituting. `-v' --- 3538,3544 ---- `-u' ! Treat unset variables as an error when performing parameter ! expansion. An error message will be written to the standard ! error, and a non-interactive shell will exit. `-v' *************** *** 3279,3283 **** `-x' ! Print commands and their arguments as they are executed. `-B' --- 3546,3551 ---- `-x' ! Print a trace of simple commands and their arguments after ! they are expanded and before they are executed. `-B' *************** *** 3286,3295 **** `-C' ! Disallow output redirection to existing files. `-H' Enable `!' style history substitution (*note History ! Interaction::.). This flag is on by default for interactive ! shells. `-P' --- 3554,3564 ---- `-C' ! Prevent output redirection using `>', `>&', and `<>' from ! overwriting existing files. `-H' Enable `!' style history substitution (*note History ! Interaction::.). This option is on by default for ! interactive shells. `-P' *************** *** 3300,3304 **** which change the current directory. ! For example, if `/usr/sys' is a link to `/usr/local/sys' then: $ cd /usr/sys; echo $PWD /usr/sys --- 3569,3574 ---- which change the current directory. ! For example, if `/usr/sys' is a symbolic link to ! `/usr/local/sys' then: $ cd /usr/sys; echo $PWD /usr/sys *************** *** 3313,3317 **** `--' ! If no arguments follow this flag, then the positional parameters are unset. Otherwise, the positional parameters are set to the ARGUMENTS, even if some of them begin with a --- 3583,3587 ---- `--' ! If no arguments follow this option, then the positional parameters are unset. Otherwise, the positional parameters are set to the ARGUMENTS, even if some of them begin with a *************** *** 3324,3334 **** positional parameters remain unchanged. ! Using `+' rather than `-' causes these flags to be turned off. ! The flags can also be used upon invocation of the shell. The ! current set of flags may be found in `$-'. The remaining N ARGUMENTS are positional parameters and are ! assigned, in order, to `$1', `$2', ... `$N'. If no arguments are ! given, all shell variables are printed.  --- 3594,3607 ---- positional parameters remain unchanged. ! Using `+' rather than `-' causes these options to be turned off. ! The options can also be used upon invocation of the shell. The ! current set of options may be found in `$-'. The remaining N ARGUMENTS are positional parameters and are ! assigned, in order, to `$1', `$2', ... `$N'. The special ! parameter `#' is set to N. ! ! The return status is always zero unless an invalid option is ! supplied.  *************** *** 3338,3349 **** ============================ ! Conditional expressions are used by the `test' and `[' builtins. Expressions may be unary or binary. Unary expressions are often used to examine the status of a file. There are string operators and ! numeric comparison operators as well. Each operator and operand must ! be a separate argument. If FILE is of the form `/dev/fd/N', then file ! descriptor N is checked. Expressions are composed of the following ! primaries: `-b FILE' --- 3611,3625 ---- ============================ ! Conditional expressions are used by the `[[' compound command and ! the `test' and `[' builtin commands. Expressions may be unary or binary. Unary expressions are often used to examine the status of a file. There are string operators and ! numeric comparison operators as well. If any FILE argument to one of ! the primaries is of the form `/dev/fd/N', then file descriptor N is ! checked. ! ! `-a FILE' ! True if FILE exists. `-b FILE' *************** *** 3363,3376 **** `-g FILE' ! True if FILE exists and is set-group-id. `-k FILE' ! True if FILE has its "sticky" bit set. ! ! `-L FILE' ! True if FILE exists and is a symbolic link. `-p FILE' ! True if FILE exists and is a named pipe. `-r FILE' --- 3639,3649 ---- `-g FILE' ! True if FILE exists and its set-group-id bit is set. `-k FILE' ! True if FILE exists and its "sticky" bit is set. `-p FILE' ! True if FILE exists and is a named pipe (FIFO). `-r FILE' *************** *** 3380,3388 **** True if FILE exists and has a size greater than zero. - `-S FILE' - True if FILE exists and is a socket. - `-t FD' ! True if FD is opened on a terminal. `-u FILE' --- 3653,3658 ---- True if FILE exists and has a size greater than zero. `-t FD' ! True if file descriptor FD is open and refers to a terminal. `-u FILE' *************** *** 3401,3404 **** --- 3671,3683 ---- True if FILE exists and is owned by the effective group id. + `-L FILE' + True if FILE exists and is a symbolic link. + + `-S FILE' + True if FILE exists and is a socket. + + `-N FILE' + True if FILE exists and has been modified since it was last read. + `FILE1 -nt FILE2' True if FILE1 is newer (according to modification date) than FILE2. *************** *** 3422,3427 **** True if the length of STRING is non-zero. ! `STRING1 = STRING2' ! True if the strings are equal. `==' may be used in place of `='. `STRING1 != STRING2' --- 3701,3706 ---- True if the length of STRING is non-zero. ! `STRING1 == STRING2' ! True if the strings are equal. `=' may be used in place of `=='. `STRING1 != STRING2' *************** *** 3429,3445 **** `STRING1 < STRING2' ! True if STRING1 sorts before STRING2 lexicographically. `STRING1 > STRING2' ! True if STRING1 sorts after STRING2 lexicographically. ! ! `! EXPR' ! True if EXPR is false. ! ! `EXPR1 -a EXPR2' ! True if both EXPR1 and EXPR2 are true. ! ! `EXPR1 -o EXPR2' ! True if either EXPR1 and EXPR2 is true. `ARG1 OP ARG2' --- 3708,3717 ---- `STRING1 < STRING2' ! True if STRING1 sorts before STRING2 lexicographically in the ! current locale. `STRING1 > STRING2' ! True if STRING1 sorts after STRING2 lexicographically in the ! current locale. `ARG1 OP ARG2' *************** *** 3450,3491 **** positive or negative integers. - The Bash `test' and `[' builtins evaluate conditional expressions - using a set of rules based on the number of arguments. These are the - rules: - - 0 arguments - The expression is false. - - 1 argument - The expression is true if and only if the argument is not null. - - 2 arguments - If the first argument is `!', the expression is true if and only - if the second argument is null. If the first argument is one of - the listed unary operators, the expression is true if the unary - test is true. If the first argument is not a legal unary - operator, the expression is false. - - 3 arguments - If the first argument is `!', the value is the negation of the - two-argument test using the second and third arguments. If the - second argument is one of the binary operators, the result of the - expression is the result of the binary test using the first and - third arguments as operands. If the first argument is exactly `(' - and the third argument is exactly `)', the result is the - one-argument test of the second argument. Otherwise, the - expression is false. The `-a' and `-o' operators are considered - binary operators in this case. - - 4 arguments - If the first argument is `!', the result is the negation of the - three-argument expression composed of the remaining arguments. - Otherwise, the expression is parsed and evaluated according to - precedence. `-a' has a higher precedence than `-o'. - - 5 or more arguments - The expression is parsed and evaluated according to precedence, - with `-a' having a higher precedence than `-o'. -  File: bashref.info, Node: Bash Variables, Next: Shell Arithmetic, Prev: Bash Conditional Expressions, Up: Bash Features --- 3722,3725 ---- *************** *** 3497,3500 **** --- 3731,3737 ---- normally treat them specially. + `BASH' + The full pathname used to execute the current instance of Bash. + `BASH_ENV' If this variable is set when Bash is invoked to execute a shell *************** *** 3503,3543 **** Files::. ! `TIMEFORMAT' ! The value of this parameter is used as a format string specifying ! how the timing information for pipelines prefixed with the `time' ! reserved word should be displayed. The `%' character introduces an ! escape sequence that is expanded to a time value or other ! information. The escape sequences and their meanings are as ! follows; the braces denote optional portions. ! `%%' ! A literal `%'. ! `%[P][l]R' ! The elapsed time in seconds. ! `%[P][l]U' ! The number of CPU seconds spent in user mode. ! `%[P][l]S' ! The number of CPU seconds spent in system mode. ! `%P' ! The CPU percentage, computed as (%U + %S) / %R. ! The optional P is a digit specifying the precision, the number of ! fractional digits after a decimal point. A value of 0 causes no ! decimal point or fraction to be output. At most three places ! after the decimal point may be specified; values of P greater than ! 3 are changed to 3. If P is not specified, the value 3 is used. ! The optional `l' specifies a longer format, including minutes, of ! the form MMmSS.FFs. The value of P determines whether or not the ! fraction is included. ! If this variable is not set, bash acts as if it had the value ! `$'\nreal\t%3lR\nuser\t%3lU\nsys\t%3lS''. ! If the value is null, no timing information is displayed. A ! trailing newline is added when the format string is displayed. `HISTCONTROL' --- 3740,3823 ---- Files::. ! `BASH_VERSION' ! The version number of the current instance of Bash. ! `BASH_VERSINFO' ! A readonly array variable whose members hold version information ! for this instance of Bash. The values assigned to the array ! members are as follows: ! `BASH_VERSINFO[0]' ! The major version number (the RELEASE). ! `BASH_VERSINFO[1]' ! The minor version number (the VERSION). ! `BASH_VERSINFO[2]' ! The patch level. ! `BASH_VERSINFO[3]' ! The build version. ! `BASH_VERSINFO[4]' ! The release status (e.g., BETA1). ! ! `BASH_VERSINFO[5]' ! The value of `MACHTYPE'. ! ! `DIRSTACK' ! An array variable (*note Arrays::.) containing the current ! contents of the directory stack. Directories appear in the stack ! in the order they are displayed by the `dirs' builtin. Assigning ! to members of this array variable may be used to modify ! directories already in the stack, but the `pushd' and `popd' ! builtins must be used to add and remove directories. Assignment ! to this variable will not change the current directory. If ! `DIRSTACK' is unset, it loses its special properties, even if it ! is subsequently reset. ! ! `EUID' ! The numeric effective user id of the current user. This variable ! is readonly. ! ! `FCEDIT' ! The editor used as a default by the `-e' option to the `fc' ! builtin command. ! ! `FIGNORE' ! A colon-separated list of suffixes to ignore when performing ! filename completion. A file name whose suffix matches one of the ! entries in `FIGNORE' is excluded from the list of matched file ! names. A sample value is `.o:~' ! ! `GLOBIGNORE' ! A colon-separated list of patterns defining the set of filenames to ! be ignored by filename expansion. If a filename matched by a ! filename expansion pattern also matches one of the patterns in ! `GLOBIGNORE', it is removed from the list of matches. ! `GROUPS' ! An array variable containing the list of groups of which the ! current user is a member. This variable is readonly. ! `histchars' ! Up to three characters which control history expansion, quick ! substitution, and tokenization (*note History Interaction::.). ! The first character is the "history-expansion-char", that is, the ! character which signifies the start of a history expansion, ! normally `!'. The second character is the character which ! signifies `quick substitution' when seen as the first character on ! a line, normally `^'. The optional third character is the ! character which indicates that the remainder of the line is a ! comment when found as the first character of a word, usually `#'. ! The history comment character causes history substitution to be ! skipped for the remaining words on the line. It does not ! necessarily cause the shell parser to treat the rest of the line ! as a comment. ! ! `HISTCMD' ! The history number, or index in the history list, of the current ! command. If `HISTCMD' is unset, it loses its special properties, ! even if it is subsequently reset. `HISTCONTROL' *************** *** 3547,3551 **** entered line. A value of `ignoreboth' combines the two options. Unset, or set to any other value than those above, means to save ! all lines on the history list. `HISTIGNORE' --- 3827,3833 ---- entered line. A value of `ignoreboth' combines the two options. Unset, or set to any other value than those above, means to save ! all lines on the history list. The second and subsequent lines of ! a multi-line compound command are not tested, and are added to the ! history regardless of the value of `HISTCONTROL'. `HISTIGNORE' *************** *** 3558,3562 **** characters, `&' matches the previous history line. `&' may be escaped using a backslash. The backslash is removed before ! attempting a match. `HISTIGNORE' subsumes the function of `HISTCONTROL'. A pattern of --- 3840,3846 ---- characters, `&' matches the previous history line. `&' may be escaped using a backslash. The backslash is removed before ! attempting a match. The second and subsequent lines of a ! multi-line compound command are not tested, and are added to the ! history regardless of the value of `HISTIGNORE'. `HISTIGNORE' subsumes the function of `HISTCONTROL'. A pattern of *************** *** 3571,3576 **** `HISTSIZE' ! If set, this is the maximum number of commands to remember in the ! history. `HISTFILESIZE' --- 3855,3860 ---- `HISTSIZE' ! The maximum number of commands to remember on the history list. ! The default value is 500. `HISTFILESIZE' *************** *** 3581,3604 **** size after writing it when an interactive shell exits. - `histchars' - Up to three characters which control history expansion, quick - substitution, and tokenization (*note History Interaction::.). - The first character is the "history-expansion-char", that is, the - character which signifies the start of a history expansion, - normally `!'. The second character is the character which - signifies `quick substitution' when seen as the first character on - a line, normally `^'. The optional third character is the - character which signifies the remainder of the line is a comment, - when found as the first character of a word, usually `#'. The - history comment character causes history substitution to be - skipped for the remaining words on the line. It does not - necessarily cause the shell parser to treat the rest of the line - as a comment. - - `HISTCMD' - The history number, or index in the history list, of the current - command. If `HISTCMD' is unset, it loses its special properties, - even if it is subsequently reset. - `HOSTFILE' Contains the name of a file in the same format as `/etc/hosts' that --- 3865,3868 ---- *************** *** 3608,3640 **** the already existing database. ! `MAILCHECK' ! How often (in seconds) that the shell should check for mail in the ! files specified in `MAILPATH'. ! `PROMPT_COMMAND' ! If present, this contains a string which is a command to execute ! before the printing of each primary prompt (`$PS1'). ! `UID' ! The numeric real user id of the current user. ! `EUID' ! The numeric effective user id of the current user. ! `GROUPS' ! An array variable containing the list of groups of which the ! current user is a member. ! `PPID' ! The process id of the shell's parent process. ! `HOSTNAME' ! The name of the current host. ! `HOSTTYPE' ! A string describing the machine Bash is running on. ! `OSTYPE' ! A string describing the operating system Bash is running on. `MACHTYPE' --- 3872,3922 ---- the already existing database. ! `HOSTNAME' ! The name of the current host. ! `HOSTTYPE' ! A string describing the machine Bash is running on. ! `IGNOREEOF' ! Controls the action of the shell on receipt of an `EOF' character ! as the sole input. If set, the value denotes the number of ! consecutive `EOF' characters that can be read as the first ! character on an input line before the shell will exit. If the ! variable exists but does not have a numeric value (or has no ! value) then the default is 10. If the variable does not exist, ! then `EOF' signifies the end of input to the shell. This is only ! in effect for interactive shells. ! `INPUTRC' ! The name of the Readline startup file, overriding the default of ! `~/.inputrc'. ! `LANG' ! Used to determine the locale category for any category not ! specifically selected with a variable starting with `LC_'. ! `LC_ALL' ! This variable overrides the value of `LANG' and any other `LC_' ! variable specifying a locale category. ! `LC_COLLATE' ! This variable determines the collation order used when sorting the ! results of filename expansion, and determines the behavior of ! range expressions, equivalence classes, and collating sequences ! within filename expansion and pattern matching (*note Filename ! Expansion::.). ! ! `LC_CTYPE' ! This variable determines the interpretation of characters and the ! behavior of character classes within filename expansion and pattern ! matching (*note Filename Expansion::.). ! `LC_MESSAGES' ! This variable determines the locale used to translate double-quoted ! strings preceded by a `$' (*note Locale Translation::.). ! `LINENO' ! The line number in the script or shell function currently ! executing. `MACHTYPE' *************** *** 3642,3676 **** executing, in the standard GNU CPU-COMPANY-SYSTEM format. ! `SHELLOPTS' ! A colon-separated list of enabled shell options. Each word in the ! list is a valid argument for the `-o' option to the `set' builtin ! command (*note The Set Builtin::.). The options appearing in ! `SHELLOPTS' are those reported as `on' by `set -o'. If this ! variable is in the environment when Bash starts up, each shell ! option in the list will be enabled before reading any startup ! files. This variable is readonly. ! `FIGNORE' ! A colon-separated list of suffixes to ignore when performing ! filename completion. A file name whose suffix matches one of the ! entries in `FIGNORE' is excluded from the list of matched file ! names. A sample value is `.o:~' ! `GLOBIGNORE' ! A colon-separated list of patterns defining the set of filenames to ! be ignored by filename expansion. If a filename matched by a ! filename expansion pattern also matches one of the patterns in ! `GLOBIGNORE', it is removed from the list of matches. ! `DIRSTACK' ! An array variable (*note Arrays::.) containing the current ! contents of the directory stack. Directories appear in the stack ! in the order they are displayed by the `dirs' builtin. Assigning ! to members of this array variable may be used to modify ! directories already in the stack, but the `pushd' and `popd' ! builtins must be used to add and remove directories. Assignment ! to this variable will not change the current directory. If ! `DIRSTACK' is unset, it loses its special properties, even if it ! is subsequently reset. `PIPESTATUS' --- 3924,3940 ---- executing, in the standard GNU CPU-COMPANY-SYSTEM format. ! `MAILCHECK' ! How often (in seconds) that the shell should check for mail in the ! files specified in the `MAILPATH' or `MAIL' variables. ! `OLDPWD' ! The previous working directory as set by the `cd' builtin. ! `OPTERR' ! If set to the value 1, Bash displays error messages generated by ! the `getopts' builtin command. ! `OSTYPE' ! A string describing the operating system Bash is running on. `PIPESTATUS' *************** *** 3679,3714 **** foreground pipeline (which may contain only a single command). ! `INPUTRC' ! The name of the Readline startup file, overriding the default of ! `~/.inputrc'. ! ! `BASH' ! The full filename used to execute the current instance of Bash. ! `BASH_VERSION' ! The version number of the current instance of Bash. ! `BASH_VERSINFO' ! An array variable whose members hold version information for this ! instance of Bash. The values assigned to the array members are as ! follows: ! `BASH_VERSINFO[0]' ! The major version number (the RELEASE). ! `BASH_VERSINFO[1]' ! The minor version number (the VERSION). ! `BASH_VERSINFO[2]' ! The patch level. ! `BASH_VERSINFO[3]' ! The build version. ! `BASH_VERSINFO[4]' ! The release status (e.g., BETA1). ! `BASH_VERSINFO[5]' ! The value of `MACHTYPE'. `SHLVL' --- 3943,3990 ---- foreground pipeline (which may contain only a single command). ! `PPID' ! The process id of the shell's parent process. This variable is ! readonly. ! `PROMPT_COMMAND' ! If present, this contains a string which is a command to execute ! before the printing of each primary prompt (`$PS1'). ! `PS3' ! The value of this variable is used as the prompt for the `select' ! command. If this variable is not set, the `select' command ! prompts with `#? ' ! `PS4' ! This is the prompt printed before the command line is echoed when ! the `-x' option is set (*note The Set Builtin::.). The first ! character of `PS4' is replicated multiple times, as necessary, to ! indicate multiple levels of indirection. The default is `+ '. ! `PWD' ! The current working directory as set by the `cd' builtin. ! `RANDOM' ! Each time this parameter is referenced, a random integer between 0 ! and 32767 is generated. Assigning a value to this variable seeds ! the random number generator. ! `REPLY' ! The default variable for the `read' builtin. ! `SECONDS' ! This variable expands to the number of seconds since the shell was ! started. Assignment to this variable resets the count to the ! value assigned, and the expanded value becomes the value assigned ! plus the number of seconds since the assignment. ! `SHELLOPTS' ! A colon-separated list of enabled shell options. Each word in the ! list is a valid argument for the `-o' option to the `set' builtin ! command (*note The Set Builtin::.). The options appearing in ! `SHELLOPTS' are those reported as `on' by `set -o'. If this ! variable is in the environment when Bash starts up, each shell ! option in the list will be enabled before reading any startup ! files. This variable is readonly. `SHLVL' *************** *** 3717,3770 **** nested. ! `OPTERR' ! If set to the value 1, Bash displays error messages generated by ! the `getopts' builtin command. ! `LANG' ! Used to determine the locale category for any category not ! specifically selected with a variable starting with `LC_'. ! `LC_ALL' ! This variable overrides the value of `LANG' and any other `LC_' ! variable specifying a locale category. ! `LC_COLLATE' ! This variable determines the collation order used when sorting the ! results of filename expansion (*note Filename Expansion::.). ! `LC_MESSAGES' ! This variable determines the locale used to translate double-quoted ! strings preceded by a `$' (*note Locale Translation::.). ! `IGNOREEOF' ! Controls the action of the shell on receipt of an `EOF' character ! as the sole input. If set, then the value of it is the number of ! consecutive `EOF' characters that can be read as the first ! character on an input line before the shell will exit. If the ! variable exists but does not have a numeric value (or has no ! value) then the default is 10. If the variable does not exist, ! then `EOF' signifies the end of input to the shell. This is only ! in effect for interactive shells. !  ! File: bashref.info, Node: Shell Arithmetic, Next: Arrays, Prev: Bash Variables, Up: Bash Features ! Shell Arithmetic ! ================ ! * Menu: ! * Arithmetic Evaluation:: How shell arithmetic works. ! * Arithmetic Expansion:: How to use arithmetic in shell expansions. ! * Arithmetic Builtins:: Builtin commands that use shell arithmetic. ! Bash includes several mechanisms to evaluate arithmetic expressions ! and display the result or use it as part of a command.  ! File: bashref.info, Node: Arithmetic Evaluation, Next: Arithmetic Expansion, Up: Shell Arithmetic ! Arithmetic Evaluation ! --------------------- The shell allows arithmetic expressions to be evaluated, as one of --- 3993,4049 ---- nested. ! `TIMEFORMAT' ! The value of this parameter is used as a format string specifying ! how the timing information for pipelines prefixed with the `time' ! reserved word should be displayed. The `%' character introduces an ! escape sequence that is expanded to a time value or other ! information. The escape sequences and their meanings are as ! follows; the braces denote optional portions. ! `%%' ! A literal `%'. ! `%[P][l]R' ! The elapsed time in seconds. ! `%[P][l]U' ! The number of CPU seconds spent in user mode. ! `%[P][l]S' ! The number of CPU seconds spent in system mode. ! `%P' ! The CPU percentage, computed as (%U + %S) / %R. ! The optional P is a digit specifying the precision, the number of ! fractional digits after a decimal point. A value of 0 causes no ! decimal point or fraction to be output. At most three places ! after the decimal point may be specified; values of P greater than ! 3 are changed to 3. If P is not specified, the value 3 is used. ! The optional `l' specifies a longer format, including minutes, of ! the form MMmSS.FFs. The value of P determines whether or not the ! fraction is included. ! If this variable is not set, Bash acts as if it had the value ! `$'\nreal\t%3lR\nuser\t%3lU\nsys\t%3lS'' ! If the value is null, no timing information is displayed. A ! trailing newline is added when the format string is displayed. ! `TMOUT' ! If set to a value greater than zero, the value is interpreted as ! the number of seconds to wait for input after issuing the primary ! prompt. Bash terminates after that number of seconds if input does ! not arrive. ! `UID' ! The numeric real user id of the current user. This variable is ! readonly.  ! File: bashref.info, Node: Shell Arithmetic, Next: Aliases, Prev: Bash Variables, Up: Bash Features ! Shell Arithmetic ! ================ The shell allows arithmetic expressions to be evaluated, as one of *************** *** 3782,3785 **** --- 4061,4067 ---- logical and bitwise negation + `**' + exponentiation + `* / %' multiplication, division, remainder *************** *** 3839,3879 ****  ! File: bashref.info, Node: Arithmetic Expansion, Next: Arithmetic Builtins, Prev: Arithmetic Evaluation, Up: Shell Arithmetic ! Arithmetic Expansion ! -------------------- ! Arithmetic expansion allows the evaluation of an arithmetic ! expression and the substitution of the result. The format for ! arithmetic expansion is: ! $(( EXPRESSION )) ! The expression is treated as if it were within double quotes, but a ! double quote inside the braces or parentheses is not treated specially. ! All tokens in the expression undergo parameter expansion, command ! substitution, and quote removal. Arithmetic substitutions may be ! nested. ! The evaluation is performed according to the rules listed above. If ! the expression is invalid, Bash prints a message indicating failure and ! no substitution occurs. !  ! File: bashref.info, Node: Arithmetic Builtins, Prev: Arithmetic Expansion, Up: Shell Arithmetic ! Arithmetic Builtins ! ------------------- ! `let' ! let EXPRESSION [EXPRESSION] ! The `let' builtin allows arithmetic to be performed on shell ! variables. Each EXPRESSION is evaluated according to the rules ! given previously (*note Arithmetic Evaluation::.). If the last ! EXPRESSION evaluates to 0, `let' returns 1; otherwise 0 is ! returned.  ! File: bashref.info, Node: Arrays, Next: Printing a Prompt, Prev: Shell Arithmetic, Up: Bash Features Arrays --- 4121,4201 ----  ! File: bashref.info, Node: Aliases, Next: Arrays, Prev: Shell Arithmetic, Up: Bash Features ! ! Aliases ! ======= ! ! * Menu: ! ! * Alias Builtins:: Builtins commands to maniuplate aliases. ! ! Aliases allow a string to be substituted for a word when it is used ! as the first word of a simple command. The shell maintains a list of ! ALIASES that may be set and unset with the `alias' and `unalias' ! builtin commands. ! ! The first word of each simple command, if unquoted, is checked to see ! if it has an alias. If so, that word is replaced by the text of the ! alias. The alias name and the replacement text may contain any valid ! shell input, including shell metacharacters, with the exception that ! the alias name may not contain `='. The first word of the replacement ! text is tested for aliases, but a word that is identical to an alias ! being expanded is not expanded a second time. This means that one may ! alias `ls' to `"ls -F"', for instance, and Bash does not try to ! recursively expand the replacement text. If the last character of the ! alias value is a space or tab character, then the next command word ! following the alias is also checked for alias expansion. ! ! Aliases are created and listed with the `alias' command, and removed ! with the `unalias' command. ! ! There is no mechanism for using arguments in the replacement text, ! as in `csh'. If arguments are needed, a shell function should be used ! (*note Shell Functions::.). ! ! Aliases are not expanded when the shell is not interactive, unless ! the `expand_aliases' shell option is set using `shopt' (*note Bash ! Builtins::.). ! The rules concerning the definition and use of aliases are somewhat ! confusing. Bash always reads at least one complete line of input ! before executing any of the commands on that line. Aliases are ! expanded when a command is read, not when it is executed. Therefore, an ! alias definition appearing on the same line as another command does not ! take effect until the next line of input is read. The commands ! following the alias definition on that line are not affected by the new ! alias. This behavior is also an issue when functions are executed. ! Aliases are expanded when a function definition is read, not when the ! function is executed, because a function definition is itself a ! compound command. As a consequence, aliases defined in a function are ! not available until after that function is executed. To be safe, ! always put alias definitions on a separate line, and do not use `alias' ! in compound commands. ! For almost every purpose, aliases are superseded by shell functions. !  ! File: bashref.info, Node: Alias Builtins, Up: Aliases ! Alias Builtins ! -------------- ! `alias' ! alias [`-p'] [NAME[=VALUE] ...] ! Without arguments or with the `-p' option, `alias' prints the list ! of aliases on the standard output in a form that allows them to be ! reused as input. If arguments are supplied, an alias is defined ! for each NAME whose VALUE is given. If no VALUE is given, the name ! and value of the alias is printed. ! `unalias' ! unalias [-a] [NAME ... ] ! Remove each NAME from the list of aliases. If `-a' is supplied, ! all aliases are removed.  ! File: bashref.info, Node: Arrays, Next: The Directory Stack, Prev: Aliases, Up: Bash Features Arrays *************** *** 3928,3934 **** The `unset' builtin is used to destroy arrays. `unset' ! NAME[SUBSCRIPT] destroys the array element at index SUBSCRIPT. `unset' ! NAME, where NAME is an array, removes the entire array. A subscript of ! `*' or `@' also removes the entire array. The `declare', `local', and `readonly' builtins each accept a `-a' --- 4250,4256 ---- The `unset' builtin is used to destroy arrays. `unset' ! `name[SUBSCRIPT]' destroys the array element at index SUBSCRIPT. ! `unset' NAME, where NAME is an array, removes the entire array. A ! subscript of `*' or `@' also removes the entire array. The `declare', `local', and `readonly' builtins each accept a `-a' *************** *** 3940,3944 ****  ! File: bashref.info, Node: Printing a Prompt, Next: The Restricted Shell, Prev: Arrays, Up: Bash Features Controlling the Prompt --- 4262,4359 ----  ! File: bashref.info, Node: The Directory Stack, Next: Printing a Prompt, Prev: Arrays, Up: Bash Features ! ! The Directory Stack ! =================== ! ! The directory stack is a list of recently-visited directories. The ! `pushd' builtin adds directories to the stack as it changes the current ! directory, and the `popd' builtin removes specified directories from ! the stack and changes the current directory to the directory removed. ! The `dirs' builtin displays the contents of the directory stack. ! ! The contents of the directory stack are also visible as the value of ! the `DIRSTACK' shell variable. ! ! `dirs' ! dirs [+N | -N] [-clvp] ! Display the list of currently remembered directories. Directories ! are added to the list with the `pushd' command; the `popd' command ! removes directories from the list. ! `+N' ! Displays the Nth directory (counting from the left of the ! list printed by `dirs' when invoked without options), starting ! with zero. ! ! `-N' ! Displays the Nth directory (counting from the right of the ! list printed by `dirs' when invoked without options), starting ! with zero. ! ! `-c' ! Clears the directory stack by deleting all of the elements. ! ! `-l' ! Produces a longer listing; the default listing format uses a ! tilde to denote the home directory. ! ! `-p' ! Causes `dirs' to print the directory stack with one entry per ! line. ! ! `-v' ! Causes `dirs' to print the directory stack with one entry per ! line, prefixing each entry with its index in the stack. ! ! `popd' ! popd [+N | -N] [-n] ! ! Remove the top entry from the directory stack, and `cd' to the new ! top directory. When no arguments are given, `popd' removes the ! top directory from the stack and performs a `cd' to the new top ! directory. The elements are numbered from 0 starting at the first ! directory listed with `dirs'; i.e., `popd' is equivalent to `popd ! +0'. ! `+N' ! Removes the Nth directory (counting from the left of the list ! printed by `dirs'), starting with zero. ! ! `-N' ! Removes the Nth directory (counting from the right of the ! list printed by `dirs'), starting with zero. ! ! `-n' ! Suppresses the normal change of directory when removing ! directories from the stack, so that only the stack is ! manipulated. ! ! `pushd' ! pushd [DIR | +N | -N] [-n] ! ! Save the current directory on the top of the directory stack and ! then `cd' to DIR. With no arguments, `pushd' exchanges the top ! two directories. ! ! `+N' ! Brings the Nth directory (counting from the left of the list ! printed by `dirs', starting with zero) to the top of the list ! by rotating the stack. ! ! `-N' ! Brings the Nth directory (counting from the right of the list ! printed by `dirs', starting with zero) to the top of the list ! by rotating the stack. ! ! `-n' ! Suppresses the normal change of directory when adding ! directories to the stack, so that only the stack is ! manipulated. ! ! `DIR' ! Makes the current working directory be the top of the stack, ! and then executes the equivalent of ``cd' DIR'. `cd's to DIR. ! !  ! File: bashref.info, Node: Printing a Prompt, Next: The Restricted Shell, Prev: The Directory Stack, Up: Bash Features Controlling the Prompt *************** *** 3947,3951 **** The value of the variable `PROMPT_COMMAND' is examined just before Bash prints each primary prompt. If it is set and non-null, then the ! value is executed just as if you had typed it on the command line. In addition, the following table describes the special characters --- 4362,4366 ---- The value of the variable `PROMPT_COMMAND' is examined just before Bash prints each primary prompt. If it is set and non-null, then the ! value is executed just as if it had been typed on the command line. In addition, the following table describes the special characters *************** *** 3953,4022 **** `\a' ! a bell character. `\d' ! the date, in "Weekday Month Date" format (e.g., "Tue May 26"). `\e' ! an escape character. `\h' ! the hostname, up to the first `.'. `\H' ! the hostname. `\n' ! newline. `\s' ! the name of the shell, the basename of `$0' (the portion following the final slash). `\t' ! the time, in 24-hour HH:MM:SS format. `\T' ! the time, in 12-hour HH:MM:SS format. `\@' ! the time, in 12-hour am/pm format. `\v' ! the version of Bash (e.g., 2.00) `\V' ! the release of Bash, version + patchlevel (e.g., 2.00.0) `\w' ! the current working directory. `\W' ! the basename of `$PWD'. ! ! `\u' ! your username. `\!' ! the history number of this command. `\#' ! the command number of this command. `\$' ! if the effective uid is 0, `#', otherwise `$'. ! `\nnn' ! the character corresponding to the octal number `nnn'. `\\' ! a backslash. `\[' ! begin a sequence of non-printing characters. This could be used to embed a terminal control sequence into the prompt. `\]' ! end a sequence of non-printing characters.  --- 4368,4440 ---- `\a' ! A bell character. `\d' ! The date, in "Weekday Month Date" format (e.g., "Tue May 26"). `\e' ! An escape character. `\h' ! The hostname, up to the first `.'. `\H' ! The hostname. `\n' ! A newline. ! ! `\r' ! A carriage return. `\s' ! The name of the shell, the basename of `$0' (the portion following the final slash). `\t' ! The time, in 24-hour HH:MM:SS format. `\T' ! The time, in 12-hour HH:MM:SS format. `\@' ! The time, in 12-hour am/pm format. ! ! `\u' ! The username of the current user. `\v' ! The version of Bash (e.g., 2.00) `\V' ! The release of Bash, version + patchlevel (e.g., 2.00.0) `\w' ! The current working directory. `\W' ! The basename of `$PWD'. `\!' ! The history number of this command. `\#' ! The command number of this command. `\$' ! If the effective uid is 0, `#', otherwise `$'. ! `\NNN' ! The character whose ASCII code is the octal value NNN. `\\' ! A backslash. `\[' ! Begin a sequence of non-printing characters. This could be used to embed a terminal control sequence into the prompt. `\]' ! End a sequence of non-printing characters.  *************** *** 4043,4046 **** --- 4461,4467 ---- startup. + * Parsing the value of `SHELLOPTS' from the shell environment at + startup. + * Redirecting output using the `>', `>|', `<>', `>&', `&>', and `>>' redirection operators. *************** *** 4053,4057 **** * Specifying the `-p' option to the `command' builtin. ! * Turning off restricted mode with `set +r'.  --- 4474,4478 ---- * Specifying the `-p' option to the `command' builtin. ! * Turning off restricted mode with `set +r' or `set +o restricted'.  *************** *** 4081,4089 **** 5. The POSIX.2 `PS1' and `PS2' expansions of `!' to the history number and `!!' to `!' are enabled, and parameter expansion is ! performed on the value regardless of the setting of the ! `promptvars' option. ! 6. Interactive comments are enabled by default. (Note that Bash has ! them on by default anyway.) 7. The POSIX.2 startup files are executed (`$ENV') rather than the --- 4502,4510 ---- 5. The POSIX.2 `PS1' and `PS2' expansions of `!' to the history number and `!!' to `!' are enabled, and parameter expansion is ! performed on the values of `PS1' and `PS2' regardless of the ! setting of the `promptvars' option. ! 6. Interactive comments are enabled by default. (Bash has them on by ! default anyway.) 7. The POSIX.2 startup files are executed (`$ENV') rather than the *************** *** 4102,4117 **** found. ! 12. Redirection operators do not perform filename expansion on the word in the redirection unless the shell is interactive. ! 13. Function names must be valid shell `name's. That is, they may not contain characters other than letters, digits, and underscores, and ! may not start with a digit. Declaring a function with an illegal name causes a fatal syntax error in non-interactive shells. ! 14. POSIX.2 `special' builtins are found before shell functions during command lookup. ! 15. If a POSIX.2 special builtin returns an error status, a non-interactive shell exits. The fatal errors are those listed in the POSIX.2 standard, and include things like passing incorrect --- 4523,4541 ---- found. ! 12. Non-interactive shells exit if a syntax error in an arithmetic ! expansion results in an invalid expression. ! ! 13. Redirection operators do not perform filename expansion on the word in the redirection unless the shell is interactive. ! 14. Function names must be valid shell `name's. That is, they may not contain characters other than letters, digits, and underscores, and ! may not start with a digit. Declaring a function with an invalid name causes a fatal syntax error in non-interactive shells. ! 15. POSIX.2 `special' builtins are found before shell functions during command lookup. ! 16. If a POSIX.2 special builtin returns an error status, a non-interactive shell exits. The fatal errors are those listed in the POSIX.2 standard, and include things like passing incorrect *************** *** 4119,4141 **** assignments preceding the command name, and so on. ! 16. If the `cd' builtin finds a directory to change to using `$CDPATH', the value it assigns to the `PWD' variable does not contain any symbolic links, as if `cd -P' had been executed. ! 17. A non-interactive shell exits with an error status if a variable assignment error occurs when no command name follows the assignment statements. A variable assignment error occurs, for example, when ! trying to assign a value to a read-only variable. ! 18. A non-interactive shell exits with an error status if the iteration variable in a `for' statement or the selection variable in a ! `select' statement is a read-only variable. ! 19. Process substitution is not available. ! 20. Assignment statements preceding POSIX.2 `special' builtins persist in the shell environment after the builtin completes. ! 21. The `export' and `readonly' builtin commands display their output in the format required by POSIX.2. --- 4543,4571 ---- assignments preceding the command name, and so on. ! 17. If the `cd' builtin finds a directory to change to using `$CDPATH', the value it assigns to the `PWD' variable does not contain any symbolic links, as if `cd -P' had been executed. ! 18. If `$CDPATH' is set, the `cd' builtin will not implicitly append ! the current directory to it. This means that `cd' will fail if no ! valid directory name can be constructed from any of the entries in ! `$CDPATH', even if the a directory with the same name as the name ! given as an argument to `cd' exists in the current directory. ! ! 19. A non-interactive shell exits with an error status if a variable assignment error occurs when no command name follows the assignment statements. A variable assignment error occurs, for example, when ! trying to assign a value to a readonly variable. ! 20. A non-interactive shell exits with an error status if the iteration variable in a `for' statement or the selection variable in a ! `select' statement is a readonly variable. ! 21. Process substitution is not available. ! 22. Assignment statements preceding POSIX.2 special builtins persist in the shell environment after the builtin completes. ! 23. The `export' and `readonly' builtin commands display their output in the format required by POSIX.2. *************** *** 4153,4157 **** *********** ! This chapter disusses what job control is, how it works, and how Bash allows you to access its facilities. --- 4583,4587 ---- *********** ! This chapter discusses what job control is, how it works, and how Bash allows you to access its facilities. *************** *** 4177,4182 **** The shell associates a JOB with each pipeline. It keeps a table of currently executing jobs, which may be listed with the `jobs' command. ! When Bash starts a job asynchronously (in the background), it prints a ! line that looks like: [1] 25647 --- 4607,4611 ---- The shell associates a JOB with each pipeline. It keeps a table of currently executing jobs, which may be listed with the `jobs' command. ! When Bash starts a job asynchronously, it prints a line that looks like: [1] 25647 *************** *** 4200,4213 **** If the operating system on which Bash is running supports job ! control, Bash allows you to use it. Typing the SUSPEND character ! (typically `^Z', Control-Z) while a process is running causes that ! process to be stopped and returns you to Bash. Typing the DELAYED ! SUSPEND character (typically `^Y', Control-Y) causes the process to be ! stopped when it attempts to read input from the terminal, and control to ! be returned to Bash. You may then manipulate the state of this job, ! using the `bg' command to continue it in the background, the `fg' ! command to continue it in the foreground, or the `kill' command to kill ! it. A `^Z' takes effect immediately, and has the additional side ! effect of causing pending output and typeahead to be discarded. There are a number of ways to refer to a job in the shell. The --- 4629,4643 ---- If the operating system on which Bash is running supports job ! control, Bash contains facilities to use it. Typing the SUSPEND ! character (typically `^Z', Control-Z) while a process is running causes ! that process to be stopped and returns control to Bash. Typing the ! DELAYED SUSPEND character (typically `^Y', Control-Y) causes the ! process to be stopped when it attempts to read input from the terminal, ! and control to be returned to Bash. The user then manipulates the ! state of this job, using the `bg' command to continue it in the ! background, the `fg' command to continue it in the foreground, or the ! `kill' command to kill it. A `^Z' takes effect immediately, and has ! the additional side effect of causing pending output and typeahead to ! be discarded. There are a number of ways to refer to a job in the shell. The *************** *** 4220,4227 **** reports an error. The symbols `%%' and `%+' refer to the shell's notion of the current job, which is the last job stopped while it was ! in the foreground. The previous job may be referenced using `%-'. In ! output pertaining to jobs (e.g., the output of the `jobs' command), the ! current job is always flagged with a `+', and the previous job with a ! `-'. Simply naming a job can be used to bring it into the foreground: --- 4650,4657 ---- reports an error. The symbols `%%' and `%+' refer to the shell's notion of the current job, which is the last job stopped while it was ! in the foreground or started in the background. The previous job may ! be referenced using `%-'. In output pertaining to jobs (e.g., the ! output of the `jobs' command), the current job is always flagged with a ! `+', and the previous job with a `-'. Simply naming a job can be used to bring it into the foreground: *************** *** 4233,4244 **** Normally, Bash waits until it is about to print a prompt before reporting changes in a job's status so as to not interrupt any other ! output. If the the `-b' option to the `set' builtin is set, Bash reports such changes immediately (*note The Set Builtin::.). ! If you attempt to exit Bash while jobs are stopped, the shell prints ! a message warning you that you have stopped jobs. You may then use the ! `jobs' command to inspect their status. If you do this, or try to exit ! again immediately, you are not warned again, and the stopped jobs are ! terminated.  --- 4663,4674 ---- Normally, Bash waits until it is about to print a prompt before reporting changes in a job's status so as to not interrupt any other ! output. If the the `-b' option to the `set' builtin is enabled, Bash reports such changes immediately (*note The Set Builtin::.). ! If an attempt to exit Bash is while jobs are stopped, the shell ! prints a message warning that there are stopped jobs. The `jobs' ! command may then be used to inspect their status. If a second attempt ! to exit is made without an intervening command, Bash does not print ! another warning, and the stopped jobs are terminated.  *************** *** 4250,4264 **** `bg' bg [JOBSPEC] ! Place JOBSPEC into the background, as if it had been started with ! `&'. If JOBSPEC is not supplied, the current job is used. `fg' fg [JOBSPEC] ! Bring JOBSPEC into the foreground and make it the current job. If ! JOBSPEC is not supplied, the current job is used. `jobs' jobs [-lpnrs] [JOBSPEC] ! jobs -x COMMAND [JOBSPEC] The first form lists the active jobs. The options have the --- 4680,4702 ---- `bg' bg [JOBSPEC] ! Resume the suspended job JOBSPEC in the background, as if it had ! been started with `&'. If JOBSPEC is not supplied, the current ! job is used. The return status is zero unless it is run when job ! control is not enabled, or, when run with job control enabled, if ! JOBSPEC was not found or JOBSPEC specifies a job that was started ! without job control. `fg' fg [JOBSPEC] ! Resume the job JOBSPEC in the foreground and make it the current ! job. If JOBSPEC is not supplied, the current job is used. The ! return status is that of the command placed into the foreground, ! or non-zero if run when job control is disabled or, when run with ! job control enabled, JOBSPEC does not specify a valid job or ! JOBSPEC specifies a job that was started without job control. `jobs' jobs [-lpnrs] [JOBSPEC] ! jobs -x COMMAND [ARGUMENTS] The first form lists the active jobs. The options have the *************** *** 4266,4274 **** `-l' ! List process IDs in addition to the normal information `-n' Display information only about jobs that have changed status ! since you were last notified of their status. `-p' --- 4704,4712 ---- `-l' ! List process IDs in addition to the normal information. `-n' Display information only about jobs that have changed status ! since the user was last notified of their status. `-p' *************** *** 4291,4318 **** `kill' ! kill [-s SIGSPEC] [-n SIGNUM] [-SIGSPEC] JOBSPEC ! kill -l [SIGSPEC] Send a signal specified by SIGSPEC or SIGNUM to the process named ! by JOBSPEC. SIGSPEC is either a signal name such as `SIGINT' ! (with or without the `SIG' prefix) or a signal number; SIGNUM is a ! signal number. If SIGSPEC and SIGNUM are not present, `SIGTERM' ! is used. The `-l' option lists the signal names, or the signal ! name corresponding to SIGSPEC. `wait' wait [JOBSPEC|PID] Wait until the child process specified by process ID PID or job ! specification JOBSPEC exits and report its exit status. If a job ! spec is given, all processes in the job are waited for. If no ! arguments are given, all currently active child processes are ! waited for. `disown' ! disown [-h] [JOBSPEC ...] Without options, each JOBSPEC is removed from the table of active jobs. If the `-h' option is given, the job is not removed from the table, but is marked so that `SIGHUP' is not sent to the job ! if the shell receives a `SIGHUP'. If JOBSPEC is not present, the ! current job is used. `suspend' --- 4729,4767 ---- `kill' ! kill [-s SIGSPEC] [-n SIGNUM] [-SIGSPEC] JOBSPEC or PID ! kill -l [EXIT_STATUS] Send a signal specified by SIGSPEC or SIGNUM to the process named ! by job specification JOBSPEC or process ID PID. SIGSPEC is either ! a signal name such as `SIGINT' (with or without the `SIG' prefix) ! or a signal number; SIGNUM is a signal number. If SIGSPEC and ! SIGNUM are not present, `SIGTERM' is used. The `-l' option lists ! the signal names. If any arguments are supplied when `-l' is ! given, the names of the signals corresponding to the arguments are ! listed, and the return status is zero. EXIT_STATUS is a number ! specifying a signal number or the exit status of a process ! terminated by a signal. The return status is zero if at least one ! signal was successfully sent, or non-zero if an error occurs or an ! invalid option is encountered. `wait' wait [JOBSPEC|PID] Wait until the child process specified by process ID PID or job ! specification JOBSPEC exits and return the exit status of the last ! command waited for. If a job spec is given, all processes in the ! job are waited for. If no arguments are given, all currently ! active child processes are waited for, and the return status is ! zero. If neither JOBSPEC nor PID specifies an active child process ! of the shell, the return status is 127. `disown' ! disown [-ar] [-h] [JOBSPEC ...] Without options, each JOBSPEC is removed from the table of active jobs. If the `-h' option is given, the job is not removed from the table, but is marked so that `SIGHUP' is not sent to the job ! if the shell receives a `SIGHUP'. If JOBSPEC is not present, and ! neither the `-a' nor `-r' option is supplied, the current job is ! used. If no JOBSPEC is supplied, the `-a' option means to remove ! or mark all jobs; the `-r' option without a JOBSPEC argument ! restricts operation to running jobs. `suspend' *************** *** 4334,4344 **** This variable controls how the shell interacts with the user and job control. If this variable exists then single word simple ! commands without redirects are treated as candidates for resumption ! of an existing job. There is no ambiguity allowed; if there is ! more than one job beginning with the string typed, then the most ! recently accessed job will be selected. The name of a stopped ! job, in this context, is the command line used to start it. If ! this variable is set to the value `exact', the string supplied ! must match the name of a stopped job exactly; if set to `substring', the string supplied needs to match a substring of the name of a stopped job. The `substring' value provides --- 4783,4793 ---- This variable controls how the shell interacts with the user and job control. If this variable exists then single word simple ! commands without redirections are treated as candidates for ! resumption of an existing job. There is no ambiguity allowed; if ! there is more than one job beginning with the string typed, then ! the most recently accessed job will be selected. The name of a ! stopped job, in this context, is the command line used to start ! it. If this variable is set to the value `exact', the string ! supplied must match the name of a stopped job exactly; if set to `substring', the string supplied needs to match a substring of the name of a stopped job. The `substring' value provides *************** *** 4356,4361 **** This chapter describes how to use the GNU History Library interactively, from a user's standpoint. It should be considered a ! user's guide. For information on using the GNU History Library in your ! own programs, see the GNU Readline Library Manual. * Menu: --- 4805,4810 ---- This chapter describes how to use the GNU History Library interactively, from a user's standpoint. It should be considered a ! user's guide. For information on using the GNU History Library in ! other programs, see the GNU Readline Library Manual. * Menu: *************** *** 4363,4370 **** * Bash History Facilities:: How Bash lets you manipulate your command history. * History Interaction:: What it feels like using History as a user.  ! File: bashref.info, Node: Bash History Facilities, Next: History Interaction, Up: Using History Interactively Bash History Facilities --- 4812,4821 ---- * Bash History Facilities:: How Bash lets you manipulate your command history. + * Bash History Builtins:: The Bash builtin commands that manipulate + the command history. * History Interaction:: What it feels like using History as a user.  ! File: bashref.info, Node: Bash History Facilities, Next: Bash History Builtins, Up: Using History Interactively Bash History Facilities *************** *** 4391,4400 **** truncation is performed. ! The builtin command `fc' (*note Korn Shell Builtins::.) may be used ! to list or edit and re-execute a portion of the history list. The ! `history' builtin (*note C Shell Builtins::.) can be used to display or ! modify the history list and manipulate the history file. When using ! the command-line editing, search commands are available in each editing ! mode that provide access to the history list. The shell allows control over which commands are saved on the history --- 4842,4850 ---- truncation is performed. ! The builtin command `fc' may be used to list or edit and re-execute ! a portion of the history list. The `history' builtin can be used to ! display or modify the history list and manipulate the history file. ! When using the command-line editing, search commands are available in ! each editing mode that provide access to the history list. The shell allows control over which commands are saved on the history *************** *** 4405,4416 **** where necessary to preserve syntactic correctness. The `lithist' shell option causes the shell to save the command with embedded newlines ! instead of semicolons. *Note Bash Builtins:: for a description of `shopt'.  ! File: bashref.info, Node: History Interaction, Prev: Bash History Facilities, Up: Using History Interactively ! Interactive History Expansion ! ============================= The History library provides a history expansion feature that is --- 4855,4948 ---- where necessary to preserve syntactic correctness. The `lithist' shell option causes the shell to save the command with embedded newlines ! instead of semicolons. *Note Bash Builtins::, for a description of `shopt'.  ! File: bashref.info, Node: Bash History Builtins, Next: History Interaction, Prev: Bash History Facilities, Up: Using History Interactively ! Bash History Builtins ! ===================== ! ! Bash provides two builtin commands that allow you to manipulate the ! history list and history file. ! ! `fc' ! `fc [-e ENAME] [-nlr] [FIRST] [LAST]' ! `fc -s [PAT=REP] [COMMAND]' ! ! Fix Command. In the first form, a range of commands from FIRST to ! LAST is selected from the history list. Both FIRST and LAST may ! be specified as a string (to locate the most recent command ! beginning with that string) or as a number (an index into the ! history list, where a negative number is used as an offset from the ! current command number). If LAST is not specified it is set to ! FIRST. If FIRST is not specified it is set to the previous ! command for editing and -16 for listing. If the `-l' flag is ! given, the commands are listed on standard output. The `-n' flag ! suppresses the command numbers when listing. The `-r' flag ! reverses the order of the listing. Otherwise, the editor given by ! ENAME is invoked on a file containing those commands. If ENAME is ! not given, the value of the following variable expansion is used: ! `${FCEDIT:-${EDITOR:-vi}}'. This says to use the value of the ! `FCEDIT' variable if set, or the value of the `EDITOR' variable if ! that is set, or `vi' if neither is set. When editing is complete, ! the edited commands are echoed and executed. ! ! In the second form, COMMAND is re-executed after each instance of ! PAT in the selected command is replaced by REP. ! ! A useful alias to use with the `fc' command is `r='fc -s'', so ! that typing `r cc' runs the last command beginning with `cc' and ! typing `r' re-executes the last command (*note Aliases::.). ! ! `history' ! history [-c] [N] ! history [-anrw] [FILENAME] ! history -ps ARG ! ! Display the history list with line numbers. Lines prefixed with ! with a `*' have been modified. An argument of N says to list only ! the last N lines. Options, if supplied, have the following ! meanings: ! ! `-w' ! Write out the current history to the history file. ! ! `-r' ! Read the current history file and append its contents to the ! history list. ! ! `-a' ! Append the new history lines (history lines entered since the ! beginning of the current Bash session) to the history file. ! ! `-n' ! Append the history lines not already read from the history ! file to the current history list. These are lines appended ! to the history file since the beginning of the current Bash ! session. ! ! `-c' ! Clear the history list. This may be combined with the other ! options to replace the history list completely. ! ! `-s' ! The ARGs are added to the end of the history list as a single ! entry. ! ! `-p' ! Perform history substitution on the ARGs and display the ! result on the standard output, without storing the results in ! the history list. ! ! When the `-w', `-r', `-a', or `-n' option is used, if FILENAME is ! given, then it is used as the history file. If not, then the ! value of the `HISTFILE' variable is used. ! !  ! File: bashref.info, Node: History Interaction, Prev: Bash History Builtins, Up: Using History Interactively ! ! History Expansion ! ================= The History library provides a history expansion feature that is *************** *** 4424,4438 **** History expansion takes place in two parts. The first is to ! determine which line from the previous history should be used during substitution. The second is to select portions of that line for ! inclusion into the current one. The line selected from the previous ! history is called the "event", and the portions of that line that are ! acted upon are called "words". Various "modifiers" are available to ! manipulate the selected words. The line is broken into words in the ! same fashion that Bash does, so that several English (or Unix) words ! surrounded by quotes are considered as one word. History expansions ! are introduced by the appearance of the history expansion character, ! which is `!' by default. Only `\' and `'' may be used to escape the ! history expansion character. Several shell options settable with the `shopt' builtin (*note Bash --- 4956,4969 ---- History expansion takes place in two parts. The first is to ! determine which line from the history list should be used during substitution. The second is to select portions of that line for ! inclusion into the current one. The line selected from the history is ! called the "event", and the portions of that line that are acted upon ! are called "words". Various "modifiers" are available to manipulate ! the selected words. The line is broken into words in the same fashion ! that Bash does, so that several words surrounded by quotes are ! considered one word. History expansions are introduced by the ! appearance of the history expansion character, which is `!' by default. ! Only `\' and `'' may be used to escape the history expansion character. Several shell options settable with the `shopt' builtin (*note Bash *************** *** 4448,4452 **** option to the `history' builtin may be used to add commands to the end of the history list without actually executing them, so that they are ! available for subsequent recall. The shell allows control of the various characters used by the --- 4979,4984 ---- option to the `history' builtin may be used to add commands to the end of the history list without actually executing them, so that they are ! available for subsequent recall. This is most useful in conjunction ! with Readline. The shell allows control of the various characters used by the *************** *** 4470,4474 **** `!' Start a history substitution, except when followed by a space, tab, ! the end of the line, <=> or <(>. `!N' --- 5002,5006 ---- `!' Start a history substitution, except when followed by a space, tab, ! the end of the line, `=' or `('. `!N' *************** *** 4503,4507 **** Word designators are used to select desired words from the event. A ! `:' separates the event specification from the word designator. It can be omitted if the word designator begins with a `^', `$', `*', `-', or `%'. Words are numbered from the beginning of the line, with the first --- 5035,5039 ---- Word designators are used to select desired words from the event. A ! `:' separates the event specification from the word designator. It may be omitted if the word designator begins with a `^', `$', `*', `-', or `%'. Words are numbered from the beginning of the line, with the first *************** *** 4699,4704 **** ! Undo the last thing that you did. You can undo all the way back ! to an empty line.  --- 5231,5236 ---- ! Undo the last editing command. You can undo all the way back to an ! empty line.  *************** *** 4721,4725 **** ! Move forward a word. --- 5253,5258 ---- ! Move forward a word, where a word is composed of letters and ! digits. *************** *** 4769,4774 **** different than because the word boundaries differ. ! And, here is how to "yank" the text back into the line. Yanking ! means to copy the most-recently-killed text from the kill buffer. --- 5302,5307 ---- different than because the word boundaries differ. ! Here is how to "yank" the text back into the line. Yanking means to ! copy the most-recently-killed text from the kill buffer. *************** *** 4794,4801 **** The general way to pass numeric arguments to a command is to type ! meta digits before the command. If the first `digit' you type is a ! minus sign (<->), then the sign of the argument will be negative. Once ! you have typed one meta digit to get the argument started, you can type ! the remainder of the digits, and then the command. For example, to give the command an argument of 10, you could type `M-1 0 C-d'. --- 5327,5334 ---- The general way to pass numeric arguments to a command is to type ! meta digits before the command. If the first `digit' typed is a minus ! sign (<->), then the sign of the argument will be negative. Once you ! have typed one meta digit to get the argument started, you can type the ! remainder of the digits, and then the command. For example, to give the command an argument of 10, you could type `M-1 0 C-d'. *************** *** 4812,4833 **** Incremental searches begin before the user has finished typing the search string. As each character of the search string is typed, ! readline displays the next entry from the history matching the string typed so far. An incremental search requires only as many characters ! as needed to find the desired history entry. The Escape character is ! used to terminate an incremental search. Control-J will also terminate ! the search. Control-G will abort an incremental search and restore the original line. When the search is terminated, the history entry containing the search string becomes the current line. To find other ! matching entries in the history list, type Control-S or Control-R as appropriate. This will search backward or forward in the history for the next entry matching the search string typed so far. Any other key ! sequence bound to a readline command will terminate the search and ! execute that command. For instance, a `newline' will terminate the ! search and accept the line, thereby executing the command from the ! history list. Non-incremental searches read the entire search string before starting to search for matching history lines. The search string may be ! typed by the user or part of the contents of the current line.  --- 5345,5366 ---- Incremental searches begin before the user has finished typing the search string. As each character of the search string is typed, ! Readline displays the next entry from the history matching the string typed so far. An incremental search requires only as many characters ! as needed to find the desired history entry. The character is ! used to terminate an incremental search. will also terminate the ! search. will abort an incremental search and restore the original line. When the search is terminated, the history entry containing the search string becomes the current line. To find other ! matching entries in the history list, type or as appropriate. This will search backward or forward in the history for the next entry matching the search string typed so far. Any other key ! sequence bound to a Readline command will terminate the search and ! execute that command. For instance, a will terminate the search ! and accept the line, thereby executing the command from the history ! list. Non-incremental searches read the entire search string before starting to search for matching history lines. The search string may be ! typed by the user or be part of the contents of the current line.  *************** *** 4838,4847 **** Although the Readline library comes with a set of `emacs'-like ! keybindings installed by default, it is possible that you would like to ! use a different set of keybindings. You can customize programs that ! use Readline by putting commands in an "inputrc" file in your home ! directory. The name of this file is taken from the value of the shell ! variable `INPUTRC'. If that variable is unset, the default is ! `~/.inputrc'. When a program which uses the Readline library starts up, the init --- 5371,5379 ---- Although the Readline library comes with a set of `emacs'-like ! keybindings installed by default, it is possible to use a different set ! of keybindings. Any user can customize programs that use Readline by ! putting commands in an "inputrc" file in his home directory. The name ! of this file is taken from the value of the shell variable `INPUTRC'. ! If that variable is unset, the default is `~/.inputrc'. When a program which uses the Readline library starts up, the init *************** *** 4872,4883 **** Variable Settings ! You can change the state of a few variables in Readline by using ! the `set' command within the init file. Here is how you would ! specify that you wish to use `vi' line editing commands: set editing-mode vi ! Right now, there are only a few variables which can be set; so ! few, in fact, that we just list them here: `bell-style' --- 5404,5416 ---- Variable Settings ! You can modify the run-time behavior of Readline by altering the ! values of variables in Readline using the `set' command within the ! init file. Here is how to change from the default Emacs-like key ! binding to use `vi' line editing commands: set editing-mode vi ! A great deal of run-time behavior is changeable with the following ! variables. `bell-style' *************** *** 4893,4896 **** --- 5426,5434 ---- `"#"'. + `completion-ignore-case' + If set to `on', Readline performs filename matching and + completion in a case-insensitive fashion. The default value + is `off'. + `completion-query-items' The number of possible completions that determines when the *************** *** 4903,4923 **** `convert-meta' If set to `on', Readline will convert characters with the ! eigth bit set to an ASCII key sequence by stripping the eigth ! bit and prepending an character, converting them to a ! meta-prefixed key sequence. The default value is `on'. `disable-completion' ! If set to `On', readline will inhibit word completion. Completion characters will be inserted into the line as if they had been mapped to `self-insert'. The default is `off'. `editing-mode' ! The `editing-mode' variable controls which editing mode you ! are using. By default, Readline starts up in Emacs editing ! mode, where the keystrokes are most similar to Emacs. This ! variable can be set to either `emacs' or `vi'. `enable-keypad' ! When set to `on', readline will try to enable the application keypad when it is called. Some systems need this to enable the arrow keys. The default is `off'. --- 5441,5461 ---- `convert-meta' If set to `on', Readline will convert characters with the ! eighth bit set to an ASCII key sequence by stripping the ! eighth bit and prepending an character, converting them ! to a meta-prefixed key sequence. The default value is `on'. `disable-completion' ! If set to `On', Readline will inhibit word completion. Completion characters will be inserted into the line as if they had been mapped to `self-insert'. The default is `off'. `editing-mode' ! The `editing-mode' variable controls which default set of key ! bindings is used. By default, Readline starts up in Emacs ! editing mode, where the keystrokes are most similar to Emacs. ! This variable can be set to either `emacs' or `vi'. `enable-keypad' ! When set to `on', Readline will try to enable the application keypad when it is called. Some systems need this to enable the arrow keys. The default is `off'. *************** *** 4929,4933 **** `horizontal-scroll-mode' This variable can be set to either `on' or `off'. Setting it ! to `on' means that the text of the lines that you edit will scroll horizontally on a single screen line when they are longer than the width of the screen, instead of wrapping onto --- 5467,5471 ---- `horizontal-scroll-mode' This variable can be set to either `on' or `off'. Setting it ! to `on' means that the text of the lines being edited will scroll horizontally on a single screen line when they are longer than the width of the screen, instead of wrapping onto *************** *** 4948,4954 **** `mark-modified-lines' ! This variable, when set to `on', says to display an asterisk ! (`*') at the start of history lines which have been modified. ! This variable is `off' by default. `input-meta' --- 5486,5492 ---- `mark-modified-lines' ! This variable, when set to `on', causes Readline to display an ! asterisk (`*') at the start of history lines which have been ! modified. This variable is `off' by default. `input-meta' *************** *** 4964,4967 **** --- 5502,5510 ---- sequence. The default is `off'. + `print-completions-horizontally' + If set to `on', Readline will display completions with matches + sorted horizontally in alphabetical order, rather than down + the screen. The default is `off'. + `show-all-if-ambiguous' This alters the default behavior of the completion functions. *************** *** 4978,4984 **** The syntax for controlling key bindings in the init file is simple. First you have to know the name of the command that you ! want to change. The following pages contain tables of the command ! name, the default keybinding, and a short description of what the ! command does. Once you know the name of the command, simply place the name of --- 5521,5527 ---- The syntax for controlling key bindings in the init file is simple. First you have to know the name of the command that you ! want to change. The following sections contain tables of the ! command name, the default keybinding, if any, and a short ! description of what the command does. Once you know the name of the command, simply place the name of *************** *** 4995,5000 **** Control-o: "> output" ! In the above example, `C-u' is bound to the function ! `universal-argument', and `C-o' is bound to run the macro expressed on the right hand side (that is, to insert the text `> output' into the line). --- 5538,5543 ---- Control-o: "> output" ! In the above example, is bound to the function ! `universal-argument', and is bound to run the macro expressed on the right hand side (that is, to insert the text `> output' into the line). *************** *** 5011,5046 **** "\e[11~": "Function Key 1" ! In the above example, `C-u' is bound to the function `universal-argument' (just as it was in the first example), ! `C-x C-r' is bound to the function `re-read-init-file', and ! `ESC [ 1 1 ~' is bound to insert the text `Function Key 1'. ! The following escape sequences are available when specifying ! key sequences: ! ! `\C-' ! control prefix ! ! `\M-' ! meta prefix ! ! `\e' ! an escape character ! ! `\\' ! backslash ! ! `\"' ! <"> ! ! `\'' ! <'> ! ! When entering the text of a macro, single or double quotes ! should be used to indicate a macro definition. Unquoted text ! is assumed to be a function name. Backslash will quote any ! character in the macro text, including `"' and `''. For ! example, the following binding will make `C-x \' insert a ! single `\' into the line: ! "\C-x\\": "\\"  --- 5554,5627 ---- "\e[11~": "Function Key 1" ! In the above example, is bound to the function `universal-argument' (just as it was in the first example), ! ` ' is bound to the function `re-read-init-file', ! and ` <[> <1> <1> <~>' is bound to insert the text ! `Function Key 1'. ! ! The following GNU Emacs style escape sequences are available when ! specifying key sequences: ! ! `\C-' ! control prefix ! ! `\M-' ! meta prefix ! ! `\e' ! an escape character ! ! `\\' ! backslash ! ! `\"' ! <"> ! ! `\'' ! <'> ! ! In addition to the GNU Emacs style escape sequences, a second set ! of backslash escapes is available: ! ! `\a' ! alert (bell) ! ! `\b' ! backspace ! ! `\d' ! delete ! ! `\f' ! form feed ! ! `\n' ! newline ! ! `\r' ! carriage return ! ! `\t' ! horizontal tab ! ! `\v' ! vertical tab ! ! `\NNN' ! the character whose ASCII code is the octal value NNN (one to ! three digits) ! ! `\xNNN' ! the character whose ASCII code is the hexadecimal value NNN ! (one to three digits) ! ! When entering the text of a macro, single or double quotes must be ! used to indicate a macro definition. Unquoted text is assumed to ! be a function name. In the macro body, the backslash escapes ! described above are expanded. Backslash will quote any other ! character in the macro text, including `"' and `''. For example, ! the following binding will make `C-x \' insert a single `\' into ! the line: ! "\C-x\\": "\\"  *************** *** 5053,5057 **** compilation features of the C preprocessor which allows key bindings and variable settings to be performed as the result of tests. There ! are three parser directives used. `$if' --- 5634,5638 ---- compilation features of the C preprocessor which allows key bindings and variable settings to be performed as the result of tests. There ! are four parser directives used. `$if' *************** *** 5073,5078 **** bindings, perhaps to bind the key sequences output by the terminal's function keys. The word on the right side of the ! `=' is tested against the full name of the terminal and the ! portion of the terminal name before the first `-'. This allows `sun' to match both `sun' and `sun-cmd', for instance. --- 5654,5659 ---- bindings, perhaps to bind the key sequences output by the terminal's function keys. The word on the right side of the ! `=' is tested against both the full name of the terminal and ! the portion of the terminal name before the first `-'. This allows `sun' to match both `sun' and `sun-cmd', for instance. *************** *** 5091,5096 **** `$endif' ! This command, as you saw in the previous example, terminates an ! `$if' command. `$else' --- 5672,5677 ---- `$endif' ! This command, as seen in the previous example, terminates an `$if' ! command. `$else' *************** *** 5098,5101 **** --- 5679,5687 ---- test fails. + `$include' + This directive takes a single filename as an argument and reads + commands and bindings from that file. + $include /etc/inputrc +  File: bashref.info, Node: Sample Init File, Prev: Conditional Init Constructs, Up: Readline Init File *************** *** 5115,5118 **** --- 5701,5709 ---- # Lines beginning with '#' are comments. # + # First, include any systemwide bindings and variable assignments from + # /etc/Inputrc + $include /etc/Inputrc + + # # Set various bindings for emacs mode. *************** *** 5263,5268 **** Accept the line regardless of where the cursor is. If this line is non-empty, add it to the history list according to the setting of ! the `HISTCONTROL' variable. If this line was a history line, then ! restore the history line to its original state. `previous-history (C-p)' --- 5854,5859 ---- Accept the line regardless of where the cursor is. If this line is non-empty, add it to the history list according to the setting of ! the `HISTCONTROL' and `HISTIGNORE' variables. If this line was a ! history line, then restore the history line to its original state. `previous-history (C-p)' *************** *** 5276,5281 **** `end-of-history (M->)' ! Move to the end of the input history, i.e., the line you are ! entering. `reverse-search-history (C-r)' --- 5867,5872 ---- `end-of-history (M->)' ! Move to the end of the input history, i.e., the line currently ! being entered. `reverse-search-history (C-r)' *************** *** 5301,5305 **** Search forward through the history for the string of characters between the start of the current line and the current cursor ! position (the `point'). This is a non-incremental search. By default, this command is unbound. --- 5892,5896 ---- Search forward through the history for the string of characters between the start of the current line and the current cursor ! position (the POINT). This is a non-incremental search. By default, this command is unbound. *************** *** 5319,5323 **** Insert last argument to the previous command (the last word of the previous history entry). With an argument, behave exactly like ! `yank-nth-arg'.  --- 5910,5916 ---- Insert last argument to the previous command (the last word of the previous history entry). With an argument, behave exactly like ! `yank-nth-arg'. Successive calls to `yank-last-arg' move back ! through the history list, inserting the last argument of each line ! in turn.  *************** *** 5330,5345 **** Delete the character under the cursor. If the cursor is at the beginning of the line, there are no characters in the line, and ! the last character typed was not `C-d', then return `EOF'. `backward-delete-char (Rubout)' ! Delete the character behind the cursor. A numeric arg says to kill ! the characters instead of deleting them. `quoted-insert (C-q, C-v)' ! Add the next character that you type to the line verbatim. This is ! how to insert key sequences like , for example. ! ! `tab-insert (M-TAB)' ! Insert a tab character. `self-insert (a, b, A, 1, !, ...)' --- 5923,5936 ---- Delete the character under the cursor. If the cursor is at the beginning of the line, there are no characters in the line, and ! the last character typed was not bound to `delete-char', then ! return `EOF'. `backward-delete-char (Rubout)' ! Delete the character behind the cursor. A numeric argument means ! to kill the characters instead of deleting them. `quoted-insert (C-q, C-v)' ! Add the next character typed to the line verbatim. This is how to ! insert key sequences like , for example. `self-insert (a, b, A, 1, !, ...)' *************** *** 5350,5354 **** the cursor, moving the cursor forward as well. If the insertion point is at the end of the line, then this transposes the last two ! characters of the line. Negative argumentss don't work. `transpose-words (M-t)' --- 5941,5945 ---- the cursor, moving the cursor forward as well. If the insertion point is at the end of the line, then this transposes the last two ! characters of the line. Negative arguments don't work. `transpose-words (M-t)' *************** *** 5358,5370 **** `upcase-word (M-u)' Uppercase the current (or following) word. With a negative ! argument, do the previous word, but do not move the cursor. `downcase-word (M-l)' Lowercase the current (or following) word. With a negative ! argument, do the previous word, but do not move the cursor. `capitalize-word (M-c)' Capitalize the current (or following) word. With a negative ! argument, do the previous word, but do not move the cursor.  --- 5949,5961 ---- `upcase-word (M-u)' Uppercase the current (or following) word. With a negative ! argument, uppercase the previous word, but do not move the cursor. `downcase-word (M-l)' Lowercase the current (or following) word. With a negative ! argument, lowercase the previous word, but do not move the cursor. `capitalize-word (M-c)' Capitalize the current (or following) word. With a negative ! argument, capitalize the previous word, but do not move the cursor.  *************** *** 5383,5387 **** `unix-line-discard (C-u)' Kill backward from the cursor to the beginning of the current line. ! Save the killed text on the kill-ring. `kill-whole-line ()' --- 5974,5978 ---- `unix-line-discard (C-u)' Kill backward from the cursor to the beginning of the current line. ! The killed text is saved on the kill-ring. `kill-whole-line ()' *************** *** 5408,5425 **** `kill-region ()' Kill the text between the point and the *mark* (saved cursor ! position. This text is referred to as the REGION. By default, this command is unbound. `copy-region-as-kill ()' ! Copy the text in the region to the kill buffer, so you can yank it right away. By default, this command is unbound. `copy-backward-word ()' ! Copy the word before point to the kill buffer. By default, this command is unbound. `copy-forward-word ()' ! Copy the word following point to the kill buffer. By default, ! this command is unbound. `yank (C-y)' --- 5999,6018 ---- `kill-region ()' Kill the text between the point and the *mark* (saved cursor ! position). This text is referred to as the REGION. By default, this command is unbound. `copy-region-as-kill ()' ! Copy the text in the region to the kill buffer, so it can be yanked right away. By default, this command is unbound. `copy-backward-word ()' ! Copy the word before point to the kill buffer. The word ! boundaries are the same as `backward-word'. By default, this command is unbound. `copy-forward-word ()' ! Copy the word following point to the kill buffer. The word ! boundaries are the same as `forward-word'. By default, this ! command is unbound. `yank (C-y)' *************** *** 5464,5469 **** application-specific. Generally, if you are typing a filename argument, you can do filename completion; if you are typing a ! command, you can do command completion, if you are typing in a ! symbol to GDB, you can do symbol name completion, if you are typing in a variable to Bash, you can do variable name completion, and so on. Bash attempts completion treating the text as a --- 6057,6062 ---- application-specific. Generally, if you are typing a filename argument, you can do filename completion; if you are typing a ! command, you can do command completion; if you are typing in a ! symbol to GDB, you can do symbol name completion; if you are typing in a variable to Bash, you can do variable name completion, and so on. Bash attempts completion treating the text as a *************** *** 5480,5483 **** --- 6073,6087 ---- been generated by `possible-completions'. + `menu-complete ()' + Similar to `complete', but replaces the word to be completed with + a single match from the list of possible completions. Repeated + execution of `menu-complete' steps through the list of possible + completions, inserting each match in turn. At the end of the list + of completions, the bell is rung and the original text is restored. + An argument of N moves N positions forward in the list of matches; + a negative argument may be used to move backward through the list. + This command is intended to be bound to `TAB', but is unbound by + default. + `complete-filename (M-/)' Attempt filename completion on the text before point. *************** *** 5514,5519 **** Attempt completion on the text before point, treating it as a command name. Command completion attempts to match the text ! against aliases, reserved words, shell functions, builtins, and ! finally executable filenames, in that order. `possible-command-completions (C-x !)' --- 6118,6123 ---- Attempt completion on the text before point, treating it as a command name. Command completion attempts to match the text ! against aliases, reserved words, shell functions, shell builtins, ! and finally executable filenames, in that order. `possible-command-completions (C-x !)' *************** *** 5567,5573 **** `prefix-meta (ESC)' ! Make the next character that you type be metafied. This is for ! people without a meta key. Typing `ESC f' is equivalent to typing ! `M-f'. `undo (C-_, C-x C-u)' --- 6171,6176 ---- `prefix-meta (ESC)' ! Make the next character typed be metafied. This is for keyboards ! without a meta key. Typing `ESC f' is equivalent to typing `M-f'. `undo (C-_, C-x C-u)' *************** *** 5575,5580 **** `revert-line (M-r)' ! Undo all changes made to this line. This is like typing the `undo' ! command enough times to get back to the beginning. `tilde-expand (M-~)' --- 6178,6183 ---- `revert-line (M-r)' ! Undo all changes made to this line. This is like executing the ! `undo' command enough times to get back to the beginning. `tilde-expand (M-~)' *************** *** 5607,5611 **** `dump-functions ()' ! Print all of the functions and their key bindings to the readline output stream. If a numeric argument is supplied, the output is formatted in such a way that it can be made part of an INPUTRC --- 6210,6214 ---- `dump-functions ()' ! Print all of the functions and their key bindings to the Readline output stream. If a numeric argument is supplied, the output is formatted in such a way that it can be made part of an INPUTRC *************** *** 5614,5623 **** `dump-variables ()' Print all of the settable variables and their values to the ! readline output stream. If a numeric argument is supplied, the output is formatted in such a way that it can be made part of an INPUTRC file. This command is unbound by default. `dump-macros ()' ! Print all of the readline key sequences bound to macros and the strings they ouput. If a numeric argument is supplied, the output is formatted in such a way that it can be made part of an INPUTRC --- 6217,6226 ---- `dump-variables ()' Print all of the settable variables and their values to the ! Readline output stream. If a numeric argument is supplied, the output is formatted in such a way that it can be made part of an INPUTRC file. This command is unbound by default. `dump-macros ()' ! Print all of the Readline key sequences bound to macros and the strings they ouput. If a numeric argument is supplied, the output is formatted in such a way that it can be made part of an INPUTRC *************** *** 5631,5636 **** `glob-list-expansions (C-x g)' The list of expansions that would have been generated by ! `glob-expand-word' is inserted into the line, replacing the word ! before point. `display-shell-version (C-x C-v)' --- 6234,6238 ---- `glob-list-expansions (C-x g)' The list of expansions that would have been generated by ! `glob-expand-word' is displayed, and the line is redrawn. `display-shell-version (C-x C-v)' *************** *** 5638,5652 **** `shell-expand-line (M-C-e)' ! Expand the line the way the shell does when it reads it. This ! performs alias and history expansion as well as all of the shell ! word expansions. `history-expand-line (M-^)' Perform history expansion on the current line. ! `alias-expand-line' Perform alias expansion on the current line (*note Aliases::.). ! `history-and-alias-expand-line' Perform history and alias expansion on the current line. --- 6240,6258 ---- `shell-expand-line (M-C-e)' ! Expand the line as the shell does. This performs alias and ! history expansion as well as all of the shell word expansions ! (*note Shell Expansions::.). `history-expand-line (M-^)' Perform history expansion on the current line. ! `magic-space ()' ! Perform history expansion on the current line and insert a space ! (*note History Interaction::.). ! ! `alias-expand-line ()' Perform alias expansion on the current line (*note Aliases::.). ! `history-and-alias-expand-line ()' Perform history and alias expansion on the current line. *************** *** 5693,5697 **** various supported platforms. The distribution supports nearly every version of Unix (and, someday, GNU). Other independent ports exist for ! OS/2, Windows 95, and Windows NT. * Menu: --- 6299,6303 ---- various supported platforms. The distribution supports nearly every version of Unix (and, someday, GNU). Other independent ports exist for ! MS-DOS, OS/2, Windows 95, and Windows NT. * Menu: *************** *** 5739,5746 **** remove or edit it. ! If you need to do unusual things to compile the package, please try ! to figure out how `configure' could check whether or not to do them, ! and mail diffs or instructions to `bash-maintainers@prep.ai.mit.edu' so ! they can be considered for the next release. The file `configure.in' is used to create `configure' by a program --- 6345,6352 ---- remove or edit it. ! If you need to do unusual things to compile Bash, please try to ! figure out how `configure' could check whether or not to do them, and ! mail diffs or instructions to so they can be ! considered for the next release. The file `configure.in' is used to create `configure' by a program *************** *** 5848,5853 **** You can specify separate installation prefixes for architecture-specific files and architecture-independent files. If you ! give `configure' the option `--exec-prefix=PATH', the package will use ! `PATH' as the prefix for installing programs and libraries. Documentation and other data files will still use the regular prefix. --- 6454,6459 ---- You can specify separate installation prefixes for architecture-specific files and architecture-independent files. If you ! give `configure' the option `--exec-prefix=PATH', `make install' will ! use `PATH' as the prefix for installing programs and libraries. Documentation and other data files will still use the regular prefix. *************** *** 5859,5865 **** There may be some features `configure' can not figure out ! automatically, but needs to determine by the type of host the package ! will run on. Usually `configure' can figure that out, but if it prints ! a message saying it can not guess the host type, give it the `--host=TYPE' option. `TYPE' can either be a short name for the system type, such as `sun4', or a canonical name with three fields: --- 6465,6471 ---- There may be some features `configure' can not figure out ! automatically, but needs to determine by the type of host Bash will run ! on. Usually `configure' can figure that out, but if it prints a ! message saying it can not guess the host type, give it the `--host=TYPE' option. `TYPE' can either be a short name for the system type, such as `sun4', or a canonical name with three fields: *************** *** 5923,5932 **** The Bash `configure' has a number of `--enable-FEATURE' options, ! where FEATURE indicates an optional part of the package. There are ! also several `--with-PACKAGE' options, where PACKAGE is something like ! `gnu-malloc' or `purify' (for the Purify memory allocation checker). To ! turn off the default use of a package, use `--without-PACKAGE'. To ! configure Bash without a feature that is enabled by default, use ! `--disable-FEATURE'. Here is a complete list of the `--enable-' and `--with-' options --- 6529,6537 ---- The Bash `configure' has a number of `--enable-FEATURE' options, ! where FEATURE indicates an optional part of Bash. There are also ! several `--with-PACKAGE' options, where PACKAGE is something like ! `gnu-malloc' or `purify'. To turn off the default use of a package, use ! `--without-PACKAGE'. To configure Bash without a feature that is ! enabled by default, use `--disable-FEATURE'. Here is a complete list of the `--enable-' and `--with-' options *************** *** 5943,5948 **** `--with-glibc-malloc' Use the GNU libc version of `malloc' in `lib/malloc/gmalloc.c'. ! This is somewhat slower than the default `malloc', but wastes ! considerably less space. `--with-gnu-malloc' --- 6548,6556 ---- `--with-glibc-malloc' Use the GNU libc version of `malloc' in `lib/malloc/gmalloc.c'. ! This is not the version of `malloc' that appears in glibc version ! 2, but a modified version of the `malloc' from glibc version 1. ! This is somewhat slower than the default `malloc', but wastes less ! space on a per-allocation basis, and will return memory to the ! operating system under some circumstances. `--with-gnu-malloc' *************** *** 5950,5957 **** not the same `malloc' that appears in GNU libc, but an older version derived from the 4.2 BSD `malloc'. This `malloc' is very ! fast, but wastes a lot of space. This option is enabled by ! default. The `NOTES' file contains a list of systems for which ! this should be turned off, and `configure' disables this option ! automatically for a number of systems. `--with-purify' --- 6558,6565 ---- not the same `malloc' that appears in GNU libc, but an older version derived from the 4.2 BSD `malloc'. This `malloc' is very ! fast, but wastes some space on each allocation. This option is ! enabled by default. The `NOTES' file contains a list of systems ! for which this should be turned off, and `configure' disables this ! option automatically for a number of systems. `--with-purify' *************** *** 5963,5969 **** historical Bourne shell. ! The `minimal-config' option can be used to disable all of the following ! options, but it is processed first, so individual options may be ! enabled using `enable-FEATURE'. All of the following options except for `disabled-builtins' and --- 6571,6588 ---- historical Bourne shell. ! There are several `--enable-' options that alter how Bash is ! compiled and linked, rather than changing run-time features. ! ! `--enable-profiling' ! This builds a Bash binary that produces profiling information to be ! processed by `gprof' each time it is executed. ! ! `--enable-static-link' ! This causes Bash to be linked statically, if `gcc' is being used. ! This could be used to build a version to use as root's shell. ! ! The `minimal-config' option can be used to disable all of the ! following options, but it is processed first, so individual options may ! be enabled using `enable-FEATURE'. All of the following options except for `disabled-builtins' and *************** *** 5973,5986 **** `--enable-alias' Allow alias expansion and include the `alias' and `unalias' ! builtins. `--enable-array-variables' ! Include support for one-dimensional array shell variables. `--enable-bang-history' ! Include support for `csh'-like history substitution. `--enable-brace-expansion' Include `csh'-like brace expansion ( `b{a,b}c' ==> `bac bbc' ). `--enable-command-timing' --- 6592,6608 ---- `--enable-alias' Allow alias expansion and include the `alias' and `unalias' ! builtins (*note Aliases::.). `--enable-array-variables' ! Include support for one-dimensional array shell variables (*note ! Arrays::.). `--enable-bang-history' ! Include support for `csh'-like history substitution (*note History ! Interaction::.). `--enable-brace-expansion' Include `csh'-like brace expansion ( `b{a,b}c' ==> `bac bbc' ). + See *Note Brace Expansion::, for a complete description. `--enable-command-timing' *************** *** 5990,5996 **** be timed. `--enable-directory-stack' Include support for a `csh'-like directory stack and the `pushd', ! `popd', and `dirs' builtins. `--enable-disabled-builtins' --- 6612,6622 ---- be timed. + `--enable-cond-command' + Include support for the `[[' conditional command (*note + Conditional Constructs::.). + `--enable-directory-stack' Include support for a `csh'-like directory stack and the `pushd', ! `popd', and `dirs' builtins (*note The Directory Stack::.). `--enable-disabled-builtins' *************** *** 6001,6005 **** `--enable-dparen-arithmetic' ! Include support for the `ksh' `((...))' command. `--enable-help-builtin' --- 6627,6636 ---- `--enable-dparen-arithmetic' ! Include support for the `((...))' command (*note Conditional ! Constructs::.). ! ! `--enable-extended-glob' ! Include support for the extended pattern matching features ! described above under *Note Pattern Matching::. `--enable-help-builtin' *************** *** 6012,6029 **** `--enable-job-control' ! This enables job control features, if the OS supports them. `--enable-process-substitution' This enables process substitution (*note Process Substitution::.) ! if the OS provides the necessary support. `--enable-prompt-string-decoding' Turn on the interpretation of a number of backslash-escaped characters in the `$PS1', `$PS2', `$PS3', and `$PS4' prompt ! strings. `--enable-readline' Include support for command-line editing and history with the Bash ! version of the Readline library. `--enable-restricted' --- 6643,6662 ---- `--enable-job-control' ! This enables the job control features (*note Job Control::.), if ! the operating system supports them. `--enable-process-substitution' This enables process substitution (*note Process Substitution::.) ! if the operating system provides the necessary support. `--enable-prompt-string-decoding' Turn on the interpretation of a number of backslash-escaped characters in the `$PS1', `$PS2', `$PS3', and `$PS4' prompt ! strings. See *Note Printing a Prompt::, for a complete list of ! prompt string escape sequences. `--enable-readline' Include support for command-line editing and history with the Bash ! version of the Readline library (*note Command Line Editing::.). `--enable-restricted' *************** *** 6033,6038 **** `--enable-select' ! Include the `ksh' `select' builtin, which allows the generation of ! simple menus. `--enable-usg-echo-default' --- 6666,6671 ---- `--enable-select' ! Include the `select' builtin, which allows the generation of simple ! menus (*note Conditional Constructs::.). `--enable-usg-echo-default' *************** *** 6060,6065 **** `bashbug' command to submit a bug report. If you have a fix, you are encouraged to mail that as well! Suggestions and `philosophical' bug ! reports may be mailed to `bug-bash@prep.ai.MIT.Edu' or posted to the ! Usenet newsgroup `gnu.bash.bug'. All bug reports should include: --- 6693,6698 ---- `bashbug' command to submit a bug report. If you have a fix, you are encouraged to mail that as well! Suggestions and `philosophical' bug ! reports may be mailed to or posted to the Usenet ! newsgroup `gnu.bash.bug'. All bug reports should include: *************** *** 6078,6083 **** it provides for filing a bug report. ! Please send all reports concerning this manual to ! `chet@ins.CWRU.Edu'.  --- 6711,6715 ---- it provides for filing a bug report. ! Please send all reports concerning this manual to .  *************** *** 6101,6105 **** * continue: Bourne Shell Builtins. * declare: Bash Builtins. ! * dirs: C Shell Builtins. * disown: Job Control Builtins. * echo: Bash Builtins. --- 6733,6737 ---- * continue: Bourne Shell Builtins. * declare: Bash Builtins. ! * dirs: The Directory Stack. * disown: Job Control Builtins. * echo: Bash Builtins. *************** *** 6109,6127 **** * exit: Bourne Shell Builtins. * export: Bourne Shell Builtins. ! * fc: Korn Shell Builtins. * fg: Job Control Builtins. * getopts: Bourne Shell Builtins. * hash: Bourne Shell Builtins. * help: Bash Builtins. ! * history: C Shell Builtins. * jobs: Job Control Builtins. * kill: Job Control Builtins. ! * let <1>: Arithmetic Builtins. ! * let: Korn Shell Builtins. * local: Bash Builtins. ! * logout <1>: Bash Builtins. ! * logout: C Shell Builtins. ! * popd: C Shell Builtins. ! * pushd: C Shell Builtins. * pwd: Bourne Shell Builtins. * read: Bash Builtins. --- 6741,6758 ---- * exit: Bourne Shell Builtins. * export: Bourne Shell Builtins. ! * fc: Bash History Builtins. * fg: Job Control Builtins. * getopts: Bourne Shell Builtins. * hash: Bourne Shell Builtins. * help: Bash Builtins. ! * history: Bash History Builtins. * jobs: Job Control Builtins. * kill: Job Control Builtins. ! * let: Bash Builtins. * local: Bash Builtins. ! * logout: Bash Builtins. ! * popd: The Directory Stack. ! * printf: Bash Builtins. ! * pushd: The Directory Stack. * pwd: Bourne Shell Builtins. * read: Bash Builtins. *************** *** 6131,6135 **** * shift: Bourne Shell Builtins. * shopt: Bash Builtins. ! * source: C Shell Builtins. * suspend: Job Control Builtins. * test: Bourne Shell Builtins. --- 6762,6766 ---- * shift: Bourne Shell Builtins. * shopt: Bash Builtins. ! * source: Bash Builtins. * suspend: Job Control Builtins. * test: Bourne Shell Builtins. *************** *** 6137,6141 **** * trap: Bourne Shell Builtins. * type: Bash Builtins. ! * typeset: Korn Shell Builtins. * ulimit: Bash Builtins. * umask: Bourne Shell Builtins. --- 6768,6772 ---- * trap: Bourne Shell Builtins. * type: Bash Builtins. ! * typeset: Bash Builtins. * ulimit: Bash Builtins. * umask: Bourne Shell Builtins. *************** *** 6153,6156 **** --- 6784,6789 ---- * !: Pipelines. + * [[: Conditional Constructs. + * ]]: Conditional Constructs. * case: Conditional Constructs. * do: Looping Constructs. *************** *** 6164,6168 **** * if: Conditional Constructs. * in: Conditional Constructs. ! * select: Korn Shell Constructs. * then: Conditional Constructs. * time: Pipelines. --- 6797,6801 ---- * if: Conditional Constructs. * in: Conditional Constructs. ! * select: Conditional Constructs. * then: Conditional Constructs. * time: Pipelines. *************** *** 6205,6209 **** * EUID: Bash Variables. * expand-tilde: Readline Init File Syntax. ! * FCEDIT: Korn Shell Variables. * FIGNORE: Bash Variables. * GLOBIGNORE: Bash Variables. --- 6838,6842 ---- * EUID: Bash Variables. * expand-tilde: Readline Init File Syntax. ! * FCEDIT: Bash Variables. * FIGNORE: Bash Variables. * GLOBIGNORE: Bash Variables. *************** *** 6222,6227 **** * HOSTTYPE: Bash Variables. * IFS: Bourne Shell Variables. ! * IGNOREEOF <1>: Bash Variables. ! * IGNOREEOF: C Shell Variables. * input-meta: Readline Init File Syntax. * INPUTRC: Bash Variables. --- 6855,6859 ---- * HOSTTYPE: Bash Variables. * IFS: Bourne Shell Variables. ! * IGNOREEOF: Bash Variables. * input-meta: Readline Init File Syntax. * INPUTRC: Bash Variables. *************** *** 6230,6235 **** * LC_ALL: Bash Variables. * LC_COLLATE: Bash Variables. * LC_MESSAGES: Bash Variables. ! * LINENO: Korn Shell Variables. * MACHTYPE: Bash Variables. * MAIL: Bourne Shell Variables. --- 6862,6868 ---- * LC_ALL: Bash Variables. * LC_COLLATE: Bash Variables. + * LC_CTYPE: Bash Variables. * LC_MESSAGES: Bash Variables. ! * LINENO: Bash Variables. * MACHTYPE: Bash Variables. * MAIL: Bourne Shell Variables. *************** *** 6238,6242 **** * mark-modified-lines: Readline Init File Syntax. * meta-flag: Readline Init File Syntax. ! * OLDPWD: Korn Shell Variables. * OPTARG: Bourne Shell Variables. * OPTERR: Bash Variables. --- 6871,6875 ---- * mark-modified-lines: Readline Init File Syntax. * meta-flag: Readline Init File Syntax. ! * OLDPWD: Bash Variables. * OPTARG: Bourne Shell Variables. * OPTERR: Bash Variables. *************** *** 6250,6264 **** * PS1: Bourne Shell Variables. * PS2: Bourne Shell Variables. ! * PS3: Korn Shell Variables. ! * PS4: Korn Shell Variables. ! * PWD: Korn Shell Variables. ! * RANDOM: Korn Shell Variables. ! * REPLY: Korn Shell Variables. ! * SECONDS: Korn Shell Variables. * SHELLOPTS: Bash Variables. * SHLVL: Bash Variables. * show-all-if-ambiguous: Readline Init File Syntax. * TIMEFORMAT: Bash Variables. ! * TMOUT: Korn Shell Variables. * UID: Bash Variables. * visible-stats: Readline Init File Syntax. --- 6883,6897 ---- * PS1: Bourne Shell Variables. * PS2: Bourne Shell Variables. ! * PS3: Bash Variables. ! * PS4: Bash Variables. ! * PWD: Bash Variables. ! * RANDOM: Bash Variables. ! * REPLY: Bash Variables. ! * SECONDS: Bash Variables. * SHELLOPTS: Bash Variables. * SHLVL: Bash Variables. * show-all-if-ambiguous: Readline Init File Syntax. * TIMEFORMAT: Bash Variables. ! * TMOUT: Bash Variables. * UID: Bash Variables. * visible-stats: Readline Init File Syntax. *************** *** 6313,6316 **** --- 6946,6950 ---- * kill-whole-line (): Commands For Killing. * kill-word (M-d): Commands For Killing. + * menu-complete (): Commands For Completion. * next-history (C-n): Commands For History. * non-incremental-forward-search-history (M-n): Commands For History. *************** *** 6327,6331 **** * set-mark (C-@): Miscellaneous Commands. * start-kbd-macro (C-x (): Keyboard Macros. - * tab-insert (M-TAB): Commands For Text. * tilde-expand (M-~): Miscellaneous Commands. * transpose-chars (C-t): Commands For Text. --- 6961,6964 ---- *************** *** 6350,6354 **** * alias expansion: Aliases. ! * arithmetic evaluation: Arithmetic Evaluation. * arithmetic expansion: Arithmetic Expansion. * arithmetic, shell: Shell Arithmetic. --- 6983,6987 ---- * alias expansion: Aliases. ! * arithmetic evaluation: Shell Arithmetic. * arithmetic expansion: Arithmetic Expansion. * arithmetic, shell: Shell Arithmetic. *************** *** 6362,6365 **** --- 6995,6999 ---- * command editing: Readline Bare Essentials. * command execution: Command Search and Execution. + * command expansion: Simple Command Expansion. * command history: Bash History Facilities. * command search: Command Search and Execution. *************** *** 6371,6384 **** * commands, looping: Looping Constructs. * commands, pipelines: Pipelines. * commands, simple: Simple Commands. * comments, shell: Comments. * configuration: Basic Installation. * control operator: Definitions. * editing command lines: Readline Bare Essentials. * environment: Environment. ! * evaluation, arithmetic: Arithmetic Evaluation. * event designators: Event Designators. ! * exit status <1>: Definitions. ! * exit status: Exit Status. * expansion: Shell Expansions. * expansion, arithmetic: Arithmetic Expansion. --- 7005,7021 ---- * commands, looping: Looping Constructs. * commands, pipelines: Pipelines. + * commands, shell: Shell Commands. * commands, simple: Simple Commands. * comments, shell: Comments. * configuration: Basic Installation. * control operator: Definitions. + * directory stack: The Directory Stack. * editing command lines: Readline Bare Essentials. * environment: Environment. ! * evaluation, arithmetic: Shell Arithmetic. * event designators: Event Designators. ! * execution environment: Command Execution Environment. ! * exit status <1>: Exit Status. ! * exit status: Definitions. * expansion: Shell Expansions. * expansion, arithmetic: Arithmetic Expansion. *************** *** 6388,6392 **** * expansion, pathname: Filename Expansion. * expansion, tilde: Tilde Expansion. ! * expressions, arithmetic: Arithmetic Evaluation. * expressions, conditional: Bash Conditional Expressions. * field: Definitions. --- 7025,7029 ---- * expansion, pathname: Filename Expansion. * expansion, tilde: Tilde Expansion. ! * expressions, arithmetic: Shell Arithmetic. * expressions, conditional: Bash Conditional Expressions. * field: Definitions. *************** *** 6395,6398 **** --- 7032,7036 ---- * foreground: Job Control Basics. * functions, shell: Shell Functions. + * history builtins: Bash History Builtins. * history events: Event Designators. * history expansion: History Interaction. *************** *** 6411,6414 **** --- 7049,7053 ---- * killing text: Readline Killing Commands. * localization: Locale Translation. + * matching, pattern: Pattern Matching. * metacharacter: Definitions. * name: Definitions. *************** *** 6420,6423 **** --- 7059,7063 ---- * parameters, special: Special Parameters. * pathname expansion: Filename Expansion. + * pattern matching: Pattern Matching. * pipeline: Pipelines. * POSIX: Definitions. *************** *** 6434,6437 **** --- 7074,7078 ---- * restricted shell: The Restricted Shell. * return status: Definitions. + * shell arithmetic: Shell Arithmetic. * shell function: Shell Functions. * shell script: Shell Scripts. *************** *** 6452,6573 ****  Tag Table: ! Node: Top1179 ! Node: Introduction3283 ! Node: What is Bash?3508 ! Node: What is a shell?4592 ! Node: Definitions6473 ! Node: Basic Shell Features9134 ! Node: Shell Syntax10655 ! Node: Shell Operation10945 ! Node: Quoting12179 ! Node: Escape Character13214 ! Node: Single Quotes13645 ! Node: Double Quotes13974 ! Node: ANSI-C Quoting14670 ! Node: Locale Translation15402 ! Node: Comments15823 ! Node: Simple Commands16347 ! Node: Pipelines16936 ! Node: Lists18007 ! Node: Looping Constructs19282 ! Node: Conditional Constructs20459 ! Node: Command Grouping22526 ! Node: Shell Functions23912 ! Node: Shell Parameters25685 ! Node: Positional Parameters27008 ! Node: Special Parameters27702 ! Node: Shell Expansions30268 ! Node: Shell Parameter Expansion32272 ! Node: Command Substitution38280 ! Node: Process Substitution39280 ! Node: Word Splitting40186 ! Node: Filename Expansion41638 ! Node: Quote Removal44004 ! Node: Redirections44290 ! Node: Executing Commands50031 ! Node: Command Search and Execution50486 ! Node: Environment52220 ! Node: Exit Status53856 ! Node: Signals54873 ! Node: Shell Scripts56084 ! Node: Bourne Shell Features57953 ! Node: Bourne Shell Builtins58623 ! Node: Bourne Shell Variables66977 ! Node: Other Bourne Shell Features68514 ! Node: Major Differences From The Bourne Shell69271 ! Node: Csh Features79631 ! Node: Brace Expansion80549 ! Node: Tilde Expansion82104 ! Node: C Shell Builtins82736 ! Node: C Shell Variables87292 ! Node: Korn Shell Features87700 ! Node: Korn Shell Constructs88428 ! Node: Korn Shell Builtins90143 ! Node: Korn Shell Variables92301 ! Node: Aliases93860 ! Node: Alias Builtins96326 ! Node: Bash Features96942 ! Node: Invoking Bash97933 ! Node: Bash Startup Files101798 ! Node: Is This Shell Interactive?105373 ! Node: Bash Builtins106356 ! Node: The Set Builtin122211 ! Node: Bash Conditional Expressions127586 ! Node: Bash Variables132237 ! Node: Shell Arithmetic142271 ! Node: Arithmetic Evaluation142739 ! Node: Arithmetic Expansion144769 ! Node: Arithmetic Builtins145573 ! Node: Arrays146044 ! Node: Printing a Prompt149071 ! Node: The Restricted Shell150669 ! Node: Bash POSIX Mode151899 ! Node: Job Control155583 ! Node: Job Control Basics156048 ! Node: Job Control Builtins160191 ! Node: Job Control Variables163114 ! Node: Using History Interactively164261 ! Node: Bash History Facilities164850 ! Node: History Interaction167248 ! Node: Event Designators169810 ! Node: Word Designators170737 ! Node: Modifiers171986 ! Node: Command Line Editing173303 ! Node: Introduction and Notation173963 ! Node: Readline Interaction175001 ! Node: Readline Bare Essentials176193 ! Node: Readline Movement Commands177736 ! Node: Readline Killing Commands178648 ! Node: Readline Arguments180368 ! Node: Searching181345 ! Node: Readline Init File182981 ! Node: Readline Init File Syntax184037 ! Node: Conditional Init Constructs191820 ! Node: Sample Init File194101 ! Node: Bindable Readline Commands197134 ! Node: Commands For Moving197884 ! Node: Commands For History198731 ! Node: Commands For Text201404 ! Node: Commands For Killing203148 ! Node: Numeric Arguments205174 ! Node: Commands For Completion206300 ! Node: Keyboard Macros209262 ! Node: Miscellaneous Commands209820 ! Node: Readline vi Mode214036 ! Node: Installing Bash214914 ! Node: Basic Installation215983 ! Node: Compilers and Options218908 ! Node: Compiling For Multiple Architectures219642 ! Node: Installation Names221299 ! Node: Specifying the System Type222021 ! Node: Sharing Defaults222732 ! Node: Operation Controls223397 ! Node: Optional Features224302 ! Node: Reporting Bugs229185 ! Node: Builtin Index230265 ! Node: Reserved Word Index233732 ! Node: Variable Index235059 ! Node: Function Index240327 ! Node: Concept Index244750  End Tag Table --- 7093,7211 ----  Tag Table: ! Node: Top1197 ! Node: Introduction3153 ! Node: What is Bash?3378 ! Node: What is a shell?4472 ! Node: Definitions6494 ! Node: Basic Shell Features9155 ! Node: Shell Syntax10378 ! Node: Shell Operation10667 ! Node: Quoting11961 ! Node: Escape Character12986 ! Node: Single Quotes13458 ! Node: Double Quotes13787 ! Node: ANSI-C Quoting14685 ! Node: Locale Translation15554 ! Node: Comments15975 ! Node: Shell Commands16589 ! Node: Simple Commands17100 ! Node: Pipelines17659 ! Node: Lists19186 ! Node: Looping Constructs20641 ! Node: Conditional Constructs22246 ! Node: Command Grouping28184 ! Node: Shell Functions29561 ! Node: Shell Parameters31525 ! Node: Positional Parameters32851 ! Node: Special Parameters33600 ! Node: Shell Expansions36221 ! Node: Brace Expansion38144 ! Node: Tilde Expansion39705 ! Node: Shell Parameter Expansion42037 ! Node: Command Substitution48379 ! Node: Arithmetic Expansion49653 ! Node: Process Substitution50498 ! Node: Word Splitting51392 ! Node: Filename Expansion52844 ! Node: Pattern Matching54808 ! Node: Quote Removal57197 ! Node: Redirections57483 ! Node: Executing Commands63553 ! Node: Simple Command Expansion64220 ! Node: Command Search and Execution66143 ! Node: Command Execution Environment68146 ! Node: Environment70600 ! Node: Exit Status72257 ! Node: Signals73454 ! Node: Shell Scripts75349 ! Node: Bourne Shell Features77385 ! Node: Bourne Shell Builtins78115 ! Node: Bourne Shell Variables92056 ! Node: Other Bourne Shell Features93761 ! Node: Major Differences From The Bourne Shell94504 ! Node: Bash Features106693 ! Node: Invoking Bash107796 ! Node: Bash Startup Files111981 ! Node: Is This Shell Interactive?115540 ! Node: Bash Builtins116511 ! Node: The Set Builtin137351 ! Node: Bash Conditional Expressions143960 ! Node: Bash Variables147033 ! Node: Shell Arithmetic159463 ! Node: Aliases161511 ! Node: Alias Builtins164086 ! Node: Arrays164702 ! Node: The Directory Stack167723 ! Node: Printing a Prompt171073 ! Node: The Restricted Shell172736 ! Node: Bash POSIX Mode174072 ! Node: Job Control178233 ! Node: Job Control Basics178699 ! Node: Job Control Builtins182898 ! Node: Job Control Variables187190 ! Node: Using History Interactively188340 ! Node: Bash History Facilities189019 ! Node: Bash History Builtins191360 ! Node: History Interaction194728 ! Node: Event Designators197280 ! Node: Word Designators198207 ! Node: Modifiers199456 ! Node: Command Line Editing200773 ! Node: Introduction and Notation201433 ! Node: Readline Interaction202471 ! Node: Readline Bare Essentials203663 ! Node: Readline Movement Commands205203 ! Node: Readline Killing Commands206168 ! Node: Readline Arguments207883 ! Node: Searching208857 ! Node: Readline Init File210475 ! Node: Readline Init File Syntax211514 ! Node: Conditional Init Constructs220379 ! Node: Sample Init File222817 ! Node: Bindable Readline Commands225986 ! Node: Commands For Moving226736 ! Node: Commands For History227583 ! Node: Commands For Text230412 ! Node: Commands For Killing232146 ! Node: Numeric Arguments234295 ! Node: Commands For Completion235421 ! Node: Keyboard Macros238991 ! Node: Miscellaneous Commands239549 ! Node: Readline vi Mode243869 ! Node: Installing Bash244747 ! Node: Basic Installation245824 ! Node: Compilers and Options248734 ! Node: Compiling For Multiple Architectures249468 ! Node: Installation Names251125 ! Node: Specifying the System Type251850 ! Node: Sharing Defaults252554 ! Node: Operation Controls253219 ! Node: Optional Features254124 ! Node: Reporting Bugs260319 ! Node: Builtin Index261390 ! Node: Reserved Word Index264793 ! Node: Variable Index266251 ! Node: Function Index271456 ! Node: Concept Index275885  End Tag Table diff -Nrc2 bash-2.01.1/doc/bashref.texi bash-2.02/doc/bashref.texi *** bash-2.01.1/doc/bashref.texi Mon Jul 21 13:57:04 1997 --- bash-2.02/doc/bashref.texi Wed Apr 1 13:17:06 1998 *************** *** 6,16 **** @ignore ! last change: Mon May 19 12:55:22 EDT 1997 @end ignore ! @set EDITION 2.0 ! @set VERSION 2.01 ! @set UPDATED 19 May 1997 ! @set UPDATE-MONTH May 1997 @iftex --- 6,16 ---- @ignore ! last change: Wed Mar 25 11:36:48 EST 1998 @end ignore ! @set EDITION 2.2 ! @set VERSION 2.02 ! @set UPDATED 1 April 1998 ! @set UPDATE-MONTH April 1998 @iftex *************** *** 23,32 **** @set BashFeatures @dircategory Utilities @direntry ! * Bash: (bash). GNU Bourne-Again SHell @end direntry - @ifinfo @format This text is a brief description of the features that are present in --- 23,32 ---- @set BashFeatures + @ifinfo @dircategory Utilities @direntry ! * Bash: (bash). The GNU Bourne-Again SHell. @end direntry @format This text is a brief description of the features that are present in *************** *** 37,41 **** for @code{Bash}, Version @value{VERSION}. ! Copyright (C) 1991, 1993, 1996 Free Software Foundation, Inc. Permission is granted to make and distribute verbatim copies of --- 37,41 ---- for @code{Bash}, Version @value{VERSION}. ! Copyright (C) 1991, 1993, 1996, 1997 Free Software Foundation, Inc. Permission is granted to make and distribute verbatim copies of *************** *** 58,62 **** into another language, under the above conditions for modified versions, except that this permission notice may be stated in a translation approved ! by the Foundation. @end format @end ifinfo --- 58,62 ---- into another language, under the above conditions for modified versions, except that this permission notice may be stated in a translation approved ! by the Free Software Foundation. @end format @end ifinfo *************** *** 126,135 **** Bourne shell. - * Csh Features:: Features originally found in the - Berkeley C-Shell. - - * Korn Shell Features:: Features originally found in the Korn - Shell. - * Bash Features:: Features found only in Bash. --- 126,129 ---- *************** *** 182,189 **** Bash is an @code{sh}-compatible shell that incorporates useful features from the Korn shell @code{ksh} and the C shell @code{csh}. ! It is ultimately intended to be a ! conformant implementation of the @sc{IEEE} @sc{POSIX} Shell and Tools ! specification (@sc{IEEE} Working Group 1003.2). It offers functional ! improvements over @code{sh} for both interactive and programming use. While the @sc{GNU} operating system will include a version --- 176,183 ---- Bash is an @code{sh}-compatible shell that incorporates useful features from the Korn shell @code{ksh} and the C shell @code{csh}. ! It is intended to be a conformant implementation of the @sc{IEEE} ! @sc{POSIX} Shell and Tools specification (@sc{IEEE} Working Group 1003.2). ! It offers functional improvements over @code{sh} for both interactive and ! programming use. While the @sc{GNU} operating system will include a version *************** *** 191,195 **** Like other @sc{GNU} software, Bash is quite portable. It currently runs on nearly every version of Unix and a few other operating systems @minus{} ! independently-supported ports exist for @sc{OS/2} and Windows @sc{NT}. @node What is a shell? --- 185,190 ---- Like other @sc{GNU} software, Bash is quite portable. It currently runs on nearly every version of Unix and a few other operating systems @minus{} ! independently-supported ports exist for @sc{MS-DOS}, @sc{OS/2}, ! Windows @sc{95}, and Windows @sc{NT}. @node What is a shell? *************** *** 200,205 **** provides the user interface to the rich set of Unix utilities, and a programming language, allowing these utilitites to be ! combined. The shell reads commands either from a terminal or a ! file. Files containing commands can be created, and become commands themselves. These new commands have the same status as system commands in directories like @file{/bin}, allowing users --- 195,199 ---- provides the user interface to the rich set of Unix utilities, and a programming language, allowing these utilitites to be ! combined. Files containing commands can be created, and become commands themselves. These new commands have the same status as system commands in directories like @file{/bin}, allowing users *************** *** 207,211 **** A shell allows execution of Unix commands, both synchronously and ! asynchronously. The @dfn{redirection} constructs permit fine-grained control of the input and output of those commands, and the shell allows control over the contents of their --- 201,209 ---- A shell allows execution of Unix commands, both synchronously and ! asynchronously. ! The shell waits for synchronous commands to complete before accepting ! more input; asynchronous commands continue to execute in parallel ! with the shell while it reads and executes additional commands. ! The @dfn{redirection} constructs permit fine-grained control of the input and output of those commands, and the shell allows control over the contents of their *************** *** 352,356 **** 1003.2 specification for the `standard' Unix shell. ! This chapter briefly summarizes the shell's "building blocks": commands, control structures, shell functions, shell @i{parameters}, shell expansions, --- 350,354 ---- 1003.2 specification for the `standard' Unix shell. ! This chapter briefly summarizes the shell's `building blocks': commands, control structures, shell functions, shell @i{parameters}, shell expansions, *************** *** 360,370 **** @menu * Shell Syntax:: What your input means to the shell. ! * Simple Commands:: The most common type of command. ! * Pipelines:: Connecting the input and output of several ! commands. ! * Lists:: How to execute commands sequentially. ! * Looping Constructs:: Shell commands for iterative action. ! * Conditional Constructs:: Shell commands for conditional execution. ! * Command Grouping:: Ways to group commands. * Shell Functions:: Grouping commands by name. * Shell Parameters:: Special shell variables. --- 358,362 ---- @menu * Shell Syntax:: What your input means to the shell. ! * Shell Commands:: The types of commands you can use. * Shell Functions:: Grouping commands by name. * Shell Parameters:: Special shell variables. *************** *** 401,410 **** @item Breaks the input into words and operators, obeying the quoting rules ! described in @ref{Quoting}. Tokens are separated by @code{metacharacters}. Alias expansion is performed by this step (@pxref{Aliases}). @item ! Parses the tokens into simple and compound commands. @item --- 393,403 ---- @item Breaks the input into words and operators, obeying the quoting rules ! described in @ref{Quoting}. These tokens are separated by @code{metacharacters}. Alias expansion is performed by this step (@pxref{Aliases}). @item ! Parses the tokens into simple and compound commands ! (@pxref{Shell Commands}). @item *************** *** 422,426 **** @item Optionally waits for the command to complete and collects its exit ! status. @end enumerate --- 415,419 ---- @item Optionally waits for the command to complete and collects its exit ! status (@pxref{Exit Status}). @end enumerate *************** *** 447,453 **** parameter expansion. ! Each of the shell @code{metacharacters} (@pxref{Definitions}) ! has special meaning to the shell and must be quoted if they are to ! represent themselves. There are three quoting mechanisms: the @var{escape character}, single quotes, and double quotes. --- 440,446 ---- parameter expansion. ! Each of the shell metacharacters (@pxref{Definitions}) ! has special meaning to the shell and must be quoted if it is to ! represent itself. There are three quoting mechanisms: the @var{escape character}, single quotes, and double quotes. *************** *** 457,462 **** It preserves the literal value of the next character that follows, with the exception of @code{newline}. If a @code{\newline} pair ! appears, and the backslash is not quoted, the @code{\newline} ! is treated as a line continuation (that is, it is effectively ignored). @node Single Quotes --- 450,456 ---- It preserves the literal value of the next character that follows, with the exception of @code{newline}. If a @code{\newline} pair ! appears, and the backslash itself is not quoted, the @code{\newline} ! is treated as a line continuation (that is, it is removed from ! the input stream and effectively ignored). @node Single Quotes *************** *** 474,481 **** @samp{$}, @samp{`}, and @samp{\}. The characters @samp{$} and @samp{`} ! retain their special meaning within double quotes. The backslash ! retains its special meaning only when followed by one of the following ! characters: @samp{$}, @samp{`}, @samp{"}, @samp{\}, or @code{newline}. A double quote may be quoted within double quotes by preceding it with a backslash. --- 468,478 ---- @samp{$}, @samp{`}, and @samp{\}. The characters @samp{$} and @samp{`} ! retain their special meaning within double quotes (@pxref{Shell Expansions}). ! The backslash retains its special meaning only when followed by one of ! the following characters: @samp{$}, @samp{`}, @samp{"}, @samp{\}, or @code{newline}. + Within double quotes, backslashes that are followed by one of these + characters are removed. Backslashes preceding characters without a + special meaning are left unmodified. A double quote may be quoted within double quotes by preceding it with a backslash. *************** *** 513,517 **** backslash @item \@var{nnn} ! the character whose @code{ASCII} code is @var{nnn} in octal @end table --- 510,518 ---- backslash @item \@var{nnn} ! the character whose @code{ASCII} code is the octal value @var{nnn} ! (one to three digits) ! @item \x@var{nnn} ! the character whose @code{ASCII} code is the hexadecimal value @var{nnn} ! (one to three digits) @end table *************** *** 542,553 **** option enabled does not allow comments. The @code{interactive_comments} option is on by default in interactive shells. @node Simple Commands ! @section Simple Commands @cindex commands, simple ! A simple command is the kind of command you'll encounter most often. It's just a sequence of words separated by @code{blank}s, terminated ! by one of the shell control operators (@pxref{Definitions}). The first word generally specifies a command to be executed. --- 543,569 ---- option enabled does not allow comments. The @code{interactive_comments} option is on by default in interactive shells. + @xref{Is This Shell Interactive?}, for a description of what makes + a shell interactive. + + @node Shell Commands + @section Shell Commands + @cindex commands, shell + @menu + * Simple Commands:: The most common type of command. + * Pipelines:: Connecting the input and output of several + commands. + * Lists:: How to execute commands sequentially. + * Looping Constructs:: Shell commands for iterative action. + * Conditional Constructs:: Shell commands for conditional execution. + * Command Grouping:: Ways to group commands. + @end menu @node Simple Commands ! @subsection Simple Commands @cindex commands, simple ! A simple command is the kind of command encountered most often. It's just a sequence of words separated by @code{blank}s, terminated ! by one of the shell's control operators (@pxref{Definitions}). The first word generally specifies a command to be executed. *************** *** 558,562 **** @node Pipelines ! @section Pipelines @cindex pipeline @cindex commands, pipelines --- 574,578 ---- @node Pipelines ! @subsection Pipelines @cindex pipeline @cindex commands, pipelines *************** *** 580,583 **** --- 596,601 ---- The reserved word @code{time} causes timing statistics to be printed for the pipeline once it finishes. + The statistics currently consist of elapsed (wall-clock) time and + user and system time consumed by the command's execution. The @samp{-p} option changes the output format to that specified by @sc{POSIX}. *************** *** 585,596 **** specifies how the timing information should be displayed. @xref{Bash Variables}, for a description of the available formats. ! Each command in a pipeline is executed in its own subshell. The exit status of a pipeline is the exit status of the last command in the pipeline. If the reserved word @samp{!} precedes the pipeline, the ! exit status is the logical @sc{NOT} of the exit status of the last command. @node Lists ! @section Lists of Commands @cindex commands, lists --- 603,621 ---- specifies how the timing information should be displayed. @xref{Bash Variables}, for a description of the available formats. + The use of @code{time} as a reserved word permits the timing of + shell builtins, shell functions, and pipelines. An external + @code{time} command cannot time these easily. + + If the pipeline is not executed asynchronously (@pxref{Lists}), the + shell waits for all commands in the pipeline to complete. ! Each command in a pipeline is executed in its own subshell ! (@pxref{Command Execution Environment}). The exit status of a pipeline is the exit status of the last command in the pipeline. If the reserved word @samp{!} precedes the pipeline, the ! exit status is the logical negation of the exit status of the last command. @node Lists ! @subsection Lists of Commands @cindex commands, lists *************** *** 605,613 **** If a command is terminated by the control operator @samp{&}, ! the shell executes the command in the @var{background} ! in a subshell. The shell does not wait for the command to ! finish, and the return status is 0 (true). Commands separated by a ! @samp{;} are executed sequentially; the shell waits for each ! command to terminate in turn. The return status is the exit status of the last command executed. --- 630,642 ---- If a command is terminated by the control operator @samp{&}, ! the shell executes the command asynchronously in a subshell. ! This is known as executing the command in the @var{background}. ! The shell does not wait for the command to finish, and the return ! status is 0 (true). ! The standard input for asynchronous commands, in the absence of any ! explicit redirections, is redirected from @code{/dev/null}. ! ! Commands separated by a @samp{;} are executed sequentially; the shell ! waits for each command to terminate in turn. The return status is the exit status of the last command executed. *************** *** 629,633 **** @noindent ! @var{command2} is executed if and only if @var{command} returns a non-zero exit status. --- 658,662 ---- @noindent ! @var{command2} is executed if, and only if, @var{command} returns a non-zero exit status. *************** *** 637,649 **** @node Looping Constructs ! @section Looping Constructs @cindex commands, looping - Note that wherever you see a @samp{;} in the description of a - command's syntax, it may be replaced indiscriminately with - one or more newlines. - Bash supports the following looping constructs. @table @code @item until --- 666,677 ---- @node Looping Constructs ! @subsection Looping Constructs @cindex commands, looping Bash supports the following looping constructs. + Note that wherever you see a @samp{;} in the description of a + command's syntax, it may be replaced with one or more newlines. + @table @code @item until *************** *** 655,660 **** until @var{test-commands}; do @var{consequent-commands}; done @end example ! Execute @var{consequent-commands} as long as the final command in @var{test-commands} has an exit status which is not zero. @item while --- 683,690 ---- until @var{test-commands}; do @var{consequent-commands}; done @end example ! Execute @var{consequent-commands} as long as @var{test-commands} has an exit status which is not zero. + The return status is the exit status of the last command executed + in @var{consequent-commands}, or zero if none was executed. @item while *************** *** 665,670 **** @end example ! Execute @var{consequent-commands} as long as the final command in @var{test-commands} has an exit status of zero. @item for --- 695,702 ---- @end example ! Execute @var{consequent-commands} as long as @var{test-commands} has an exit status of zero. + The return status is the exit status of the last command executed + in @var{consequent-commands}, or zero if none was executed. @item for *************** *** 675,682 **** for @var{name} [in @var{words} @dots{}]; do @var{commands}; done @end example ! Execute @var{commands} for each member in @var{words}, with @var{name} ! bound to the current member. If @samp{in @var{words}} is not ! present, @samp{in "$@@"} is assumed. ! @end table --- 707,716 ---- for @var{name} [in @var{words} @dots{}]; do @var{commands}; done @end example ! Expand @var{words}, and execute @var{commands} once for each member ! in the resultant list, with @var{name} bound to the current member. ! If @samp{in @var{words}} is not present, @samp{in "$@@"} is assumed. ! The return status is the exit status of the last command that executes. ! If there are no items in the expansion of @var{words}, no commands are ! executed, and the return status is zero. @end table *************** *** 685,689 **** @node Conditional Constructs ! @section Conditional Constructs @cindex commands, conditional --- 719,723 ---- @node Conditional Constructs ! @subsection Conditional Constructs @cindex commands, conditional *************** *** 706,718 **** @end example ! Execute @var{consequent-commands} only if the final command in ! @var{test-commands} has an exit status of zero. ! Otherwise, each @code{elif} list is executed in turn, ! and if its exit status is zero, the corresponding @var{more-consequents} is executed and the command completes. If @samp{else @var{alternate-consequents}} is present, and the final command in the final @code{if} or @code{elif} clause ! has a non-zero exit status, then execute @var{alternate-consequents}. @item case --- 740,754 ---- @end example ! The @var{test-commands} list is executed, and if its return status is zero, ! the @var{consequent-commands} list is executed. ! If @var{test-commands} returns a non-zero status, each @code{elif} list ! is executed in turn, and if its exit status is zero, the corresponding @var{more-consequents} is executed and the command completes. If @samp{else @var{alternate-consequents}} is present, and the final command in the final @code{if} or @code{elif} clause ! has a non-zero exit status, then @var{alternate-consequents} is executed. ! The return status is the exit status of the last command executed, or ! zero if no condition tested true. @item case *************** *** 723,731 **** @example ! @code{case @var{word} in [ ( @var{pattern} [| @var{pattern}]@dots{}) @var{commands} ;;]@dots{} esac} @end example ! Selectively execute @var{commands} based upon @var{word} matching ! @var{pattern}. The @samp{|} is used to separate multiple patterns. Here is an example using @code{case} in a script that could be used to --- 759,779 ---- @example ! @code{case @var{word} in [ [(] @var{pattern} [| @var{pattern}]@dots{}) @var{command-list} ;;]@dots{} esac} @end example ! @code{case} will selectively execute the @var{command-list} corresponding to ! the first @var{pattern} that matches @var{word}. ! The @samp{|} is used to separate multiple patterns, and the @samp{)} ! operator terminates a pattern list. ! A list of patterns and an associated command-list is known ! as a @var{clause}. Each clause must be terminated with @samp{;;}. ! The @var{word} undergoes tilde expansion, parameter expansion, command ! substitution, arithmetic expansion, and quote removal before matching is ! attempted. Each @var{pattern} undergoes tilde expansion, parameter ! expansion, command substitution, and arithmetic expansion. ! ! There may be an arbitrary number of @code{case} clauses, each terminated ! by a @samp{;;}. The first pattern that matches determines the ! command-list that is executed. Here is an example using @code{case} in a script that could be used to *************** *** 744,747 **** --- 792,839 ---- @end example + @noindent + The return status is zero if no @var{pattern} is matched. Otherwise, the + return status is the exit status of the @var{command-list} executed. + + @item select + @rwindex select + + The @code{select} construct allows the easy generation of menus. + It has almost the same syntax as the @code{for} command: + + @example + select @var{name} [in @var{words} @dots{}]; do @var{commands}; done + @end example + + The list of words following @code{in} is expanded, generating a list + of items. The set of expanded words is printed on the standard + error output stream, each preceded by a number. If the + @samp{in @var{words}} is omitted, the positional parameters are printed, + as if @samp{in "$@@"} had been specifed. + The @code{PS3} prompt is then displayed and a line is read from the + standard input. + If the line consists of a number corresponding to one of the displayed + words, then the value of @var{name} is set to that word. + If the line is empty, the words and prompt are displayed again. + If @code{EOF} is read, the @code{select} command completes. + Any other value read causes @var{name} to be set to null. + The line read is saved in the variable @code{REPLY}. + + The @var{commands} are executed after each selection until a + @code{break} or @code{return} command is executed, at which + point the @code{select} command completes. + + Here is an example that allows the user to pick a filename from the + current directory, and displays the name and index of the file + selected. + + @example + select fname in *; + do + echo you picked $fname \($REPLY\) + break; + done + @end example + @item ((@dots{})) @example *************** *** 749,754 **** @end example ! The @var{expression} is evaluated according to the rules described ! below (@pxref{Arithmetic Evaluation}). If the value of the expression is non-zero, the return status is 0; otherwise the return status is 1. This is exactly equivalent to --- 841,846 ---- @end example ! The arithmetic @var{expression} is evaluated according to the rules ! described below (@pxref{Shell Arithmetic}). If the value of the expression is non-zero, the return status is 0; otherwise the return status is 1. This is exactly equivalent to *************** *** 756,768 **** let "@var{expression}" @end example @end table ! The @code{select} construct, which allows users to choose from a list ! of items presented as a menu, is also available. ! @xref{Korn Shell Constructs}, for a full description of @code{select}. @node Command Grouping ! @section Grouping Commands @cindex commands, grouping --- 848,904 ---- let "@var{expression}" @end example + @noindent + @xref{Bash Builtins}, for a full description of the @code{let} builtin. + + @item [[@dots{}]] + @rwindex [[ + @rwindex ]] + @example + [[ @var{expression} ]] + @end example + + Return a status of 0 or 1 depending on the evaluation of + the conditional expression @var{expression}. + Expressions are composed of the primaries described below in + @ref{Bash Conditional Expressions}. + Word splitting and filename expansion are not performed on the words + between the @samp{[[} and @samp{]]}; tilde expansion, parameter and + variable expansion, arithmetic expansion, command substitution, process + substitution, and quote removal are performed. + + When the @samp{==} and @samp{!=} operators are used, the string to the + right of the operator is considered a pattern and matched according + to the rules described below in @ref{Pattern Matching}. + The return value is 0 if the string matches or does not match + the pattern, respectively, and 1 otherwise. + Any part of the pattern may be quoted to force it to be matched as a + string. + + Expressions may be combined using the following operators, listed + in decreasing order of precedence: + + @table @code + @item ( @var{expression} ) + Returns the value of @var{expression}. + This may be used to override the normal precedence of operators. + + @item ! @var{expression} + True if @var{expression} is false. + @item @var{expression1} && @var{expression2} + True if both @var{expression1} and @var{expression2} are true. + + @item @var{expression1} || @var{expression2} + True if either @var{expression1} or @var{expression2} is true. @end table + @noindent + The && and || commands do not execute @var{expression2} if the + value of @var{expression1} is sufficient to determine the return + value of the entire conditional expression. ! @end table @node Command Grouping ! @subsection Grouping Commands @cindex commands, grouping *************** *** 779,785 **** Placing a list of commands between parentheses causes a subshell ! to be created, and each of the commands to be executed in that ! subshell. Since the @var{list} is executed in a subshell, variable ! assignments do not remain in effect after the subshell completes. @item @{@} --- 915,921 ---- Placing a list of commands between parentheses causes a subshell ! to be created, and each of the commands in @var{list} to be executed ! in that subshell. Since the @var{list} is executed in a subshell, ! variable assignments do not remain in effect after the subshell completes. @item @{@} *************** *** 792,796 **** Placing a list of commands between curly braces causes the list to be executed in the current shell context. No subshell is created. ! The semicolon following @var{list} is required. @end table --- 928,932 ---- Placing a list of commands between curly braces causes the list to be executed in the current shell context. No subshell is created. ! The semicolon (or newline) following @var{list} is required. @end table *************** *** 822,828 **** This defines a shell function named @var{name}. The reserved ! word @code{function} is optional. The @var{body} of the ! function is the @var{command-list} between @{ and @}. This list ! is executed whenever @var{name} is specified as the name of a command. The exit status of a function is the exit status of the last command executed in the body. --- 958,966 ---- This defines a shell function named @var{name}. The reserved ! word @code{function} is optional. ! If the @code{function} reserved ! word is supplied, the parentheses are optional. ! The @var{body} of the function is the @var{command-list} between @{ and @}. ! This list is executed whenever @var{name} is specified as the name of a command. The exit status of a function is the exit status of the last command executed in the body. *************** *** 840,846 **** call. When a function completes, the values of the positional parameters and the special parameter @samp{#} ! are restored to the values they had prior to function execution. If a numeric argument is given to @code{return}, ! that is the function return status. Variables local to the function may be declared with the --- 978,986 ---- call. When a function completes, the values of the positional parameters and the special parameter @samp{#} ! are restored to the values they had prior to the function's execution. If a numeric argument is given to @code{return}, ! that is the function's return status; otherwise the functions's ! return status is the exit status of the last command executed ! before the @code{return}. Variables local to the function may be declared with the *************** *** 881,889 **** @var{value}s undergo tilde expansion, parameter and variable expansion, command substitution, arithmetic expansion, and quote ! removal (detailed below). If the variable has its @samp{-i} attribute ! set (see the description of the @code{declare} builtin in @ref{Bash Builtins}), then @var{value} is subject to arithmetic expansion even if the @code{$((@dots{}))} ! syntax does not appear (@pxref{Arithmetic Expansion}). Word splitting is not performed, with the exception of @code{"$@@"} as explained below. --- 1021,1029 ---- @var{value}s undergo tilde expansion, parameter and variable expansion, command substitution, arithmetic expansion, and quote ! removal (detailed below). If the variable has its @code{integer} ! attribute set (see the description of the @code{declare} builtin in @ref{Bash Builtins}), then @var{value} is subject to arithmetic expansion even if the @code{$((@dots{}))} ! expansion is not used (@pxref{Arithmetic Expansion}). Word splitting is not performed, with the exception of @code{"$@@"} as explained below. *************** *** 894,903 **** @cindex parameters, positional ! A @var{positional parameter} ! is a parameter denoted by one or more digits, other than the single digit @code{0}. Positional parameters are assigned from the shell's arguments when it is invoked, ! and may be reassigned using the @code{set} ! builtin command. Positional parameters may not be assigned to with assignment statements. The positional parameters are temporarily replaced when a shell function is executed --- 1034,1043 ---- @cindex parameters, positional ! A @var{positional parameter} is a parameter denoted by one or more digits, other than the single digit @code{0}. Positional parameters are assigned from the shell's arguments when it is invoked, ! and may be reassigned using the @code{set} builtin command. ! Positional parameter @code{N} may be referenced as @code{$@{N@}}. ! Positional parameters may not be assigned to with assignment statements. The positional parameters are temporarily replaced when a shell function is executed *************** *** 932,936 **** @item @@ Expands to the positional parameters, starting from one. When the ! expansion occurs within double quotes, each parameter expands as a separate word. That is, @code{"$@@"} is equivalent to @code{"$1" "$2" @dots{}}. --- 1072,1076 ---- @item @@ Expands to the positional parameters, starting from one. When the ! expansion occurs within double quotes, each parameter expands to a separate word. That is, @code{"$@@"} is equivalent to @code{"$1" "$2" @dots{}}. *************** *** 954,959 **** @item $ Expands to the process @sc{ID} of the shell. In a @code{()} subshell, it ! expands to the process @sc{ID} of the current shell, not the ! subshell. @item ! --- 1094,1098 ---- @item $ Expands to the process @sc{ID} of the shell. In a @code{()} subshell, it ! expands to the process @sc{ID} of the invoking shell, not the subshell. @item ! *************** *** 963,970 **** @item 0 Expands to the name of the shell or shell script. This is set at ! shell initialization. If Bash is invoked with a file of commands, ! @code{$0} is set to the name of that file. If Bash ! is started with the @samp{-c} option, then @code{$0} ! is set to the first argument after the string to be executed, if one is present. Otherwise, it is set to the filename used to invoke Bash, as given by argument zero. --- 1102,1109 ---- @item 0 Expands to the name of the shell or shell script. This is set at ! shell initialization. If Bash is invoked with a file of commands ! (@pxref{Shell Scripts}), @code{$0} is set to the name of that file. ! If Bash is started with the @samp{-c} option (@pxref{Invoking Bash}), ! then @code{$0} is set to the first argument after the string to be executed, if one is present. Otherwise, it is set to the filename used to invoke Bash, as given by argument zero. *************** *** 975,979 **** Subsequently, expands to the last argument to the previous command, after expansion. ! Also set to the full filename of each command executed and placed in the environment exported to that command. When checking mail, this parameter holds the name of the mail file. --- 1114,1118 ---- Subsequently, expands to the last argument to the previous command, after expansion. ! Also set to the full pathname of each command executed and placed in the environment exported to that command. When checking mail, this parameter holds the name of the mail file. *************** *** 997,1002 **** --- 1136,1144 ---- @menu + * Brace Expansion:: Expansion of expressions within braces. + * Tilde Expansion:: Expansion of the ~ character. * Shell Parameter Expansion:: How Bash expands variables to their values. * Command Substitution:: Using the output of a command as an argument. + * Arithmetic Expansion:: How to use arithmetic in shell expansions. * Process Substitution:: A way to write and read to and from a command. *************** *** 1008,1016 **** @end menu - Brace expansion, tilde expansion, and arithmetic expansion are described - in other sections. For brace expansion, see @ref{Brace Expansion}; for - tilde expansion, see @ref{Tilde Expansion}; and for arithmetic expansion, - see @ref{Arithmetic Expansion}. - The order of expansions is: brace expansion, tilde expansion, parameter, variable, and arithmetic expansion and --- 1150,1153 ---- *************** *** 1021,1025 **** On systems that can support it, there is an additional expansion available: @var{process substitution}. This is performed at the ! same time as parameter, variable, and arithemtic expansion and command substitution. --- 1158,1162 ---- On systems that can support it, there is an additional expansion available: @var{process substitution}. This is performed at the ! same time as parameter, variable, and arithmetic expansion and command substitution. *************** *** 1034,1037 **** --- 1171,1292 ---- is performed. + @node Brace Expansion + @subsection Brace Expansion + @cindex brace expansion + @cindex expansion, brace + + Brace expansion + is a mechanism by which arbitrary strings + may be generated. This mechanism is similar to + @var{filename expansion} (@pxref{Filename Expansion}), + but the file names generated + need not exist. Patterns to be brace expanded take + the form of an optional @var{preamble}, + followed by a series of comma-separated strings + between a pair of braces, followed by an optional @var{postscript}. + The preamble is prepended to each string contained + within the braces, and the postscript is then appended + to each resulting string, expanding left to right. + + Brace expansions may be nested. The results of each expanded + string are not sorted; left to right order is preserved. + For example, + @example + bash$ echo a@{d,c,b@}e + ade ace abe + @end example + + Brace expansion is performed before any other expansions, + and any characters special to other expansions are preserved + in the result. It is strictly textual. Bash + does not apply any syntactic interpretation to the context of the + expansion or the text between the braces. + + A correctly-formed brace expansion must contain unquoted opening + and closing braces, and at least one unquoted comma. + Any incorrectly formed brace expansion is left unchanged. + + This construct is typically used as shorthand when the common + prefix of the strings to be generated is longer than in the + above example: + @example + mkdir /usr/local/src/bash/@{old,new,dist,bugs@} + @end example + or + @example + chown root /usr/@{ucb/@{ex,edit@},lib/@{ex?.?*,how_ex@}@} + @end example + + @node Tilde Expansion + @subsection Tilde Expansion + @cindex tilde expansion + @cindex expansion, tilde + + If a word begins with an unquoted tilde character (@samp{~}), all of the + characters up to the first unquoted slash (or all characters, + if there is no unquoted slash) are considered a @var{tilde-prefix}. + If none of the characters in the tilde-prefix are quoted, the + characters in the tilde-prefix following the tilde are treated as a + possible @var{login name}. + If this login name is the null string, the tilde is replaced with the + value of the @code{HOME} shell variable. + If @code{HOME} is unset, the home directory of the user executing the + shell is substituted instead. + Otherwise, the tilde-prefix is replaced with the home directory + associated with the specified login name. + + If the tilde-prefix is @samp{~+}, the value of + the shell variable @code{PWD} replaces the tilde-prefix. + If the tilde-prefix is @samp{~-}, the value of the shell variable + @code{OLDPWD}, if it is set, is substituted. + + If the characters following the tilde in the tilde-prefix consist of a + number @var{N}, optionally prefixed by a @samp{+} or a @samp{-}, + the tilde-prefix is replaced with the + corresponding element from the directory stack, as it would be displayed + by the @code{dirs} builtin invoked with the characters following tilde + in the tilde-prefix as an argument (@pxref{The Directory Stack}). + If the tilde-prefix, sans the tilde, consists of a number without a + leading @samp{+} or @samp{-}, @samp{+} is assumed. + + If the login name is invalid, or the tilde expansion fails, the word is + left unchanged. + + Each variable assignment is checked for unquoted tilde-prefixes immediately + following a @samp{:} or @samp{=}. + In these cases, tilde expansion is also performed. + Consequently, one may use file names with tildes in assignments to + @code{PATH}, @code{MAILPATH}, and @code{CDPATH}, + and the shell assigns the expanded value. + + The following table shows how Bash treats unquoted tilde-prefixes: + + @table @code + @item ~ + The value of @code{$HOME} + @item ~/foo + @file{$HOME/foo} + + @item ~fred/foo + The subdirectory @code{foo} of the home directory of the user + @code{fred} + + @item ~+/foo + @file{$PWD/foo} + + @item ~-/foo + @file{$@{OLDPWD-'~-'@}/foo} + + @item ~@var{N} + The string that would be displayed by @samp{dirs +@var{N}} + + @item ~+@var{N} + The string that would be displayed by @samp{dirs +@var{N}} + + @item ~-@var{N} + The string that would be displayed by @samp{dirs -@var{N}} + + @end table + @node Shell Parameter Expansion @subsection Shell Parameter Expansion *************** *** 1046,1049 **** --- 1301,1309 ---- interpreted as part of the name. + When braces are used, the matching ending brace is the first @samp{@}} + not escaped by a backslash or within a quoted string, and not within an + embedded arithmetic expansion, command substitution, or parameter + expansion. + The basic form of parameter expansion is $@{@var{parameter}@}. The value of @var{parameter} is substituted. The braces are required *************** *** 1099,1107 **** @itemx $@{@var{parameter}:@var{offset}:@var{length}@} Expands to up to @var{length} characters of @var{parameter}, ! starting at @var{offset}. If @var{length} is omitted, expands to the substring of @var{parameter}, starting at the character specified by @var{offset}. @var{length} and @var{offset} are arithmetic expressions ! (@pxref{Arithmetic Evaluation}). This is referred to as Substring Expansion. --- 1359,1367 ---- @itemx $@{@var{parameter}:@var{offset}:@var{length}@} Expands to up to @var{length} characters of @var{parameter}, ! starting at the character specified by @var{offset}. If @var{length} is omitted, expands to the substring of @var{parameter}, starting at the character specified by @var{offset}. @var{length} and @var{offset} are arithmetic expressions ! (@pxref{Shell Arithmetic}). This is referred to as Substring Expansion. *************** *** 1113,1129 **** If @var{parameter} is an array name indexed by @samp{@@} or @samp{*}, the result is the @var{length} ! members of the array beginning with $@{@var{parameter}[@var{offset}]@}. ! Substring indexing is zero-based unless the positional parameters are ! used, in which case the indexing starts at 1. @item $@{#@var{parameter}@} ! The length in characters of the value of @var{parameter} is substituted. ! If @var{parameter} ! is @samp{*} or @samp{@@}, ! the length substituted is the number of positional parameters. ! If @var{parameter} ! is an array name subscripted ! by @samp{*} or @samp{@@}, ! the length substituted is the number of elements in the array. @item $@{@var{parameter}#@var{word}@} --- 1373,1387 ---- If @var{parameter} is an array name indexed by @samp{@@} or @samp{*}, the result is the @var{length} ! members of the array beginning with @code{$@{@var{parameter}[@var{offset}]@}}. ! Substring indexing is zero-based unless the positional parameters ! are used, in which case the indexing starts at 1. @item $@{#@var{parameter}@} ! The length in characters of the expanded value of @var{parameter} is ! substituted. ! If @var{parameter} is @samp{*} or @samp{@@}, the value substituted ! is the number of positional parameters. ! If @var{parameter} is an array name subscripted by @samp{*} or @samp{@@}, ! the value substituted is the number of elements in the array. @item $@{@var{parameter}#@var{word}@} *************** *** 1132,1137 **** is expanded to produce a pattern just as in filename expansion (@pxref{Filename Expansion}). If the pattern matches ! the beginning of the value of @var{parameter}, ! then the expansion is the value of @var{parameter} with the shortest matching pattern (the @samp{#} case) or the longest matching pattern (the @samp{##} case) deleted. --- 1390,1395 ---- is expanded to produce a pattern just as in filename expansion (@pxref{Filename Expansion}). If the pattern matches ! the beginning of the expanded value of @var{parameter}, ! then the result of the expansion is the expanded value of @var{parameter} with the shortest matching pattern (the @samp{#} case) or the longest matching pattern (the @samp{##} case) deleted. *************** *** 1148,1155 **** The @var{word} is expanded to produce a pattern just as in filename expansion. ! If the pattern matches a trailing portion of the value of ! @var{parameter}, then the expansion is the value of @var{parameter} ! with the shortest matching pattern (the @samp{%} case) or the ! longest matching pattern (the @samp{%%} case) deleted. If @var{parameter} is @samp{@@} or @samp{*}, the pattern removal operation is applied to each positional --- 1406,1413 ---- The @var{word} is expanded to produce a pattern just as in filename expansion. ! If the pattern matches a trailing portion of the expanded value of ! @var{parameter}, then the result of the expansion is the value of ! @var{parameter} with the shortest matching pattern (the @samp{%} case) ! or the longest matching pattern (the @samp{%%} case) deleted. If @var{parameter} is @samp{@@} or @samp{*}, the pattern removal operation is applied to each positional *************** *** 1205,1221 **** replacing the command substitution with the standard output of the command, with any trailing newlines deleted. When the old-style backquote form of substitution is used, backslash retains its literal meaning except when followed by ! @samp{$}, @samp{`}, or @samp{\}. When using the @code{$(@var{command})} form, all characters between the parentheses make up the command; none are treated specially. ! Command substitutions may be nested. To nest when using the old form, ! escape the inner backquotes with backslashes. If the substitution appears within double quotes, word splitting and filename expansion are not performed on the results. @node Process Substitution @subsection Process Substitution --- 1463,1508 ---- replacing the command substitution with the standard output of the command, with any trailing newlines deleted. + Embedded newlines are not deleted, but they may be removed during + word splitting. + The command substitution @code{$(cat @var{file})} can be + replaced by the equivalent but faster @code{$(< @var{file})}. When the old-style backquote form of substitution is used, backslash retains its literal meaning except when followed by ! @samp{$}, @samp{`}, or @samp{\}. ! The first backquote not preceded by a backslash terminates the ! command substitution. When using the @code{$(@var{command})} form, all characters between the parentheses make up the command; none are treated specially. ! Command substitutions may be nested. To nest when using the backquoted ! form, escape the inner backquotes with backslashes. If the substitution appears within double quotes, word splitting and filename expansion are not performed on the results. + @node Arithmetic Expansion + @subsection Arithmetic Expansion + @cindex expansion, arithmetic + @cindex arithmetic expansion + + Arithmetic expansion allows the evaluation of an arithmetic expression + and the substitution of the result. The format for arithmetic expansion is: + + @example + $(( @var{expression} )) + @end example + + The expression is treated as if it were within double quotes, but + a double quote inside the parentheses is not treated specially. + All tokens in the expression undergo parameter expansion, command + substitution, and quote removal. + Arithmetic substitutions may be nested. + + The evaluation is performed according to the rules listed below + (@pxref{Shell Arithmetic}). + If the expression is invalid, Bash prints a message indicating + failure to the standard error and no substitution occurs. + @node Process Substitution @subsection Process Substitution *************** *** 1242,1248 **** argument should be read to obtain the output of @var{list}. ! On systems that support it, process substitution is performed ! simultaneously with parameter and variable expansion, ! command substitution, and arithmetic expansion. @node Word Splitting --- 1529,1535 ---- argument should be read to obtain the output of @var{list}. ! When available, process substitution is performed simultaneously with ! parameter and variable expansion, command substitution, and arithmetic ! expansion. @node Word Splitting *************** *** 1283,1286 **** --- 1570,1576 ---- @node Filename Expansion @subsection Filename Expansion + @menu + * Pattern Matching:: How the shell matches patterns. + @end menu @cindex expansion, filename @cindex expansion, pathname *************** *** 1288,1296 **** @cindex pathname expansion ! After word splitting, ! unless the @samp{-f} ! option has been set (@pxref{The Set Builtin}), ! Bash scans each word for the characters ! @samp{*}, @samp{?}, and @samp{[}. If one of these characters appears, then the word is regarded as a @var{pattern}, --- 1578,1584 ---- @cindex pathname expansion ! After word splitting, unless the @samp{-f} option has been set ! (@pxref{The Set Builtin}), Bash scans each word for the characters ! @samp{*}, @samp{?}, @samp{(}, and @samp{[}. If one of these characters appears, then the word is regarded as a @var{pattern}, *************** *** 1298,1318 **** file names matching the pattern. If no matching file names are found, and the shell option @code{nullglob} is disabled, the word is left ! unchanged. If the option is set, and no matches are found, the word ! is removed. When a pattern is used for filename generation, ! the character @samp{.} at the start of a filename or immediately following a slash ! must be matched explicitly, unless the shell option @code{dotglob} ! is set. The slash character must always be matched explicitly. In other cases, the @samp{.} character is not treated specially. See the description of @code{shopt} in @ref{Bash Builtins}, ! for a description of the @code{nullglob} and @code{dotglob} options. The @code{GLOBIGNORE} shell variable may be used to restrict the set of filenames matching a ! @var{pattern}. If @code{GLOBIGNORE} is set, each matching filename that also matches one of the patterns in @code{GLOBIGNORE} is removed from the list of matches. The filenames @file{.} and @file{..} ! are always ignored, even when @code{GLOBIGNORE}. is set. However, setting @code{GLOBIGNORE} has the effect of enabling the @code{dotglob} --- 1586,1613 ---- file names matching the pattern. If no matching file names are found, and the shell option @code{nullglob} is disabled, the word is left ! unchanged. ! If the @code{nullglob} option is set, and no matches are found, the word ! is removed. ! If the shell option @code{nocaseglob} is enabled, the match is performed ! without regard to the case of alphabetic characters. ! ! When a pattern is used for filename generation, the character @samp{.} at the start of a filename or immediately following a slash ! must be matched explicitly, unless the shell option @code{dotglob} is set. ! When matching a file name, the slash character must always be ! matched explicitly. In other cases, the @samp{.} character is not treated specially. + See the description of @code{shopt} in @ref{Bash Builtins}, ! for a description of the @code{nocaseglob}, @code{nullglob}, ! and @code{dotglob} options. The @code{GLOBIGNORE} shell variable may be used to restrict the set of filenames matching a ! pattern. If @code{GLOBIGNORE} is set, each matching filename that also matches one of the patterns in @code{GLOBIGNORE} is removed from the list of matches. The filenames @file{.} and @file{..} ! are always ignored, even when @code{GLOBIGNORE} is set. However, setting @code{GLOBIGNORE} has the effect of enabling the @code{dotglob} *************** *** 1324,1327 **** --- 1619,1632 ---- is unset. + @node Pattern Matching + @subsubsection Pattern Matching + @cindex pattern matching + @cindex matching, pattern + + Any character that appears in a pattern, other than the special pattern + characters described below, matches itself. The NUL character may not + occur in a pattern. The special pattern characters must be quoted if + they are to be matched literally. + The special pattern characters have the following meanings: @table @code *************** *** 1340,1343 **** --- 1645,1691 ---- in the set. A @samp{]} may be matched by including it as the first character in the set. + + Within @samp{[} and @samp{]}, @var{character classes} can be specified + using the syntax + @code{[:}@var{class}@code{:]}, where @var{class} is one of the + following classes defined in the @sc{POSIX.2} standard: + @example + alnum alpha ascii blank cntrl digit graph lower + print punct space upper xdigit + @end example + @noindent + A character class matches any character belonging to that class. + + Within @samp{[} and @samp{]}, an @var{equivalence class} can be + specified using the syntax @code{[=}@var{c}@code{=]}, which + matches all characters with the same collation weight (as defined + by the current locale) as the character @var{c}. + + Within @samp{[} and @samp{]}, the syntax @code{[.}@var{symbol}@code{.]} + matches the collating symbol @var{symbol}. + @end table + + If the @code{extglob} shell option is enabled using the @code{shopt} + builtin, several extended pattern matching operators are recognized. + In the following description, a @var{pattern-list} is a list of one + or more patterns separated by a @samp{|}. + Composite patterns may be formed using one or more of the following + sub-patterns: + + @table @code + @item ?(@var{pattern-list}) + Matches zero or one occurrence of the given patterns. + + @item *(@var{pattern-list}) + Matches zero or more occurrences of the given patterns. + + @item +(@var{pattern-list}) + Matches one or more occurrences of the given patterns. + + @item @@(@var{pattern-list}) + Matches exactly one of the given patterns. + + @item !(@var{pattern-list}) + Matches anything except one of the given patterns. @end table *************** *** 1370,1378 **** descriptor 1). ! The word that follows the redirection operator in the following ! descriptions is subjected to brace expansion, tilde expansion, ! parameter expansion, command substitution, arithmetic expansion, ! quote removal, and filename expansion. If it expands to more ! than one word, Bash reports an error. Note that the order of redirections is significant. For example, --- 1718,1726 ---- descriptor 1). ! The word following the redirection operator in the following ! descriptions, unless otherwise noted, is subjected to brace expansion, ! tilde expansion, parameter expansion, command substitution, arithmetic ! expansion, quote removal, and filename expansion. ! If it expands to more than one word, Bash reports an error. Note that the order of redirections is significant. For example, *************** *** 1392,1395 **** --- 1740,1745 ---- before the standard output was redirected to @var{dirlist}. + A failure to open or create a file causes the redirection to fail. + @subsection Redirecting Input Redirection of input causes the file whose name results from *************** *** 1417,1427 **** @end example ! If the redirection operator is @samp{>}, and the @samp{-C} option to the ! @code{set} builtin has been enabled, the redirection will fail if the ! filename whose name results from the expansion of @var{word} exists. ! If the redirection operator is @samp{>|}, ! then the value of the @samp{-C} option to the @code{set} ! builtin command is not tested, and the redirection is attempted even ! if the file named by @var{word} exists. @subsection Appending Redirected Output --- 1767,1777 ---- @end example ! If the redirection operator is @samp{>}, and the @code{noclobber} ! option to the @code{set} builtin has been enabled, the redirection ! will fail if the filename whose name results from the expansion of ! @var{word} exists and is a regular file. ! If the redirection operator is @samp{>|}, or the redirection operator is ! @samp{>} and the @code{noclobber} option is not enabled, the redirection ! is attempted even if the file named by @var{word} exists. @subsection Appending Redirected Output *************** *** 1480,1484 **** @var{word}. If any characters in @var{word} are quoted, the @var{delimiter} is the result of quote removal on @var{word}, ! and the lines in the here-document are not expanded. Otherwise, all lines of the here-document are subjected to parameter expansion, command substitution, and arithmetic expansion. In the latter --- 1830,1835 ---- @var{word}. If any characters in @var{word} are quoted, the @var{delimiter} is the result of quote removal on @var{word}, ! and the lines in the here-document are not expanded. ! If @var{word} is unquoted, all lines of the here-document are subjected to parameter expansion, command substitution, and arithmetic expansion. In the latter *************** *** 1502,1506 **** If @var{word} expands to one or more digits, the file descriptor denoted by @code{n} ! is made to be a copy of that file descriptor. If @var{word} evaluates to @samp{-}, file descriptor @code{n} is closed. If @code{n} is not specified, the standard input (file descriptor 0) is used. --- 1853,1860 ---- If @var{word} expands to one or more digits, the file descriptor denoted by @code{n} ! is made to be a copy of that file descriptor. ! If the digits in @var{word} do not specify a file descriptor open for ! input, a redirection error occurs. ! If @var{word} evaluates to @samp{-}, file descriptor @code{n} is closed. If @code{n} is not specified, the standard input (file descriptor 0) is used. *************** *** 1514,1517 **** --- 1868,1873 ---- @code{n} is not specified, the standard output (file descriptor 1) is used. + If the digits in @var{word} do not specify a file descriptor open for + output, a redirection error occurs. As a special case, if @code{n} is omitted, and @var{word} does not expand to one or more digits, the standard output and standard *************** *** 1533,1538 **** --- 1889,1901 ---- @menu + * Simple Command Expansion:: How Bash expands simple commands before + executing them. + * Command Search and Execution:: How Bash finds commands and runs them. + * Command Execution Environment:: The environment in which Bash + executes commands that are not + shell builtins. + * Environment:: The environment given to a command. *************** *** 1542,1547 **** --- 1905,1956 ---- * Signals:: What happens when Bash or a command it runs receives a signal. + @end menu + @node Simple Command Expansion + @subsection Simple Command Expansion + @cindex command expansion + + When a simple command is executed, the shell performs the following + expansions, assignments, and redirections, from left to right. + + @enumerate + @item + The words that the parser has marked as variable assignments (those + preceding the command name) and redirections are saved for later + processing. + + @item + The words that are not variable assignments or redirections are + expanded (@pxref{Shell Expansions}). + If any words remain after expansion, the first word + is taken to be the name of the command and the remaining words are + the arguments. + + @item + Redirections are performed as described above (@pxref{Redirections}). + + @item + The text after the @samp{=} in each variable assignment undergoes tilde + expansion, parameter expansion, command substitution, arithmetic expansion, + and quote removal before being assigned to the variable. + @end enumerate + + If no command name results, the variable assignments affect the current + shell environment. Otherwise, the variables are added to the environment + of the executed command and do not affect the current shell environment. + If any of the assignments attempts to assign a value to a readonly variable, + an error occurs, and the command exits with a non-zero status. + + If no command name results, redirections are performed, but do not + affect the current shell environment. A redirection error causes the + command to exit with a non-zero status. + + If there is a command name left after expansion, execution proceeds as + described below. Otherwise, the command exits. If one of the expansions + contained a command substitution, the exit status of the command is + the exit status of the last command substitution performed. If there + were no command substitutions, the command exits with a status of zero. + @node Command Search and Execution @subsection Command Search and Execution *************** *** 1569,1583 **** @code{$PATH} for a directory containing an executable file by that name. Bash uses a hash table to remember the full ! filenames of executable files (see the description of ! @code{hash} in @ref{Bourne Shell Builtins}) to avoid multiple ! @code{PATH} searches. A full search of the directories in @code{$PATH} is performed only if the command is not found in the hash table. If the search is unsuccessful, the shell prints an error ! message and returns a nonzero exit status. @item If the search is successful, or if the command name contains ! one or more slashes, the shell executes the named program. Argument 0 is set to the name given, and the remaining arguments to the command are set to the arguments supplied, if any. --- 1978,1992 ---- @code{$PATH} for a directory containing an executable file by that name. Bash uses a hash table to remember the full ! pathnames of executable files to avoid multiple @code{PATH} searches ! (see the description of @code{hash} in @ref{Bourne Shell Builtins}). A full search of the directories in @code{$PATH} is performed only if the command is not found in the hash table. If the search is unsuccessful, the shell prints an error ! message and returns an exit status of 127. @item If the search is successful, or if the command name contains ! one or more slashes, the shell executes the named program in ! a separate execution environment. Argument 0 is set to the name given, and the remaining arguments to the command are set to the arguments supplied, if any. *************** *** 1585,1592 **** @item If this execution fails because the file is not in executable ! format, and the file is not a directory, it is assumed to be ! @var{shell script} (@pxref{Shell Scripts}). @end enumerate @node Environment @subsection Environment --- 1994,2093 ---- @item If this execution fails because the file is not in executable ! format, and the file is not a directory, it is assumed to be a ! @var{shell script} and the shell executes it as described in ! @ref{Shell Scripts}. ! ! @item ! If the command was not begun asynchronously, the shell waits for ! the command to complete and collects its exit status. ! @end enumerate + @node Command Execution Environment + @subsection Command Execution Environment + @cindex execution environment + + The shell has an @var{execution environment}, which consists of the + following: + + @itemize @bullet + @item + open files inherited by the shell at invocation, as modified by + redirections supplied to the @code{exec} builtin + + @item + the current working directory as set by @code{cd}, @code{pushd}, or + @code{popd}, or inherited by the shell at invocation + + @item + the file creation mode mask as set by @code{umask} or inherited from + the shell's parent + + @item + current traps set by @code{trap} + + @item + shell parameters that are set by variable assignment or with @code{set} + or inherited from the shell's parent in the environment + + @item + shell functions defined during execution or inherited from the shell's + parent in the environment + + @item + options enabled at invocation (either by default or with command-line + arguments) or by @code{set} + + @item + options enabled by @code{shopt} + + @item + shell aliases defined with @code{alias} (@pxref{Aliases}) + + @item + various process IDs, including those of background jobs + (@pxref{Lists}), the value of @code{$$}, and the value of + @code{$PPID} + + @end itemize + + When a simple command other than a builtin or shell function + is to be executed, it + is invoked in a separate execution environment that consists of + the following. Unless otherwise noted, the values are inherited + from the shell. + + @itemize @bullet + @item + the shell's open files, plus any modifications and additions specified + by redirections to the command + + @item + the current working directory + + @item + the file creation mode mask + + @item + shell variables marked for export, along with variables exported for + the command, passed in the environment (@pxref{Environment}) + + @item + traps caught by the shell are reset to the values inherited from the + shell's parent, and traps ignored by the shell are ignored + + @end itemize + + A command invoked in this separate environment cannot affect the + shell's execution environment. + + Command substitution and asynchronous commands are invoked in a + subshell environment that is a duplicate of the shell environment, + except that traps caught by the shell are reset to the values + that the shell inherited from its parent at invocation. Builtin + commands that are invoked as part of a pipeline are also executed + in a subshell environment. Changes made to the subshell environment + cannot affect the shell's execution environment. + @node Environment @subsection Environment *************** *** 1609,1614 **** inherited by any executed command consists of the shell's initial environment, whose values may be modified in the shell, ! less any pairs removed by the @code{unset} command, plus any ! additions via the @code{export} and @samp{declare -x} commands. The environment for any simple command --- 2110,2116 ---- inherited by any executed command consists of the shell's initial environment, whose values may be modified in the shell, ! less any pairs removed by the @code{unset} and @samp{export -n} ! commands, plus any additions via the @code{export} and ! @samp{declare -x} commands. The environment for any simple command *************** *** 1618,1622 **** by that command. ! If the @samp{-k} flag is set (@pxref{The Set Builtin}, then all parameter assignments are placed in the environment for a command, not just those that precede the command name. --- 2120,2124 ---- by that command. ! If the @samp{-k} option is set (@pxref{The Set Builtin}), then all parameter assignments are placed in the environment for a command, not just those that precede the command name. *************** *** 1630,1634 **** @cindex exit status ! For the purposes of the shell, a command which exits with a zero exit status has succeeded. A non-zero exit status indicates failure. --- 2132,2136 ---- @cindex exit status ! For the shell's purposes, a command which exits with a zero exit status has succeeded. A non-zero exit status indicates failure. *************** *** 1643,1646 **** --- 2145,2151 ---- but is not executable, the return status is 126. + If a command fails because of an error during expansion or redirection, + the exit status is greater than zero. + The exit status is used by the Bash conditional commands (@pxref{Conditional Constructs}) and some of the list *************** *** 1650,1653 **** --- 2155,2159 ---- and a non-zero status on failure, so they may be used by the conditional and list constructs. + All builtins return an exit status of 2 to indicate incorrect usage. @node Signals *************** *** 1655,1659 **** @cindex signal handling ! When Bash is interactive, it ignores @code{SIGTERM} (so that @samp{kill 0} does not kill an interactive shell), and @code{SIGINT} --- 2161,2165 ---- @cindex signal handling ! When Bash is interactive, in the absence of any traps, it ignores @code{SIGTERM} (so that @samp{kill 0} does not kill an interactive shell), and @code{SIGINT} *************** *** 1664,1682 **** ignores @code{SIGTTIN}, @code{SIGTTOU}, and @code{SIGTSTP}. ! Synchronous jobs started by Bash have signals set to the ! values inherited by the shell from its parent. When job control ! is not in effect, background jobs (commands terminated with @samp{&}) ! ignore @code{SIGINT} and @code{SIGQUIT}. ! Commands run as a result of command substitution ignore the ! keyboard-generated job control signals @code{SIGTTIN}, @code{SIGTTOU}, and @code{SIGTSTP}. The shell exits by default upon receipt of a @code{SIGHUP}. ! Before exiting, it resends the @code{SIGHUP} ! to all jobs, running or stopped. To prevent the shell from ! sending the @code{SIGHUP} signal to a particular job, remove it ! from the jobs table with the @code{disown} builtin ! (@pxref{Job Control Builtins}) ! or use @code{disown -h} to mark it to not receive @code{SIGHUP}. @node Shell Scripts --- 2170,2204 ---- ignores @code{SIGTTIN}, @code{SIGTTOU}, and @code{SIGTSTP}. ! Commands started by Bash have signal handlers set to the ! values inherited by the shell from its parent. ! When job control is not in effect, asynchronous commands ! ignore @code{SIGINT} and @code{SIGQUIT} as well. ! Commands run as a result of ! command substitution ignore the keyboard-generated job control signals @code{SIGTTIN}, @code{SIGTTOU}, and @code{SIGTSTP}. The shell exits by default upon receipt of a @code{SIGHUP}. ! Before exiting, it resends the @code{SIGHUP} to all jobs, running ! or stopped. ! Stopped jobs are sent @code{SIGCONT} to ensure that they receive ! the @code{SIGHUP}. ! To prevent the shell from sending the @code{SIGHUP} signal to a ! particular job, it should be removed ! from the jobs table with the @code{disown} ! builtin (@pxref{Job Control Builtins}) or marked ! to not receive @code{SIGHUP} using @code{disown -h}. ! ! If the @code{huponexit} shell option has been set with @code{shopt} ! (@pxref{Bash Builtins}), Bash sends a @code{SIGHUP} to all jobs when ! an interactive login shell exits. ! ! When Bash receives a signal for which a trap has been set while waiting ! for a command to complete, the trap will not be executed until the ! command completes. ! When Bash is waiting for an asynchronous ! command via the @code{wait} builtin, the reception of a signal for ! which a trap has been set will cause the @code{wait} builtin to return ! immediately with an exit status greater than 128, immediately after ! which the trap is executed. @node Shell Scripts *************** *** 1712,1716 **** if @code{filename} is an executable shell script. This subshell reinitializes itself, so that the effect is as if a ! new shell had been invoked to interpret the script. Most versions of Unix make this a part of the kernel's command --- 2234,2241 ---- if @code{filename} is an executable shell script. This subshell reinitializes itself, so that the effect is as if a ! new shell had been invoked to interpret the script, with the ! exception that the locations of commands remembered by the parent ! (see the description of @code{hash} in @ref{Bourne Shell Builtins}) ! are retained by the child. Most versions of Unix make this a part of the kernel's command *************** *** 1738,1744 **** This section briefly summarizes things which Bash inherits from ! the Bourne Shell: builtins, variables, ! and other features. It also lists the significant differences ! between Bash and the Bourne Shell. @node Bourne Shell Builtins --- 2263,2269 ---- This section briefly summarizes things which Bash inherits from ! the Bourne Shell: builtins, variables, and other features. ! It also lists the significant differences between Bash and the Bourne Shell. ! Many of the builtins have been extended by @sc{POSIX} or Bash. @node Bourne Shell Builtins *************** *** 1756,1759 **** --- 2281,2285 ---- @end example Do nothing beyond expanding @var{arguments} and performing redirections. + The return status is zero. @item . *************** *** 1763,1767 **** @end example Read and execute commands from the @var{filename} argument in the ! current shell context. @item break --- 2289,2299 ---- @end example Read and execute commands from the @var{filename} argument in the ! current shell context. If @var{filename} does not contain a slash, ! the @code{$PATH} variable is used to find ! @var{filename}. The current directory is searched if @var{filename} ! is not found in @code{$PATH}. ! The return status is the exit status of the last command executed, or ! zero if no commands are executed. If @var{filename} is not found, or ! cannot be read, the return status is non-zero. @item break *************** *** 1772,1775 **** --- 2304,2309 ---- Exit from a @code{for}, @code{while}, @code{until}, or @code{select} loop. If @var{n} is supplied, the @var{n}th enclosing loop is exited. + @var{n} must be greater than or equal to 1. + The return status is zero unless @var{n} is not greater than or equal to 1. @item cd *************** *** 1783,1788 **** @var{directory} begins with a slash, @code{CDPATH} is not used. The @samp{-P} option means ! to not follow symbolic links; symlinks are followed by default or with the ! @samp{-L} option. @item continue --- 2317,2325 ---- @var{directory} begins with a slash, @code{CDPATH} is not used. The @samp{-P} option means ! to not follow symbolic links; symbolic links are followed by default ! or with the @samp{-L} option. ! If @var{directory} is @samp{-}, it is equivalent to @code{$OLDPWD}. ! The return status is zero if the directory is successfully changed, ! non-zero otherwise. @item continue *************** *** 1793,1798 **** Resume the next iteration of an enclosing @code{for}, @code{while}, @code{until}, or @code{select} loop. ! If @var{n} is supplied, the execution of the ! @var{n}th enclosing loop is resumed. @item eval --- 2330,2337 ---- Resume the next iteration of an enclosing @code{for}, @code{while}, @code{until}, or @code{select} loop. ! If @var{n} is supplied, the execution of the @var{n}th enclosing loop ! is resumed. ! @var{n} must be greater than or equal to 1. ! The return status is zero unless @var{n} is not greater than or equal to 1. @item eval *************** *** 1801,1823 **** eval [@var{arguments}] @end example ! The arguments are concatenated together into a single ! command, which is then read and executed. @item exec @btindex exec @example ! exec [-cl] [-a @var{name}] [@var{command}] [@var{arguments}] @end example If @var{command} ! is supplied, it replaces the shell. ! If the @samp{-l} option is supplied, ! the shell places a dash in the zeroth arg passed to @var{command}. This is what the @code{login} program does. ! The @samp{-c} option causes @var{command} ! to be executed with an empty environment. ! If @samp{-a} is supplied, the shell passes @var{name} ! as the zeroth argument to @var{command}. If no @var{command} is specified, redirections may be used to affect ! the current shell environment. @item exit --- 2340,2366 ---- eval [@var{arguments}] @end example ! The arguments are concatenated together into a single command, which is ! then read and executed, and its exit status returned as the exit status ! of @code{eval}. ! If there are no arguments or only empty arguments, the return status is ! zero. @item exec @btindex exec @example ! exec [-cl] [-a @var{name}] [@var{command} [@var{arguments}]] @end example If @var{command} ! is supplied, it replaces the shell without creating a new process. ! If the @samp{-l} option is supplied, the shell places a dash in the ! zeroth arg passed to @var{command}. This is what the @code{login} program does. ! The @samp{-c} option causes @var{command} to be executed with an empty ! environment. ! If @samp{-a} is supplied, the shell passes @var{name} as the zeroth ! argument to @var{command}. If no @var{command} is specified, redirections may be used to affect ! the current shell environment. If there are no redirection errors, the ! return status is zero; otherwise the return status is non-zero. @item exit *************** *** 1827,1830 **** --- 2370,2374 ---- @end example Exit the shell, returning a status of @var{n} to the shell's parent. + Any trap on @code{EXIT} is executed before the shell terminates. @item export *************** *** 1835,1842 **** Mark each @var{name} to be passed to child processes in the environment. If the @samp{-f} option is supplied, the @var{name}s ! refer to shell functions. The @samp{-n} option means to no longer mark ! each @var{name} for export. If no @var{names} are supplied, or if the @samp{-p} option is given, a list of exported names is displayed. @item getopts --- 2379,2390 ---- Mark each @var{name} to be passed to child processes in the environment. If the @samp{-f} option is supplied, the @var{name}s ! refer to shell functions; otherwise the names refer to shell variables. ! The @samp{-n} option means to no longer mark each @var{name} for export. If no @var{names} are supplied, or if the @samp{-p} option is given, a list of exported names is displayed. + The @samp{-p} option displays output in a form that may be reused as input. + The return status is zero unless an invalid option is supplied, one of + the names is not a valid shell variable name, or @samp{-f} is supplied + with a name that is not a shell function. @item getopts *************** *** 1853,1876 **** @var{name} if it does not exist, and the index of the next argument to be processed into the ! variable @code{OPTIND}. @code{OPTIND} ! is initialized to 1 each time the shell or a shell script ! is invoked. When an option requires an argument, @code{getopts} places that argument into the variable @code{OPTARG}. ! The shell does not reset @code{OPTIND} ! automatically; it must be manually reset between multiple ! calls to @code{getopts} ! within the same shell invocation if a new set of parameters ! is to be used. @code{getopts} can report errors in two ways. If the first character of @var{optstring} is a colon, @var{silent} error reporting is used. In normal operation diagnostic messages ! are printed when illegal options or missing option arguments are encountered. If the variable @code{OPTERR} ! is set to 0, no error message will be displayed, even if the first character of @code{optstring} is not a colon. ! If an illegal option is seen, @code{getopts} places @samp{?} into @var{name} and, if not silent, prints an error message and unsets @code{OPTARG}. --- 2401,2432 ---- @var{name} if it does not exist, and the index of the next argument to be processed into the ! variable @code{OPTIND}. ! @code{OPTIND} is initialized to 1 each time the shell or a shell script ! is invoked. ! When an option requires an argument, @code{getopts} places that argument into the variable @code{OPTARG}. ! The shell does not reset @code{OPTIND} automatically; it must be manually ! reset between multiple calls to @code{getopts} within the same shell ! invocation if a new set of parameters is to be used. ! ! When the end of options is encountered, @code{getopts} exits with a ! return value greater than zero. ! @code{OPTIND} is set to the index of the first non-option argument, ! and @code{name} is set to @samp{?}. ! ! @code{getopts} ! normally parses the positional parameters, but if more arguments are ! given in @var{args}, @code{getopts} parses those instead. @code{getopts} can report errors in two ways. If the first character of @var{optstring} is a colon, @var{silent} error reporting is used. In normal operation diagnostic messages ! are printed when invalid options or missing option arguments are encountered. If the variable @code{OPTERR} ! is set to 0, no error messages will be displayed, even if the first character of @code{optstring} is not a colon. ! If an invalid option is seen, @code{getopts} places @samp{?} into @var{name} and, if not silent, prints an error message and unsets @code{OPTARG}. *************** *** 1884,1891 **** @var{name} and @code{OPTARG} is set to the option character found. - @code{getopts} - normally parses the positional parameters, but if more arguments are - given in @var{args}, @code{getopts} parses those instead. - @item hash @btindex hash --- 2440,2443 ---- *************** *** 1893,1904 **** hash [-r] [-p @var{filename}] [@var{name}] @end example ! Remember the full filenames of commands specified as arguments, ! so they need not be searched for on subsequent invocations. The ! commands are found by searching through the directories listed in ! @code{$PATH}. The @samp{-p} option inhibits the path search, and ! @var{filename} is used as the location of @var{name}. ! The @samp{-r} option causes the shell to forget ! all remembered locations. If no arguments are given, information ! about remembered commands is printed. @item pwd --- 2445,2458 ---- hash [-r] [-p @var{filename}] [@var{name}] @end example ! Remember the full pathnames of commands specified as @var{name} arguments, ! so they need not be searched for on subsequent invocations. ! The commands are found by searching through the directories listed in ! @code{$PATH}. ! The @samp{-p} option inhibits the path search, and @var{filename} is ! used as the location of @var{name}. ! The @samp{-r} option causes the shell to forget all remembered locations. ! If no arguments are given, information about remembered commands is printed. ! The return status is zero unless a @var{name} is not found or an invalid ! option is supplied. @item pwd *************** *** 1907,1913 **** pwd [-LP] @end example ! Print the current working directory. If the @samp{-P} option is supplied, ! the path printed will not contain symbolic links. If the @samp{-L} option ! is supplied, the path printed may contain symbolic links. @item readonly --- 2461,2472 ---- pwd [-LP] @end example ! Print the current working directory. ! If the @samp{-P} option is supplied, the path printed will not ! contain symbolic links. ! If the @samp{-L} option is supplied, the path printed may contain ! symbolic links. ! The return status is zero unless an error is encountered while ! determining the name of the current directory or an invalid option ! is supplied. @item readonly *************** *** 1916,1925 **** readonly [-apf] [@var{name}] @dots{} @end example ! Mark each @var{name} as unchangable. The values of these names may not ! be changed by subsequent assignment. If the @samp{-f} option is supplied, ! each @var{name} refers to a shell function. The @samp{-a} option means ! each @var{name} refers to an array variable. If no @var{name} arguments are given, or if the @samp{-p} option is supplied, a list of all readonly names is printed. @item return --- 2475,2490 ---- readonly [-apf] [@var{name}] @dots{} @end example ! Mark each @var{name} as readonly. ! The values of these names may not be changed by subsequent assignment. ! If the @samp{-f} option is supplied, each @var{name} refers to a shell ! function. ! The @samp{-a} option means each @var{name} refers to an array variable. If no @var{name} arguments are given, or if the @samp{-p} option is supplied, a list of all readonly names is printed. + The @samp{-p} option causes output to be displayed in a format that + may be reused as input. + The return status is zero unless an invalid option is supplied, one of + the @var{name} arguments is not a valid shell variable or function name, + or the @samp{-f} option is supplied with a name that is not a shell function. @item return *************** *** 1928,1934 **** return [@var{n}] @end example ! Cause a shell function to exit with value @var{n}. This may also be used ! to terminate execution of a script being executed with the @code{.} ! builtin. @item shift --- 2493,2503 ---- return [@var{n}] @end example ! Cause a shell function to exit with the return value @var{n}. ! This may also be used to terminate execution of a script being executed ! with the @code{.} builtin, returning either @var{n} or the exit status ! of the last command executed within the script as the exit status of the ! script. ! The return status is false if @code{return} is used outside a function ! and not during the execution of a script by @samp{.}. @item shift *************** *** 1937,1947 **** shift [@var{n}] @end example ! Shift positional parameters to the left by @var{n}. ! The positional parameters from @var{n}+1 @dots{} ! are renamed to ! @code{$1} @dots{} . ! Parameters represented by the numbers ! @code{$#} to @var{n}+1 are unset. @var{n} ! must be a non-negative number less than or equal to @code{$#}. @item test --- 2506,2518 ---- shift [@var{n}] @end example ! Shift the positional parameters to the left by @var{n}. ! The positional parameters from @var{n}+1 @dots{} @code{$#} are ! renamed to @code{$1} @dots{} @code{$#}-@var{n}+1. ! Parameters represented by the numbers @code{$#} to @var{n}+1 are unset. ! @var{n} must be a non-negative number less than or equal to @code{$#}. ! If @var{n} is zero or greater than @code{$#}, the positional parameters ! are not changed. ! The return status is zero unless @var{n} is greater than @code{$#} or ! less than zero, non-zero otherwise. @item test *************** *** 1949,1960 **** @btindex test @btindex [ ! Evaluate a conditional expression (@pxref{Bash Conditional Expressions}). ! @item times ! @btindex times ! @example times @end example Print out the user and system times used by the shell and its children. @item trap --- 2520,2597 ---- @btindex test @btindex [ ! Evaluate a conditional expression @var{expr}. ! Each operator and operand must be a separate argument. ! Expressions are composed of the primaries described below in ! @ref{Bash Conditional Expressions}. ! Expressions may be combined using the following operators, listed in ! decreasing order of precedence. ! ! @table @code ! @item ! @var{expr} ! True if @var{expr} is false. ! ! @item ( @var{expr} ) ! Returns the value of @var{expr}. ! This may be used to override the normal precedence of operators. ! ! @item @var{expr1} -a @var{expr2} ! True if both @var{expr1} and @var{expr2} are true. ! ! @item @var{expr1} -o @var{expr2} ! True if either @var{expr1} or @var{expr2} is true. ! @end table ! ! The @code{test} and @code{[} builtins evaluate conditional ! expressions using a set of rules based on the number of arguments. ! ! @table @asis ! @item 0 arguments ! The expression is false. ! ! @item 1 argument ! The expression is true if and only if the argument is not null. ! ! @item 2 arguments ! If the first argument is @samp{!}, the expression is true if and ! only if the second argument is null. ! If the first argument is one of the unary conditional operators ! (@pxref{Bash Conditional Expressions}), the expression ! is true if the unary test is true. ! If the first argument is not a valid unary operator, the expression is ! false. ! ! @item 3 arguments ! If the second argument is one of the binary conditional ! operators (@pxref{Bash Conditional Expressions}), the ! result of the expression is the result of the binary test using the ! first and third arguments as operands. ! If the first argument is @samp{!}, the value is the negation of ! the two-argument test using the second and third arguments. ! If the first argument is exactly @samp{(} and the third argument is ! exactly @samp{)}, the result is the one-argument test of the second ! argument. ! Otherwise, the expression is false. ! The @samp{-a} and @samp{-o} operators are considered binary operators ! in this case. ! ! @item 4 arguments ! If the first argument is @samp{!}, the result is the negation of ! the three-argument expression composed of the remaining arguments. ! Otherwise, the expression is parsed and evaluated according to ! precedence using the rules listed above. ! ! @item 5 or more arguments ! The expression is parsed and evaluated according to precedence ! using the rules listed above. ! @end table ! ! @item times ! @btindex times ! @example times @end example Print out the user and system times used by the shell and its children. + The return status is zero. @item trap *************** *** 1972,1976 **** associated with each @var{sigspec}. If no arguments are supplied, or only @samp{-p} is given, @code{trap} prints the list of commands ! associated with each signal number. Each @var{sigspec} is either a signal name such as @code{SIGINT} (with or without the @code{SIG} prefix) or a signal number. --- 2609,2614 ---- associated with each @var{sigspec}. If no arguments are supplied, or only @samp{-p} is given, @code{trap} prints the list of commands ! associated with each signal number in a form that may be reused as ! shell input. Each @var{sigspec} is either a signal name such as @code{SIGINT} (with or without the @code{SIG} prefix) or a signal number. *************** *** 1986,1993 **** process when it is created. @item umask @btindex umask @example ! umask [-S] [@var{mode}] @end example Set the shell process's file creation mask to @var{mode}. If --- 2624,2634 ---- process when it is created. + The return status is zero unless a @var{sigspec} does not specify a + valid signal. + @item umask @btindex umask @example ! umask [-p] [-S] [@var{mode}] @end example Set the shell process's file creation mask to @var{mode}. If *************** *** 1998,2001 **** --- 2639,2646 ---- option is supplied without a @var{mode} argument, the mask is printed in a symbolic format. + If the @samp{-p} option is supplied, and @var{mode} + is omitted, the output is in a form that may be reused as input. + The return status is zero if the mode is successfully changed or if + no @var{mode} argument is supplied, and non-zero otherwise. @item unset *************** *** 2009,2014 **** If the @samp{-f} option is given, the @var{name}s refer to shell functions, and the function definition is removed. ! Read-only variables and functions may not be unset. ! @end table --- 2654,2660 ---- If the @samp{-f} option is given, the @var{name}s refer to shell functions, and the function definition is removed. ! Readonly variables and functions may not be unset. ! The return status is zero unless a @var{name} does not exist or is ! readonly. @end table *************** *** 2021,2046 **** @vtable @code ! @item IFS ! A list of characters that separate fields; used when the shell splits ! words as part of expansion. ! ! @item PATH ! A colon-separated list of directories in which the shell looks for ! commands. @item HOME The current user's home directory; the default for the @code{cd} builtin command. ! @item CDPATH ! A colon-separated list of directories used as a search path for ! the @code{cd} command. ! ! @item MAILPATH ! A colon-separated list of files which the shell periodically checks ! for new mail. You can ! also specify what message is printed by separating the file name from ! the message with a @samp{?}. When used in the text of the message, ! @code{$_} stands for the name of the current mailfile. @item MAIL --- 2667,2683 ---- @vtable @code ! @item CDPATH ! A colon-separated list of directories used as a search path for ! the @code{cd} builtin command. @item HOME The current user's home directory; the default for the @code{cd} builtin command. + The value of this variable is also used by tilde expansion + (@pxref{Tilde Expansion}). ! @item IFS ! A list of characters that separate fields; used when the shell splits ! words as part of expansion. @item MAIL *************** *** 2049,2052 **** --- 2686,2708 ---- the specified file. + @item MAILPATH + A colon-separated list of filenames which the shell periodically checks + for new mail. + Each list entry can specify the message that is printed when new mail + arrives in the mail file by separating the file name from the message with + a @samp{?}. + When used in the text of the message, @code{$_} expands to the name of + the current mail file. + + @item OPTARG + The value of the last option argument processed by the @code{getopts} builtin. + + @item OPTIND + The index of the last option argument processed by the @code{getopts} builtin. + + @item PATH + A colon-separated list of directories in which the shell looks for + commands. + @item PS1 The primary prompt string. The default value is @samp{\s-\v\$ }. *************** *** 2055,2066 **** The secondary prompt string. The default value is @samp{> }. - @item OPTIND - The index of the last option processed by the - @code{getopts} builtin. - - @item OPTARG - The value of the last option argument processed by the - @code{getopts} builtin. - @end vtable --- 2711,2714 ---- *************** *** 2073,2126 **** @end menu ! Bash implements essentially the same grammar, parameter and variable ! expansion, redirection, and quoting as the Bourne Shell. Bash uses the ! @sc{POSIX} 1003.2 standard as the specification of how these features are to be ! implemented. There are some differences between the traditional Bourne ! shell and the @sc{POSIX} standard; this section quickly details the differences ! of significance. A number of these differences are explained in greater ! depth in subsequent sections. @node Major Differences From The Bourne Shell @subsection Major Differences From The SVR4.2 Bourne Shell Bash is @sc{POSIX}-conformant, even where the @sc{POSIX} specification differs from traditional @code{sh} behavior. Bash has multi-character invocation options (@pxref{Invoking Bash}). Bash has command-line editing (@pxref{Command Line Editing}) and the @code{bind} builtin. Bash has command history (@pxref{Bash History Facilities}) and the @code{history} and @code{fc} builtins to manipulate it. ! Bash implements @code{csh}-like history expansion (@pxref{History Interaction}). Bash has one-dimensional array variables (@pxref{Arrays}), and the appropriate variable expansions and assignment syntax to use them. ! Some of the Bash builtins take options to act on arrays. Bash provides ! some built-in array variables. Bash implements the @code{!} keyword to negate the return value of a pipeline (@pxref{Pipelines}). Very useful when an @code{if} statement needs to act only if a test fails. Bash includes the @code{select} compound command, which allows the ! generation of simple menus (@pxref{Korn Shell Constructs}). Bash includes brace expansion (@pxref{Brace Expansion}) and tilde expansion (@pxref{Tilde Expansion}). Bash implements command aliases and the @code{alias} and @code{unalias} builtins (@pxref{Aliases}). ! Bash provides shell arithmetic and arithmetic expansion ! (@pxref{Shell Arithmetic}). ! ! The @sc{POSIX} and @code{ksh}-style @code{$()} form of command substitution ! is implemented (@pxref{Command Substitution}), ! and preferred to the Bourne shell's @code{``} (which ! is also implemented for backwards compatibility). Variables present in the shell's initial environment are automatically exported to child processes. The Bourne shell does not normally do --- 2721,2807 ---- @end menu ! Bash implements essentially the same grammar, parameter and ! variable expansion, redirection, and quoting as the Bourne Shell. ! Bash uses the @sc{POSIX} 1003.2 standard as the specification of ! how these features are to be implemented. There are some ! differences between the traditional Bourne shell and Bash; this ! section quickly details the differences of significance. A ! number of these differences are explained in greater depth in ! subsequent sections. @node Major Differences From The Bourne Shell @subsection Major Differences From The SVR4.2 Bourne Shell + @itemize @bullet + + @item Bash is @sc{POSIX}-conformant, even where the @sc{POSIX} specification differs from traditional @code{sh} behavior. + @item Bash has multi-character invocation options (@pxref{Invoking Bash}). + @item Bash has command-line editing (@pxref{Command Line Editing}) and the @code{bind} builtin. + @item Bash has command history (@pxref{Bash History Facilities}) and the @code{history} and @code{fc} builtins to manipulate it. ! @item ! Bash implements @code{csh}-like history expansion ! (@pxref{History Interaction}). + @item Bash has one-dimensional array variables (@pxref{Arrays}), and the appropriate variable expansions and assignment syntax to use them. ! Several of the Bash builtins take options to act on arrays. ! Bash provides a number of built-in array variables. ! ! @item ! The @code{$'@dots{}'} quoting syntax, which expands ANSI-C ! backslash-escaped characters in the text between the single quotes, ! is supported (@pxref{ANSI-C Quoting}). ! ! @item ! Bash supports the @code{$"@dots{}"} quoting syntax to do ! locale-specific translation of the characters between the double ! quotes. The @samp{-D}, @samp{--dump-strings}, and @samp{--dump-po-strings} ! invocation options list the translatable strings found in a script ! (@pxref{Locale Translation}). + @item Bash implements the @code{!} keyword to negate the return value of a pipeline (@pxref{Pipelines}). Very useful when an @code{if} statement needs to act only if a test fails. + @item + Bash has the @code{time} reserved word and command timing (@pxref{Pipelines}). + The display of the timing statistics may be controlled with the + @code{TIMEFORMAT} variable. + + @item Bash includes the @code{select} compound command, which allows the ! generation of simple menus (@pxref{Conditional Constructs}). ! ! @item ! Bash includes the @code{[[} compound command, which makes conditional ! testing part of the shell grammar (@pxref{Conditional Constructs}). + @item Bash includes brace expansion (@pxref{Brace Expansion}) and tilde expansion (@pxref{Tilde Expansion}). + @item Bash implements command aliases and the @code{alias} and @code{unalias} builtins (@pxref{Aliases}). ! @item ! Bash provides shell arithmetic, the @code{((} compound command ! (@pxref{Conditional Constructs}), ! and arithmetic expansion (@pxref{Shell Arithmetic}). + @item Variables present in the shell's initial environment are automatically exported to child processes. The Bourne shell does not normally do *************** *** 2128,2154 **** command. ! Bash includes the @sc{POSIX} and @code{ksh}-style pattern removal ! @samp{%}, @samp{#}, @samp{%%} and @samp{##} constructs to remove ! leading or trailing substrings from variable values ! (@pxref{Shell Parameter Expansion}). ! The expansion @code{$@{#xx@}}, which returns the length of @code{$xx}, is supported (@pxref{Shell Parameter Expansion}). ! The @code{$'@dots{}'} quoting syntax, which expands ANSI-C ! backslash-escaped characters in the text between the single quotes, ! is supported (@pxref{ANSI-C Quoting}). ! ! Bash supports the @code{$"@dots{}"} quoting syntax to do ! locale-specific translation of the characters between the double ! quotes. The @samp{-D} and @samp{--dump-strings} invocation options ! list the translatable strings found in a script ! (@pxref{Locale Translation}). ! The expansion @code{$@{var:}@var{offset}@code{[:}@var{length}@code{]@}}, which expands to the substring of @code{var}'s value of length ! @var{length}, optionally beginning at @var{offset}, is present (@pxref{Shell Parameter Expansion}). The expansion @code{$@{var/[/]}@var{pattern}@code{[/}@var{replacement}@code{]@}}, --- 2809,2828 ---- command. ! @item ! Bash includes the @sc{POSIX} pattern removal @samp{%}, @samp{#}, @samp{%%} ! and @samp{##} expansions to remove leading or trailing substrings from ! variable values (@pxref{Shell Parameter Expansion}). ! @item ! The expansion @code{$@{#xx@}}, which returns the length of @code{$@{xx@}}, is supported (@pxref{Shell Parameter Expansion}). ! @item The expansion @code{$@{var:}@var{offset}@code{[:}@var{length}@code{]@}}, which expands to the substring of @code{var}'s value of length ! @var{length}, beginning at @var{offset}, is present (@pxref{Shell Parameter Expansion}). + @item The expansion @code{$@{var/[/]}@var{pattern}@code{[/}@var{replacement}@code{]@}}, *************** *** 2156,2184 **** the value of @code{var}, is available (@pxref{Shell Parameter Expansion}). Bash has @var{indirect} variable expansion using @code{$@{!word@}} (@pxref{Shell Parameter Expansion}). Bash can expand positional parameters beyond @code{$9} using @code{$@{@var{num}@}}. Bash has process substitution (@pxref{Process Substitution}). Bash automatically assigns variables that provide information about the current user (@code{UID}, @code{EUID}, and @code{GROUPS}), the current host (@code{HOSTTYPE}, @code{OSTYPE}, @code{MACHTYPE}, and @code{HOSTNAME}), and the instance of Bash that is running (@code{BASH}, ! @code{BASH_VERSION}, and @code{BASH_VERSINFO}. @xref{Bash Variables}, for details. The @code{IFS} variable is used to split only the results of expansion, not all words (@pxref{Word Splitting}). This closes a longstanding shell security hole. It is possible to have a variable and a function with the same name; @code{sh} does not separate the two name spaces. Bash functions are permitted to have local variables using the @code{local} builtin, and thus useful recursive functions may be written. Variable assignments preceding commands affect only that command, even builtins and functions (@pxref{Environment}). --- 2830,2881 ---- the value of @code{var}, is available (@pxref{Shell Parameter Expansion}). + @item Bash has @var{indirect} variable expansion using @code{$@{!word@}} (@pxref{Shell Parameter Expansion}). + @item Bash can expand positional parameters beyond @code{$9} using @code{$@{@var{num}@}}. + @item + The @sc{POSIX} @code{$()} form of command substitution + is implemented (@pxref{Command Substitution}), + and preferred to the Bourne shell's @code{``} (which + is also implemented for backwards compatibility). + + @item Bash has process substitution (@pxref{Process Substitution}). + @item Bash automatically assigns variables that provide information about the current user (@code{UID}, @code{EUID}, and @code{GROUPS}), the current host (@code{HOSTTYPE}, @code{OSTYPE}, @code{MACHTYPE}, and @code{HOSTNAME}), and the instance of Bash that is running (@code{BASH}, ! @code{BASH_VERSION}, and @code{BASH_VERSINFO}). @xref{Bash Variables}, for details. + @item The @code{IFS} variable is used to split only the results of expansion, not all words (@pxref{Word Splitting}). This closes a longstanding shell security hole. + @item + Bash implements the full set of @sc{POSIX.2} filename expansion operators, + including @var{character classes}, @var{equivalence classes}, and + @var{collating symbols} (@pxref{Filename Expansion}). + + @item + Bash implements extended pattern matching features when the @code{extglob} + shell option is enabled (@pxref{Pattern Matching}). + + @item It is possible to have a variable and a function with the same name; @code{sh} does not separate the two name spaces. + @item Bash functions are permitted to have local variables using the @code{local} builtin, and thus useful recursive functions may be written. + @item Variable assignments preceding commands affect only that command, even builtins and functions (@pxref{Environment}). *************** *** 2187,2193 **** file system. Bash performs filename expansion on filenames specified as operands ! to output redirection operators. Bash contains the @samp{<>} redirection operator, allowing a file to be opened for both reading and writing, and the @samp{&>} redirection --- 2884,2892 ---- file system. + @item Bash performs filename expansion on filenames specified as operands ! to input and output redirection operators. + @item Bash contains the @samp{<>} redirection operator, allowing a file to be opened for both reading and writing, and the @samp{&>} redirection *************** *** 2195,2225 **** file (@pxref{Redirections}). The @code{noclobber} option is available to avoid overwriting existing files with output redirection (@pxref{The Set Builtin}). The @samp{>|} redirection operator may be used to override @code{noclobber}. ! Bash interprets special backslash-escaped characters in the prompt ! strings when interactive (@pxref{Printing a Prompt}). ! Bash allows you to write a function to override a builtin, and provides access to that builtin's functionality within the function via the @code{builtin} and @code{command} builtins (@pxref{Bash Builtins}). The @code{command} builtin allows selective disabling of functions when command lookup is performed (@pxref{Bash Builtins}). Individual builtins may be enabled or disabled using the @code{enable} builtin (@pxref{Bash Builtins}). ! The Bash @code{hash} builtin allows a name to be associated with ! an arbitrary filename, even when that filename cannot be found by ! searching the @code{$PATH}, using @samp{hash -p}. Shell functions may be exported to children via the environment ! (@pxref{Shell Functions}). Bash includes a @code{help} builtin for quick reference to shell facilities (@pxref{Bash Builtins}). The Bash @code{read} builtin (@pxref{Bash Builtins}) will read a line ending in @samp{\} with --- 2894,2953 ---- file (@pxref{Redirections}). + @item The @code{noclobber} option is available to avoid overwriting existing files with output redirection (@pxref{The Set Builtin}). The @samp{>|} redirection operator may be used to override @code{noclobber}. ! @item ! The Bash @code{cd} and @code{pwd} builtins (@pxref{Bourne Shell Builtins}) ! each take @samp{-L} and @samp{-P} builtins to switch between logical and ! physical modes. ! @item ! Bash allows a function to override a builtin with the same name, and provides access to that builtin's functionality within the function via the @code{builtin} and @code{command} builtins (@pxref{Bash Builtins}). + @item The @code{command} builtin allows selective disabling of functions when command lookup is performed (@pxref{Bash Builtins}). + @item Individual builtins may be enabled or disabled using the @code{enable} builtin (@pxref{Bash Builtins}). ! @item ! The Bash @code{exec} builtin takes additional options that allow users ! to control the contents of the environment passed to the executed ! command, and what the zeroth argument to the command is to be ! (@pxref{Bourne Shell Builtins}). + @item Shell functions may be exported to children via the environment ! using @code{export -f} (@pxref{Shell Functions}). ! ! @item ! The Bash @code{export}, @code{readonly}, and @code{declare} builtins can ! take a @samp{-f} option to act on shell functions, a @samp{-p} option to ! display variables with various attributes set in a format that can be ! used as shell input, a @samp{-n} option to remove various variable ! attributes, and @samp{name=value} arguments to set variable attributes ! and values simultaneously. ! ! @item ! The Bash @code{hash} builtin allows a name to be associated with ! an arbitrary filename, even when that filename cannot be found by ! searching the @code{$PATH}, using @samp{hash -p} ! (@pxref{Bourne Shell Builtins}). + @item Bash includes a @code{help} builtin for quick reference to shell facilities (@pxref{Bash Builtins}). + @item + The @code{printf} builtin is available to display formatted output + (@pxref{Bash Builtins}). + + @item The Bash @code{read} builtin (@pxref{Bash Builtins}) will read a line ending in @samp{\} with *************** *** 2229,2250 **** Readline to obtain the line when given the @samp{-e} option. Bash includes the @code{shopt} builtin, for finer control of shell optional capabilities (@pxref{Bash Builtins}). Bash has much more optional behavior controllable with the @code{set} builtin (@pxref{The Set Builtin}). ! The @code{disown} builtin can remove a job from the internal shell ! job table (@pxref{Job Control Builtins}). ! ! The @code{return} builtin may be used to abort execution of scripts ! executed with the @code{.} or @code{source} builtins ! (@pxref{Bourne Shell Builtins}). ! The @code{test} builtin (@pxref{Bourne Shell Builtins}) ! is slightly different, as it implements the ! @sc{POSIX} 1003.2 algorithm, which specifies the behavior based on the ! number of arguments. The @code{trap} builtin (@pxref{Bourne Shell Builtins}) allows a @code{DEBUG} pseudo-signal specification, --- 2957,2979 ---- Readline to obtain the line when given the @samp{-e} option. + @item + The @code{return} builtin may be used to abort execution of scripts + executed with the @code{.} or @code{source} builtins + (@pxref{Bourne Shell Builtins}). + + @item Bash includes the @code{shopt} builtin, for finer control of shell optional capabilities (@pxref{Bash Builtins}). + @item Bash has much more optional behavior controllable with the @code{set} builtin (@pxref{The Set Builtin}). ! @item The @code{test} builtin (@pxref{Bourne Shell Builtins}) ! is slightly different, as it implements the @sc{POSIX} algorithm, ! which specifies the behavior based on the number of arguments. + @item The @code{trap} builtin (@pxref{Bourne Shell Builtins}) allows a @code{DEBUG} pseudo-signal specification, *************** *** 2253,2295 **** inherited by shell functions. ! The Bash @code{export}, @code{readonly}, and @code{declare} builtins can ! take a @samp{-f} option to act on shell functions, a @samp{-p} option to ! display variables with various attributes set in a format that can be ! used as shell input, a @samp{-n} option to remove various variable ! attributes, and @samp{name=value} arguments to set variable attributes ! and values simultaneously. ! ! The Bash @code{cd} and @code{pwd} builtins (@pxref{Bourne Shell Builtins}) ! each take @samp{-L} and @samp{-P} builtins to switch between logical and ! physical modes. ! The Bash @code{type} builtin is more extensive and gives more information about the names it finds (@pxref{Bash Builtins}). Bash implements a @code{csh}-like directory stack, and provides the @code{pushd}, @code{popd}, and @code{dirs} builtins to manipulate it ! (@pxref{C Shell Builtins}). Bash also makes the directory stack visible as the value of the @code{DIRSTACK} shell variable. The Bash restricted mode is more useful (@pxref{The Restricted Shell}); the @sc{SVR4.2} shell restricted mode is too limited. ! Bash has the @code{time} reserved word and command timing (@pxref{Pipelines}). ! The display of the timing statistics may be controlled with the ! @code{TIMEFORMAT} variable. The @sc{SVR4.2} shell has two privilege-related builtins (@code{mldmode} and @code{priv}) not present in Bash. Bash does not have the @code{stop} or @code{newgrp} builtins. Bash does not use the @code{SHACCT} variable or perform shell accounting. The @sc{SVR4.2} @code{sh} uses a @code{TIMEOUT} variable like Bash uses @code{TMOUT}. ! More features unique to Bash may be found in ! @ref{Bash Features}. @subsection Implementation Differences From The SVR4.2 Shell --- 2982,3033 ---- inherited by shell functions. ! @item The Bash @code{type} builtin is more extensive and gives more information about the names it finds (@pxref{Bash Builtins}). + @item + The Bash @code{umask} builtin permits a @samp{-p} option to cause + the output to be displayed in the form of a @code{umask} command + that may be reused as input (@pxref{Bourne Shell Builtins}). + + @item Bash implements a @code{csh}-like directory stack, and provides the @code{pushd}, @code{popd}, and @code{dirs} builtins to manipulate it ! (@pxref{The Directory Stack}). Bash also makes the directory stack visible as the value of the @code{DIRSTACK} shell variable. + @item + Bash interprets special backslash-escaped characters in the prompt + strings when interactive (@pxref{Printing a Prompt}). + + @item The Bash restricted mode is more useful (@pxref{The Restricted Shell}); the @sc{SVR4.2} shell restricted mode is too limited. ! @item ! The @code{disown} builtin can remove a job from the internal shell ! job table (@pxref{Job Control Builtins}) or suppress the sending ! of @code{SIGHUP} to a job when the shell exits as the result of a ! @code{SIGHUP}. + @item The @sc{SVR4.2} shell has two privilege-related builtins (@code{mldmode} and @code{priv}) not present in Bash. + @item Bash does not have the @code{stop} or @code{newgrp} builtins. + @item Bash does not use the @code{SHACCT} variable or perform shell accounting. + @item The @sc{SVR4.2} @code{sh} uses a @code{TIMEOUT} variable like Bash uses @code{TMOUT}. ! @end itemize ! ! @noindent ! More features unique to Bash may be found in @ref{Bash Features}. @subsection Implementation Differences From The SVR4.2 Shell *************** *** 2314,2318 **** trapping @code{SIGSEGV}. If the shell is started from a process with @code{SIGSEGV} blocked (e.g., by using the @code{system()} C library ! function call), the shell misbehaves badly. @item --- 3052,3056 ---- trapping @code{SIGSEGV}. If the shell is started from a process with @code{SIGSEGV} blocked (e.g., by using the @code{system()} C library ! function call), it misbehaves badly. @item *************** *** 2324,2333 **** @item ! The @sc{SVR4.2} shell does not allow users to trap @code{SIGALRM} or ! @code{SIGCHLD}. @item ! For some reason, the @sc{SVR4.2} shell does not allow the @code{MAILCHECK} ! variable to be unset. @item --- 3062,3071 ---- @item ! The @sc{SVR4.2} shell does not allow users to trap @code{SIGSEGV}, ! @code{SIGALRM}, or @code{SIGCHLD}. @item ! The @sc{SVR4.2} shell does not allow the @code{IFS}, @code{MAILCHECK}, ! @code{PATH}, @code{PS1}, or @code{PS2} variables to be unset. @item *************** *** 2351,2889 **** @end itemize ! @node Csh Features ! @chapter C-Shell Style Features ! ! The C-Shell (@dfn{@code{csh}}) was created by Bill Joy at The ! University of California at Berkeley. It ! is generally considered to have better features for interactive use than ! the original Bourne shell. Some of the @code{csh} features present in ! Bash include job control, history expansion, `protected' redirection, and ! several variables to control the interactive behaviour of the shell ! (e.g., @code{IGNOREEOF}). ! @xref{Using History Interactively}, for details on history expansion. @menu ! * Brace Expansion:: Expansion of expressions within braces. ! * Tilde Expansion:: Expansion of the ~ character. ! * C Shell Builtins:: Builtin commands adopted from the C Shell. ! * C Shell Variables:: Variables which Bash uses in essentially ! the same way as the C Shell. @end menu ! @node Brace Expansion ! @section Brace Expansion ! @cindex brace expansion ! @cindex expansion, brace ! ! Brace expansion ! is a mechanism by which arbitrary strings ! may be generated. This mechanism is similar to ! @var{filename expansion} (@pxref{Filename Expansion}), ! but the file names generated ! need not exist. Patterns to be brace expanded take ! the form of an optional @var{preamble}, ! followed by a series of comma-separated strings ! between a pair of braces, followed by an optional @var{postamble}. ! The preamble is prepended to each string contained ! within the braces, and the postamble is then appended ! to each resulting string, expanding left to right. ! ! Brace expansions may be nested. The results of each expanded ! string are not sorted; left to right order is preserved. ! For example, ! @example ! bash$ echo a@{d,c,b@}e ! ade ace abe ! @end example ! ! Brace expansion is performed before any other expansions, ! and any characters special to other expansions are preserved ! in the result. It is strictly textual. Bash ! does not apply any syntactic interpretation to the context of the ! expansion or the text between the braces. ! ! A correctly-formed brace expansion must contain unquoted opening ! and closing braces, and at least one unquoted comma. ! Any incorrectly formed brace expansion is left unchanged. ! ! This construct is typically used as shorthand when the common ! prefix of the strings to be generated is longer than in the ! above example: ! @example ! mkdir /usr/local/src/bash/@{old,new,dist,bugs@} ! @end example ! or ! @example ! chown root /usr/@{ucb/@{ex,edit@},lib/@{ex?.?*,how_ex@}@} ! @end example ! ! @node Tilde Expansion ! @section Tilde Expansion ! @cindex tilde expansion ! @cindex expansion, tilde ! ! Bash has tilde (~) expansion, similar, but not identical, to that of ! @code{csh}. The following table shows what unquoted words beginning ! with a tilde expand to. ! ! @table @code ! @item ~ ! The current value of @code{$HOME}. ! @item ~/foo ! @file{$HOME/foo} ! ! @item ~fred/foo ! The subdirectory @code{foo} of the home directory of the user ! @code{fred}. ! ! @item ~+/foo ! @file{$PWD/foo} ! ! @item ~-/foo ! @file{$OLDPWD/foo} ! @end table ! ! Bash will also tilde expand words following redirection operators ! and words following @samp{=} in assignment statements. ! ! @node C Shell Builtins ! @section C Shell Builtins ! ! Bash has several builtin commands whose definition is very similar ! to @code{csh}. ! ! @table @code ! @btindex pushd ! @item pushd ! @example ! pushd [@var{dir} | @var{+N} | @var{-N}] [-n] ! @end example ! ! Save the current directory on a list and then @code{cd} to ! @var{dir}. With no ! arguments, exchanges the top two directories. ! ! @table @code ! @item +@var{N} ! Brings the @var{N}th directory (counting from the left of the ! list printed by @code{dirs}, starting with zero) to the top of ! the list by rotating the stack. ! @item -@var{N} ! Brings the @var{N}th directory (counting from the right of the ! list printed by @code{dirs}, starting with zero) to the top of ! the list by rotating the stack. ! @item -n ! Suppresses the normal change of directory when adding directories ! to the stack, so that only the stack is manipulated. ! @item @var{dir} ! Makes the current working directory be the top of the stack, and then ! @code{cd}s to @var{dir}. You can see the saved directory list ! with the @code{dirs} command. ! @end table ! ! @item popd ! @btindex popd ! @example ! popd [+@var{N} | -@var{N}] [-n] ! @end example ! ! Pop the directory stack, and @code{cd} to the new top directory. When ! no arguments are given, @code{popd} ! removes the top directory from the stack and ! performs a @code{cd} to the new top directory. The ! elements are numbered from 0 starting at the first directory listed with ! @code{dirs}; i.e., @code{popd} is equivalent to @code{popd +0}. ! @table @code ! @item +@var{N} ! Removes the @var{N}th directory (counting from the left of the ! list printed by @code{dirs}), starting with zero. ! @item -@var{N} ! Removes the @var{N}th directory (counting from the right of the ! list printed by @code{dirs}), starting with zero. ! @item -n ! Suppresses the normal change of directory when removing directories ! from the stack, so that only the stack is manipulated. ! @end table ! ! @item dirs ! @btindex dirs ! @example ! dirs [+@var{N} | -@var{N}] [-clvp] ! @end example ! Display the list of currently remembered directories. Directories ! find their way onto the list with the @code{pushd} command; you can get ! back up through the list with the @code{popd} command. ! @table @code ! @item +@var{N} ! Displays the @var{N}th directory (counting from the left of the ! list printed by @code{dirs} when invoked without options), starting ! with zero. ! @item -@var{N} ! Displays the @var{N}th directory (counting from the right of the ! list printed by @code{dirs} when invoked without options), starting ! with zero. ! @item -c ! Clears the directory stack by deleting all of the elements. ! @item -l ! Produces a longer listing; the default listing format uses a ! tilde to denote the home directory. ! @item -p ! Causes @code{dirs} to print the directory stack with one entry per ! line. ! @item -v ! Causes @code{dirs} to print the directory stack with one entry per ! line, prepending each entry with its index in the stack. ! @end table ! ! @item history ! @btindex history ! @example ! history [-c] [@var{n}] ! history [-anrw] [@var{filename}] ! history -ps @var{arg} ! @end example ! ! Display the history list with line numbers. Lines prefixed with ! with a @samp{*} have been modified. An argument of @var{n} says ! to list only the last @var{n} lines. Options, if supplied, have ! the following meanings: ! ! @table @code ! @item -w ! Write out the current history to the history file. ! ! @item -r ! Read the current history file and append its contents to ! the history list. ! ! @item -a ! Append the new ! history lines (history lines entered since the beginning of the ! current Bash session) to the history file. ! ! @item -n ! Append the history lines not already read from the history file ! to the current history list. These are lines appended to the history ! file since the beginning of the current Bash session. ! ! @item -c ! Clear the history list. This may be combined ! with the other options to replace the history list completely. ! ! @item -s ! The @var{arg}s are added to the end of ! the history list as a single entry. ! ! @item -p ! Perform history substitution on the @var{arg}s and display the result ! on the standard output, without storing the results in the history list. ! @end table ! ! When the @samp{-w}, @samp{-r}, @samp{-a}, or @samp{-n} option is ! used, if @var{filename} ! is given, then it is used as the history file. If not, then ! the value of the @code{HISTFILE} variable is used. ! ! @item logout ! @btindex logout ! Exit a login shell. ! ! @item source ! @btindex source ! A synonym for @code{.} (@pxref{Bourne Shell Builtins}). ! ! @end table ! ! @node C Shell Variables ! @section C Shell Variables ! ! @vtable @code ! ! @item IGNOREEOF ! If this variable is set, its value is used the number of consecutive ! @code{EOF}s Bash will read before exiting. By default, Bash will exit ! upon reading a single @code{EOF}. If @code{IGNOREEOF} is not set to ! a numeric value, Bash acts as if its value were 10. ! ! @end vtable ! ! @node Korn Shell Features ! @chapter Korn Shell Style Features ! ! This section describes features primarily inspired by the ! Korn Shell (@code{ksh}). In some cases, the @sc{POSIX} 1003.2 ! standard has adopted these commands and variables from the ! Korn Shell; Bash implements those features using the @sc{POSIX} ! standard as a guide. ! ! @menu ! * Korn Shell Constructs:: Shell grammar constructs adopted from the ! Korn Shell ! * Korn Shell Builtins:: Builtin commands adopted from the Korn Shell. ! * Korn Shell Variables:: Variables which Bash uses in essentially ! the same way as the Korn Shell. ! * Aliases:: Substituting one command for another. ! @end menu ! ! @node Korn Shell Constructs ! @section Korn Shell Constructs ! ! Bash includes the Korn Shell @code{select} construct. This construct ! allows the easy generation of menus. It has almost the same syntax as ! the @code{for} command. ! ! The syntax of the @code{select} command is: ! @rwindex select ! @example ! select @var{name} [in @var{words} @dots{}]; do @var{commands}; done ! @end example ! ! The list of words following @code{in} is expanded, generating a list ! of items. The set of expanded words is printed on the standard ! error, each preceded by a number. If the @samp{in @var{words}} ! is omitted, the positional parameters are printed. The ! @code{PS3} prompt is then displayed and a line is read from the standard ! input. If the line consists of a number corresponding to one of ! the displayed words, then the value of @var{name} ! is set to that word. If the line is empty, the words and prompt ! are displayed again. If @code{EOF} is read, the @code{select} ! command completes. Any other value read causes @var{name} ! to be set to null. The line read is saved in the variable ! @code{REPLY}. ! ! The @var{commands} are executed after each selection until a ! @code{break} or @code{return} command is executed, at which ! point the @code{select} command completes. ! ! Bash also has adopted command timing from the Korn shell. If the ! @code{time} reserved word precedes a pipeline, which may consist ! of a single command, timing statistics for the pipeline are displayed ! when it completes. ! The statistics currently consist of elapsed (wall-clock) time and ! user and system time consumed by the command's execution. ! ! The use of @code{time} as a reserved word permits the timing of ! shell builtins, shell functions, and pipelines. An external ! @code{time} command cannot time these easily. ! ! @node Korn Shell Builtins ! @section Korn Shell Builtins ! ! This section describes Bash builtin commands taken from @code{ksh}. ! ! @table @code ! ! @item fc ! @btindex fc ! @example ! @code{fc [-e @var{ename}] [-nlr] [@var{first}] [@var{last}]} ! @code{fc -s [@var{pat}=@var{rep}] [@var{command}]} ! @end example ! ! Fix Command. In the first form, a range of commands from @var{first} to ! @var{last} is selected from the history list. Both @var{first} and ! @var{last} may be specified as a string (to locate the most recent ! command beginning with that string) or as a number (an index into the ! history list, where a negative number is used as an offset from the ! current command number). If @var{last} is not specified it is set to ! @var{first}. If @var{first} is not specified it is set to the previous ! command for editing and @minus{}16 for listing. If the @samp{-l} flag is ! given, the commands are listed on standard output. The @samp{-n} flag ! suppresses the command numbers when listing. The @samp{-r} flag ! reverses the order of the listing. Otherwise, the editor given by ! @var{ename} is invoked on a file containing those commands. If ! @var{ename} is not given, the value of the following variable expansion ! is used: @code{$@{FCEDIT:-$@{EDITOR:-vi@}@}}. This says to use the ! value of the @code{FCEDIT} variable if set, or the value of the ! @code{EDITOR} variable if that is set, or @code{vi} if neither is set. ! When editing is complete, the edited commands are echoed and executed. ! ! In the second form, @var{command} is re-executed after each instance ! of @var{pat} in the selected command is replaced by @var{rep}. ! ! A useful alias to use with the @code{fc} command is @code{r='fc -s'}, so ! that typing @samp{r cc} runs the last command beginning with @code{cc} ! and typing @samp{r} re-executes the last command (@pxref{Aliases}). ! ! @item let ! @btindex let ! The @code{let} builtin allows arithmetic to be performed on shell variables. ! For details, refer to @ref{Arithmetic Builtins}. ! ! @item typeset ! @btindex typeset ! The @code{typeset} command is supplied for compatibility with the Korn ! shell; however, it has been deprecated in favor of the ! @code{declare} command (@pxref{Bash Builtins}). ! ! @end table ! ! @node Korn Shell Variables ! @section Korn Shell Variables ! ! @vtable @code ! ! @item REPLY ! The default variable for the @code{read} builtin. ! ! @item RANDOM ! Each time this parameter is referenced, a random integer ! between 0 and 32767 is generated. Assigning a value to this ! variable seeds the random number generator. ! ! @item SECONDS ! This variable expands to the number of seconds since the ! shell was started. Assignment to this variable resets ! the count to the value assigned, and the expanded value ! becomes the value assigned plus the number of seconds ! since the assignment. ! ! @item PS3 ! The value of this variable is used as the prompt for the ! @code{select} command. If this variable is not set, the ! @code{select} command prompts with @samp{#? } ! ! @item PS4 ! This is the prompt printed before the command line is echoed ! when the @samp{-x} option is set (@pxref{The Set Builtin}). ! The default is @samp{+ }. ! ! @item PWD ! The current working directory as set by the @code{cd} builtin. ! ! @item OLDPWD ! The previous working directory as set by the @code{cd} builtin. ! ! @item TMOUT ! If set to a value greater than zero, the value is interpreted as ! the number of seconds to wait for input after issuing the primary ! prompt. ! Bash terminates after that number of seconds if input does ! not arrive. ! ! @item LINENO ! The line number in the script or shell function currently executing. ! ! @item FCEDIT ! The editor used as a default by the @code{fc} builtin command. ! ! @end vtable ! ! @node Aliases ! @section Aliases ! @cindex alias expansion ! ! @menu ! * Alias Builtins:: Builtins commands to maniuplate aliases. ! @end menu ! ! The shell maintains a list of @var{aliases} ! that may be set and unset with the @code{alias} and ! @code{unalias} builtin commands. ! ! The first word of each command, if unquoted, ! is checked to see if it has an ! alias. If so, that word is replaced by the text of the alias. ! The alias name and the replacement text may contain any valid ! shell input, including shell metacharacters, with the exception ! that the alias name may not contain @key{=}. ! The first word of the replacement text is tested for ! aliases, but a word that is identical to an alias being expanded ! is not expanded a second time. This means that one may alias ! @code{ls} to @code{"ls -F"}, ! for instance, and Bash does not try to recursively expand the ! replacement text. If the last character of the alias value is a ! space or tab character, then the next command word following the ! alias is also checked for alias expansion. ! ! Aliases are created and listed with the @code{alias} ! command, and removed with the @code{unalias} command. ! ! There is no mechanism for using arguments in the replacement text, ! as in @code{csh}. ! If arguments are needed, a shell function should be used ! (@pxref{Shell Functions}). ! ! Aliases are not expanded when the shell is not interactive, ! unless the @code{expand_aliases} shell option is set using ! @code{shopt} (@pxref{Bash Builtins}). ! ! The rules concerning the definition and use of aliases are ! somewhat confusing. Bash ! always reads at least one complete line ! of input before executing any ! of the commands on that line. Aliases are expanded when a ! command is read, not when it is executed. Therefore, an ! alias definition appearing on the same line as another ! command does not take effect until the next line of input is read. ! The commands following the alias definition ! on that line are not affected by the new alias. ! This behavior is also an issue when functions are executed. ! Aliases are expanded when the function definition is read, ! not when the function is executed, because a function definition ! is itself a compound command. As a consequence, aliases ! defined in a function are not available until after that ! function is executed. To be safe, always put ! alias definitions on a separate line, and do not use @code{alias} ! in compound commands. ! ! Note that for almost every purpose, aliases are superseded by ! shell functions. ! ! @node Alias Builtins ! @subsection Alias Builtins ! ! @table @code ! ! @item alias ! @btindex alias ! @example ! alias [@code{-p}] [@var{name}[=@var{value}] @dots{}] ! @end example ! ! Without arguments or with the @samp{-p} option, @code{alias} prints ! the list of aliases on the standard output in a form that allows ! them to be reused as input. ! If arguments are supplied, an alias is defined for each @var{name} ! whose @var{value} is given. If no @var{value} is given, the name ! and value of the alias is printed. ! ! @item unalias ! @btindex unalias ! @example ! unalias [-a] [@var{name} @dots{} ] ! @end example ! ! Remove each @var{name} from the list of aliases. If @samp{-a} is ! supplied, all aliases are removed. ! @end table ! ! @node Bash Features ! @chapter Bash Features ! ! This section describes features unique to Bash. ! ! @menu ! * Invoking Bash:: Command line options that you can give ! to Bash. ! * Bash Startup Files:: When and how Bash executes scripts. ! * Is This Shell Interactive?:: Determining the state of a running Bash. ! * Bash Builtins:: Table of builtins specific to Bash. ! * The Set Builtin:: This builtin is so overloaded it ! deserves its own section. ! * Bash Conditional Expressions:: Primitives used in composing expressions for ! the @code{test} builtin. ! * Bash Variables:: List of variables that exist in Bash. ! * Shell Arithmetic:: Arithmetic on shell variables. ! * Arrays:: Array Variables ! * Printing a Prompt:: Controlling the PS1 string. ! * The Restricted Shell:: A more controlled mode of shell execution. ! * Bash POSIX Mode:: Making Bash behave more closely to what ! the POSIX standard specifies. ! @end menu ! ! @node Invoking Bash ! @section Invoking Bash @example --- 3089,3120 ---- @end itemize ! @node Bash Features ! @chapter Bash Features ! This section describes features unique to Bash. @menu ! * Invoking Bash:: Command line options that you can give ! to Bash. ! * Bash Startup Files:: When and how Bash executes scripts. ! * Is This Shell Interactive?:: Determining the state of a running Bash. ! * Bash Builtins:: Table of builtins specific to Bash. ! * The Set Builtin:: This builtin is so overloaded it ! deserves its own section. ! * Bash Conditional Expressions:: Primitives used in composing expressions for ! the @code{test} builtin. ! * Bash Variables:: List of variables that exist in Bash. ! * Shell Arithmetic:: Arithmetic on shell variables. ! * Aliases:: Substituting one command for another. ! * Arrays:: Array Variables. ! * The Directory Stack:: History of visited directories. ! * Printing a Prompt:: Controlling the PS1 string. ! * The Restricted Shell:: A more controlled mode of shell execution. ! * Bash POSIX Mode:: Making Bash behave more closely to what ! the POSIX standard specifies. @end menu ! @node Invoking Bash ! @section Invoking Bash @example *************** *** 2900,2903 **** --- 3131,3138 ---- @table @code + @item --dump-po-strings + Equivalent to @samp{-D}, but the output is in the GNU @code{gettext} + PO (portable object) file format. + @item --dump-strings Equivalent to @samp{-D}. *************** *** 2909,2915 **** Make this shell act as if it were directly invoked by login. This is equivalent to @samp{exec -l bash} but can be issued from ! another shell, such as @code{csh}. If you wanted to replace your ! current login shell with a Bash login shell, you would say ! @samp{exec bash --login}. @item --noediting --- 3144,3149 ---- Make this shell act as if it were directly invoked by login. This is equivalent to @samp{exec -l bash} but can be issued from ! another shell, such as @code{csh}. @samp{exec bash --login} ! will replace the current shell with a Bash login shell. @item --noediting *************** *** 2951,2956 **** @end table ! There are several single-character options you can give which are ! not available with the @code{set} builtin. @table @code --- 3185,3190 ---- @end table ! There are several single-character options that may be supplied at ! invocation which are not available with the @code{set} builtin. @table @code *************** *** 2964,2971 **** @item -r ! Make the shell restricted. @item -s ! If this flag is present, or if no arguments remain after option processing, then commands are read from the standard input. This option allows the positional parameters to be set --- 3198,3205 ---- @item -r ! Make the shell a restricted shell (@pxref{The Restricted Shell}). @item -s ! If this option is present, or if no arguments remain after option processing, then commands are read from the standard input. This option allows the positional parameters to be set *************** *** 2980,2988 **** This implies the @samp{-n} option; no commands will be executed. @end table @cindex interactive shell An @emph{interactive} shell is one whose input and output are both ! connected to terminals (as determined by @code{isatty()}), or one started with the @samp{-i} option. --- 3214,3227 ---- This implies the @samp{-n} option; no commands will be executed. + @item -- + A @code{--} signals the end of options and disables further option + processing. + Any arguments after the @code{--} are treated as filenames and arguments. + @end table @cindex interactive shell An @emph{interactive} shell is one whose input and output are both ! connected to terminals (as determined by @code{isatty(3)}), or one started with the @samp{-i} option. *************** *** 3047,3057 **** possible, while conforming to the @sc{POSIX} standard as well. ! When invoked as a login shell, it first attempts to read and execute ! commands from @file{/etc/profile} and @file{~/.profile}, in that order. The @samp{--noprofile} option may be used to inhibit this behavior. ! When invoked as an interactive shell with the name @code{sh}, ! @code{bash} looks for the variable @code{ENV}, ! expands its value if it is defined, and uses the ! expanded value as the name of a file to read and execute. Since a shell invoked as @code{sh} does not attempt to read and execute commands from any other startup files, the @samp{--rcfile} option has --- 3286,3296 ---- possible, while conforming to the @sc{POSIX} standard as well. ! When invoked as an interactive login shell, it first attempts to read ! and execute commands from @file{/etc/profile} and @file{~/.profile}, in ! that order. The @samp{--noprofile} option may be used to inhibit this behavior. ! When invoked as an interactive shell with the name @code{sh}, Bash ! looks for the variable @code{ENV}, expands its value if it is defined, ! and uses the expanded value as the name of a file to read and execute. Since a shell invoked as @code{sh} does not attempt to read and execute commands from any other startup files, the @samp{--rcfile} option has *************** *** 3066,3073 **** @samp{--posix} command line option, it follows the @sc{POSIX} standard for startup files. ! In this mode, the @code{ENV} variable is expanded and commands are read ! and executed from the file whose name is the expanded value. No other startup files are read. - This is done by interactive shells only. Bash attempts to determine when it is being run by the remote shell --- 3305,3312 ---- @samp{--posix} command line option, it follows the @sc{POSIX} standard for startup files. ! In this mode, interactive shells expand the @code{ENV} variable ! and commands are read and executed from the file whose name is the ! expanded value. No other startup files are read. Bash attempts to determine when it is being run by the remote shell *************** *** 3078,3083 **** The @samp{--norc} option may be used to inhibit this behavior, and the @samp{--rcfile} option may be used to force another file to be read, but ! rshd does not generally invoke the shell with those options or allow ! them to be specified. @node Is This Shell Interactive? --- 3317,3322 ---- The @samp{--norc} option may be used to inhibit this behavior, and the @samp{--rcfile} option may be used to force another file to be read, but ! @code{rshd} does not generally invoke the shell with those options or ! allow them to be specified. @node Is This Shell Interactive? *************** *** 3090,3095 **** or one started with the @samp{-i} option. ! You may wish to determine within a startup script whether Bash is ! running interactively or not. To do this, examine the variable @code{$PS1}; it is unset in non-interactive shells, and set in interactive shells. Thus: --- 3329,3334 ---- or one started with the @samp{-i} option. ! To determine within a startup script whether Bash is ! running interactively or not, examine the variable @code{$PS1}; it is unset in non-interactive shells, and set in interactive shells. Thus: *************** *** 3103,3107 **** @end example ! Alternatively, you may test the value of the @samp{-} special parameter. It contains @code{i} when the shell is interactive. For example: --- 3342,3347 ---- @end example ! Alternatively, startup scripts may test the value of the @samp{-} ! special parameter. It contains @code{i} when the shell is interactive. For example: *************** *** 3124,3128 **** @btindex bind @example ! bind [-m @var{keymap}] [-lpsvPSV] [-q @var{name}] [-r @var{keyseq}] bind [-m @var{keymap}] -f @var{filename} bind [-m @var{keymap}] @var{keyseq:function-name} --- 3364,3369 ---- @btindex bind @example ! bind [-m @var{keymap}] [-lpsvPSV] ! bind [-m @var{keymap}] [-q @var{function}] [-u @var{function}] [-r @var{keyseq}] bind [-m @var{keymap}] -f @var{filename} bind [-m @var{keymap}] @var{keyseq:function-name} *************** *** 3154,3191 **** @item -l ! List the names of all Readline functions @item -p Display Readline function names and bindings in such a way that they ! can be re-read @item -P ! List current Readline function names and bindings @item -v Display Readline variable names and values in such a way that they ! can be re-read @item -V ! List current Readline variable names and values @item -s Display Readline key sequences bound to macros and the strings they output ! in such a way that they can be re-read @item -S ! Display Readline key sequences bound to macros and the strings they output @item -f @var{filename} ! Read key bindings from @var{filename} ! @item -q ! Query about which keys invoke the named @var{function} @item -r @var{keyseq} ! Remove any current binding for @var{keyseq} @end table @item builtin @btindex builtin --- 3395,3439 ---- @item -l ! List the names of all Readline functions. @item -p Display Readline function names and bindings in such a way that they ! can be re-read. @item -P ! List current Readline function names and bindings. @item -v Display Readline variable names and values in such a way that they ! can be re-read. @item -V ! List current Readline variable names and values. @item -s Display Readline key sequences bound to macros and the strings they output ! in such a way that they can be re-read. @item -S ! Display Readline key sequences bound to macros and the strings they output. @item -f @var{filename} ! Read key bindings from @var{filename}. ! @item -q @var{function} ! Query about which keys invoke the named @var{function}. ! ! @item -u @var{function} ! Unbind all keys bound to the named @var{function}. @item -r @var{keyseq} ! Remove any current binding for @var{keyseq}. @end table + @noindent + The return status is zero unless an invalid option is supplied or an + error occurs. + @item builtin @btindex builtin *************** *** 3193,3216 **** builtin [@var{shell-builtin} [@var{args}]] @end example ! Run a shell builtin. This is useful when you wish to define a ! shell function with the same name as a shell builtin, but need the ! functionality of the builtin within the function itself. @item command @btindex command @example ! command [-pVv] @var{command} [@var{args} @dots{}] @end example ! Runs @var{command} with @var{arg} ignoring shell functions. If ! you have a shell function called @code{ls}, and you wish to call ! the command @code{ls}, you can say @samp{command ls}. The ! @samp{-p} option means to use a default value for @code{$PATH} that is guaranteed to find all of the standard utilities. If either the @samp{-V} or @samp{-v} option is supplied, a description of @var{command} is printed. The @samp{-v} option causes a single word indicating the command or file name used to ! invoke @var{command} to be printed; the @samp{-V} option produces ! a more verbose description. @item declare --- 3441,3475 ---- builtin [@var{shell-builtin} [@var{args}]] @end example ! Run a shell builtin, passing it @var{args}, and return its exit status. ! This is useful when defining a shell function with the same ! name as a shell builtin, retaining the functionality of the builtin within ! the function. ! The return status is non-zero if @var{shell-builtin} is not a shell ! builtin command. @item command @btindex command @example ! command [-pVv] @var{command} [@var{arguments} @dots{}] @end example ! Runs @var{command} with @var{arguments} ignoring any shell function ! named @var{command}. ! Only shell builtin commands or commands found by searching the ! @code{PATH} are executed. ! If there is a shell function named @code{ls}, running @samp{command ls} ! within the function will execute the external command @code{ls} ! instead of calling the function recursively. ! The @samp{-p} option means to use a default value for @code{$PATH} that is guaranteed to find all of the standard utilities. + The return status in this case is 127 if @var{command} cannot be + found or an error occurred, and the exit status of @var{command} + otherwise. If either the @samp{-V} or @samp{-v} option is supplied, a description of @var{command} is printed. The @samp{-v} option causes a single word indicating the command or file name used to ! invoke @var{command} to be displayed; the @samp{-V} option produces ! a more verbose description. In this case, the return status is ! zero if @var{command} is found, and non-zero if not. @item declare *************** *** 3245,3249 **** @item -r Make @var{name}s readonly. These names cannot then be assigned values ! by subsequent assignment statements. @item -x --- 3504,3508 ---- @item -r Make @var{name}s readonly. These names cannot then be assigned values ! by subsequent assignment statements or unset. @item -x *************** *** 3252,3272 **** @end table ! Using @samp{+} ! instead of @samp{-} turns off the attribute instead. When used in ! a function, @code{declare} makes each @var{name} local, as with the ! @code{local} command. @item echo @btindex echo @example ! echo [-neE] [arg @dots{}] @end example ! Output the @code{arg}s, separated by spaces, terminated with a ! newline. The return status is always 0. If @samp{-n} is ! specified, the trailing newline is suppressed. If the @samp{-e} ! option is given, interpretation of the following backslash-escaped ! characters is enabled. The @samp{-E} option disables the interpretation ! of these escape characters, even on systems where they are interpreted ! by default. @code{echo} interprets the following escape sequences: @table @code --- 3511,3541 ---- @end table ! Using @samp{+} instead of @samp{-} turns off the attribute instead. ! When used in a function, @code{declare} makes each @var{name} local, ! as with the @code{local} command. ! ! The return status is zero unless an invalid option is encountered, ! an attempt is made to define a function using @code{-f foo=bar}, ! an attempt is made to assign a value to a readonly variable, ! an attempt is made to assign a value to an array variable without ! using the compound assignment syntax (@pxref{Arrays}), ! one of the @var{names} is not a valid shell variable name, ! an attempt is made to turn off readonly status for a readonly variable, ! an attempt is made to turn off array status for an array variable, ! or an attempt is made to display a non-existent function with @samp{-f}. @item echo @btindex echo @example ! echo [-neE] [@var{arg} @dots{}] @end example ! Output the @var{arg}s, separated by spaces, terminated with a ! newline. ! The return status is always 0. ! If @samp{-n} is specified, the trailing newline is suppressed. ! If the @samp{-e} option is given, interpretation of the following ! backslash-escaped characters is enabled. ! The @samp{-E} option disables the interpretation of these escape characters, ! even on systems where they are interpreted by default. @code{echo} interprets the following escape sequences: @table @code *************** *** 3291,3296 **** @item \\ backslash ! @item \nnn ! the character whose ASCII code is @code{nnn} (octal) @end table --- 3560,3569 ---- @item \\ backslash ! @item \@var{nnn} ! the character whose @code{ASCII} code is the octal value @var{nnn} ! (one to three digits) ! @item \x@var{nnn} ! the character whose @code{ASCII} code is the hexadecimal value @var{nnn} ! (one to three digits) @end table *************** *** 3300,3305 **** enable [-n] [-p] [-f @var{filename}] [-ads] [@var{name} @dots{}] @end example ! Enable and disable builtin shell commands. This allows you to ! use a disk command which has the same name as a shell builtin. If @samp{-n} is used, the @var{name}s become disabled. Otherwise @var{name}s are enabled. For example, to use the @code{test} binary --- 3573,3580 ---- enable [-n] [-p] [-f @var{filename}] [-ads] [@var{name} @dots{}] @end example ! Enable and disable builtin shell commands. ! Disabling a builtin allows a disk command which has the same name ! as a shell builtin to be executed with specifying a full pathname, ! even though the shell normally searches for builtins before disk commands. If @samp{-n} is used, the @var{name}s become disabled. Otherwise @var{name}s are enabled. For example, to use the @code{test} binary *************** *** 3316,3324 **** from shared object @var{filename}, on systems that support dynamic loading. The @samp{-d} option will delete a builtin loaded with @samp{-f}. If there are no options, a list of the shell builtins is displayed. ! The @samp{-s} option restricts @code{enable} to the @sc{POSIX.2} special builtins. If @samp{-s} is used with @samp{-f}, the new builtin becomes a special builtin. @item help @btindex help --- 3591,3603 ---- from shared object @var{filename}, on systems that support dynamic loading. The @samp{-d} option will delete a builtin loaded with @samp{-f}. + If there are no options, a list of the shell builtins is displayed. ! The @samp{-s} option restricts @code{enable} to the @sc{POSIX} special builtins. If @samp{-s} is used with @samp{-f}, the new builtin becomes a special builtin. + The return status is zero unless a @var{name} is not a shell builtin + or there is an error loading a new builtin from a shared object. + @item help @btindex help *************** *** 3326,3333 **** help [@var{pattern}] @end example ! Display helpful information about builtin commands. If ! @var{pattern} is specified, @code{help} gives detailed help on all commands matching @var{pattern}, otherwise a list of ! the builtins is printed. @item local --- 3605,3624 ---- help [@var{pattern}] @end example ! Display helpful information about builtin commands. ! If @var{pattern} is specified, @code{help} gives detailed help on all commands matching @var{pattern}, otherwise a list of ! the builtins is printed. The return status is zero unless no ! command matches @var{pattern}. ! ! @item let ! @btindex let ! @example ! let @var{expression} [@var{expression}] ! @end example ! The @code{let} builtin allows arithmetic to be performed on shell ! variables. Each @var{expression} is evaluated according to the ! rules given below in @ref{Shell Arithmetic}. If the ! last @var{expression} evaluates to 0, @code{let} returns 1; ! otherwise 0 is returned. @item local *************** *** 3336,3344 **** local @var{name}[=@var{value}] @end example ! For each argument, create a local variable called @var{name}, and ! give it @var{value}. @code{local} can only be used within a function; it makes the variable @var{name} have a visible scope restricted to that function and its ! children. @item logout --- 3627,3636 ---- local @var{name}[=@var{value}] @end example ! For each argument, a local variable named @var{name} is created, ! and assigned @var{value}. @code{local} can only be used within a function; it makes the variable @var{name} have a visible scope restricted to that function and its ! children. The return status is zero unless @code{local} is used outside ! a function or an invalid @var{name} is supplied. @item logout *************** *** 3350,3353 **** --- 3642,3667 ---- parent. + @item printf + @btindex printf + @example + @code{printf} @var{format} [@var{arguments}] + @end example + Write the formatted @var{arguments} to the standard output under the + control of the @var{format}. + The @var{format} is a character string which contains three types of objects: + plain characters, which are simply copied to standard output, character + escape sequences, which are converted and copied to the standard output, and + format specifications, each of which causes printing of the next successive + @var{argument}. + In addition to the standard @code{printf(1)} formats, @samp{%b} causes + @code{printf} to expand backslash escape sequences in the corresponding + @var{argument}, and @samp{%q} causes @code{printf} to output the + corresponding @var{argument} in a format that can be reused as shell input. + + The @var{format} is reused as necessary to consume all of the @var{arguments}. + If the @var{format} requires more @var{arguments} than are supplied, the + extra format specifications behave as if a zero value or null string, as + appropriate, had been supplied. + @item read @btindex read *************** *** 3356,3367 **** @end example One line is read from the standard input, and the first word ! is assigned to the first ! @var{name}, the second word to the second @var{name}, ! and so on, with leftover words assigned to the last @var{name}. ! Only the characters in the value of the @code{IFS} variable ! are recognized as word delimiters. If no names ! are supplied, the line read is assigned to the variable @code{REPLY}. ! The return code is zero, unless end-of-file is encountered. Options, ! if supplied, have the following meanings: @table @code --- 3670,3684 ---- @end example One line is read from the standard input, and the first word ! is assigned to the first @var{name}, the second word to the second @var{name}, ! and so on, with leftover words and their intervening separators assigned ! to the last @var{name}. ! If there are fewer words read from the standard input than names, ! the remaining names are assigned empty values. ! The characters in the value of the @code{IFS} variable ! are used to split the line into words. ! If no names are supplied, the line read is assigned to the ! variable @code{REPLY}. ! The return code is zero, unless end-of-file is encountered. ! Options, if supplied, have the following meanings: @table @code *************** *** 3371,3381 **** @item -p @var{prompt} ! Display @code{prompt}, without a trailing newline, before attempting to read any input. The prompt is displayed only if input is coming from a terminal. @item -a @var{aname} ! The words are assigned to ! sequential indices of the array variable @var{aname}, starting at 0. @item -e --- 3688,3700 ---- @item -p @var{prompt} ! Display @var{prompt}, without a trailing newline, before attempting to read any input. The prompt is displayed only if input is coming from a terminal. @item -a @var{aname} ! The words are assigned to sequential indices of the array variable ! @var{aname}, starting at 0. ! All elements are removed from @var{aname} before the assignment. ! Other @var{name} arguments are ignored. @item -e *************** *** 3390,3401 **** @end example Toggle the values of variables controlling optional shell behavior. ! With no options, or with the @samp{-p} ! option, a list of all settable options is displayed, with ! an indication of whether or not each is set. Other options have ! the following meanings: @table @code @item -s ! Enable (set) each @var{optname} @item -u --- 3709,3721 ---- @end example Toggle the values of variables controlling optional shell behavior. ! With no options, or with the @samp{-p} option, a list of all settable ! options is displayed, with an indication of whether or not each is set. ! The @samp{-p} option causes output to be displayed in a form that ! may be reused as input. ! Other options have the following meanings: @table @code @item -s ! Enable (set) each @var{optname}. @item -u *************** *** 3415,3420 **** @end table ! If either of ! @samp{-s} or @samp{-u} is used with no @var{optname} arguments, the display is limited to those options which are set or unset, respectively. --- 3735,3739 ---- @end table ! If either @samp{-s} or @samp{-u} is used with no @var{optname} arguments, the display is limited to those options which are set or unset, respectively. *************** *** 3425,3429 **** The return status when listing options is zero if all @var{optnames} are enabled, non-zero otherwise. When setting or unsetting options, ! the return status is zero unless an @var{optname} is not a legal shell option. --- 3744,3748 ---- The return status when listing options is zero if all @var{optnames} are enabled, non-zero otherwise. When setting or unsetting options, ! the return status is zero unless an @var{optname} is not a valid shell option. *************** *** 3471,3474 **** --- 3790,3802 ---- fails. + @item expand_aliases + If set, aliases are expanded as described below< under Aliases + (@pxref{Aliases}). + This option is enabled by default for interactive shells. + + @item extglob + If set, the extended pattern matching features described above + (@pxref{Pattern Matching}) are enabled. + @item histappend If set, the history list is appended to the file named by the value *************** *** 3489,3496 **** @item hostcomplete If set, and Readline is being used, Bash will attempt to perform ! hostname completion when a word beginning with @samp{@@} is being completed (@pxref{Commands For Completion}). This option is enabled by default. @item interactive_comments Allow a word beginning with @samp{#} --- 3817,3828 ---- @item hostcomplete If set, and Readline is being used, Bash will attempt to perform ! hostname completion when a word containing a @samp{@@} is being completed (@pxref{Commands For Completion}). This option is enabled by default. + @item huponexit + If set, Bash will send @code{SIGHUP} to all jobs when an interactive + login shell exits (@pxref{Signals}). + @item interactive_comments Allow a word beginning with @samp{#} *************** *** 3509,3512 **** --- 3841,3848 ---- @code{"The mail in @var{mailfile} has been read"} is displayed. + @item nocaseglob + If set, Bash matches filenames in a case-insensitive fashion when + performing filename expansion. + @item nullglob If set, Bash allows filename patterns which match no *************** *** 3526,3541 **** If set, the @code{source} builtin uses the value of @code{PATH} to find the directory containing the file supplied as an argument. ! This is enabled by default. @end table @item type @btindex type @example ! type [-all] [-type | -path] [@var{name} @dots{}] @end example For each @var{name}, indicate how it would be interpreted if used as a command name. ! If the @samp{-type} flag is used, @code{type} returns a single word which is one of @samp{alias}, @samp{function}, @samp{builtin}, @samp{file} or @samp{keyword}, --- 3862,3890 ---- If set, the @code{source} builtin uses the value of @code{PATH} to find the directory containing the file supplied as an argument. ! This option is enabled by default. @end table + @noindent + The return status when listing options is zero if all @var{optnames} + are enabled, non-zero otherwise. + When setting or unsetting options, the return status is zero unless an + @var{optname} is not a valid shell option. + + @item source + @btindex source + @example + source @var{filename} + @end example + A synonym for @code{.} (@pxref{Bourne Shell Builtins}). + @item type @btindex type @example ! type [-atp] [@var{name} @dots{}] @end example For each @var{name}, indicate how it would be interpreted if used as a command name. ! If the @samp{-t} option is used, @code{type} prints a single word which is one of @samp{alias}, @samp{function}, @samp{builtin}, @samp{file} or @samp{keyword}, *************** *** 3545,3558 **** @code{type} returns a failure status. ! If the @samp{-path} flag is used, @code{type} either returns the name ! of the disk file that would be executed, or nothing if @samp{-type} would not return @samp{file}. ! If the @samp{-all} flag is used, returns all of the places that contain ! an executable named @var{file}. This includes aliases and functions, ! if and only if the @samp{-path} flag is not also used. ! @code{type} accepts @samp{-a}, @samp{-t}, and @samp{-p} as equivalent to ! @samp{-all}, @samp{-type}, and @samp{-path}, respectively. @item ulimit --- 3894,3917 ---- @code{type} returns a failure status. ! If the @samp{-p} option is used, @code{type} either returns the name ! of the disk file that would be executed, or nothing if @samp{-t} would not return @samp{file}. ! If the @samp{-a} option is used, @code{type} returns all of the places ! that contain an executable named @var{file}. ! This includes aliases and functions, if and only if the @samp{-p} option ! is not also used. ! ! The return status is zero if any of the @var{names} are found, non-zero ! if none are found. ! @item typeset ! @btindex typeset ! @example ! typeset [-afFrxi] [-p] [@var{name}[=@var{value}]] ! @end example ! The @code{typeset} command is supplied for compatibility with the Korn ! shell; however, it has been deprecated in favor of the @code{declare} ! builtin command. @item ulimit *************** *** 3566,3585 **** @table @code @item -S ! change and report the soft limit associated with a resource. @item -H ! change and report the hard limit associated with a resource. @item -a ! all current limits are reported. @item -c ! the maximum size of core files created. @item -d ! the maximum size of a process's data segment. @item -f ! the maximum size of files created by the shell. @item -l --- 3925,3944 ---- @table @code @item -S ! Change and report the soft limit associated with a resource. @item -H ! Change and report the hard limit associated with a resource. @item -a ! All current limits are reported. @item -c ! The maximum size of core files created. @item -d ! The maximum size of a process's data segment. @item -f ! The maximum size of files created by the shell. @item -l *************** *** 3587,3609 **** @item -m ! the maximum resident set size. @item -n ! the maximum number of open file descriptors. @item -p ! the pipe buffer size. @item -s ! the maximum stack size. @item -t ! the maximum amount of cpu time in seconds. @item -u ! the maximum number of processes available to a single user. @item -v ! the maximum amount of virtual memory available to the process. @end table --- 3946,3968 ---- @item -m ! The maximum resident set size. @item -n ! The maximum number of open file descriptors. @item -p ! The pipe buffer size. @item -s ! The maximum stack size. @item -t ! The maximum amount of cpu time in seconds. @item -u ! The maximum number of processes available to a single user. @item -v ! The maximum amount of virtual memory available to the process. @end table *************** *** 3619,3622 **** --- 3978,3985 ---- are unscaled values. + The return status is zero unless an invalid option is supplied, a + non-numeric argument other than @code{unlimited} is supplied as a + @var{limit}, or an error occurs while setting a new limit. + @end table *************** *** 3624,3628 **** @section The Set Builtin ! This builtin is so overloaded that it deserves its own section. @table @code --- 3987,3991 ---- @section The Set Builtin ! This builtin is so complicated that it deserves its own section. @table @code *************** *** 3630,3636 **** @btindex set @example ! set [-abefhkmnptuvxdBCHP] [-o @var{option}] [@var{argument} @dots{}] @end example @table @code @item -a --- 3993,4006 ---- @btindex set @example ! set [--abefhkmnptuvxBCHP] [-o @var{option}] [@var{argument} @dots{}] @end example + If no options or arguments are supplied, @code{set} displays the names + and values of all shell variables and functions, sorted according to the + current locale, in a format that may be reused as input. + + When options are supplied, they set or unset shell attributes. + Options, if specified, have the following meanings: + @table @code @item -a *************** *** 3642,3646 **** @item -e ! Exit immediately if a simple command exits with a non-zero status. @item -f --- 4012,4020 ---- @item -e ! Exit immediately if a simple command (@pxref{Simple Commands}) exits ! with a non-zero status, unless the command that fails is part of an ! @code{until} or @code{while} loop, part of an @code{if} statement, ! part of a @code{&&} or @code{||} list, or if the command's return ! status is being inverted using @code{!}. @item -f *************** *** 3649,3652 **** --- 4023,4027 ---- @item -h Locate and remember (hash) commands as they are looked up for execution. + This option is enabled by default. @item -k *************** *** 3659,3686 **** @item -n ! Read commands but do not execute them. @item -o @var{option-name} ! Set the flag corresponding to @var{option-name}: @table @code @item allexport ! same as @code{-a}. @item braceexpand ! same as @code{-B}. @item emacs ! use an @code{emacs}-style line editing interface (@pxref{Command Line Editing}). @item errexit ! same as @code{-e}. @item hashall ! same as @code{-h}. @item histexpand ! same as @code{-H}. @item history --- 4034,4063 ---- @item -n ! Read commands but do not execute them; this may be used to check a ! script for syntax errors. ! This option is ignored by interactive shells. @item -o @var{option-name} ! Set the option corresponding to @var{option-name}: @table @code @item allexport ! Same as @code{-a}. @item braceexpand ! Same as @code{-B}. @item emacs ! Use an @code{emacs}-style line editing interface (@pxref{Command Line Editing}). @item errexit ! Same as @code{-e}. @item hashall ! Same as @code{-h}. @item histexpand ! Same as @code{-H}. @item history *************** *** 3689,3745 **** @item ignoreeof ! the shell will not exit upon reading EOF. @item keyword ! same as @code{-k}. @item monitor ! same as @code{-m}. @item noclobber ! same as @code{-C}. @item noexec ! same as @code{-n}. @item noglob ! same as @code{-f}. @item notify ! same as @code{-b}. @item nounset ! same as @code{-u}. @item onecmd ! same as @code{-t}. @item physical ! same as @code{-P}. @item posix ! change the behavior of Bash where the default operation differs ! from the @sc{POSIX} 1003.2 standard to match the standard. This ! is intended to make Bash behave as a strict superset of that standard. @item privileged ! same as @code{-p}. @item verbose ! same as @code{-v}. @item vi ! use a @code{vi}-style line editing interface. @item xtrace ! same as @code{-x}. @end table @item -p Turn on privileged mode. ! In this mode, the @code{$BASH_ENV} ! file is not processed, and shell functions ! are not inherited from the environment. This is enabled automatically on startup if the effective user (group) id is not equal to the real user (group) id. Turning this option off causes the effective user --- 4066,4125 ---- @item ignoreeof ! An interactive shell will not exit upon reading EOF. @item keyword ! Same as @code{-k}. @item monitor ! Same as @code{-m}. @item noclobber ! Same as @code{-C}. @item noexec ! Same as @code{-n}. @item noglob ! Same as @code{-f}. @item notify ! Same as @code{-b}. @item nounset ! Same as @code{-u}. @item onecmd ! Same as @code{-t}. @item physical ! Same as @code{-P}. @item posix ! Change the behavior of Bash where the default operation differs ! from the @sc{POSIX} 1003.2 standard to match the standard ! (@pxref{Bash POSIX Mode}). ! This is intended to make Bash behave as a strict superset of that standard. @item privileged ! Same as @code{-p}. @item verbose ! Same as @code{-v}. @item vi ! Use a @code{vi}-style line editing interface. @item xtrace ! Same as @code{-x}. @end table @item -p Turn on privileged mode. ! In this mode, the @code{$BASH_ENV} and @code{$ENV} files are not ! processed, shell functions are not inherited from the environment, ! and the @code{SHELLOPTS} variable, if it appears in the environment, ! is ignored. ! This is enabled automatically on startup if the effective user (group) id is not equal to the real user (group) id. Turning this option off causes the effective user *************** *** 3750,3754 **** @item -u ! Treat unset variables as an error when substituting. @item -v --- 4130,4136 ---- @item -u ! Treat unset variables as an error when performing parameter expansion. ! An error message will be written to the standard error, and a non-interactive ! shell will exit. @item -v *************** *** 3756,3760 **** @item -x ! Print commands and their arguments as they are executed. @item -B --- 4138,4143 ---- @item -x ! Print a trace of simple commands and their arguments after they are ! expanded and before they are executed. @item -B *************** *** 3763,3771 **** @item -C ! Disallow output redirection to existing files. @item -H Enable @samp{!} style history substitution (@pxref{History Interaction}). ! This flag is on by default for interactive shells. @item -P --- 4146,4155 ---- @item -C ! Prevent output redirection using @samp{>}, @samp{>&}, and @samp{<>} ! from overwriting existing files. @item -H Enable @samp{!} style history substitution (@pxref{History Interaction}). ! This option is on by default for interactive shells. @item -P *************** *** 3776,3780 **** which change the current directory. ! For example, if @file{/usr/sys} is a link to @file{/usr/local/sys} then: @example $ cd /usr/sys; echo $PWD --- 4160,4165 ---- which change the current directory. ! For example, if @file{/usr/sys} is a symbolic link to @file{/usr/local/sys} ! then: @example $ cd /usr/sys; echo $PWD *************** *** 3794,3798 **** @item -- ! If no arguments follow this flag, then the positional parameters are unset. Otherwise, the positional parameters are set to the @var{arguments}, even if some of them begin with a @samp{-}. --- 4179,4183 ---- @item -- ! If no arguments follow this option, then the positional parameters are unset. Otherwise, the positional parameters are set to the @var{arguments}, even if some of them begin with a @samp{-}. *************** *** 3805,3815 **** @end table ! Using @samp{+} rather than @samp{-} causes these flags to be ! turned off. The flags can also be used upon invocation of the ! shell. The current set of flags may be found in @code{$-}. The remaining N @var{arguments} are positional parameters and are ! assigned, in order, to @code{$1}, @code{$2}, @dots{} @code{$N}. If ! no arguments are given, all shell variables are printed. @end table --- 4190,4202 ---- @end table ! Using @samp{+} rather than @samp{-} causes these options to be ! turned off. The options can also be used upon invocation of the ! shell. The current set of options may be found in @code{$-}. The remaining N @var{arguments} are positional parameters and are ! assigned, in order, to @code{$1}, @code{$2}, @dots{} @code{$N}. ! The special parameter @code{#} is set to N. ! ! The return status is always zero unless an invalid option is supplied. @end table *************** *** 3818,3831 **** @cindex expressions, conditional ! Conditional expressions are used by the @code{test} and @code{[} builtins. ! Expressions may be unary or binary. Unary ! expressions are often used to examine the status of a file. There ! are string operators and numeric comparison operators as well. Each ! operator and operand must be a separate argument. If @var{file} ! is of the form @file{/dev/fd/@var{N}}, then file descriptor @var{N} is ! checked. Expressions are composed of the following primaries: @table @code @item -b @var{file} True if @var{file} exists and is a block special file. --- 4205,4221 ---- @cindex expressions, conditional ! Conditional expressions are used by the @code{[[} compound command ! and the @code{test} and @code{[} builtin commands. ! Expressions may be unary or binary. ! Unary expressions are often used to examine the status of a file. ! There are string operators and numeric comparison operators as well. ! If any @var{file} argument to one of the primaries is of the form ! @file{/dev/fd/@var{N}}, then file descriptor @var{N} is checked. @table @code + @item -a @var{file} + True if @var{file} exists. + @item -b @var{file} True if @var{file} exists and is a block special file. *************** *** 3844,3857 **** @item -g @var{file} ! True if @var{file} exists and is set-group-id. @item -k @var{file} ! True if @var{file} has its "sticky" bit set. ! ! @item -L @var{file} ! True if @var{file} exists and is a symbolic link. @item -p @var{file} ! True if @var{file} exists and is a named pipe. @item -r @var{file} --- 4234,4244 ---- @item -g @var{fi