From e6e3b4442080b63cf18d1428138434900a8ea128 Mon Sep 17 00:00:00 2001 From: Chet Ramey Date: Sat, 3 Dec 2011 13:33:39 -0500 Subject: commit bash-20040728 snapshot --- CWRU/CWRU.chlog | 37 + CWRU/changelog | 9641 +------------- CWRU/old/set.def.save | 544 + CWRU/save/unwind_prot.h.save | 50 + MANIFEST | 1 - array.c | 2 +- autom4te.cache/output.0 | 219 +- autom4te.cache/requests | 150 +- autom4te.cache/traces.0 | 14 - bashline.c | 2 +- builtins/evalfile.c | 1 + builtins/reserved.def | 5 +- doc/FAQ-2.05b | 1771 +++ doc/FAQ.orig | 1745 +++ doc/FAQ.save | 1745 +++ doc/bash.1.orig | 8583 ++++++++++++ doc/bash.html | 5 +- doc/bash.pdf | Bin 572128 -> 308031 bytes doc/bash.ps | 21 +- doc/bashref.dvi | Bin 580120 -> 580108 bytes doc/bashref.html | 12 +- doc/bashref.log | 51 +- doc/bashref.pdf | Bin 528198 -> 529773 bytes doc/bashref.ps | 23814 ++++++++++++++++++---------------- doc/bashref.texi.orig | 7105 ++++++++++ doc/builtins.0 | 16 +- doc/builtins.ps | 2 +- doc/mkinstall-tmp | 44 + doc/rbash.0 | 4 +- doc/rbash.ps | 2 +- doc/texinfo.tex | 6689 +--------- examples/scripts/adventure.sh.save1 | 549 + externs.h | 3 + general.c | 2 + include/memalloc.h.save | 58 + lib/malloc/malloc.c.save | 1213 ++ lib/readline/ansi_stdlib.h | 55 +- lib/readline/display.c | 4 +- lib/readline/display.c.orig | 2282 ++++ lib/readline/doc/fdl.texi | 453 +- lib/readline/doc/history.dvi | Bin 79868 -> 79856 bytes lib/readline/doc/history.html | 6 +- lib/readline/doc/history.info | 52 +- lib/readline/doc/history.log | 30 +- lib/readline/doc/history.ps | 61 +- lib/readline/doc/readline.dvi | Bin 270424 -> 274068 bytes lib/readline/doc/readline.html | 1021 +- lib/readline/doc/readline.info | 170 +- lib/readline/doc/readline.ps | 1790 +-- lib/readline/doc/rlman.aux | 10 +- lib/readline/doc/rlman.cp | 2 +- lib/readline/doc/rlman.cps | 2 +- lib/readline/doc/rlman.fn | 17 +- lib/readline/doc/rlman.fns | 17 +- lib/readline/doc/rlman.log | 38 +- lib/readline/doc/rlman.toc | 12 +- lib/readline/doc/rluserman.dvi | Bin 91652 -> 91852 bytes lib/readline/doc/rluserman.fn | 3 +- lib/readline/doc/rluserman.fns | 3 +- lib/readline/doc/rluserman.html | 150 +- lib/readline/doc/rluserman.info | 63 +- lib/readline/doc/rluserman.log | 18 +- lib/readline/doc/rluserman.ps | 195 +- lib/readline/posixdir.h | 62 +- lib/readline/posixjmp.h | 41 +- lib/readline/posixstat.h | 143 +- lib/readline/tilde.c | 459 +- lib/readline/tilde.h | 79 +- make_cmd.c | 1 + pathnames.h | 30 - po/bash.po.orig | 5623 ++++++++ subst.c.orig | 7376 +++++++++++ support/mkconffiles | 0 support/mkversion.sh | 0 support/rlvers.sh | 0 tests/? | 1 - tests/cprint.right.save1 | 72 + tests/history.tests.save | 97 + tests/misc/regress/log.orig | 50 + tests/misc/regress/shx.orig | 10 + tests/run-histexpand.debug | 4 + 81 files changed, 53820 insertions(+), 30782 deletions(-) mode change 100644 => 120000 CWRU/changelog create mode 100644 CWRU/old/set.def.save create mode 100644 CWRU/save/unwind_prot.h.save create mode 100644 doc/FAQ-2.05b create mode 100644 doc/FAQ.orig create mode 100644 doc/FAQ.save create mode 100644 doc/bash.1.orig create mode 100644 doc/bashref.texi.orig create mode 100755 doc/mkinstall-tmp mode change 100644 => 120000 doc/texinfo.tex create mode 100755 examples/scripts/adventure.sh.save1 create mode 100644 include/memalloc.h.save create mode 100644 lib/malloc/malloc.c.save mode change 100644 => 120000 lib/readline/ansi_stdlib.h create mode 100644 lib/readline/display.c.orig mode change 100644 => 120000 lib/readline/doc/fdl.texi mode change 100644 => 120000 lib/readline/posixdir.h mode change 100644 => 120000 lib/readline/posixjmp.h mode change 100644 => 120000 lib/readline/posixstat.h mode change 100644 => 120000 lib/readline/tilde.c mode change 100644 => 120000 lib/readline/tilde.h delete mode 100644 pathnames.h create mode 100644 po/bash.po.orig create mode 100644 subst.c.orig mode change 100755 => 100644 support/mkconffiles mode change 100755 => 100644 support/mkversion.sh mode change 100755 => 100644 support/rlvers.sh delete mode 100644 tests/? create mode 100644 tests/cprint.right.save1 create mode 100644 tests/history.tests.save create mode 100644 tests/misc/regress/log.orig create mode 100644 tests/misc/regress/shx.orig create mode 100644 tests/run-histexpand.debug diff --git a/CWRU/CWRU.chlog b/CWRU/CWRU.chlog index f6ce0b92..3268ef26 100644 --- a/CWRU/CWRU.chlog +++ b/CWRU/CWRU.chlog @@ -9638,3 +9638,40 @@ flags.c error messages [bash-3.0 frozen] + + 7/27 + ---- +doc/Makefile.in + - small fixes + +[bash-3.0-released] + + 7/28 + ---- +array.c + - in array_insert(), make sure the value to be added is non-NULL before + calling savestring() on it + +builtins/reserved.def + - fix description of `CDPATH' + +lib/readline/display.c + - when expanding a prompt that spans multiple lines with embedded + newlines, set prompt_physical_chars from the portion after the + final newline, not the preceding portion. Bug reported by + "Ralf S. Engelschall" + +make_cmd.c + - explicitly declare `lineno' in function prologue for make_case_command + +builtins/evalfile.c + - include `trap.h' for declaration for run_return_trap + +bashline.c + - fix a `return' without a value in enable_hostname_completion + +general.c + - include test.h for extern declaration for test_eaccess + +externs.h + - add declaration for zcatfd diff --git a/CWRU/changelog b/CWRU/changelog deleted file mode 100644 index f6ce0b92..00000000 --- a/CWRU/changelog +++ /dev/null @@ -1,9640 +0,0 @@ - 4/9/2001 - -------- -[bash-2.05 released] - - 4/10 - ---- -redir.c - - check return value of fclose() in write_here_document() for error - returns; don't just rely on fwrite() failing - -support/bashbug.sh - - set TMPDIR to /tmp if it's null or unset - - use $TMPDIR in the TEMP tempfile name template - - fixed the call to `mktemp', if it exists, to make it more portable - -jobs.c - - if WCONTINUED is not defined, define it to 0 and add a define for - WIFCONTINUED(wstatus) which expands to 0 - - add WCONTINUED to the flags passed to waitpid(2) in waitchld() - - don't increment children_exited if waitpid's status is WIFCONTINUED, - since we don't want to call a SIGCHLD trap handler in this case - - in waitchld(), we set child->running to 1 if WIFCONTINUED(status) - is non-zero - - make sure pretty_print_job doesn't check for the core dump bit if - the process has been continued; it's only valid if the job is dead - - in set_job_status_and_cleanup, set the job to JRUNNING if job_state - is non-zero and the job was previously marked as JSTOPPED - -configure.in - - add -DBROKEN_DIRENT_D_INO to interix LOCAL_CFLAGS - -lib/glob/glob.c - - if BROKEN_DIRENT_D_INO is defined, define REAL_DIR_ENTRY to 1 - -jobs.c - - in kill_pid, we only need to block and unblock SIGCHLD if the - `group' argument is non-zero, since otherwise we just call `kill' - on the pid argument - -version.c - - update copyright date to 2001 - -bashline.c - - prog_complete_return needs to take a `const char *' as its first - argument - - history_completion_generator needs to take a `const char *' as - its first argument, and `text' needs to be a `const char *' - - 4/11 - ---- -redir.c - - fixed a weird typo in redir_special_open, case RF_DEVFD, added - call to all_digits before call to legal_number - - fixed do_redirection_internal to call legal_number instead of atol(3) - when translating r_duplicating_{in,out}put_word, so it handles - overflow better - - produce an error message in redirection_error for out-of-range - file descriptors - - change allocation strategy in redirection_error so we don't have to - malloc scratch memory if redirection_expand() fails - -jobs.h - - added defines for `running' member of a struct process - -general.c - - fix legal_number to return 0 when strtol(3) reports overflow or - underflow - -parse.y - - changed read_token_word to call legal_number instead of atoi(3) - -input.c - - return -1/EBADF from close_buffered_fd if fd is < 0 - -command.h - - fixed bogus comment about IS_DESCRIPTOR in description of the - REDIRECTEE struct - -print_cmd.c - - change cprintf's 'd' modifier code to display negative numbers as - an out-of-range value. We can do this only because the only use - of %d is to output file descriptor numbers in redirections - -support/mksignames.c - - need to include config.h to get a possible value for - UNUSABLE_RT_SIGNALS - - 4/16 - ---- -lib/readline/doc/rluser.texinfo - - corrected a small error in one description of M-DEL - - 4/17 - ---- -stringlib.c - - need to initialize `ind' before calls to RESIZE_MALLOCED_BUFFER - in strcreplace() - -support/bashversion.c - - new file, prints bash version information - -Makefile.in - - rules for building bashversion and linking it to version.o - - 4/24 - ---- -conftypes.h - - new file with HOSTTYPE, OSTYPE, MACHTYPE, etc. defines from - variables.h - -variables.h, version.c - - include conftypes.h - -patchlevel.h - - new file, contains define for PATCHLEVEL. Doing away with the old - scheme of having the information in configure.in - -version.c - - include patchlevel.h - -Makefile.in - - run bashversion -p to find patch level rather than have configure - substitute in a value - - pass -S ${top_srcdir} to support/mkversion.sh - -support/mkversion.sh - - don't put PATCHLEVEL define into version.h, but accept and ignore - a -p option - - take a new -S srcdir option - - find the patch level by parsing it out of patchlevel.h - -configure.in - - hard-code BASHVERS assignment instead of reading it from a file - - remove BASHPATCH; don't substitute it - -_distribution,_patchlevel - - removed - - 4/26 - ---- -shell.c - - call init_noninteractive() in open_shell_script if forced_interactive - is non-zero (the shell was started with -i) and fd_is_tty is 0 - (the script file is a real file, not something like /dev/stdin), - since it wasn't done earlier - -builtins/printf.def - - change for POSIX.2 compliance when conversion errors are encountered - when processing %d, %u, and floating point conversion operators - (print a warning message, return the value accumulated at the time - of the error -- which is always 0 -- and exit with a non-zero status) - -command.h - - added CMD_COMMAND_BUILTIN for use by the `command' builtin and the - code in execute_cmd.c - -builtins/command.def - - add CMD_COMMAND_BUILTIN to the created command's flags - - 5/1 - --- -configure.in - - add call to AC_C_CONST to test `const' compiler behavior - - add call to AC_C_INLINE to test `inline' compiler behavior - - add call to AC_C_STRINGIZE to test cpp #x stringizing operator - -config.h.in - - add `#undef const' for configure to substitute - - add `#undef inline' for configure to substitute - - add `#undef HAVE_STRINGIZE' for configure to substitute - -include/stdc.h - - remove code that defines or undefines `const' and `inline' - - change the __STRING macro to be defined depending on the value - of HAVE_STRINGIZE - -lib/malloc/malloc.c - - change the __STRING macro to be defined depending on the value - of HAVE_STRINGIZE - -lib/readline/{readline,rlprivate}.h - - moved rl_get_termcap to readline.h, making it a public function - -lib/readline/readline.h - - new #define, RL_READLINE_VERSION, hex-encoded library version - number, currently set to 0x0402 - - new public int variable, rl_readline_version - -lib/readline/readline.c - - #define RL_READLINE_VERSION if it is not already defined (which it - should be in readline.h) - - initialize rl_readline_version to RL_READLINE_VERSION - -lib/readline/doc/rltech.texinfo - - documented rl_get_termcap - - documented rl_readline_version - -jobs.c - - job_exit_status should return an int, not a WAIT (undetected - before because on most POSIX-like systems a WAIT is really an int) - -builtins/evalfile.c - - added FEVAL_REGFILE (file must be a regular file) to accepted - _evalfile flags - - fc_execute_file() adds FEVAL_REGFILE to _evalfile flags. This - means that startup files and files read with `.' no longer need - to be regular files - - 5/2 - --- - -lib/termcap/Makefile.in - - fix target for installed termcap library (normally unused) - -lib/tilde/Makefile.in - - fix install target to install in $(libdir) (normally unused) - -Makefile.in - - don't make $(man3dir) since there's nothing installed there - -Makefile.in,doc/Makefile.in - - change `man1ext' to `.1', `man3ext' to `.3' - - change appropriate install targets to use new values of man[13]ext - - use `test ...' instead of `[...]' - - add support for DESTDIR root installation prefix, for package - building (installdirs, install, install-strip, uninstall targets) - -builtins/common.c - - new function int get_exitstat(WORD_LIST *list) returns an eight-bit - exit status value for use in return, exit, logout builtins - -builtins/common.h - - extern declaration for get_exitstat() - -builtins/{exit,return}.def - - call get_exitstat where appropriate - -builtins/printf.def - - add support for "'" flag character as posix 1003.2-200x d6 says - - fix core dump when user-supplied field width or precision is 0 - - fix to printstr() to handle zero-length precision with `%b' format - specifier (printf '%.0b-%.0s\n' foo bar) - - fix to printstr() to treat a negative field width as a positive - field width with left-justification - - fix to mklong to avoid static buffers, which can always be overrun - by someone sufficiently motivated - -bashline.c - - change var in add_host_name to type `size_t' for passing to xrealloc - - 5/3 - --- -execute_cmd.c - - change restore_signal_mask to accept a sigset_t *, since a sigset_t - may not fit into a pointer, change call - -unwind_prot.c - - use a union UWP in restore_variable when restoring a variable whose - size is the same as sizeof(int), the reverse of the method used to - store it in unwind_protect_int - -builtins/printf.def - - use a #define LENMODS containing the length modifiers instead of - testing against each possible modifier character, save any mod - character found - - add support for ISO C99 length specifiers `j', `t', and `z' - - if `L' modifier is supplied with a floating point conversion char, - pass a `long double' to printf if HAVE_LONG_DOUBLE is defined - -configure.in,config.h.in - - call AC_C_LONG_DOUBLE to check for `long double'; define - HAVE_LONG_DOUBLE if supported - -bashline.c - - fix an inadvertantly-unclosed comment in attempt_shell_completion - - make set_saved_history return a value - - make dynamic_complete_history return a useful value - -{make_cmd,execute_cmd,shell,subst,trap,variables,input,unwind_prot,test, -pcomplete}.c - - removed some declared-but-unused variables - -builtins/{cd,enable,fc,set,setattr,type,umask,printf,complete}.def - - removed some declared-but-unused variables - -lib/sh/{zread,netopen}.c - - removed some declared-but-unused variables - -execute_cmd.c - - in execute_arith_command, use a long variable to hold the result - of evalexp(), since that's what it returns - -builtins/evalstring.c - - make cat_file return -1 on a read or write error - -lib/sh/stringlib.c - - make merge_stringlists() return the right value - - 5/7 - --- -pcomplete.c - - remove typo that caused empty declaration (;;) - -parse.y - - fix yyerror() to accept a single string argument; fix callers - -trap.c - - cast pointer to long instead of int when printing message with - internal_warning() in run_pending_traps() - -subst.c - - fix process_substitute to handle stdin being closed - -test.c - - change `while' to `if' in and() and or(), since the loop isn't - actually performed -- there's an unconditional `return' in the - loop body - - check for integer overflow of arguments to `-t' - -lib/sh/netopen.c - - change _getserv() to reject negative port/service numbers - -expr.c - - fix strlong() to not convert the base specification from long to - int before checking for overflow, since truncation on machines - where sizeof(int) != sizeof(long) may mask errors - -builtins/{jobs,kill,wait}.def - - use legal_number instead of atoi when converting strings to pid_t; - check for numeric overflow - -input.c - - fix for cygwin in b_fill_buffer -- off-by-one error when checking - buffer for \r\n termination - -general.h - - new #define INT_STRLEN_BOUND(t), computes max length of string - representing integer value of type T, possibly including a sign - character - - include if it's present - -{execute_cmd,findcmd,test}.c - - don't include , since general.h does it now - -{execute_cmd,lib/sh/itos,pcomplete,print_cmd,subst,variables}.c - - use INT_STRLEN_BOUND instead of static array sizes when converting - various strings to integer values - -shell.h - - struct fd_bitmap now uses an `int' size, since it's bounded by - the number of file descriptors, which must fit into an `int' - -execute_cmd.c - - FD_BITMAP_DEFAULT_SIZE is now 32, not 32L - - new_fd_bitmap takes an `int' size parameter, not a `long' - -execute_cmd.h - - change prototype for new_fd_bitmap() - -test.c - - fix test_stat to check for overflow when parsing the integer file - descriptor number; return ENOENT instead of EBADF for files that - are not open - -hashlib.c - - don't discard the upper 32 bits of the random value, if present - -lib/readline/shell.c - - use the same INT_STRLEN_BOUND mechanism to decide how much space to - allocated in sh_set_lines_and_columns - - 5/8 - --- -aclocal.m4 - - add check for libtinfo (termcap-specific portion of ncurses-5.2) to - BASH_CHECK_LIB_TERMCAP - - new macro, RL_LIB_READLINE_VERSION, checks version of installed - readline library and (optionally) writes version #defines to - config.h. Bash doesn't use the version defines - -configure.in - - call RL_LIB_READLINE_VERSION instead of support/rlvers.sh - -execute_cmd.c - - fix execute_shell_script and the WHITECHAR and STRINGCHAR macros - to check array bounds before indexing into the sample string - -unwind_prot.[ch] - - import new versions submitted by Paul Eggert - with a couple of changes for backwards compatibility, so the rest - of the source doesn't need to be changed yet - -jobs.c - - use unwind_protect_var on last_made_pid in run_sigchld_trap - -builtins/bind.def - - use unwind_protect_var on rl_outstream - -general.c - - rework print_rlimtype to use INT_STRLEN_BOUND and handle the - most negative number correctly - -expr.c - - `tokval' should have been a `long', since all arithmetic is done - as longs - -builtins/history.def - - consolidate tests for valid history position in one block to - avoid duplicate code and strings - -builtins/ulimit.def - - fix check for overflow when setting limit to work when int is 32 - bits and RLIMTYPE is 64 - -lib/sh/tmpfile.c - - don't truncate the result of time(3) to int; just use time_t, - since it's being assigned to an `unsigned long' - -mailcheck.c - - use legal_number instead of atoi in time_to_check_mail() to catch - more numeric errors; consolidate error checking in one block - - last_time_mail_checked should be a time_t - - 5/9 - --- -builtins/set.def - - recognize `set [-+]o nolog' if HISTORY is defined - -bashline.c - - new variable `dont_save_function_defs', set by `set -o nolog'; - currently ignored - -command.h - - the `dest' member of a REDIRECTEE is now an `int' - -parse.y,redir.c - - changed uses of `redir.test' (where redir is a REDIRECTEE) since - it's now an int - -lib/readline/rlstdc.h - - don't mess around with `const', rely on configure to supply a - proper definition if the compiler doesn't support it - -lib/tilde/tilde.h - - include if HAVE_CONFIG_H is defined - - don't mess around with `const', rely on configure - -builtins/shopt.def - - new read-only `shopt' option, login_shell, non-zero if shell is a - login shell (as decided by shell.c) - - new function set_login_shell(), sets shopt private value of - login_shell - -builtins/common.h - - new extern declaration for set_login_shell - -shell.c - - call set_login_shell after setting value of login_shell (in - main() and set_shell_name()) - -parse.y - - added new `\A' prompt string escape sequence: time in 24-hour - HH:MM format - -configure.in, config.h.in - - check for , define HAVE_GRP_H if found - -builtins/complete.def - - add new `-A group/-g' option to complete group names - -pcomplete.h - - new define for CA_GROUP, used with group name completion - -pcomplete.c - - add code to support CA_GROUP group name completion - -bashline.c - - new function, bash_groupname_completion_function(), supports - programmable completion of group names - -bashline.h - - extern declaration for bash_groupname_completion_function - -lib/readline/bind.c - - new inputrc variable, `match-hidden-files', controls completion - matching files beginning with a `.' (on Unix) - -lib/readline/complete.c - - new variable, _rl_match_hidden_files, mirrors `match-hidden-files' - inputrc variable - -lib/readline/rlprivate.h - - extern declaration for _rl_match_hidden_files - -builtins/hash.def - - new `-t' option to list hash values for each filename argument - -builtins/read.def - - alarm(3) takes an `unsigned int' argument, not int - - check for arithmetic overflow with -t and -n options - -input.c - - check for read error before doing \r\n translation on cygwin in - b_fill_buffer - - reset bp->b_used to 0 instead of leaving it at -1 on read error - in b_fill_buffer - -builtins/shopt.def - - new functions, shopt_setopt(name, mode) and - shopt_listopt(name, mode) to give the rest of the shell an easy - interface - -builtins/common.h - - extern declarations for shopt_setopt and shopt_listopt - -shell.c - - new invocation options -O and +O, to list or set/unset shopt - options like +o/-o sets and unsets `set -o' options - -doc/{bash.1,bashref.texi} - - document `set -o nolog' - - document `login_shell' shopt option - - document new `\A' prompt string escape sequence - - document new `-t' option to `hash' - - document new `[+-]O' invocation option - -doc/bashref.texi - - add text to `Invoking Bash' section defining a login shell; text - taken from man page - -doc/bash.1, lib/readline/doc/rluser.texinfo - - documented new complete/compgen `-A group/-g' option - -lib/readline/doc/{rluser.texinfo,readline.3}, doc/bash.1 - - documented new `match-hidden-files' inputrc variable - - 5/10 - ---- -configure.in - - fix AC_CHECK_PROG(ar, ...) - - add AC_CHECK_TYPE for ssize_t - -config.h.in - - new #undef for ssize_t - -lib/sh/zread.c - - int -> ssize_t fixes to mirror modern declarations of read and write - - the `off' variable in zsyncfd should be an off_t since it computes - a file offset - - the local buffer `lbuf' is now char, since it's not nice to pass - unsigned char * to read(2), and the values from it are assigned to - a char anyway - - lind and lused are now size_t, since they index into a buffer - - set lused to 0 on read error - -lib/sh/zwrite.c - - change second argument to type `char *', since ISO C says you have - to pass a `char *' to `write' - -externs.h - - fix extern declarations of zread, zread1, zreadc, and zwrite - - prototype extern declaration of qsort_string_compare - - add extern declaration for history_delimiting_chars() from parse.y - -input.h - - b_used and b_inputp members ofr struct BSTREAM are now size_t - -builtins/evalstring.c - - the number of chars read with zread in cat_file should be assigned - to a variable of type ssize_t - -input.c - - the number of chars read with zread in b_fill_buffer should be - assigned to a variable of type ssize_t - - `localbuf' is now type char[], since POSIX says you shouldn't pass - unsigned char * to read(2) - - in getc_with_restart(), use a variable of type unsigned char to - get a value from the local buffer and return it - - in ungetc_with_restart, explicitly return the character arg passed - to avoid relying on localbuf being unsigned char - -subst.c - - the number of chars read with zread in read_comsub should be - assigned to a variable of type ssize_t - -mksyntax.c - - instead of casting to unsigned char * in addcstr, use a variable - of type unsigned char and let the compiler do the work - -parse.y - - instead of casting to unsigned char * in yy_readline_get, use a - variable of type unsigned char and let the compiler do the work - - ditto for yy_string_get and shell_getc (cast to unsigned char) - -subst.c - - instead of casting to unsigned char when assigning to ifscmap in - expand_word_internal, use a variable of type unsigned char and - let the compiler do the work - -lib/sh/strtrans.c - - instead of casting to unsigned char in ansic_quote, use a variable - of type unsigned char and let the compiler do the work - -builtins/evalstring.c - - remove extern declarations for zwrite and run_trap_cleanup; they're - in externs.h - - prototype cat_file forward declaration - -Makefile.in - - remove -I$(includedir) from INCLUDES and SUBDIR_INCLUDES - -aclocal.m4 - - change RL_LIB_READLINE_VERSION to set RL_PREFIX, RL_LIBDIR, - and RL_INCLUDEDIR to what it used to test the installed readline - library version for use by the caller - - change RL_LIB_READLINE_VERSION to not compute ac_cv_rl_prefix if - the caller has already assigned it a value - - rename _rl_prefix -> ac_cv_rl_prefix, _rl_libdir -> ac_cv_rl_libdir, - _rl_includedir -> ac_cv_rl_includedir - -configure.in - - change testing of whether to use the value of - $opt_with_installed_readline to be != no, to allow the user to - specify a prefix where the installed readline library may be found - - if --with-installed-readline=PREFIX is supplied, set ac_cv_rl_prefix - to PREFIX before calling RL_LIB_READLINE_VERSION - - if --with-installed-readline[=PREFIX] is supplied, don't set - RL_LIBDIR and RL_INCLUDEDIR; let RL_LIB_READLINE_VERSION take care - of it, set RL_INCLUDE=-I${RL_INCLUDEDIR} - - if --with-installed-readline[=PREFIX] is supplied, and we're - linking with the history library, assign $RL_LIBDIR to HIST_LIBDIR - so we use the same version of the installed readline and history - libraries - -Makefile.in, builtins/Makefile.in - - have configure substitute RL_INCLUDEDIR, set RL_INCLUDEDIR variable - -doc/bashref.texi - - updated description of --with-installed-readline configure option - -general.c - - moved QSFUNC typedef here from builtins/common.c - -{alias,bashline,variables,lib/sh/stringvec}.c - - cast fourth argument to qsort to (QSFUNC *) - -alias.c - - prototype forward declaration of qsort_alias_compare - -bashhist.c - - include for extern declaration of glob_pattern_p - - remove extern declaration of history_delimiting_chars; it's now - in externs.h - - prototype forward declarations of histignore_item_func, - maybe_add_history, and bash_add_history - -bracecomp.c - - remove extern declaration for sh_backslash_quote; it's in externs.h - -braces.c - - remove extern declaration for extract_command_subst; it's in subst.h - - prototype forward declarations for expand_amble, array_concat, and - brace_gobbler - -error.c - - prototype extern declaration of give_terminal_to, fix bad call - -{execute_cmd,expr,findcmd,jobs,mailcheck,nojobs,pcomplete,print_cmd,redir, -shell}.c - - prototype all static forward function declarations - -pcomplete.c - - changed some function parameters to `const char *' to avoid discarding - const qualifier - -make_cmd.c - - make_bare_word, make_word_flags, and make_word now take a - `const char *' string argument - -make_cmd.h - - changed extern declarations for make_bare_word and make_word - -print_cmd.c - - cprintf now takes a `const char *' as its first argument, like - xprintf and printf - - the conditional define for xprintf should have been HAVE_VPRINTF, - not HAVE_VFPRINTF - -shell.c - - in isnetconn(), the return value of sizeof() is size_t - -aclocal.m4 - - add inclusion of stddef.h if STDC_HEADERS is defined to 1 in - BASH_CHECK_TYPE - -configure.in - - add a call to BASH_CHECK_TYPE for socklen_t (type of third argument - to getpeername(2)) - - 5/11 - ---- -lib/readline/bind.c - - make `useq' a char array to pass to rl_macro_bind in - rl_parse_and_bind - -lib/readline/{{bind,isearch}.c,rlprivate.h} - - _rl_isearch_terminators is now a char *, not unsigned char * - -{subst,variables,lib/sh/tmpfile}.c - - dollar_dollar_pid is now a `pid_t' instead of `int' - -variables.c - - sbrand() now takes an `unsigned long' to set the seed value - - changed last_random_value to type int, since it's always between - 0 and 32767 - - use strtoul to convert the value in assign_random instead of atoi - - take out casts in any arguments to sbrand() - - take out cast to int in call to inttostr in set_ppid() - -subst.c - - don't cast last_asynchronous_pid when passing to itos() - -{sig,subst}.c - - prototype all static forward function declarations - - 5/14 - ---- -{test,trap,variables}.c - - prototype all static forward function declarations - -variables.c - - free_variable_hash_data() now takes a PTR_T, a `generic pointer' - -builtins/{alias,bind,break,cd,complete,declare,enable,exit,fc,fg_bg,help, -history,jobs,pushd,read,set,trap,umask, - - prototype all static forward function declarations - -builtins/read.def - - reset_eol_delim now takes a `char *' arg, since that's what the - unwind_protect functions pass it, and it ignores its arguments - anyway - -lib/readline/{histsearch,input,kill,rltty,search,vi_mode}.c - - prototype all static forward function declarations - -lib/tilde/tilde.c - - prototype all static forward function declarations - - tilde_find_prefix, tilde_find_suffix, isolate_tilde_prefix, and - glue_prefix_and_suffix now take `const char *' arguments where - appropriate - -configure.in,config.h.in - - check for vsnprintf, define HAVE_VSNPRINTF if found - -lib/readline/display.c - - use vsnprintf() in rl_message if it's available; if we don't, at - least set the last character in msg_buf to 0 to avoid overrun -- - we really can't do anything about overflow at this point. if it's - available, this fixes buffer overflow problems in rl_message - - 5/15 - ---- -lib/readline/histexpand.c - - in get_history_word_specifier, allow any character to terminate - a `:first-' modifier, not just `:' and null. This is what csh - appears to do. This allows things like `!:0- xyzzy' to replace the - last argument with xyzzy - - 5/18 - ---- -configure.in, config.h.in - - check for , define HAVE_STDINT_H if found - - check for intmax_t in , define intmax_t as long if not - found - - 5/21 - ---- -builtins/kill.def - - change to use strerror() for error message when kill(2) fails - -aclocal.m4 - - new macro, BASH_C_LONG_LONG, check for `long long' - -configure.in, config.h.in - - call BASH_C_LONG_LONG, define HAVE_LONG_LONG if found - -lib/sh/snprintf.c - - new file, with implementations of snprintf, vsnprintf, asprintf, - and vasprintf, derived from inetutils version - -Makefile.in, lib/sh/Makefile.in - - add snprintf.c/snprintf.o - -configure.in, config.h.in - - add checks for snprintf, asprintf, vasprintf, with appropriate - cpp defines - -lib/readline/{rldefs,xmalloc}.h, lib/readline/xmalloc.c - - xmalloc and xrealloc now take `size_t' arguments, like their bash - counterparts - -externs.h,lib/sh/itos.c - - inttostr and itos now take `long' arguments - - inttostr takes a `size_t' argument for the buffer size - -{expr,lib/malloc/malloc,variables,general}.c - - fixed calls to itos() by removing casts, etc. - -subst.[ch] - - get_dollar_var_value now takes a long, not an int - - sub_append_number now takes a long, not an int - -subst.c - - in parameter_brace_expand_word, use a long and legal_number to - translate ${N}, to avoid overflow - - in parameter_brace_expand_length, use a long and legal_number to - translate ${#N}, to avoid overflow - - in do_array_element_assignment, array_expand_index, - array_value_internal, use arrayind_t instead of int - - let verify_substring_values take long * arguments for the return - value of evalexp() - - pass long * arguments to verify_substring_values in - parameter_brace_substring - - parameter_brace_expand_length now returns `long' - - parameter_brace_expand now uses a long variable for the return - value of parameter_brace_expand_length - - param_expand now uses a long variable for the return value from - evalexp - - array_length reference now returns an `arrayind_t', since it can - return the num_elements member of an array, which is of type - arrayind_t - -subst.h - - array_expand_index now returns an `arrayind_t' - -array.[ch] - - array_subrange now takes arrayind_t arguments, not `int' - - dup_array_subrange now uses arrayind_t local variable to do - array indexing - - use long to print array indices in print_element - -variables.c - - null_array_assign, assign_dirstack, bind_array_variable - now take arrayind_t arguments as array indices - - assign_array_var_from_word_list, assign_array_var_from_string, - unbind_array_element now use arrayind_t local variables for - array indexing - -variables.h - - change extern declaration of bind_array_variable - -builtins/common.[ch] - - get_numeric_arg now returns a `long', since it usually returns - the value of legal_number() - -builtins/{shift,break}.def - - use long variables for the return value of get_numeric_arg - -builtins/history.def - - convert string argument to int only if it's in range - -builtins/pushd.def - - set_dirstack_element and get_dirstack_element now take `long' - index arguments - - get_dirstack_index now takes a `long' index argument, since it's - passed the converted value from legal_number - -lib/sh/timeval.c - - in print_timeval, don't assume that the number of minutes fits into - an int, since it's just seconds/60. - -lib/sh/clock.c - - ditto for print_clock_t - - 5/22 - ---- -shell.c - - since the -O option settings may possibly be overridden by the - normal shell initialization or posix initialization, save the - invocation options on an alist (with add_shopt_to_alist) and - process them after basic initialization (with run_shopt_alist) - - 5/23 - ---- -trap.h - - new define, BASH_NSIG, all system signals plus special bash traps - -trap.c, builtins/trap.def - - use BASH_NSIG for array bounds and loops where appropriate - -trap.c - - change decode_signal to disallow numeric signal numbers above - NSIG -- this means you can only reference special traps like - DEBUG by name - - new SPECIAL_TRAP(s) macro to test whether s is one of the special - bash traps (currently DEBUG and EXIT) - - change reset_or_restore_signal_handlers so command substitution - doesn't inherit the debug trap (like ksh93), and child processes - don't have to rely on initialize_traps being run to get rid of - any debug trap - -support/mksignames.c - - add extra "ERR" signal name, value NSIG+1, allocate space for it - and write it out in signal_names[] - -trap.h - - new define: ERROR_TRAP == NSIG+1, change BASH_NSIG to NSIG+2 - - extern declarations for set_error_trap, run_error_trap - - new define: TRAP_STRING(s), expands to trap_list[s] if signal S - is trapped and not ignored, NULL otherwise - -trap.c - - add ERROR_TRAP to SPECIAL_TRAPS define - - initialize ERROR_TRAP stuff in initialize_traps - - new function: set_error_trap(command), sets the ERR trap string - - new function: run_error_trap(command), runs the ERR trap string - - set trap string for ERROR_TRAP to NULL in free_trap_strings - - change reset_or_restore_signal_handlers so child processes don't - inherit the ERR trap - - add case to call run_error_trap in maybe_call_trap_handler - -execute_cmd.c - - in execute_command_internal, keep track of ERR trap and call it if - necessary - - use TRAP_STRING to get the value of debug and error traps - - in execute_function, arrange things so the ERR trap is not inherited - by shell functions, and is saved and restored like the DEBUG trap - -doc/{bash.1,bashref.texi} - - documented new ERR trap - -tests/{trap.{tests,right},trap2.sub,trap2a.sub} - - added ERR trap tests - -subst.c - - on machines without /dev/fd, change the named pipe fifo list to a - list of structs containing pathname and proc information - - change unlink_fifo_list to kill the proc in the fifo list with - signal 0 and not remove the fifo if the proc is still alive. This - should fix the problem on those backward systems without /dev/fd - where fifos were removed when a job using process substitution was - suspended - - 5/24 - ---- -examples/loadables/getconf.h - - new file, with basic defines needed to make getconf work minimally - on POSIX systems without the necessary definitions - -examples/loadables/getconf.c - - replacement functions for confstr, sysconf, pathconf for systems - that lack them, providing a minimal posix interface - - heavily augmented getconf, now supports all POSIX.1-200x, - POSIX.2-200x, Solaris 7, AIX 4.2 getconf variables - - 5/29 - ---- -builtins/setattr.def - - make `readonly', `export', and `declare' print `invisible' variables - as just a command and variable name, without a value, when listing - all variables (as POSIX.2-200x d6 requires) - - 5/30 - ---- - -configure.in - - upgraded to autoconf-2.50 on main development machine, so require - autoconf-2.50 in preparation for using some if its new features - - call AC_C_PROTOTYPES - - remove call to AC_EXEEXT, which now does the wrong thing - - changed AC_INIT to new flavor - - added call to AC_CONFIG_SRCDIR - - AC_CONFIG_HEADER -> AC_CONFIG_HEADERS - - AC_RETSIGTYPE -> AC_TYPE_SIGNAL - -configure.in, aclocal.m4, config.h.in - - removed call to BASH_LARGE_FILE_SUPPORT, use AC_SYS_LARGEFILE - standard support, with new macros _FILE_OFFSET_BITS and - _LARGE_FILES - - removed definition of BASH_LARGE_FILE_SUPPORT - -doc/bashref.texi - - document new `--enable-largefile' configure option - -lib/readline/readline.c - - change rl_set_prompt to call rl_expand_prompt unconditionally, so - local_prompt and local_prompt_prefix get set correctly - - 6/6 - --- -lib/readline/complete.c - - don't append `/' or ` ' to a match when completing a symlink that - resolves to a directory, unless the match doesn't add anything - to the word. This means that a tab will complete the word up to - the full name, but not add anything, and a subsequent tab will add - a slash. Change to append_to_match; callers changed - -hashlib.c - - new function, hash_table_nentries (table), returns the number of - items in TABLE - -hashlib.h - - extern declaration for hash_table_nentries - -configure.in - - configure without bash malloc on openbsd; they claim it needs - eight-bit alignment (which the bash malloc provides, but...) - - 7/2 - --- -stringlib.c - - only call RESIZE_MALLOCED_BUFFER from strsub() if the replacement - string length is > 0, avoid possible hangs if replacement is null - -subst.c - - don't include input.h; no longer needed - -configure.in - - remove calls to AC_SYS_RESTARTABLE_SYSCALLS and - BASH_SYS_RESTARTABLE_SYSCALLS; the results are no longer used - -config.h.in - - remove define for HAVE_RESTARTABLE_SYSCALLS - -aclocal.m4 - - removed definition of BASH_SYS_RESTARTABLE_SYSCALLS; no longer used - -execute_cmd.c - - changed select command so `return' no longer terminates the select - command, so it can be used to return from an enclosing function. - This is as ksh (88 and 93) does it - -lib/readline/vi_mode.c - - fix trivial typo in declaration of vi_motion; `t' appears twice; - the second instance should be `T' - - 7/3 - --- -configure.in - - don't add -static to LDFLAGS on Solaris 2.x. This means that the - auxiliary programs will be built as dynamic executables, but that - should do no harm - - 7/5 - --- -lib/glob/fnmatch.c - - fix the code that processes **(pattern) to short-circuit if the - pattern is ill-formed or lacks a trailing `)' -- this fixes the - segfault on **(/*) - -Makefile.in, builtins/Makefile.in - - split CCFLAGS into CCFLAGS_FOR_BUILD and CFLAGS, to aid in - cross-compilation - - build programs that use $(CC_FOR_BUILD) using $(CCFLAGS_FOR_BUILD) - -configure.in, config.h.in - - check for getaddrinfo(3), define HAVE_GETADDRINFO if found - -lib/sh/netopen.c - - implemented a version of _netopen (_netopen6) that uses - getaddrinfo(3) if available, use if HAVE_GETADDRINFO is defined. - old _netopen is _netopen4; _netopen now calls either _netopen6 - or _netopen4 as appropriate - - 7/9 - --- -builtins/exit.def - - don't source ~/.bash_logout if subshell_environment is non-zero - -execute_command.c - - in execute_until_or_while, handle the case where `breaking' is - set in the loop test (e.g., by the job control code when a job - is stopped with SIGTSTP), but the return value from the test is - something that would cause the loop to break. Need to decrement - `breaking' in this case - - 7/10 - ---- -execute_cmd.c - - in execute_in_subshell, make sure a command of type cm_subshell - inherits its `enclosing' command's CMD_IGNORE_RETURN flag - -variables.c - - in maybe_make_export_env, don't allow restricted shells to put - exported functions in the export environment - - 7/11 - ---- -lib/glob/strmatch.h - - renamed old fnmatch.h - - changed guard #ifdef to _STRMATCH_H - - include system if HAVE_LIBC_FNM_EXTMATCH is defined - -lib/glob/strmatch.c - - renamed old fnmatch.c - - include "strmatch.h" - - if HAVE_LIBC_FNM_EXTMATCH is defined, define a dummy version of - strmatch() that just calls fnmatch(3) - -lib/glob/glob.c - - include "strmatch.h" - - fnmatch -> strmatch - -Makefile.in, lib/glob/Makefile.in - - fnmatch -> strmatch - -{bashhist,execute_cmd,pathexp,pcomplete,shell,stringlib,subst,test}.c, -pathexp.h,builtins/help.def - - include - - fnmatch -> strmatch - -execute_cmd.c - - broke the code that parses the interpreter name from a #! line - out from execute_shell_script to a new function, getinterp() - - call getinterp from execute_shell_script - - use return value from getinterp in error message about bad - #! interpreter in shell_execve - - 7/12 - ---- -lib/readline/isearch.c - - the last isearch string is now remembered in a new static variable, - last_isearch_string - - if ^R^R is typed, readline now searches for the remembered isearch - string, if one exists - - 7/24 - ---- -pcomplete.h - - extern declaration for completions_to_stringlist() - - 7/25 - ---- -builtins/complete.def - - make compgen handle -o default option - - make compgen return success only if sl->list_len is non-zero, - indicating that there are items on the list - - 7/31 - ---- -execute_cmd.c - - in execute_connection, force stdin to /dev/null for asynchronous - commands if job control is not active, not just if the shell is - running a shell script (since you can run `set -m' in a script) - -lib/readline/rltty.c - - make sure _rl_tty_restore_signals resets `tty_sigs_disabled' on - successful restoration of the terminal modes - - make sure _rl_tty_disable_signals turns off IXON so that ^S and - ^Q can be read by rl_quoted_insert - - 8/1 - --- -aclocal.m4 - - new check for FNM_EXTMATCH being defined in , as Ullrich - Drepper intends to do for new versions of GNU libc - -config.h.in - - new definition for HAVE_LIBC_FNM_EXTMATCH - -configure.in - - check for fnmatch, but don't define anything in config.h - - call BASH_FUNC_FNMATCH_EXTMATCH to check for FNM_EXTMATCH - - 8/2 - --- -alias.h - - remove bogus extern declaration for xmalloc() - - include "stdc.h" - - add prototype declarations for all extern function declarations - -xmalloc.c,lib/readline/xmalloc.c - - fix xmalloc to return a PTR_T - - fix xrealloc to return a PTR_T and take a PTR_T as first argument - -include/ansi_stdlib.h - - extern declarations for malloc and realloc have them return PTR_T - -xmalloc.h - - new file, with extern declarations for functions in xmalloc.c - -general.h - - removed extern declarations for functions in xmalloc.c - - include xmalloc.h - -Makefile.in,builtins/Makefile.in - - update dependencies to include xmalloc.h - -parse.y,{alias,array,bashline,bracecomp,execute_cmd,findcmd,flags,general, -hashcmd,locale,mailcheck,make_cmd,pathexp,pcomplete,print_cmd,stringlib, -subst,unwind_prot,variables}.c -builtins/{common,evalfile}.c -builtins/{cd,command,enable,exec,printf,read,set}.def -lib/sh/{makepath,netopen,pathphys,setlinebuf,shquote,snprintf,stringlist, -strtrans,tmpfile}.c -lib/readline/{util,terminal,shell,readline,macro,kill,isearch,input, -histfile,histexpand,display,complete,bind}.c - - make sure all calls to xmalloc are cast to the right return value - -siglist.c - - include xmalloc.h - -parse.y,{alias,bashline,bracecomp,expr,make_cmd,nojobs,print_cmd,subst}.c -builtins/{fc,printf,read}.def -lib/sh/snprintf.c, lib/tilde/tilde.c -lib/readline/{bind,display,histexpand,isearch,macro,util,vi_mode}.c - - make sure all calls to xrealloc are cast to the right return value - -lib/sh/{netopen,setlinebuf,shquote,snprintf}.c, lib/tilde/tilde.c - - include xmalloc.h, remove extern declaration of xmalloc - -lib/readline/xmalloc.h - - xmalloc and xrealloc should return PTR_T - -lib/readline/rldefs.h - - don't include an extern declaration for xmalloc - - 8/7 - --- -support/shobj-conf - - fixed up commented-out stanzas for HP's unbundled C compiler on - HP/UX - -support/bashbug.sh - - force the subject to be changed from the default - -lib/readline/doc/{rluser.texinfo,readline.3}, doc/bash.1 - - document that transpose-words swaps the last two words on the line - if point is at the end of the line - - 8/9 - --- -stringlib.c - - fix possible infinite recursion problem with null pattern in - strsub() - -hashlib.c - - new function copy_hash_table to copy a hash table using a caller- - supplied function to copy item data (defaults to savestring()) - -hashlib.h - - new extern declaration for copy_hash_table - -builtins/declare.def - - changes so that declare [-a] var=value assigns `value' to element 0 - of array variable `var' like ksh93 - - change so that declare [-a] var[N]=value assigns `value' to element - N of array variable `var' like ksh93 - - 8/13 - ---- -arrayfunc.c - - new file, for miscellaneous array functions - -arrayfunc.h - - new file, extern declarations for functions in arrayfunc.c - -variables.c - - move convert_var_to_array, bind_array_variable, - assign_array_from_string, assign_array_var_from_word_list, - assign_array_var_from_string, quote_array_assignment_chars, - skipsubscript, unbind_array_element, print_array_assignment - to arrayfunc.c - -shell.h - - include arrayfunc.h after variables.h - -variables.h - - remove above extern function declarations moved to arrayfunc.h - - add extern declaration for var_lookup - -Makefile.in - - add arrayfunc.c, arrayfunc.h in appropriate places - - add arrayfunc.h to dependencies - -subst.c - - move valid_array_reference, array_expand_index, array_variable_part, - array_value_internal, array_value (now global), get_array_value, - do_array_element_assignment to arrayfunc.c - -subst.h - - extern declarations for functions above moved to arrayfunc.h - -arrayfunc.h - - extern declarations for above functions from subst.c - -subst.[ch] - - string_list_dollar_star and string_list_dollar_at are now global - functions - - quote_escapes is now a global function - -subst.c - - maybe_expand_string -> expand_string_if_necessary - - expand_string_to_string -> expand_string_to_string_internal - - new functions: expand_string_to_string and - expand_string_unsplit_to_string, which call - expand_string_to_string_internal with expand_string and - expand_string_unsplit as the FUNC arguments, respectively - -arrayfunc.c - - change array_expand_index to call expand_string_to_string instead - of maybe_expand_string - - 8/14 - ---- -shell.c - - in execute_env_file, call expand_string_unsplit_to_string - -mailcheck.c - - in check_mail, call expand_string_to_string - -variables.c - - in assign_in_env, call expand_string_unsplit_to_string - -arrayfunc.c - - new function, array_variable_name, splits an array reference into - a name (which is returned as a new string) and subscript - - change array_variable_part to just call array_variable_name and - look up the string returned with find_variable - - new function, find_or_make_array_variable (name, flags) which will - look up an array variable and convert a string variable to an - array if necessary. The FLAGS argument, if non-zero, says to - check the readonly and noassign attributes and fail if either is set - -builtins/read.def - - make `read -a aname' honor any readonly status of `aname' - - read -a now calls find_or_make_array_variable with FLAGS value 1 - -arrayfunc.[ch], subst.c, builtins/{declare,read}.def - - do_array_element_assignment -> assign_array_element - - 8/20 - ---- -parse.y - - changed `for' command grammar to allow missing word list after `IN' - token, like latest POSIX drafts require - -lib/sh/tmpfile.c - - in sh_mktmpname(), check for filenum == 0 and init to non-zero number - in this case. it can happen on arithmetic overflow - -support/mkversion.sh - - added `[0-9].[0-9][0-9][a-z]' as an acceptable value for a - distribution to allow for intermediate versions, like 2.05a - -support/config.guess - - removed the addition of the output of `/usr/bin/objformat' when - creating the canonical name on FreeBSD machines, so the canonical - name is once again `freebsd4.2' instead of `freebsdelf4.2' - - 8/22 - ---- -lib/readline/{rlstdc,history,keymaps,readline,rldefs,rlprivate,rlshell, -rltypedefs,xmalloc}.h -lib/readline/{bind,compat,complete,display,funmap,histexpand,histsearch, -input,isearch,kill,nls,parens,readline,rltty,search,shell,signals,vi_mode - - changed __P to PARAMS - -lib/tilde/tilde.[ch] - - changed __P to PARAMS - -{Makefile,configure}.in - - changed the version number to 2.05a - - changed the release status to `alpha1' - - 8/23 - ---- -support/shobj-conf - - support for building shared libraries on Darwin/MacOS X - -siglist.h - - extern declaration for strsignal() to compensate for lack of - a definition in some system include files - -jobs.c - - remove casts from strsignal() calls - -[bash-2.05a-alpha1 frozen] - - 8/27 - ---- -[bash-2.05a-alpha1 released] - - 8/27 - ---- -execute_cmd.c - - fix eval_arith_for_expr to handle the case where the expanded - word list is NULL, returning 0 in this case - -print_cmd.c - - in print_function_def, make sure that func_redirects is assigned - a value before being used - - 8/28 - ---- -alias.c - - include for definition of isalpha() - -bashhist.h - - add prototypes for extern function declarations - -flags.c - - include bashhist.h for extern function declarations - -mksyntax.c - - include if HAVE_UNISTD_H is defined in config.h - -parse.y - - include test.h for extern function declarations - -externs.h - - change extern declaration for setlinebuf to sh_setlinebuf - -stringlib.c - - include for extern function declarations - -variables.h - - add function prototypes for all of the sv_* functions - -builtins/common.h - - add extern declarations for set_shellopts() and parse_shellopts() - from builtins/set.def - -variables.c - - include "hashcmd.h" for extern declaration for flush_hashed_filenames - - include "pathexp.h" for extern declaration for setup_glob_ignore - -lib/malloc/malloc.c - - cast to `long' instead of `int' in memalign for 64-bit machines - -{pcomplete,trap}.c - - changed printf escape sequences used to print pointers to %p - -lib/readline/undo.c - - include "xmalloc.h" for extern function declaration - -input.h - - add function prototypes to extern declarations for getc_with_restart - and ungetc_with_restart - -variables.[ch] - - changed type of `function' member of `struct name_and_function' to - `sv_func_t', which is defined and prototyped in variables.h - - map_over now takes an `sh_var_map_func_t *' - -shell.h - - start of a set of function pointer typedefs like those in - lib/readline/rltypedefs.h - -hashlib.[ch] - - second paramter to flush_hash_table is now an `sh_free_func_t *' - -trap.c - - parameter to reset_or_restore_signal_handlers is now an - `sh_resetsig_func_t *' - -pcomplete.h, pcomplib.c - - function pointer argument to print_all_compspecs is now an - `sh_csprint_func_t *' - - function pointer `list_getter' element of an `ITEMLIST' is now - prototyped with __P((...)) instead of using `Function *' - -jobs.[ch] - - `j_cleanup' member of a JOB is now an `sh_vptrfunc_t *' - -alias.c - - map_over_aliases now takes an `sh_alias_map_func_t *' - - free_alias_data now takes a `PTR_T' - -pathexp.c - - function pointer argument to ignore_globbed_names is now an - `sh_ignore_func_t *' - -bashline.c - - function pointer argument to _ignore_completion_names is now an - `sh_ignore_func_t *' - -pathexp.h,{bashhist,bashline.c - - `item_func' member of a `struct ignorevar' is now an - `sh_iv_item_func_t *' - -builtins/evalfile.c - - `errfunc' is now an `sh_vmsg_func_t *' - -jobs.c - - map_over_job now takes an `sh_job_map_func_t *' as its first argument - -array.[ch] - - function pointer argument to array_walk is now an - `sh_ae_map_func_t *' - -general.c - - tilde_expansion_preexpansion_hook has type `tilde_hook_func_t *', - and so the assignment in tilde_initialize doesn't need a cast - -list.c - - map_over_words now takes an `sh_icpfunc_t *' as its second argument - -input.h - - the `getter' and `ungetter' function pointer members of a - BASH_INPUT are now of types `sh_cget_func_t *' and - `sh_cunget_func_t *' respectively - - init_yy_io now takes an `sh_cget_func_t *' as its first argument and - an `sh_cunget_func_t *' as its second - -parse.y - - init_yy_io now takes an `sh_cget_func_t *' as its first argument and - an `sh_cunget_func_t *' as its second - - initialize_bash_input casts bash_input.getter and bash_input.ungetter - appropriately - -builtins/mkbuiltins.c - - make the extern function definitions written to builtext.h have - prototypes with __P((...)) - - include "stdc.h" - - change Function to mk_handler_func_t - - fixed comment_handler to take the right number of args - - prototyped all the handler functions with __P((...)) - -builtins.h - - the `function' member of a struct builtin is now of type - `sh_builtin_func_t *' - -builtins/common.[ch] - - last_shell_builtin, this_shell_builtin are now of type - `sh_builtin_func_t *' - - find_shell_builtin, builtin_address, find_special_builtin now return - `sh_builtin_func_t *' - -builtins/exit.def, {execute_cmd,jobs,nojobs,variables}.c, parse.y - - changed all declarations of last_shell_builtin and this_shell_builtin - -execute_cmd.c - - execute_builtin, execute_builtin_or_function, - execute_subshell_builtin_or_function now take an - `sh_builtin_func_t *' instead of a `Function *' for argument - - changed appropriate variables from `Function *' to - `sh_builtin_func_t *' - -builtins/{bind,builtin,enable,read,setattr}.def - - replaced uses of `Function *' in variable declarations with - appropriate types (sh_builtin_func_t * or rl_command_func_t *) - -builtins/set.def - - set_func and get_func members of binary_o_options are now of types - `setopt_set_func_t *' and `setopt_get_func_t *', which are - prototyped - -builtins/shopt.def - - set_func member of shopt_vars is now of type `shopt_set_func_t *' - -bashline.c - - enable_hostname_completion now returns `int' (the old value of - perform_hostname_completion) - -[The only use of Function and VFunction now is for unwind-protects] - - 9/4 - --- -lib/sh/getcwd.c - - use const define from config.h rather than `CONST' - - use PTR_T define from xmalloc.h rather than `PTR' - - include xmalloc.h for PTR_T - - remove PATH_MAX define, rely on value from maxpath.h - -{general,mailcheck}.c, lib/sh/{pathcanon,pathphys}.c - - don't include maxpath.h directly; it's already included by shell.h - -lib/sh/mailstat.c - - new `mailstat()' implementation, to stat a mailbox file for - mail checking. handles maildir-style mail directories with one - file per message and creates a dummy stat struct from them - -lib/sh/Makefile.in - - add mailstat.c and mailstat.o in the appropriate places - -lib/malloc/malloc.c - - augmented implementation with wrapper functions that pass in file - and line number information from cpp. currently unused, but a - placeholder for future debugging and use tracking - -lib/malloc/shmalloc.h - - new file, extern declarations for allocation wrapper functions for - use by the shell (and others, I guess) - -xmalloc.[ch] - - wrapper functions for xmalloc, xfree, xrealloc (sh_ prefixed) that - pass cpp line number information through to the malloc functions, - if USING_BASH_MALLOC is defined - - 9/5 - --- -lib/malloc/gmalloc.c - - removed; no longer part of distribution - -lib/malloc/Makefile.in - - removed references to gmalloc.[co] - -configure.in, doc/bashref.texi - - removed references to `--with-glibc-malloc' configure option - -{configure,Makefile}.in - - changed the way bash malloc is configured into the Makefile, making - it more like how readline is configured. If the bash malloc is - not configured in, nothing in lib/malloc will be built - - 9/6 - --- -lib/malloc/imalloc.h - - new file, some internal malloc definitions - -lib/malloc/mstats.h - - new file, definitions for malloc statistics structs and functions - -lib/malloc/trace.c - - new file, malloc tracing functions (currently just print messages - to stderr), code is #ifdef MALLOC_TRACE - -lib/malloc/stats.c - - new file, moved malloc stats code from malloc.c to here - -lib/malloc/malloc.c - - moved some definitions to imalloc.h - - moved stats code to stats.c - - malloc tracing calls added to internal_{malloc,realloc,free}, all - #ifdef MALLOC_TRACE - -lib/malloc/Makefile.in, Makefile.in - - added {imalloc,mstats}.h, {trace,stats}.c - -parse.y - - changed decode_prompt_string to save and restore $? - (last_command_exit_value) around calls to expand_prompt_string(), - so command substitutions in PS1, etc. don't change $? - -{array,subst}.c - - a couple more arrayind_t fixes from Paul Eggert - -configure.in - - remove redundant check for wait3(2) - -redir.h - - fixed a typo (stdin_redirs -> stdin_redirects) - - 9/10 - ---- -execute_cmd.c - - remove check for \n and \r from WHITESPACE macro, since those - chars are not whitespace as returned by the whitespace(c) macro - - getinterp now takes a `char *' as first arg, not unsigned char * - - execute_shell_script now takes a `char *' as first arg, not - unsigned char * - - fix typo in forward declaration for `initialize_subshell' - -general.[ch] - - check_binary_file now takes a (char *) argument, not unsigned char * - - pass unsigned char to isspace and isprint because of ISO C fuckup - - bash_tilde_expand now takes a `const char *' as its argument - -builtins/evalfile.c, shell.c - - buffer passed to check_binary_file is char, not unsigned char - -parse.y - - fix extern declaration for yyerror() - - yyerror now takes a `const char *' as first arg - -{error,jobs}.c - - fixes to printf-style functions to handle pids wider than an int - -lib/readline/{isearch,vi_mode}.c - - fix call to rl_message in rl_display_search (remove extra arg) - -variables.c - - fix missing argument to builtin_error in make_local_variable - -builtins/getopts.def - - since getopts takes no options, change while loop calling - internal_getopts to a simple `if' check - -builtins/printf.def - - since printf takes no options, change while loop calling - internal_getopts to a simple `if' check - -lib/readline/bind.c - - remove _SET_BELL macro, expand code inline - -lib/readline/input.c - - change _rl_input_available to use either select or FIONREAD, - but not both - -lib/readline/readline.c - - fix rl_digit_loop to remove unreachable code at end of loop - -{bashhist,bashline,expr,jobs,redir,shell}.c, builtins/fc.def, lib/sh/snprintf.c - - bracket unused functions with #ifdef INCLUDE_UNUSED/#endif - - remove some unused variables - -execute_cmd.c - - remove #ifdef'd code that allowed `return' to terminate a select - statement - -expr.c - - remove some extraneous tests from strlong() - -array.h - - arrayind_t is now a long, since shell arithmetic is performed as - longs - - remove second declaration of new_array_element - -builtins/printf.def - - in mklong, xrealloc cannot return NULL, so don't check for it - - remove some #if 0 code - - fix core dump triggered by a format specification with more than - one `*' - - remove `foundmod', since its value mirrors `modchar != 0' - - include "common.h" for builtin_{error,usage} declarations - -Makefile.in,builtins/Makefile.in - - updated some dependencies due to new include files - -pcomplete.c - - include "execute_cmd.h" for declaration of execute_shell_function - -arrayfunc.c - - include for printf - - include "builtins/common.h" for builtin_error declaration - -builtins/evalstring.c - - include "../trap.h" for run_trap_cleanup declaration - -builtins/help.def - - include "common.h" instead of locally declaring builtin_error - and builtin_usage - -error.h - - add extern declaration for itrace() - - add prototype to extern declaration of get_name_for_error - - file_error now takes a `const char *' as first argument - -externs.h - - added prototype for sh_setlinebuf declaration, bracketed with - NEED_SH_SETLINEBUF_DECL so we don't need stdio.h everywhere - - add extern declaration for parse.y:return_EOF() - -shell.c - - add NEED_SH_SETLINEBUF_DECL before including shell.h - -lib/readline/callback.c - - include or "ansi_stdlib.h" for abort declaration - -quit.h - - remove declaration of throw_to_top_level - -subst.c - - remove unused extern declaration for getopts_reset - -lib/sh/netopen.c - - include for legal_number, etc. - - add prototype for inet_aton extern declaration - -lib/sh/clock.c - - include for __P declaration - - add extern declaration for get_clk_tck - -support/mkversion.sh - - changed so that extern function declarations for functions in - version.c (moved from externs.h) are in the generated version.h - -shell.h - - include version.h - -version.c - - various `char *' version variables are now `const char *' - -general.h - - add prototype for same_file, bracketed with _POSIXSTAT_H - #ifdef, since that's what include/posixstat.h defines - -builtins/common.[ch] - - _evalfile, maybe_execute_file, source_file, and fc_execute_file - now take a `const char *' as their first argument - -eval.c - - removed extern declaration of yyparse; it's in externs.h - -parse.y - - added prototypes to static forward function declarations - - changed local `all_digits' variable in read_token_word () to - all_digit_token to avoid clash with all_digits() function in - general.c - -{bashhist,copy_cmd,make_cmd,hashlib,mailcheck}.c - - added prototypes for static function declarations - -shell.h - - add extern declarations for interactive, interactive_shell, - changed c files with extern declarations - -pcomplete.c - - changed it_init_aliases to avoid shadowing global variable - `aliases' - -bashline.c,pathexp.c,general.h - - sh_ignore_func_t is now a pointer to a function taking a - `const char *'; users changed - -configure.in - - test for - -config.h.in - - add #undef HAVE_STRINGS_H - -bashansi.h - - change like recommended in autoconf manual - - 9/11 - ---- -[a date which will live in infamy. prayers for the victims.] - -execute_cmd.c - - don't use an absolute index into abuf in mkfmt, use - sizeof(abuf) to compute last index - -builtins/common.c - - fix read_octal to do a better job of detecting overflow while - iterating through the string - -builtins/umask.def - - change octal-print mode to print 4 digits, like other shells - - cast umask to unsigned long to avoid problems on systems where - it's wider than an int (POSIX doesn't guarantee that mode_t is - no wider than an int, but real-world systems use int) - -builtins/printf.def - - mklong can never return NULL (it uses xrealloc), so the mainline - doesn't need to check for NULL returns - - new function, getldouble (long double *), to get long doubles - - mklong now takes a `char *' as its second argument, the modifier(s) - to use - - changed use of `modchar' to handle more than a single modifier - character - - changed to handle `long double' and `L' formats better, rather - than discarding long double information - - since printf now follows the POSIX.2 rules for conversion errors, - we can dispense with the status returns from the get* functions - - make the get* functions as similar in structure as possible, - removing type casts, etc. - -lib/sh/timeval.c,execute_cmd.c - - change some instances of `long' to `time_t', for systems where - a time_t is bigger than a long - -jobs.c - - include "posixtime.h" instead of - -config.h.in - - add defines for HAVE_DECL_CONFSTR, HAVE_DECL_STRTOLD, - HAVE_DECL_SBRK, HAVE_DECL_PRINTF - - remove defines for SBRK_DECLARED and PRINTF_DECLARED - - add _GNU_SOURCE define - -configure.in - - add AC_CHECK_DECLS for strtold, confstr, sbrk, printf - - remove call to BASH_FUNC_SBRK_DECLARED - - remove call to BASH_FUNC_PRINTF - -xmalloc.c, lib/malloc/malloc.c - - change check of SBRK_DECLARED to HAVE_SBRK_DECL - -print_cmd.c - - change PRINTF_DECLARED to HAVE_DECL_PRINTF - -builtins/evalstring.c, builtins/common.h - - parse_and_execute now takes a `const char *' as its second argument - -input.h,parse.y - - with_input_from_* functions now take a `const char *' as their - second argument - - init_yy_io now takes a `const char *' as its fourth argument - -parse.y,externs.h - - parse_string_to_word_list now takes a `const char *' as its second - argument - -tests/builtins.right - - change output to account for extra digit in umask output - -pcomplib.c - - free_progcomp now takes a PTR_T argument - -builtins/bashgetopt.h - - include - - add prototypes to extern declarations - -builtins/shopt.def - - add prototypes to static function declarations - -builtins/{fc,umask,wait}.def, builtins/{bashgetopt,common}.c - - include for isdigit macro (referenced by `digit(x)') - -lib/readline/complete.c - - added more static function declarations with prototypes - - 9/12 - ---- -lib/sh/tmpfile.c - - use `^' instead of `*' in sh_mktmpname to make filenames a bit - more random - -include/stdc.h,lib/readline/rldstdc.h - - add __attribute__ definition - -builtins/common.h - - add printf __attribute__ to declaration of builtin_error - -error.h - - add printf __attribute__ to declaration of programming_error, - report_error, parser_error, fatal_error, sys_error, internal_error, - internal_warning - -lib/readline/readline.h - - add printf __attribute__ to declaration of rl_message - -pcomplete.c - - add printf __attribute__ to declaration of debug_printf - -print_cmd.c - - add printf __attribute__ to declarations of cprintf, xprintf - -include/chartypes.h - - new file, includes and defines macros that check for - safe (ascii) arguments before calling the regular ctype macros - -{alias,bashline,execute_cmd,expr,findcmd,general,locale,mksyntax,stringlib,subst,variables}.c -parse.y -builtins/{bashgetopt,common}.c -builtins/{fc,printf,umask,wait}.def -lib/glob/strmatch.c -lib/sh/{oslib,pathcanon,pathphys,snprintf,strcasecmp,strindex,stringvec,strtod,strtol,strtrans}.c -examples/loadables/{head,sleep}.c - - include "chartypes.h" or instead of - -Makefile.in,{builtins,lib/{glob,sh}}/Makefile.in - - update dependencies to include chartypes.h - -lib/sh/inet_aton.c - - use `unsigned char' instead of `char' to pass to ctype.h functions - -lib/sh/netopen.c - - check for '0' <= host[0] <= '9' in _getaddr instead of using - isdigit - -subst.c,lib/sh/shquote.c - - change array subscripts into sh_syntaxtab from `char' to - `unsigned char' - -{alias,bashline,execute_cmd,expr,general,subst}.c, parse.y -builtins/{fc,printf,umask,wait}.def builtins/{bashgetopt,common}.c -lib/sh/{pathcanon,pathphys,snprintf,strcasecmp,strindex,strtod,strtol,strtrans}.c -examples/loadables/{head,sleep}.c - - change to use some of the new macros in chartypes.h - - remove old local macro definitions now provided by chartypes.h - -general.h - - remove definition of isletter, ISOCTAL, digit, digit_value - - change legal_variable_starter and legal_variable_char to use - chartypes.h macros - - change ABSPATH to use chartypes.h macros - -lib/readline/util.c - - change to use Paul Eggert's FUNCTION_FOR_MACRO define to define - function replacements for macros in chardefs.h - -lib/readline/chardefs.h - - added some of the same macros as in chartypes.h - - change _rl_lowercase_p, _rl_uppercase_p, _rl_digit_p, - _rl_to_upper, _rl_to_lower to use new IS* macros - - added _rl_isident macro from vi_mode.c:isident - -lib/readline/{bind,complete,nls}.c - - change to use some of the new macros from chardefs.h - -lib/readline/vi_mode.c - - isident -> _rl_isident - - remove local defines of macros in chardefs.h - -lib/sh/strtol.c - - updated to new version, modified from glibc 2.2.4 and sh-utils-2.0. - This one can do strtoll and strtoull, if necessary - - 9/13 - ---- -builtins/ulimit.def - - changed get_limit so it retrieves both hard and soft limits - instead of one or the other - - changed callers of get_limit - - changed getmaxvm to take soft limit, hard limit as arguments - - changed getmaxuprc to just take a single argument, the value - - changed calls to printone() to pass soft limit or hard limit - depending on `mode' instead of using old current_limit variable - - moved check for out-of-range limits in ulimit_internal into the - block that converts a string argument to a value of type rlim_t - - changed RESOURCE_LIMITS struct to break the description into a - description string and separate scale factor string - - changed print_all_limits to print a single error message if - get_limit fails, including limits[i].description now that the - scale factor has been removed from the description string - - removed DESCFMT define, since it's now used only in printone() - - changed printone to print the option character associated with a - particular limit if we're printing multiple limits - - changed calls to builtin_error to print the description associated - with a limit if setting or getting the limit fails - - added support for new POSIX 1003.1-200x rlim_t values: - RLIM_SAVED_CUR and RLIM_SAVED_MAX, which expand to the current - soft and hard limits, whatever they are - - changed printone to print `hard' or `soft' if the current limit is - RLIM_SAVED_MAX or RLIM_SAVED_CUR, respectively - - changed ulimit_internal to handle new `hard' and `soft' arguments - - changed help text do describe the special limit arguments `hard', - `soft', and `unlimited' - -doc/{bash.1,bashref.texi} - - documented new `hard' and `soft' limit arguments to `ulimit' - -hashlib.[ch] - - find_hash_item now takes a `const char *' is its first argument - - hash_string now takes a `const char *' is its first argument - - remove_hash_item now takes a `const char *' as its first argument - -pcomplib.c - - removed cast from first argument to find_hash_item in find_compspec - -general.[ch] - - absolute_program now takes a `const char *' as its argument - - absolute_pathname now takes a `const char *' as its argument - -lib/glob/glob.[ch] - - glob_pattern_p now takes a `const char *' as its argument - -bashline.c - - removed cast from first argument to absolute_program in - command_word_completion_function - - removed cast from first argument to glob_pattern_p in - attempt_shell_completion - -findcmd.[ch] - - find_absolute_program, find_user_command, find_path_file, - search_for_command, user_command_matches now take a - `const char *' as their first argument - - file_status, executable_file, is_directory, executable_or_directory - now take a `const char *' as their argument - - _find_user_command_internal, find_user_command_internal, - find_user_command_in_path - -lib/sh/makepath.c, externs.h - - changed sh_makepath so it takes `const char *' for its first - two arguments - -hashcmd.[ch] - - find_hashed_filename now takes a `const char *' as its first arg - - remove_hashed_filename now takes a `const char *' as its first arg - -variables.[ch] - - new_shell_variable, var_lookup, shell_var_from_env_string, - find_name_in_env_array, bind_function, makunbound, - bind_name_in_env_array, bind_tempenv_variable, bind_variable - now take a `const char *' as their first arg - - find_function, make_new_variable, find_tempenv_variable, - find_variable_internal, find_variable, set_func_read_only, - set_func_auto_export, all_variables_matching_prefix, assign_in_env, - assignment, kill_local_variable, make_local_variable, unbind_variable - now take a `const char *' as their arg - - mk_env_string now takes `const char *' arguments - -arrayfunc.[ch] - - skipsubscript now takes a `const char *' as its argument - - 9/17 - ---- -lib/readline/complete.c - - attempt to preserve case of what the user typed in - compute_lcd_of_matches if we're ignoring case in completion - -builtins/{let,pushd}.def,{execute_cmd,expr}.c - - change some 0L constants to 0 and let the compiler sort it out - - 9/18 - ---- -lib/malloc/alloca.c - - alloca now takes a `size_t' argument - -include/memalloc.h - - if we're providing an extern function declaration for alloca, - use `void *' and prototype if __STDC__ is defined - - if HAVE_ALLOCA_H is defined, but C_ALLOCA is defined, don't - define HAVE_ALLOCA - - 9/19 - ---- -subst.c - - do_assignment_internal, do_assignment, and do_assignment_no_expand - now take a `const char *' as their first argument - -general.h - - a `sh_assign_func_t' is now a function taking a `const char *' and - returning int - -hashcmd.c - - free_filename_data now takes a `PTR_T' argument to agree with the - typedef for `sh_free_func_t' - -lib/sh/snprintf.c - - use TYPE_MAXIMUM define like strtol.c instead of huge constants - - 9/20 - ---- -lib/sh/snprintf.c - - don't bother to compile the bulk of the body unless HAVE_SNPRINTF - or HAVE_ASPRINTF is not defined - - 9/24 - ---- -flags.c - - ignore `set -n' if the shell was started interactively - -lib/readline/readline.c - - initialize readline_echoing_p to 0; let the terminal-specific code - in rltty.c set it appropriately - -lib/malloc/malloc.c - - changed internal_memalign() slightly to avoid compiler warnings about - negating an unsigned variable (-alignment -> (~alignment + 1)) - - 9/27 - ---- -lib/readline/readline.c - - changed rl_newline to set _rl_history_saved_point appropriately - for the {previous,next}_history code - -lib/readline/rlprivate.h - - extern declaration for _rl_history_preserve_point - -lib/readline/bind.c - - new bindable variable, `history-preserve-point', sets value of - _rl_history_preserve_point - - 10/1 - ---- -lib/malloc/table.c - - new file, with a map of allocated (and freed) memory for debugging - multiple frees, etc. Indexed by hash on values returned by - malloc(); holds size, file and line number info for last alloc or - free and a couple of statistics pointers - -lib/malloc/malloc.c - - a few cleanups; added calls for registering allocations and frees - if MALLOC_REGISTER is defined - - replaced MALLOC_RETURN with explicit MALLOC_NOTRACE define - - reordered fields in `struct...minfo' in `union mhead' to restore - eight-byte alignment - - added explicit checks for underflow in free and realloc since - checking mh_magic2 is not sufficient to detect everything (it's - no longer the last field in the struct, and thus not the bytes - immediately preceding what's returned to the user) - - new function, xbotch, for printing file and line number info for - the failed assertion before calling botch() (programming_error()) - -configure.in - - replaced call to BASH_C_LONG_LONG with call to - AC_CHECK_TYPES([long long]) - - moved the C compiler tests before the tests for various - system types, so we can know whether we have `long long' - before testing for 64-bit types - - if we have `long long', check for sizeof(long long) and save value - -aclocal.m4 - - changed BASH_TYPE_BITS64_T to check `long long' before `long', but - after `double' - - 10/2 - ---- -lib/malloc/malloc.c - - made malloc and realloc both agree on the rounding for a request of - size N (round up to nearest multiple of 8 after adjusting for - malloc overhead); uses new ALLOCATED_BYTES macro - - realloc and free now use new IN_BUCKET macro for underflow checks - -execute_cmd.c - - fixed time_command() to use `time_t' instead of `long' to hold - time stamps - -lib/sh/clock.c - - clock_t_to_secs now takes a `time_t *' second argument - - fixed print_clock_t to call clock_t_to_secs with right arguments - -lib/sh/timeval.c - - fixed print_timeval to make `minutes' a `long' and make its - structure identical to print_clock_t - -redir.c - - changed redirection_error to check for EBADF and use the file - descriptor being redirected from in the error message if it - is >= 0 - -Makefile.in - - changed release status to `beta1' - -lib/glob/collsyms.h - - added a few ASCII symbols to the posix_collsyms array - - 10/3 - ---- -aclocal.m4 - - fixed typo in BASH_TYPE_BITS64_T - -configure.in - - added check for unsigned chars with AC_C_CHAR_UNSIGNED - -config.h.in - - added PROTOTYPES and __CHAR_UNSIGNED__ #defines - -general.h - - if CHAR_MAX is not define by , provide a definition - -builtins/printf.def - - change tescape() to mask \0 and \x escape sequences with 0xFF - - change tescape() to process at most two hex digits after a `\x' - -lib/sh/strtrans.c - - change strtrans() to mask \0 and \x escape sequences with 0xFF - - change strtrans() to process at most two hex digits after a `\x'. - This affects `echo -e' and $'...' processing - -lib/readline/bind.c - - changed rl_translate_keyseq() to process at most two hex digits - after a `\x' - -lib/readline/doc/{rluser.texinfo,readline.3}, doc/bash.1 - - changed documentation for key binding escape sequences to specify - that at most two hex digits after \x are translated - - changed documentation for key binding to specify that the result - of \nnn or \xhh escapes is an eight-bit value, not just ASCII - -doc/{bash.1,bashref.texi} - - changed documentation of $'...' to specify that at most two hex - digits after \x are translated - - changed `echo' documentation to specify that at most two hex - digits after \x are translated - - changed documentation for `echo' and $'...' to specify that the - result of \nnn or \xhh escapes is an eight-bit value, not just ASCII - - 10/4 - ---- -lib/malloc/malloc.c - - changed interface for xbotch to pass memory address and error code - as two additional arguments - - call mregister_describe_mem from xbotch to get the last allocation - or free before the botch - -configure.in - - call AC_CHECK_DECLS([strsignal]) - -config.h.in - - add HAVE_DECL_STRSIGNAL - -siglist.h - - make declaration of strsignal() dependent on !HAVE_DECL_STRSIGNAL - - 10/5 - ---- -support/texi2html - - upgraded to version 1.64 - - 10/9 - ---- -aclocal.m4 - - added check for `long long' to BASH_TYPE_PTRDIFF_T - -configure.in - - replaced call to BASH_HAVE_TIOCGWINSZ with AC_HEADER_TIOCGWINSZ - -aclocal.m4 - - replaced body of BASH_STRUCT_TERMIOS_LDISC with call to - AC_CHECK_MEMBER(struct termios.c_line, ...) - - replaced body of BASH_STRUCT_TERMIO_LDISC with call to - AC_CHECK_MEMBER(struct termios.c_line, ...) - -[bash-2.05a-beta1 frozen] - - 10/10 - ----- -lib/sh/snprintf.c - - fixed exponent() to not smash the trailing zeros in the fraction - when using %g or %G with an `alternate form' - - fixed exponent() to handle the optional precision with %g and %G - correctly (number of significant digits before the exponent) - - 10/11 - ----- -expr.c - - fixed strlong() to correct the values of `@' and `_' when - translating base-64 constants (64#@ == 62 and 64#_ == 64), for - compatibility with ksh - -lib/sh/itos.c - - added a slightly more flexible fmtlong() function that takes a - base argument and flags (for future use) - - rewrote itos and inttostr in terms of fmtlong - -lib/sh/fmtulong.c - - new file, converts unsigned long to string. hooks for `unsigned - long long' in the future. unused as yet - - 10/15 - ----- -lib/readline/rltty.c - - change the SET_SPECIAL macro to avoid possible (but highly - unlikely) negative array subscripts - -error.h - - add __attribute__ to extern declaration of itrace (even though the - function isn't defined in released versions of bash) - -bashansi.h - - include if HAVE_STRINGS_H is defined, to get any extra - function declarations provided therein - -copy_cmd.c - - fix typo in forward declaration for copy_arith_for_command - -lib/malloc/stats.c - - make the accumulators in _print_malloc_stats be `unsigned long' - instead of `int' - -externs.h, sig.h - - add `__noreturn__' gcc attribute to exit_shell and jump_to_top_level - declarations - -lib/sh/mailstat.c, support/bashversion.c - - include for some string function declarations - -lib/malloc/shmalloc.h - - added extern declarations of functions that do malloc debugging - -lib/readline/{isearch,readline,vi_mode}.c - - make sure we index into _rl_keymap with a non-negative index - -parse.y - - make sure we index into sh_syntaxtab with a non-negative index - -lib/readline/vi_mode.c - - bound the vi_mark_chars array with the number of characters between - 'a' and 'z' rather than using a fixed amount - - don't use _rl_lowercase_p when deciding whether the char read by - rl_vi_set_mark is a valid mark; just use 'a' <= char <= 'z' - -lib/readline/chardefs.h - - conditionally include memory.h and strings.h as in general.h - - replace ISASCII with IN_CTYPE_DOMAIN like other GNU software - - add defines for ISPRINT(c), ISLOWER(c) and ISUPPER(c) - - fix defines for _rl_lowercase_p, _rl_uppercase_p, _rl_digit_p, - _rl_pure_alphabetic, ALPHABETIC, _rl_to_upper, _rl_to_lower, - and _rl_isident to work on systems with signed chars - -include/chartypes.h - - replace ISASCII with IN_CTYPE_DOMAIN like other GNU software - -lib/sh/{strcasecmp,strtod,strtol}.c - - don't pass possibly-negative characters to tolower() or toupper() - -lib/glob/strmatch.c - - don't bother testing for isupper in FOLD; rely on TOLOWER macro - from to do it - - don't use local definitions of isblank, et al.; rely on macros - from - -lib/readline/{display,readline}.c, mksyntax.c - - use new ISPRINT macro instead of isprint() - -builtins/{kill.def,mkbuiltins.c},{error,execute_cmd,jobs,nojobs,subst}.c - - don't assume that a pid_t fits into an int for printing and other - uses - -variables.[ch] - - the unused put_gnu_argv_flags_into_env now takes a `long' pid - argument - -configure.in, config.h.in - - call AC_STRUCT_ST_BLOCKS, define HAVE_STRUCT_STAT_ST_BLOCKS if found - - check for strtoull(), define HAVE_STRTOULL if found - - check for uintmax_t, define to `unsigned long' if not found - -lib/sh/mailstat.c - - don't use st_blocks member of struct stat unless - HAVE_STRUCT_STAT_ST_BLOCKS is defined; otherwise use the st_nlink - field to return the total number of messages in a maildir-style - mail directory - -general.h,{alias,expr,general,subst,variables}.c -builtins/{printf,read}.def -lib/readline/{bind,complete,nls}.c -lib/sh/{pathcanon,pathphys,shquote,snprintf,strindex,strtod,strtol,strtrans}.c - - cast args to ctype macros to unsigned char for systems with signed - chars; other fixes for signed chars - -lib/sh/{fmtullong,strtoull.c} - - new files, more support for `long long' - -Makefile.in, lib/sh/Makefile.in - - make fmtullong.o and strtoull.o part of libsh - -lib/sh/itos.c - - remove local copy of fmtlong; use fmtulong instead - - new functions: uitos, uinttostr work on `unsigned long' - -lib/sh/snprintf.c - - fixes to make `unsigned long long' work (%llu) - - fixes to make unsigned formats not print the sign when given - an unsigned long that is greater than LONG_MAX - -externs.h - - extern declarations for fmtulong, fmtulloing, strtoull - - extern declarations for uitos, uinttostr - - 10/16 - ----- -configure.in - - move header checks before function checks - - move c compiler tests before header checks - - check for with BASH_HEADER_INTTYPES - - change type checks for intmax_t, uintmax_t to not attempt to - include - - check for strtoimax, strtoumax, strtoll, strtol, strtoull, strtoul - with BASH_CHECK_DECL (for declarations in header files) and - AC_REPLACE_FUNCS (for availability and LIBOBJS substitution) - - remove check for have_long_long around sizeof check for long long - (since autoconf will give it a size of 0 if the type isn't found) - -config.h.in - - add a define for HAVE_INTTYPES_H - - add a define for HAVE_UNSIGNED_LONG_LONG - - add defines for HAVE_STRTOIMAX, HAVE_STRTOUMAX, HAVE_STRTOLL - -aclocal.m4 - - new func, BASH_HEADER_INTTYPES, which just calls AC_CHECK_HEADERS - on ; separate so it can be AC_REQUIREd - - AC_REQUIRE([BASH_HEADER_INTTYPES]) in BASH_CHECK_TYPE - - include in BASH_CHECK_TYPE if HAVE_INTTYPES_H is - defined - - change AC_DEFINE to AC_DEFINE_UNQUOTED in BASH_CHECK_TYPE - - new `long long' checking macros: BASH_TYPE_LONG_LONG and - BASH_TYPE_UNSIGNED_LONG_LONG - - new BASH_CHECK_DECL - -lib/sh/{strto[iu]max,strtoll}.c, lib/sh/Makefile.in, Makefile.in - - new files - -externs.h - - extern declarations for strtoll, strtoimax, strtoumax - -lib/malloc/alloca.c - - include for size_t - -builtins/printf.def - - new functions: getllong, getullong, getintmax, getuintmax; return - long long, unsigned long long, intmax_t, uintmax_t respectively - - builtin printf now handles `ll' and `j' length modifiers directly - -lib/sh/Makefile.in - - use LIBOBJS to decide whether or not the strto* functions are - needed - - 10/17 - ----- -configure.in - - call AC_REPLACE_FUNCS(rename) - - move getcwd, strpbrk, strcasecmp, strerror, strtod - from AC_CHECK_FUNCS to AC_REPLACE_FUNCS - - only call BASH_FUNC_GETCWD if $ac_func_getcwd == "yes" - - call BASH_CHECK_SYS_SIGLIST - - if we don't have vprintf but have _doprnt, call AC_LIBOBJ(vprint) - -lib/sh/Makefile.in - - remove rename, getcwd, inet_aton, strpbrk, strcasecmp, strerror, - strtod, vprint from OBJECTS; picked up from LIBOBJS - -aclocal.m4 - - change BASH_FUNC_GETCWD to call AC_LIBOBJ(getcwd) if the libc - getcwd(3) calls popen(3) - - change BASH_FUNC_INET_ATON to call AC_LIBOBJ(inet_aton) if it's - not found in libc or as a #define even with the special includes - - BASH_KERNEL_RLIMIT_CHECK -> BASH_CHECK_KERNEL_RLIMIT - - BASH_DEFAULT_MAILDIR -> BASH_SYS_DEFAULT_MAILDIR - - BASH_JOB_CONTROL_MISSING -> BASH_SYS_JOB_CONTROL_MISSING - - BASH_REINSTALL_SIGHANDLERS -> BASH_SYS_REINSTALL_SIGHANDLERS - - BASH_SIGNAL_CHECK -> BASH_SYS_SIGNAL_VINTAGE - - BASH_DUP2_CLOEXEC_CHECK -> BASH_FUNC_DUP2_CLOEXEC_CHECK - - BASH_PGRP_SYNC -> BASH_SYS_PGRP_SYNC - - BASH_RLIMIT_TYPE -> BASH_TYPE_RLIMIT - - BASH_FUNC_PRINTF -> BASH_DECL_PRINTF - - BASH_FUNC_SBRK_DECLARED -> BASH_DECL_SBRK - - BASH_MISC_SPEED_T -> BASH_CHECK_SPEED_T - - BASH_CHECK_SOCKLIB -> BASH_CHECK_LIB_SOCKET - - new macro, BASH_CHECK_SYS_SIGLIST, encapsulates all the checks for - sys_siglist, _sys_siglist, and strsignal(), sets SIGLIST_O to - siglist.o if appropriate - -Makefile.in - - use SIGLIST_O variable to decide whether or not we need siglist.o - -{execute_cmd,subst}.c - - change a couple of instances of ISDIGIT to DIGIT, where we really, - really only want ascii digits - -ansi_stdlib.h - - don't need a declaration for atol() - - 10/18 - ----- - -aclocal.m4 - - new macro, BASH_FUNC_PRINTF_A_FORMAT, checks for printf support - for %a, %A conversion specifiers, defines HAVE_PRINTF_A_FORMAT - if successful - -configure.in - - call AC_CHECK_FUNCS for isascii - - call BASH_FUNC_PRINTF_A_FORMAT - -config.h.in - - add a define for HAVE_ISASCII - - add a define for HAVE_PRINTF_A_FORMAT - -lib/sh/snprintf.c - - for long double output, fall back to sprintf using ldfallback() - function for floating point formats - - support %a, %A using dfallback() or ldfallback() if - HAVE_PRINTF_A_FORMAT is defined - - fix bug in vasprintf that returned wrong value in its first - argument if the buffer holding the result string got reallocated - - fixed PUT_CHAR macro to increment the counter even if we've - exceeded the buffer size, for the return value from - vsnprintf/snprintf - - fix vsnprintf_internal to not use counter < length as a loop - condition, but always process the entire format string (for - the return value from vsnprintf/snprintf) - -builtins/printf.def - - support %a, %A if HAVE_PRINTF_A_FORMAT is defined - -include/typemax.h - - new file, with the TYPE_MAXIMUM stuff that's duplicated in several - files in lib/sh - -lib/sh/{fmtulong,strtol,snprintf}.c - - include instead of having the definitions in each file - -lib/sh/Makefile.in - - updated dependencies for typemax.h - - 10/22 - ----- -configure.in - - call AC_CHECK_FUNCS on ctype.h functions/macros that bash redefines - in chartypes.h - -config.h.in - - defines for HAVE_IS{ASCII,BLANK,GRAPH,PRINT,SPACE,XDIGIT} - -include/chartypes.h, lib/glob/strmatch.c, lib/readline/chardefs.h - - don't redefine some is* ctype macros/functions if HAVE_ISXXX is - defined (meaning that an appropriate function, but not a macro, - exists) - -lib/sh/strtrans.c - - new function, ansic_shouldquote, returns 1 if argument string - contains non-printing chars that should be quoted with $'...' - -externs.h - - new declaration for ansic_shouldquote() - -variables.c - - change print_var_value to ansi C quote the string if we're not in - posix mode and the variable's value contains non-printing chars, - to use the regular shell single quoting if the value contains - shell meta-characters, and to just output the string otherwise - -lib/sh/shquote.c - - add `break' to `case '~':' to avoid fallthrough and extra test - -doc/bashref.texi - - note that in POSIX mode, `set' displays variable values that - include nonprinting characters without quoting, unless they - contain shell metacharacters - -builtins/printf.def, lib/sh/snprintf.c - - handle `F' conversion specifier as equivalent to 'f' - -parse.y, {nojobs,variables}.c - - a couple of cleanups for when building a minimal configuration - -nojobs.c - - new function: stop_making_children(), just sets - already_making_children to 0 (like stop_pipeline) - -subst.c - - call stop_making_children from subst.c:command_substitute if - JOB_CONTROL is not defined. This fixes the bug where the wrong - process is waited for (and its status returned) when using - command substitution in a null command in a shell function - -builtins/printf.def - - new variable `tw' used to keep track of the total number of - characters written by a single call to `printf' -- to be - used for the `%n' conversion, which will be added later. It - gets reset each time we reuse the format string, which is what - ksh93 seems to do - - 10/23 - ----- -variables.c - - new function, bind_var_to_int (char *var, long val) - -variables.h - - extern declaration for bind_var_to_int - -lib/sh/netopen.c - - use gai_strerror() for error messages when getaddrinfo() fails - - use PF_INET if DEBUG is defined, since IPv6 doesn't work for me - -Makefile.in - - pass DEBUG=${DEBUG} down to makes in some subdirectories - -{builtins,lib/{glob,sh}}/Makefile.in - - append ${DEBUG} to LOCAL_CFLAGS value, passed by top-level Makefile - -builtins/printf.def - - added support for %n format conversion char (number of chars printed - so far from current format string) - - 10/24 - ----- -variables.c - - if posixly_correct is set, the default value of $MAILCHECK is 600 - - use legal_number instead of atoi in adjust_shell_level - - treat non-numeric assignments to SECONDS as 0 in assign_seconds - - new function, init_funcname_var; sets FUNCNAME as a dynamic variable - if it's not set in the initial environment - - new function, init_groups_var; sets GROUPS as a dynamic array - variable if it's not set in the initial environment - - new function, init_dirstack_var; sets DIRSTACK as a dynamic array - variable if it's not set in the initial environment - - new function, init_seconds_var; sets SECONDS as a dynamic - variable using any valid integer value in the initial environment - as the initial value, as if an assignment had been performed - - call init_funcname_var, init_groups_var, init_dirstack_var, - init_seconds_var from initialize_dynamic_variables - - non-numeric values assigned to LINENO are treated as 0 - - change initialize_shell_variables to not auto-export PATH or TERM - - change set_home_var to not auto-export HOME - - change set_shell_var to not auto-export SHELL - - broke the code that sets HOSTNAME, HOSTTYPE, MACHTYPE, OSTYPE - out into a separate function, set_machine_vars; none of those - variables are auto-exported - - bash no longer un-exports SSH_CLIENT or SSH2_CLIENT - -shell.c - - changed isnetconn() to check SSH_CLIENT and SSH2_CLIENT only if - SSH_SOURCE_BASHRC is defined in config-top.h - -config-top.h - - added a commented-out definition for SSH_SOURCE_BASHRC - - 10/25 - ----- - -Makefile.in - - changed RELSTATUS to `rc1' (release candidate 1) - - 10/29 - ----- -locale.c - - fixed an `=' vs. `==' typo in set_locale_var when parsing - LC_NUMERIC - -doc/{bash.1,bashref.texi} - - document what bash does with $POSIXLY_CORRECT - -doc/builtins.1 - - some updates - -builtins/psize.sh - - some mktemp(1) changes - -lib/readline/readline.c - - change rl_backward to check for rl_point < 0 and reset to 0 if so - -lib/readline/util.c - - don't compile in _rl_strpbrk if HAVE_STRPBRK is defined - -lib/readline/rlprivate.h - - remove extern declaration of _rl_strpbrk - -lib/readline/rldefs.h - - #define _rl_strpbrk as strpbrk if HAVE_STRPBRK is define, otherwise - add extern declaration of _rl_strpbrk from rlprivate.h - -{mailcheck,shell,variables}.c - - make sure to include posixtime.h to get any prototype for time(3) - in scope - -{array,eval,execute_cmd,mksyntax,subst}.c, parse.y -builtins/common.c -lib/sh/pathcanon.c - - a few changes as the result of `gcc -Wall' patches from solar - designer - -builtins/read.def, parse.y - - change some calls to free() to xfree() - -builtins/set.def - - make sure unset_builtin() resets unset_array to 0 each time through - the loop, because it's set (and used) depending on the current - argument - -shell.h - - new define, USE_VAR, to force the compiler to not put a particular - variable in a register -- helpful if registers are not restored - by setjmp/longjmp - -builtins/{evalfile.c,{read,wait}.def}, {eval,execute_cmd,shell,test}.c - - use USE_VAR for some variables - -subst.c - - fixed a case in expand_word_internal where a NULL pointer could - have been passed to free() (though free() should ignore it) - - fixed a case at the end of expand_word_internal where LIST could - have been used uninitialized (it makes gcc happy, though it - doesn't happen in practice) - -test.c - - give test_syntax_error(), beyond(), and integer_expected_error() - the `__noreturn__' attribute for gcc - -unwind_prot.c - - in clear_unwind_protect_list(), convert `flags' to `long' (via - assignment to a `long' variable) before casting to `char *', in - case pointers and longs are 64 bits and ints are 32 (makes no - difference on 32-bit machines) - - 10/30 - ----- -print_cmd.c - - fixed cprintf to avoid gcc warning about assigning const pointer - to non-const (discarding type qualifier) - -{make_cmd,pcomplete,test}.c,parse.y - - some minor changes to shut up gcc warnings - -lib/sh/tmpfile.c - - fixed sh_mktmpfp to avoid file descriptor leaks in the case that - sh_mktmpfd succeeds but fdopen fails for some reason - - change sh_mktmpfd to use the same scheme for computing `filenum' - as sh_mktmpname - - change get_sys_tmpdir to prefer P_tmpdir if P_tmpdir is defined - - changed sh_mktmpname and sh_mktmpfd to avoid trying to assign to - `nameroot' if `nameroot == 0' (duh) - - add code to sh_mktmpfd to use mkstemp(3) if USE_MKSTEMP is defined - - add code to sh_mktmpname to use mktemp(3) if USE_MKTEMP is defined - -support/{fixlinks,mkclone} - - use mktemp if it's available for the symlink test - - use $TMPDIR instead of hardcoding /tmp; default to /tmp - - use a better filename for the symlink test instead of `z' - -support/bashbug.sh - - more changes inspired by a patch from solar designer - -lib/malloc/Makefile.in - - new target `alloca', which builds libmalloc.a with alloca.o only - (for systems without alloca that are configured --without-bash-malloc) - -configure.in - - if we don't have a working alloca and are not configured to build - the bash malloc library, make a malloc library containing only - alloca.o - -aclocal.m4 - - slight change to RL_LIB_READLINE_VERSION to deal with minor version - numbers with a letter appended (like 4.2a) - - 10/31 - ----- -doc/{bash.1,bashref.texi} - - slight change to note that only interactive shells resend a SIGHUP - to all jobs before exiting - -externs.h - - declare strto[ui]max only if NEED_STRTOIMAX_DECL is defined. This - keeps picky compilers from choking because intmax_t is not defined - (MacOS X 10.1) - -builtins/printf.def - - #define NEED_STRTOIMAX_DECL before including shell.h - - 11/1 - ---- -general.c - - check in bash_tilde_expand() for an unquoted tilde-prefix; don't - bother passing the string to tilde_expand unless the prefix is - unquoted - -shell.c - - fix a problem with $LINENO when executing commands supplied with - the -c invocation option when ONESHOT is defined - -[bash-2.05a-rc1 frozen] - -builtins/printf.def - - fix the %n conversion to require that the variable name supplied - be a valid shell identifier - -variables.c - - improve random number generator slightly by using the upper 16 - bits of the running random number instead of the lower 16, which - are incrementally more random - - 11/2 - ---- -configure.in - - if RL_INCLUDEDIR ends up being /usr/include, don't put - -I$(RL_INCLUDEDIR) into CFLAGS - - 11/5 - ---- -doc/{bash.1,bashref.texi} - - correct description of POSIXLY_CORRECT to note that the shell enters - posix mode *before* the startup files are read if POSIXLY_CORRECT - is in the initial environment - -variables.c - - fix function prologues for init_dirstack_var and init_groups_var - to agree with caller (no arguments) - -jobs.c - - fix forward function declarations for pipe_read and pipe_close - -subst.c - - removed `inline' attribute from skip_double_quoted because it can - potentially be called recursively - -bashline.c - - quick fix to bashline.c:attempt_shell_completion programmable - completion code to just punt if the end of the command word found - by find_cmd_end is <= the start found by find_cmd_start (the bug - is probably in find_cmd_start -- fix later) - -pcomplete.c - - fix gen_matches_from_itemlist to return if the stringlist is null - after any cleaning or initialization, before trying to use it - - fix GEN_COMPS to only bother to try to append the STRINGLIST - returned by gen_matches_from_itemlist to `glist' if it's non-NULL - -lib/sh/stringlist.c - - make copy_stringlist return NULL if the STRINGLIST * passed as an - argument is NULL - - make append_stringlist call copy_stringlist only if M2 is non-NULL; - otherwise just return NULL if m1 is NULL - - make word_list_to_stringlist return 0 immediately if the passed - LIST argument is NULL - - make realloc_stringlist call alloc_stringlist if the passed - STRINGLIST argument (`sl') is 0, just like realloc calls malloc - -subst.c - - in skip_to_delim(), if we have an unclosed ${, and it's at the end - of the string (string[i] == '{', string[i+1] == '{' and - string[i+2] == 0, return si (i +2) immediately without bothering - to call extract_dollar_brace_string or extract_delimited_string - - in skip_to_delim(), if string[i] is 0 after a call to - extract_dollar_brace_string or extract_delimited_string (meaning we - have an unclosed ${ or other expansion, return i immediately without - doing a `continue' (which will increment i past the end of string) - - in split_at_delims, don't increment te by 1 if it's pointing to a - delimiter. this has the effect of skipping the first delimiter - char in a possibly multi-character delimiter, and ignoring - single-char delimiters like `>' - -configure.in - - use AC_CHECK_MEMBERS([struct stat.st_blocks]) instead of a call to - AC_STRUCT_ST_BLOCKS to avoid configure changing LIBOBJS if the test - fails - -general.c - - introduce two new variables: bash_tilde_{prefixes,suffixes}, set - to the additional prefixes and suffixes bash wants to pass to the - tilde expansion code (reserved for post-bash-2.05a fix) - -aclocal.m4 - - add missing `test' in BASH_CHECK_SYS_SIGLIST - - 11/7 - ---- -lib/readline/vi_mode.c - - fix rl_vi_goto_mark to explicitly check that the desired mark is - between 'a' and 'z', since some locales have lowercase letters - outside that range, which could cause a negative subscript - -include/chartypes.h - - remove superfluous `#undef ISASCII' - -lib/sh/strto[iu]max.c - - changes from Paul Eggert to work around buggy compilers and catch - configuration errors at compile time - -aclocal.m4 - - new macro, BASH_C_LONG_DOUBLE, identical to AC_C_LONG_DOUBLE but - with a fix for Irix 5.3 (not called, since I'm not sure it's the - right thing to do -- the C standard allows double and long double - to be the same size) - -lib/sh/snprintf.c - - only try to write the trailing NUL in vsnprintf_internal if - data->length is >= 0, since if it's not, we probably don't have - a buffer - -Makefile.in - - changed RELSTATUS to `release' - - 11/8 - ---- -lib/sh/strtol.c - - make sure chars passed to toupper are cast to unsigned - -unwind_prot.c - - change clear_unwind_protect_list to not require a cast from `int' - to `char *' - -lib/readline/chardefs.h - - make _rl_digit_p succeed only for ascii digits, since that's what - most callers assume - - 11/13 - ----- -doc/bashref.texi - - added `ERR' trap and [-+]O invocation option to section listing - differences from the Bourne shell - - 11/15 - ----- -[bash-2.05a released] - - 11/19 - ----- -include/stdc.h - - new define, INLINE, defined as `inline' for gcc and empty otherwise - -subst.c - - make skip_double_quoted, sub_append_string have INLINE attribute - -trap.c - - use BASH_NSIG as upper limit for signal names in signal_name() - -lib/readline/bind.c - - use RL_COMMENT_BEGIN_DEFAULT in output for rl-comment-begin value - -error.c - - fix sys_error to save value of errno around calls to fprintf - -doc/Makefile.in - - added rules to create PDF files from postscript and dvi input - -MANIFEST.doc - - added {article,bash,bashref,rose94}.pdf - -doc/bash.1 - - rearranged some `.PD 0' and `.TP' directives so man2html will - handle them better (shouldn't affect groff output) - -support/man2html.c - - small fix to handle quoted string arguments to directives like - `.BR' without mangling the output - - 11/20 - ----- -{arrayfunc,variables}.c - - changed calling sequence for dynamic array variable `assign' - functions to (SHELL_VAR *self, char *value, arrayind_t ind) - - changed calling sequence for dynamic variable assign functions - to the same as array variable assign_func. Now this can be - prototyped - -variables.h - - the assign_func member of a `struct variable' is now of type - `sh_var_assign_func_t', which is prototyped - - the dynamic_value member of a `struct variable' is now of type - `sh_var_value_func_t', which is prototyped - -variables.c - - changed to use `sh_var_assign_func_t' and `sh_var_value_func_t' - -builtins/cd.def - - when in posix mode, if the new directory name formed by PWD and - the argument passed by the user cannot be canonicalized, and the - -P option has not been supplied, return failure immediately - - if canonicalization failed, but the fallback to the directory - name specified by the user succeeds, reset the current working - directory - -lib/readline/{input.c,rlprivate.h} - - renamed rl_unget_char to _rl_unget_char; made library global - -lib/readline/{{bind,readline}.c,{keymaps,rlprivate}.h} - - support for `key subsequences'; allows a key sequence and a function - mapped to a subsequence of that key sequence. Primarily to allow - arrow keys to be bound in readline vi insert mode, while preserving - the ESC function to switch to command mode. - -lib/readline/{input.c,rlprivate.h} - - new function, _rl_input_queued(T), does a check with select or - FIONREAD with a timeout of `T' (which is generally 0) - -lib/readline/readline.c - - change _rl_dispatch_subseq to test for input in the queue if we - get ESC while in vi insertion mode if the keymap entry type for - ESC is ISKMAP. If _rl_input_queued returns non-zero, we assume - that an arrow key sequence has been pressed and go ahead with the - subsequence. If it returns zero, we assume that the user pressed - ESC to switch into command mode, and dispatch to that right away. - This avoids forcing the user to press another key before switching - into command mode - - 11/21 - ----- -lib/readline/readline.c - - bind common arrow key sequences in vi insertion keymap - -lib/readline/terminal.c - - bind termcap definition's arrow keys in vi insertion keymap - -lib/readline/bind.c - - check for rl_vi_movement_mode in _rl_bind_if_unbound, so - binding the arrow keys can work - -lib/readline/readline.c - - since _rl_bind_if_unbound does the check of what's currently - bound to the key sequence, the check in bind_arrow_keys_internal - was redundant - - bind_arrow_keys_internal now takes a Keymap argument and handles - saving and restoring _rl_keymap; changed bind_arrow_keys - accordingly - -builtins/fc.def - - fix from Paul Eggert to substitute the nearest history number in - range if an out-of-range value is supplied. POSIX requires this - -lib/sh/pathcanon.c - - fix from Corrina Vinschen for the special `cygdrive' prefix on - Cygwin - -bashhist.c - - split the history adding code into more pieces: - check_history_control (char *line) checks LINE against the value - of HISTCONTROL, returning 1 if LINE should be saved and 0 if not - - check_add_history (char *line) calls check_history_control and - history_should_ignore (line) and saves the line with - bash_add_history if the checks indicate that it should be saved - - maybe_add_history just calls check_add_history to set the value - of first_line_saved - -bashhist.h - - extern declaration for check_add_history() - -shell.c - - don't call load_history() from the interactive shell startup - code if history_lines_this_session is > 0, indicating that we've - already saved some lines in the history and that we probably - don't want to overwrite them - -builtins/history.def - - call check_add_history from push_history, so `history -s xx' - works even when in a compound command whose first line has not - been saved. (Caveat: in a compound command when the first - line has been saved, the line supplied to history -s will become - part of the compound command's history entry. Of course, the - delete_history call could remove the compound command from the - history entirely) - -bashline.c - - use sh_makepath instead of xmalloc/sprintf in - command_word_completion_function - -lib/readline/complete.c - - get_y_or_n now takes an int FOR_PAGER argument; caller changed - If FOR_PAGER is non-zero, get_y_or_n returns appropriate values - for a more-like pager: `newline' or `return' return 2; `q' or - `Q' return 0 - - there is now a mini internal more-like pager for displaying a - list of completions that exceeds the screen height (new function - _rl_internal_pager, called from rl_display_match_list) - - 11/24 - ----- -command.h - - new flag, W_TILDEEXP, says to do tilde expansion on an - assignment word - -execute_cmd.c - - fix_assignment_words now sets W_TILDEEXP for assignment word - arguments to `assignment builtins' - -general.c - - bash_tilde_expand now takes a second argument indicating whether - or not it's being invoked in an `assignment context' - -general.h - - change extern declaration for bash_tilde_expand - -{bashline,execute_cmd,findcmd,general,variables}.c -builtins/evalfile.c -lib/sh/makepath.c - - fix callers of bash_tilde_expand appropriately - -subst.c - - fix callers of bash_tilde_expansion appropriately - - add (currently commented-out) code that would tilde expand assignment - statement arguments to assignment builtins (W_TILDEEXP flag set) - even when the shell is in posix mode - -bashline.c - - fix attempt_shell_completion to turn off - rl_filename_completion_desired when doing command name completion, - so no slash gets appended to the name if there happens to be a - directory with the same name in the current directory - - 11/26 - ----- -lib/readline/rltech.texinfo - - a couple of additions to the rl_stuff_char description - -parse.y - - turn off echo_input_at_read in parse_string_to_word_list, so `set -v' - doesn't give extra lines of output when doing compound array - assignment - -subst.c - - fix split_at_delims to handle skipping over a `\n' if it's a - delimiter (use spctabnl(c) instead of whitespace(c)) - - 11/27 - ----- -support/config.{guess,sub} - - updated (with bash changes) to latest version from gnu.org - -sig.h - - add prototype for set_signal_handler declaration - -builtins/setattr.def - - add prototype to extern declaration of declare_builtin - -builtins/times.def - - add no_options call, since times takes no options - -lib/sh/spell.c - - add prototypes to forward declarations for midist and spdist - -lib/sh/strtrans.c - - add explicit int return type to ansic_shouldquote declaration - -lib/readline/rldefs.h, lib/readline/{macro,readline,util,undo}.c - - move define for SWAP to rldefs.h, removed from various C files - -lib/readline/vi_mode.c - - removed define for exchange(), changed to use SWAP instead - -lib/readline/bind.c - - added some static forward function declarations - - find_boolean_var, find_string_var now take a `const char *' argument - -lib/readline/signals.c - - added static forward declaration for rl_maybe_set_sighandler - -lib/readline/readline.c - - add some common key bindings for the HOME and END keys in - bind_arrow_keys_internal - -lib/readline/terminal.c - - fetch the `@7' termcap string; it's sent by the END key - - attempt to bind the terminal's END key to rl_end_of_line in - bind_termcap_arrow_keys; I don't know why I was using `kH' - instead of `@7' - -doc/builtins.1 - - remove `case', `for', `if', `until', `while' from NAME section; - those are not shell builtins - - 11/28 - ----- -stringlib.c - - new function, find_token_in_alist, takes a token value and an - ALIST argument, and returns the string correspoinding to the - token if found in the alist - -externs.h - - new extern declaration for find_token_in_alist() - -subst.c - - string_list_internal is no longer static - -subst.h - - new extern declaration for string_list_internal() - -parse.y - - new alist array of other tokens returned by read_token which are - not reserved words in word_token_alist[] - - reworked error reporting: new functions print_offending_line, - which prints the line containing the syntax error, - error_token_from_token, which takes the current token and tries to - figure out its textual representation, and error_token_from_text, - which does the old job of finding the bad token by analyzing the - text of shell_input_line at the current index - - report_syntax_error now tries to figure out the token that caused - the syntax error by first looking at current_token and falling - back to the old method of textual analysis if that fails - - report_syntax_error doesn't say the token resulting from the textual - analysis of the input line is an `unexpected token'; it just - says there is a `syntax error near xxx' - - changed conditional command error reporting to use the value - returned by error_token_from_token if it's not null instead of - just using the token value in the message, since current_token - ends up being set to -1, and the text of the message from - report_syntax_error might not be exactly right - - change parse_string_to_word_list to set current_token to the - offending token returned by read_token before calling yyerror() - to make the error reporting do the right thing - -aclocal.m4 - - fixed typo in BASH_CHECK_LIB_TERMCAP - -configure.in - - add check for isinf(3); define HAVE_ISINF_IN_LIBC if found - -config.h.in - - add define for HAVE_ISINF_IN_LIBC - -lib/sh/snprintf.c - - check for Inf and NaN, using isinf and isnan if they're found in - libc - - use the current locale for thousands separator and decimal point - - recognize "'" flag; not implemented yet - - fix for snprintf/vsnprintf with length of 0 and string argument of - 0 with non-zero length - -builtins/read.def - - TMOUT is now the default timeout for `read' (and select) if set, - like ksh93 when reading from the terminal - - edit_line (called by read -e) now just does readline's filename - completion by setting rl_attempted_completion_function to NULL, - since e.g., doing command completion for the first word on the - line wasn't really useful - -execute_cmd.c - - changed select_command to return failure status if select_query - returns NULL, indicating that read_builtin returned - EXECUTION_FAILURE - -doc/{bash.1,bashref.texi} - - documented new TMOUT behavior - - slight change to the description of the test `-ef' option - -doc/bashref.texi - - added item to posix mode section describing failure behavior of - cd when invoked in logical mode and the pathname formed by - combining $PWD and the directory argument does not refer to an - existing directory - - 11/29 - ----- -execute_cmd.c - - fix execute_function to call dispose_function_env after - merge_function_env if the shell is in posix mode (fixes debian - bash bug #117673) - -lib/readline/readline.c - - rl_forward -> rl_forward_char; rl_forward function for compatibility - - rl_backward -> rl_backward_char; rl_forward function for - compatibility - - new functions, rl_forward_byte, rl_backward_byte, for future use - -lib/readline/readline.h - - extern declarations for rl_forward_char, rl_backward_char, - rl_forward_byte, rl_backward_byte - -lib/readline/{emacs_keymap,funmap,vi_keymap,vi_mode - - rl_forward -> rl_forward_char - - rl_backward -> rl_backward_char - -lib/readline/funmap.c - - new bindable names, `backward-byte' and `forward-byte' - -aclocal.m4 - - new function, BASH_CHECK_MULTIBYTE, encapsulates checks for - multibyte code - -config.h.in - - add necessary defines for multibyte include files and functions - -configure.in - - add call to BASH_CHECK_MULTIBYTE - -config-bot.h - - add code to define HANDLE_MULTIBYTE if prerequisites are met - -lib/sh/xstrchr.c - - new file, xstrchr() is strchr(3) that handles multibyte characters - -bashhist.c - - first_line_saved -> current_command_first_line_saved; variable is - now global - -bashhist.h - - extern declaration for current_command_first_line_saved - - 11/30 - ----- -bashhist.c - - break the code that actually calls add_history out of - bash_add_history into a new function, really_add_history; - bash_add_history now calls really_add_history - - check_add_history takes a second `force' argument telling it - whether to call bash_add_history (force == 0) or really_add_history - (force != 0) - -builtins/history.def - - in push_history, call delete_last_history if the current command - has more than one line, the first line was saved, and - command-oriented history is active. This takes care of deleting - the right history element if `history -s' is used within a - compound or multiline command - - in push_history, call check_add_history with second argument of 1 - to skip check of current_command_line_count and add the arguments - to history -s as a single separate history entry - - 12/3 - ---- -lib/readline/complete.c - - append a slash to completed names which are symlinks to directories - if the new variable _rl_complete_mark_symlink_dirs is non-zero - -lib/readline/rlprivate.h - - extern declaration for _rl_complete_mark_symlink_dirs - -lib/readline/bind.c - - new bindable variable, `mark-symlinked-directories', mirrors the - value of _rl_complete_mark_symlink_dirs - -doc/bash.1, lib/readline/doc/{readline.3,rluser.texinfo} - - documented new `mark-symlinked-directories' variable - - 12/4 - ---- -variables.[ch] - - set_pipestatus_array now takes a second argument with the number - of processes in the array - - changed set_pipestatus_array to just modify the value in place if - the existing array has one element and the new array has one - element, and to modify existing values in place if new array has - more elements than existing array - -variables.c, jobs.c - - changed set_pipestatus_array callers - -jobs.c - - moved call to setjstatus() from set_job_status_and_cleanup to - wait_for, since set_job_status_and_cleanup is part of the SIGCHLD - signal handler call path, and race conditions accessing the - PIPESTATUS array will result for things like - - while true; do date; done | cat > /dev/null - - 12/5 - ---- -xmalloc.h - - don't redefine xmalloc, xrealloc, and xfree if DISABLE_MALLOC_WRAPPERS - is #defined - -config.h.in - - #undef for DISABLE_MALLOC_WRAPPERS - -configure.in - - define DISABLE_MALLOC_WRAPPERS if the --with-purify option is - supplied - -lib/malloc/trace.c - - new function, malloc_trace_bin(N), traces allocations and frees - to bucket N (uses the same type of bitmap as `busy') - -lib/malloc/table.c - - fix wraparound search problem in find_entry when searching for a - free entry when the table is full - - 12/6 - ---- -lib/malloc/table.c - - keep an `overflow bucket' around to use when the table is full, - so find_entry always returns a valid pointer when FIND_ALLOC - is set - - new static variable to keep a count of the number of MT_ALLOC - entries in the mem_table - -lib/sh/{oslib,clktck}.c - - if HAVE_LIMITS_H is defined, include - -lib/sh/oslib.c - - new function, getmaxgroups() returns max number of simultaneous - groups - - new function, getmaxchild(), returns max number of simultaneous - user processes - -general.c - - removed forest of #defines for getmaxgroups() - -externs.h - - new extern declaration for getmaxgroups() - - new extern declaration for getmaxchild() - - new extern declaration for isnetconn() - -lib/sh/netconn.c,shell.c - - new file, isnetconn() from shell.c moved here - -Makefile.in, lib/sh/Makefile.in - - necessary changes for netconn.c - -builtins/ulimit.def - - changed getmaxuprc() to just call getmaxchild() and massage the - return value appropriately - -{jobs,nojobs}.c - - use the value returned by getmaxchild() in - mark_dead_jobs_as_notified instead of static CHILD_MAX - -jobs.c - - new function, compact_jobs_list, removes some number of jobs from - the jobs table and reallocates the table, copying the jobs that - are left from the old table to the new. Compaction happens from - the beginning of the list and removes dead jobs, and we make sure - to keep the last CHILD_MAX jobs as POSIX.2 requires - - call compact_jobs_list from stop_pipeline if we're in a subshell, - there are no free jobs in the jobs table, and the jobs table is - at or above some maximum limit - -execute_cmd.c - - change eval_arith_for_expr to set this_command_name to `((' before - calling evalexp, since it might be changed by evaluating the - loop body between evalexp calls - -trap.c - - change reset_signal to turn off the SIG_TRAPPED flag for the - given signal, so shell builtins and functions running in command - substitutions don't run the signal handlers (traps are not supposed - to be inherited by command substitutions) - -parse.y - - changed parse_string_to_word_list to turn off alias expansion - while parsing the array assignment - - 12/9 - ---- -alias.c - - fix add_alias so that redefining an alias's value also resets the - EXPANDNEXT flag - - 12/10 - ----- -parse.y - - new function, token_is_assignment, called to check whether the text - before `=' makes up a valid assignment token before trying to parse - a compound assignment statement - - new function, parse_compound_assignment, to parse a compound - assignment statement instead of using parse_matched_pair; handles - comments and error reporting in the parser instead of waiting until - expansion time - - changed parse_compound_assignment and parse_string_to_word_list to - allow reserved words in compound array assignments - -lib/readline/doc/rltech.texinfo - - changed the documentation for rl_callback_read_char and - rl_callback_handler_remove to say what happens to the terminal - settings and what needs to be done to reset them - - 12/11 - ----- -bashline.c - - add emacs_edit_and_execute_command, bound to C-xC-e, like vi-mode - `v' command - - add bindable command name `edit-and-execute-command', bound to - run emacs_edit_and_execute_command() - -lib/glob/strmatch.c - - add support for ksh93-like [:word:] character class (isalnum + `_') - -doc/{bash.1,bashref.texi} - - add note to section describing lists to clarify that a sequence of - one or more newlines may be used to delimit a command, equivalent - to a semicolon - - document new [:word:] pattern matching character class - -doc/bash.1, lib/readline/doc/rluser.texinfo - - document `edit-and-execute-command' and its default emacs-mode - binding - -include/chartypes.h - - add defines for TOCTRL and UNCTRL if they're not already defined - -lib/readline/chardefs.h - - #undef UNCTRL if it's defined to avoid cpp redefinition warnings - -lib/sh/strtrans.c - - add \cX (Control-X) escape for $'...' to ansicstr() - - change ansic_quote() to allocate at least four chars for each char - in the string argument, to account for \0xx octal values - - change ansic_quote() to no longer call sprintf for non-printable - characters; just translate the string to octal directly - -print_cmd.c - - change xtrace_print_word_list to call ansic_quote() if - ansic_shouldquote() indicates that there are nonprinting characters - in a word - -builtins/type.def - - changed deprecated long option parsing to just replace the word - in the list with the equivalent short option (-type -> -t) instead - of removing words from the list - - changed describe_command to take a single flags argument instead - of two int args; changed caller - - type now has two new options: -f suppresses function lookup (like - command), and -P forces a PATH search for the name(s) - -builtins/common.h - - flags for describe_command are here - - changed extern declaration of describe_command - -builtins/command.def - - changed call to describe_command to use flags from common.h, and - the right number of arguments - -doc/{bash.1,bashref.texi} - - documented new -f and -P options to `type' - - 12/12 - ----- -lib/readline/rldefs.h - - fixed prototype for _rl_strnicmp - -execute_cmd.c - - select_query now takes a new argument, an int flag saying whether - or not to print the menu the first time through the loop. An - empty line in response to the prompt will always cause the menu - to be reprinted - - changed execute_select_command to cause select_query to reprint - the menu only if REPLY is set to NULL, if KSH_COMPATIBLE_SELECT - is defined - -config-top.h - - define KSH_COMPATIBLE_SELECT, with a comment about its meaning - -lib/readline/readline.c - - change rl_insert_comment to toggle if given an explicit numeric - argument: if the first characters on the line don't specify a - comment, insert one; if they do, delete the comment text - -doc/bash.1, lib/readline/doc/{readline.3,rluser.texinfo} - - documented new behavior of insert-comment with a numeric argument - - 12/13 - ----- -lib/malloc/watch.c - - new file, implements watchpoint functions - -lib/malloc/watch.h - - new file, define some `events' for watchpoints and extern function - and variable declarations for watchpoint code - -lib/malloc/imalloc.h - - #define MALLOC_WATCH if MALLOC_DEBUG is defined - - add __P define as in include/stdc.h if not already defined - -lib/malloc/malloc.c - - remove __P define, now in imalloc.h - - include watch.h if MALLOC_WATCH is defined - - added calls to _malloc_ckwatch in internal_malloc, internal_free, - and internal_realloc - -include/stdc.h - - augment __P define to allow prototypes if PROTOTYPES is defined - -lib/readline/rlstdc.h - - augment PARAMS define to allow prototypes if PROTOTYPES is defined - -lib/malloc/Makefile.in, Makefile.in - necessary changes to include watch.c in libmalloc - -lib/readline/readline.c - - fix rl_delete_text to make sure that the starting position is >= 0 - - _rl_init_line_state (called by readline via readline_initialize) - now sets rl_mark to 0 - - rl_get_{next,previous}_history set rl_mark to 0 if rl_point is at - the end of the line and rl_end otherwise in emacs mode - -lib/readline/kill.c - - rl_yank_nth_arg_internal and rl_paste_clipboard now set the mark - at point before calling rl_insert_text, like rl_yank - - rl_kill_full_line now resets rl_mark to 0 - - rl_kill_line and rl_backward_kill_line now set rl_mark to the - point after the kill in emacs mode - - rl_kill_word and rl_backward_kill_word now set rl_mark to the - point after the kill in emacs mode - - rl_unix_word_rubout and rl_unix_line_discard now set rl_mark to - the point after the kill in emacs mode - -lib/readline/search.c - - noninc_search saves and restores the mark, since it can be changed - while reading the search string - - noninc_dosearch sets the mark at the end of the line, making the - region bound the `inserted' text since rl_point is set to 0 - - rl_history_search_internal sets the mark at the end of the line, - for the same reason - -lib/readline/isearch.c - - rl_search_history now saves and restores the mark - - if no matching lines are found at all when doing an isearch, leave - point where it was instead of moving it to the end of the line - - 12/17 - ----- -lib/readline/rlmbutil.h - - new file, place for multi-byte character defines and extern - declarations - -lib/readline/{bind.c,readline.c,rlprivate.h} - - new bindable variable, `byte-oriented', tracks value of - rl_byte_oriented variable - -lib/readline/mbutil.c - - new file, with multibyte char utility functions - -lib/readline/{complete,display,readline,util,vi_mode}.c - - new code for multibyte characters, derived from IBM patch - - 12/18 - ----- -lib/sh/tmpfile.c - - include posixtime.h for time() extern declaration - -support/bashversion.c - - include if it's available - -lib/readline/{histexpand,input,isearch,search}.c - - new code for multibyte characters, derived from IBM patch - -lib/readline/readline.h - - include rltypedefs.h - - 12/19 - ----- -lib/readline/complete.c - - slight change to mark-directories code to avoid adding a slash if - point is at the end of the line (rl_line_buffer[rl_point] == '\0') - and the previous character was a slash - - change printable_part to not return empty pathnames, which could - happen when completing filenames and a filename with a trailing - slash was passed as the argument. If the portion following the - trailing slash is NULL, ignore it and look for a previous slash. - If there's no previous slash, just return the filename argument - - new variable, rl_completion_mark_symlink_dirs, mirrors the value - of (user-settable with a variable) _rl_complete_mark_symlink_dirs - but may be modified by application-specific completion functions - when appropriate (set in rl_complete_internal and rl_menu_complete) - -lib/readline/readline.h - - extern declaration for rl_completion_mark_symlink_dirs - -pcomplete.c - - if one of the actions is CA_DIRECTORY, set - rl_completion_mark_symlink_dirs to indicate that we want the - trailing slash (might have to relax this) - -lib/readline/doc/rltech.texinfo - - documented rl_completion_mark_symlink_dirs variable - -lib/readline/doc/rluser.texinfo, doc/bash.1 - - documented the fact that `complete -d' and `complete -o dirnames' - force readline to append a slash to symlinks to directories - -builtins/enable.def - - changed enable_shell_builtin to disallow enabling disabled - builtins in a restricted shell - -doc/{bash.1,bashref.texi} - - documented new enable behavior in restricted shells - -doc/Makefile.in - - new rule to make an `RBASH' file documenting the restrictions - imposed by a restricted shell - -expr.c - - broke the code that evaluates variables and returns results out - of readtok() into a new function: expr_streval() - - expr_streval() now performs the standard unset variable error - behavior if `set -u' has been executed and it's asked to look - up an unset variable - - broke the code that frees up the expression context stack into - a new function: expr_unwind() - -variables.c - - fixed bind_int_variable so it handles array element assignment, - so expressions like `b[7]++' and `b[0] = 42' work right - - new function, get_variable_value, returns the string value of - the SHELL_VAR * passed as an argument - - get_string_value now calls get_variable_value with a non-null - result from find_variable - - 12/20 - ----- -lib/readline/rlmbutil.h, mbutil.c - - combined _rl_find_next_mbchar and _rl_find_next_nonzero_mbchar into - a single function - - combined _rl_find_prev_mbchar and _rl_find_prev_nonzero_mbchar into - a single function - -lib/readline/{display,readline,vi_mode}.c - - changed callers of _rl_find_next_mbchar and - _rl_find_next_nonzero_mbchar - -lib/readline/{complete,display,histexpand,readline,vi_mode}.c - - changed callers of _rl_find_prev_mbchar and - _rl_find_prev_nonzero_mbchar - - 12/20 - ----- -lib/sh/mktime.c - - new file, from glibc/gawk, compiled in if system doesn't have a - working mktime(3) - -lib/sh/strftime.c - - new file, from gawk, compiled in if system doesn't have a - working strftime(3) - -lib/sh/Makefile.in, Makefile.in - - changes for mktime.c, strftime.c - -configure.in - - call AC_FUNC_MKTIME, AC_STRUCT_TM, AC_STRUCT_TIMEZONE - - call AC_REPLACE_FUNC(strftime) - -config.h.in - - add defines for TM_IN_SYS_TIME, HAVE_TZSET, HAVE_TM_ZONE, - HAVE_STRUCT_TM_TM_ZONE, HAVE_STRFTIME - -externs.h - - provide an extern declaration for strftime if HAVE_STRFTIME is - not defined and NEED_STRFTIME_DECL is - -lib/tilde/tilde.h - - header files should not include - -parse.y - - replace code in decode_prompt_string that chops up value returned - by ctime(3) with calls to strftime -- as a result, the expansion - of \@ has changed slightly (since it depends on the locale) - - added new \D{format} prompt string escape; `format' is passed to - strftime(3). Empty format is the same as `%X' (locale-specific - representation of the current time) - - combined cases for '\\', '\a', '\e', and '\r' in same case branch - in decode_prompt_string - -doc/{bash.1,bashref.texi} - - documented new \D{format} prompt string expansion - -builtins/printf.def - - use ISO C PRIdMAX instead of INTMAX_CONV - - pass length of format modifiers to mklong instead of computing it - with strlen() - -lib/sh/{fmtulong,fmtullong}.c - - changes from Paul Eggert to make more general - -arrayfunc.c - - when converting a variable to an array, make sure to unset the - dynamic_value and assign_func members of the struct variable, - since they're not valid anymore - - 12/27 - ----- -configure.in - - use AC_HELP_STRING in AC_ARG_WITH and AC_ARG_ENABLE - - remove AC_ARG_ENABLE for largefile, since AC_SYS_LARGEFILE adds - one - - 1/2/2002 - -------- -{alias,bashline,execute_cmd,general,shell,subst,variables,arrayfunc}.c,general.h - - changed some calls to strchr to calls to xstrchr for multibyte - characters - -include/shmbutil.h - - add extern declaration for xstrchr to avoid including externs.h - where it's not appropriate - -{braces,make_cmd,pathexp,subst,arrayfunc}.c, lib/sh/xstrchr.c - - include shmbutil.h - -{stringlib,subst}.c, {externs,subst}.h - - moved substring() from subst.c to stringlib.c, moved declaration - from subst.h to externs.h - -lib/sh/xmbsrtowcs.c - - new file, replacement function for mbsrtowcs - -lib/sh/Makefile.in - - add entries for xmbsrtowcs.c - -Makefile.in - - add dependencies on shmbutil.h to appropriate object files - -lib/glob/strmatch.c - - break character-class testing out into separate function: - is_cclass, in prep for multibyte changes - -{braces,make_cmd}.c - - changes for multibyte characters - -builtins/printf.def - - changes from Paul Eggert to just use intmax_t everywhere an - int/long/quad is needed and print with "%ld" if the number - fits in a long and %PRIdMAX otherwise - - remove getlong, getulong, getllong, getullong, since they're - no longer needed - - use a new type `floatmax_t' to print floating point numbers, the - widest-available floating point type (like `intmax_t'); new - function `getfloatmax' that calls strtold or strtod as appropriate - - remove getdouble, getldouble, since they're no longer needed - -lib/sh/fmtumax.c - - new file, string-to-[u]intmax_t conversion, just includes - fmtulong.c with the right defines - -Makefile.in, lib/sh/Makefile.in - - additions for fmtumax.c - -bashtypes.h - - include if it's available - -expr.c - - arithmetic is now in intmax_t instead of long - -externs.h - - extern declaration for fmtumax - - change extern declarations for evalexp, itos, inttostr, - uitos, uinttostr since they now return or use intmax_t instead - of long - -{execute_cmd,general,mailcheck,subst,variables}.c, parse.y -{array,general,subst,test,variables}.h -lib/sh/{itos,netopen}.c -builtins/{bashgetopt,common}.c, builtins/common.h -builtins/{break,fc,history,jobs,let,printf,pushd,read,shift,wait}.def - - changes for intmax_t shell arithmetic conversion - -doc/{bashref.texi,bash.1} - - documented long->intmax_t shell arithmetic conversion - -sig.c - - in initialize_terminating_signals, if we've already trapped a - terminating signal, don't reset the signal handler for it - - 1/3 - --- -{arrayfunc,pathexp}.c, parse.y - - changes for multibyte chars - -parse.y, lib/sh/strtrans.c - - moved ansiexpand from parse.y to lib/sh/strtrans.c - -parse.y, locale.c - - moved mk_msgstr and localeexpand from parse.y to locale.c - -parse.y - - new function, yy_input_name, returns name of input file from - bash_input.name - - broke the code that parses ((...)) constructs out of read_token - into a new function, parse_dparen() - -externs.h - - new extern declaration for ansiexpand(), mk_msgstr(), and - localeexpand() - -input.h - - new extern declaration for yy_input_name() - -{error,locale}.c - - use yy_input_name for error and other messages - -execute_cmd.c - - change shell_execve to make sure that the file is executable - before looking at the interpreter to find out why the execve() - failed (avoids misleading error message) - -lib/glob/glob.c - - move code that matches leading `.' and skips those filenames into - a separate function: skipname(), so there can be unibyte and - multibyte versions of that function - - 1/7 - --- -subst.c - - more changes for multibyte characters - -print_cmd.c - - change semicolon() so it doesn't output a `;' immediately after a - newline, since that results in a null command, which is a syntax - error - -variables.c - - fix indirection_level_string to turn off set -x while evaluating - PS4 - - 1/8 - --- -builtins/set.def - - make -o options into one struct, instead of separate structs for - option names corresponding to flags and non-flag option names. - This has the side effect of sorting the option names in output - -lib/glob/glob.c - - new function, mbskipname(), multibyte char version of skipname() - - removed all #ifndef SHELL code, this will never be used outside - the shell - -include/posixdir.h - - move REAL_DIR_ENTRY define here from lib/glob/glob.c - -lib/glob/glob_loop.c - - new file, included in glob.c for unibyte and multibyte versions of - glob_pattern_p - - added some forward static function declarations with prototypes - - more changes for multibyte character handling - -lib/glob/Makefile.in - - make glob.c depend on glob_loop.c - - changes for xmbsrtowcs.[co] - -lib/glob/xmbsrtowcs.c - - moved here from lib/sh, since the matching functions use it, and - libglob.a is linked after libsh.a - - 1/9 - --- -lib/glob/smatch.c - - new file, with strmatch (now xstrmatch) and associated functions, - with changes for multibyte chars - -lib/glob/sm_loop.c - - new file, included by smatch.c, with `generic' versions of matching - functions that are compiled twice: once each for single-byte and - multibyte characters - -lib/glob/strmatch.c - - strip out everything except strmatch(), which either calls fnmatch - (if HAVE_LIBC_FNM_EXTMATCH is defined) or xstrmatch - -lib/glob/collsyms.c - - changes for multibyte chars - -lib/glob/Makefile.in, Makefile.in - - changes for new source files - - 1/10 - ---- -lib/readline/complete.c - - new function, rl_completion_mode (rl_command_func_t *func), returns - the appropriate value to pass to rl_complete_internal depending on - FUNC and the value of `show-all-if-ambiguous'. This allows - application completion functions to present the same interface as - rl_complete - -lib/readline/readline.h - - new extern declaration for rl_completion_mode() - -lib/readline/doc/rltech.texinfo - - documented rl_completion_mode - -lib/readline/readline.[ch] - - bumped the version number to 4.3, changing the relevant cpp defines - -configure.in - - require that an installed readline version be at least readline-4.3 - -bashline.c - - converted bash-specific completion functions to use - rl_completion_mode instead of passing TAB unconditionally - -builtins/bashgetopt.c - - the `#' option specifier now means a required numeric argument, - not an optional one - -builtins/type.def - - when converting [-]-{path,type,all} to -[pta], don't bother - freeing and reallocating the option string; just change opt[1] - and null opt[2] - -lib/sh/snprintf.c - - support %ls/%S and %lc/%C for wide strings and characters, - respectively, if HANDLE_MULTIBYTE is defined - -mailcheck.c - - don't print a message about new mail if the file has not grown, - even if the access time is less than the modification time - - 1/14 - ---- -lib/readline/readline.c - - new function, rl_replace_line, to replace the readline line buffer - with the text supplied as an argument - - new function, rl_replace_from_history, replaces readline line - buffer with text from history entry passed as argument (undocumented, - not in readline.h because it requires a definition of - HIST_ENTRY for the prototype) - -lib/readline/readlne.h - - new extern declaration for rl_replace_line - -lib/readline/doc/rltech.texinfo - - documented rl_replace_line - -lib/readline/{isearch,readline,search}.c - - use rl_replace_line and rl_replace_from_history where appropriate - -lib/readline/readline.c - - broke the code that sets point after moving through the history - (_rl_history_preserve_point and _rl_history_saved_point) out - into a separate function, _rl_history_set_point() - -lib/readline/{complete.c,rlprivate.h} - - find_completion_word -> _rl_find_completion_word - - free_match_list -> _rl_free_match_list - -lib/readline/complete.c - - postprocess_matches and _rl_free_match_list now return immediately - if passed a null match list - -variables.c - - new function, find_local_variable, finds a local variable by name - at the current variable context - - in find_variable_internal, call find_local_variable before searching - any of the temporary environments if variable_context > 0 (meaning - we're in a shell function). This lets a local variable - override a variable whose value was passed in the `function - environment' - - 1/15 - ---- -variables.h, execute_cmd.c - - declare variables describing the temporary environments in - variables.h instead of in C files - -findcmd.c, builtins/setattr.def - - instead of calling find_tempenv_variable, use find_variable_internal - and check whether the returned SHELL_VAR * has the tempvar - attribute - -variables.c - - tentative change to lookup order in find_variable_internal so that - function local variables are found before variables in - function_env when executing a shell function - - change make_local_variable to handle making a local variable when - a variable with the same name already appears in one of the - temporary environments - - broke the body of make_var_array out into a new function: - static char **make_env_array_from_var_list (SHELL_VAR **vars) - - new function, make_var_array_internal, takes a hash table to look - in and a pointer to a mapping function and returns a char ** - environment-style list - - make_var_array now just calls make_var_array_internal - - new mapping function, local_and_exported, returns all local variables - in the current variable context with the export attribute set - - new function, make_local_export_array, returns an environment-style - char ** array of exported local variables in current context - - change environment creation order in maybe_make_export_env to - add variables to the environment in opposite order that - find_variable_internal uses. This means that local variables in - shell functions override variables with the same name in the - function_env - - change make_local_variable to set the initial value of the - variable it creates to NULL to make the `is set' and `is null' - tests that the expansion code does work right - - change make_local_variable to inherit the value of a variable with - the same name from the temporary enviroment - - 1/16 - ---- -Makefile.in - - link bashversion with buildversion.o instead of version.o, for - cross-compiling. version.o is for the target system; - buildversion.o is for the build system - -error.c - - add line numbers to internal_error() messages if the shell is - not interactive and running a shell script or a -c command - - report_error now prints non-zero line numbers for non-interactive - shells - -test.c - - test_syntax_error now calls builtin_error() instead of printing - its own messages - -builtins/common.c - - builtin_error now prints line numbers if a non-interactive shell - is running a shell script or a -c command - -print_cmd.c - - in cprintf, remove free_argp, since it's not used - -builtins/history.def - - make `history -n' increment the number of history lines in this - session by the number of lines read from the history file - -arrayfunc.c - - fix array_value_internal to expand the subscript even if the - variable is unset, so side effects produced by the arithmetic - evaluation will take place - -lib/readline/doc/{rluser,rltech}.texinfo - - some fixes for printing in @smallbook format from Brian - Youmans - - 1/17 - ---- -jobs.h - - new PRUNNING, PSTOPPED, PDEADPROC defines for PROCESSes, analogous - to RUNNING, STOPPED, and DEADJOB defines for jobs - -jobs.c - - use PS_RUNNING, PS_DONE, PS_STOPPED values for `running' field - of a PROCESS - - find_pipeline and find_job now take an additional flags argument - that, if non-zero, means to find only running processes; changed - all callers - - changed calls to find_pipeline and find_job made from waitchld - to find only running processes - - find_pipeline takes a third argument: an int *. If it looks in - the jobs list to find the pid, and the arg is non-null, it passes - the job index back to the caller. Used to avoid calls to - find_pipeline immediately followed by find_job with the same PID - -nojobs.c - - a couple of changes to make sure that set_pid_status is never - called with a pid argument of 0 or -1 - -trap.c - - change trap_handler to longjmp to wait_intr_buf (set by wait_builtin) - if a signal is received for which a trap has been set during - execution of the wait builtin (need to include builtins.h and - builtins/builtext.h and declare some extern variables for the - right things to check) - - new variable to keep track of which signal caused the longjmp to - wait_intr_buf, set by trap_handler (wait_signal_received) - -builtins/wait.def - - set the return value of wait when a longjmp(wait_intr_buf, 1) is - done to 128 + wait_signal_received - -{jobs,nojobs}.c - - set wait_signal_received to SIGINT in wait_sigint_handler before - the longjmp(wait_intr_buf, 1) - - 1/18 - ---- -bashline.c - - turn off rl_filename_completion_desired when completing a command - name with a single match only if the first char of that match is - not a `/' - - if there are multiple identical matches for a command name in - attempt_shell_completion, turn off rl_filename_completion_desired - if the first char is not a `/' to avoid readline appending a - slash if there's a directory with the same name in the current - directory - - 1/22 - ---- -lib/readline/complete.c - - new variable, _rl_page_completions, to control whether we want to - run the internal pager when listing completions (defaults to 1) - -lib/readline/rlprivate.h - - extern declaration for _rl_page_completions - -lib/readline/bind.c - - new bindable variable, `page-completions', controls value of - _rl_page_completions - -lib/readline/doc/{rluser.texinfo,readline.3}, doc/bash.1 - - documented `page-completions' variable - -Makefile.in - - use $(INSTALL_SCRIPT) instead of $(INSTALL_PROGRAM) to install - `bashbug' - -aclocal.m4 - - fix small quoting problem in RL_LIB_READLINE_VERSION macro - -lib/readline/terminal.c - - fetch and save terminal's `vs' and `ve' cursor control attributes - - fetch and save terminal's `kI' attribute (string sent by Insert) - - new function, _rl_set_cursor, sets cursor to normal (insert mode) - or very visible (overwrite mode) - -lib/readline/readline.c - - new global variable, rl_insert_mode - - new function to toggle overwrite mode, rl_overwrite_mode - - each new line starts in insert mode - - switching to vi mode or emacs mode resets to insert mode - - reset cursor to normal before returning line - - _rl_replace_text now returns the number of characters inserted, - the return value from rl_insert_text - - new function, _rl_insert_or_replace_text (const char *string, int insert), - either inserts STRING or replaces the number of chars in STRING - with STRING starting at rl_point, depending on value of INSERT - - renamed rl_insert to _rl_insert_char, rl_insert just calls - _rl_insert_char with the same arguments when in insert mode - - new function, _rl_overwrite_char, handles self-insert in overwrite - mode. Does multibyte chars by reading an entire multibyte character - before entering overwrite loop - - new function, _rl_overwrite_rubout, handles RUBOUT when in - overwrite mode, called from rl_rubout - - new function, _rl_rubout_char, old body of rl_rubout; rl_rubout - calls this when not in overwrite mode - -lib/readline/readline.h - - extern declarations for rl_insert_mode and rl_overwrite_mode() - -lib/readline/rldefs.h - - define constants for values of rl_insert_mode - -lib/readline/rlprivate.h - - extern declarations for _rl_set_cursor and _rl_set_insert_mode - - change type of _rl_replace_text to return int - - extern declarations for _rl_insert_char, _rl_rubout_char - -lib/readline/funmap.c - - new bindable name `overwrite-mode', bound to rl_overwrite_mode - -lib/readline/rlconf.h - - define CURSOR_MODE if you want the cursor to show insert or - overwrite mode (only available if both `vs' and `ve' capabilities - are present) - -lib/readline/{complete,parens,readline,search,vi_mode}.c - - change calls to rl_insert to _rl_insert_char - -lib/readline/{readline,search}.c - - change calls to rl_rubout to _rl_rubout_char to avoid overwrite - mode problems - -lib/readline/vi_mode.c - - fix rl_vi_overstrike to just call _rl_overwrite_char, which - handles multibyte chars - -lib/readline/doc/{rluser.texinfo,readline.3}, doc/bash.1 - - document new `overwrite-mode' command - - 1/23 - ---- -lib/readline/readline.c - - return 0 immediately from rl_insert_text if the string to insert - is NULL or "" - -bashline.c - - if a numeric argument is given to one of the bash-specific glob - pattern completion functions (including TAB), append a `*' to - the word before generating matches - - in attempt_shell_completion, when doing glob completion, only - set the match list to NULL if rl_completion_type == TAB and - there is more than one completion. This permits listing completions - with double tabs and displaying ambiguous completions - - new function, bash_glob_complete_word, appends a `*' to the word - to be completed and then globs it. It uses a new filename - quoting function (bash_glob_quote_filename) to avoid quoting - globbing characters in the filename if there are no matches or - multiple matches - -lib/readline/complete.c - - set completion_changed_buffer to 0 in rl_complete_internal if - no matches were produced by the completion generator function - - new variable, rl_completion_suppress_append, suppresses appending - of rl_completion_append_character. Settable by application - completion functions, always 0 when application completion - functions are called (set to 0 by rl_complete_internal and - rl_menu_complete) - - broke the code that assigns default values to readline completion - variables out of rl_complete_internal and rl_menu_complete into - a new function, set_completion_defaults (int what_to_do) - -lib/readline/readline.h - - extern declaration for rl_completion_suppress_append - -lib/readline/doc/rluser.texinfo, doc/bash.1 - - documented behavior of glob-expand-word and glob-list-expansions - when supplied a numeric argument - - documented glob-complete-word - -lib/readline/doc/rltech.texinfo - - documented rl_completion_suppress_append - - 1/24 - ---- -lib/readline/text.c - - new file, text and character handling functions from readline.c - -lib/readline/misc.c - - new file, miscellanous bindable functions and their supporting - code from readline.c - -Makefile.in, lib/readline/Makefile.in - - changes for text.c, misc.c - -lib/readline/bind.c - - change ISKMAP case of rl_invoking_keyseqs_in_map to output - ESC as "\M-" instead of "\e" -- it's closer to the documentation - - change _rl_get_keyname to output ESC as \e instead of \C-[ - (it's easier to understand) - -pcomplete.h - - new flag, COPT_NOSPACE - -builtins/complete.def - - new `-o nospace' option for complete and compgen (though it doesn't - really do anything for compgen, since that doesn't hand anything - off to readline) - -bashline.c - - if a programmable completion specifies COPT_NOSPACE, set - rl_completion_suppress_append = 1 - -lib/readline/doc/rluser.texinfo - - documented new `-o nospace' option to complete and compgen - -doc/{bash.1,bashref.texi} - - documented $'\cX' escape sequence (forgot to before) - - 1/28 - ---- -variables.c - - make_new_variable now takes the HASH_TABLE * as its second - argument; changed callers - - new function, bind_variable_in_table, takes the HASH_TABLE * as - its third paramter; bind_variable calls bind_variable_in_table - with shell_variables as third argument - -variables.h - - new struct var_context, variable context (per-scope -- global, - function local, etc.) - -variables.[ch],builtins/common.[ch] - - moved functions that push and pop a variable context from - builtins/common.c to variables.c; move extern function - declarations to variables.h - - new function, all_local_variables - - variable_in_context is now static, used only by all_local_variables - -variables.[ch],execute_cmd.c - - push_context now takes the function name as an argument for - future use - - push_context takes an indication of whether or not the function is - executing in a subshell and saves the positional parameters only - if not in a subshell - - new functions for managing a stack of variable contexts and - scopes: new_var_context, dispose_var_context, push_var_context, - pop_var_context, push_scope, pop_scope - -builtins/declare.def - - call all_local_variables instead of map_over (...) in declare_internal - - don't call make_local_variable if we're looking at functions - ((flags_on & att_function) != 0), since it's wasted - - make sure VAR is set to NULL if check for variable_context fails - and we didn't just create or fetch a local variable in - declare_internal - - in non-function branch of declare_internal, only call find_variable - if VAR is NULL -- if it's not null, we just created or fetched a - local variable and don't need to do it again - - 1/29 - ---- -variables.[ch] - - the temporary environments (temporary_env, builtin_env, function_env) - are now HASH_TABLEs instead of argv-style arrays of strings (this - is an intermediate step on the way to the new lcc-inspired symbol - table scope structure) - - new internal attribute for variables: att_propagate. This means - to propagate the value out of the temporary environment up the - (for now implicit) chain of variable scopes when the containing - temporary environment is deleted - -variables.c - - assign_in_env now adds to the HASH_TABLE temporary_env instead - of making environment-style strings in an array of strings - - changed the way the temporary environments are merged into the - shell variable table to account for the new HASH_TABLE temp - environments - - changed the way the export environment is created due to the new - structure of the temporary environments - - new function, bind_variable_internal (name, value, table), binds - NAME to have VALUE in TABLE without searching the temporary - environments - - removed: shell_var_from_env_string, bind_name_in_env_array - - variable_in_context now checks the att_local attribute and makes - sure the variable is not invisible - - local_and_exported now makes sure the variable is not invisible - -execute_cmd.c - - we no longer need to copy the temporary environment to function_env - or builtin_env, we can simply use variable assignments - -{findcmd,subst,variables}.c, builtins/{declare,setattr}.def - - since variables from the temporary environments are no longer turned - into SHELL_VARs on the fly, don't dispose the SHELL_VAR returned - by find_variable or find_variable_internal - - need to savestring() the value returned by find_variable if it has - the tempvar attribute before calling bind_variable on it, because - bind_variable will search and bind into the temporary environments - and will free the old value before binding the new. For temporary - environments, these two pointers will be the same, and - bind_tempenv_variable will end up using freed memory - -builtins/{declare,setattr}.def - - set the att_propagate attribute when exporting or making readonly - variables from the temp environment (i.e., `var=value declare -x var' - or `var=value export var' sets the propagate attribute on the entry - for `var' in the temporary environment HASH_TABLE) - -lib/readline/isearch.c - - ^W when reading isearch string yanks the current word out of the - current line into the search string, skipping the portion already - matched - - ^Y when reading isearch string yanks the rest of the current line - into the search string, skipping the portion already matched - - 1/30 - ---- -{print_cmd,variables}.c - - moved indirection_level_string() from variables.c to print_cmd.c - -{externs,variables}.h - - moved extern declaration of indirection_level_string to externs.h - -{general,variables}.c - - moved assignment() from variables.c to general.c - -{general,variables}.h - - moved extern declaration of assignment() to general.h - -{externs,input}.h - - moved extern declaration of decode_prompt_string to externs.h - -print_cmd.c - - include flags.h, don't include stdc.h - -variables.c - - moved some functions around to group functions better - - changed new_shell_variable to explicitly initialize each member - of the created struct variable instead of calling bzero() - - make_new_variable now just calls new_shell_variable instead - of duplicating what it does - - removed some code in bind_function that duplicated what - new_variable does on the newly-created SHELL_VAR - - since there are no local function variables (functions are always - made at the global scope), kill_all_local_variables() doesn't - need to consider functions - - 1/31 - ---- -variables.c - - sort the array of special variables - - short-circuit the search in stupidly_hack_special_variables if - the passed name can't be found in the rest of the array - (that is, if name[0] < special_vars[i].name[0]) - -lib/readline/history.c - - unstifle_history() was returning values exactly opposite of - the documentation - -lib/readline/doc/{hsuser.texinfo,history.3} - - clarified the unstifle_history() documentation a little - - 2/4 - --- -variables.c - - in bind_variable, don't call bind_tempenv_variable after a - find_tempenv_variable succeeds -- just change the value inline. - There's no reason to look it up twice - - change makunbound to only call stupidly_hack_special_variables - if we're not unsetting a function - -variables.[ch] - - new function, unbind_function, like makunbound but doesn't mess - with previous contexts or calling stupidly_hack_special_variables - -builtins/set.def - - change unset_builtin to call either unbind_func or unbind_variable - -builtins/getopts.def - - call unbind_variable(name) instead of makunbound(name, shell_variables) - - 2/5 - --- -lib/glob/sm_loop.c - - use malloc instead of xmalloc in BRACKMATCH and handle failures - -error.c - - add extern declaration of executing_line_number with prototype, - since execute_cmd.h can't be included without including other - files - -lib/readline/parens.c - - include - -lib/malloc/stats.c - - include - - add extern declaration of malloc_free_blocks() with prototype - -pathexp.c - - added some forward declarations with prototypes for static functions - -lib/readline/rlprivate.h - - removed declarations of rl_untranslate_keyseq, rl_discard_argument, - rl_stop_output, rl_alphabetic since they appear in readline.h - - 2/6 - --- -{arrayfunc,execute_cmd,pcomplete,shell}.c - - change calls to makunbound(name, shell_variables) to - unbind_variable (name) - - 2/7 - --- -builtins/getopt.c - - don't defer incrementing of OPTIND when an invalid option is - encountered until the next call to sh_getopt() -- what if OPTIND - is reset before that next call? This means that OPTIND is always - incremented to the next option to be handled when an option is - returned, whether it's valid or not. This is what POSIX-2002 - says to do. - -syntax.h - - new #define, CSUBSTOP - -mksyntax.c - - add "-=?+" with value CSUBSTOP to the syntax table. These are the - valid expansion operators OP in ${param[:]OPword} - -subst.c - - use table lookup for CSUBSTOP in VALID_PARAM_EXPAND_CHAR - - new flags for the string extraction functions: EX_NOALLOC. This - indicates that the functions are being used only to skip over - strings and the result won't be used, so the substring shouldn't - be allocated, copied, and freed - - new flag for string_extract: EX_VARNAME. This serves the same - purpose as the old `varname' parameter. parameter_brace_expand() - changed appropriately - - extract_delimited_string and extract_dollar_brace_string now take - an additional `flags' argument, which may include EX_NOALLOC - - changed callers of extract_delimited_string and - extract_dollar_brace_string appropriately - - string_extract now understands EX_NOALLOC; callers changed - - some smaller code cleanups - - converted char_is_quoted(), unclosed_pair(), and skip_to_delim() - to understand multibyte characters - - 2/11 - ---- -variables.[ch] - - moved to a symbol organization inspired by lcc. The basic structure - is no longer a HASH_TABLE, but a VAR_CONTEXT, which includes a hash - table as one of its members. VAR_CONTEXTs are linked together to do - variable scoping. One nice thing about this is that the entire - symbol table doesn't need to be searched at function scope exit to - remove local variables. Fixes problems with only one instance of - builtin_env and function_env, even though it really is a stack - - shell_variables is now a VAR_CONTEXT *, with a global_variables - variable that points to the bottom of the stack for fast access - - function-scope local variables (assignments specified on the command - line before a function call) and function-local variables (declared - with the `local' builtin) have been unified in the same variable - context, replacing function_env - - assignment statements preceding the `.' and `eval' builtins are now - a separate variable scope VAR_CONTEXT, replacing builtin_env - - temporary_env (a HASH_TABLE) is now the only separate environment - - changes to export environment creation, variable binding, variable - lookup, local variable propagation all changed to work with the - new symbol table/scope structure - - a SHELL_VAR no longer has a `prev_context' member; it's not needed - -execute_cmd.c - - changes to push_context calls to include any temporary variables in - temporary_env; pop_context takes care of propagating any temporary - variables if necessary - - calls to push_scope if `eval' or `.' is called with a list of - preceding variable assignments, and pop_scope called at end of - builtin's execution. pop_scope takes care of merging temporary - variables into the shell environment when appropriate - -builtins/{setattr,declare}.def - - changes to account for variable assignments preceding `local', - `export', `readonly', `declare', etc. to work with the new - variable scoping implementation - -shell.c - - since shell_variables is now a VAR_CONTEXT, call - delete_all_contexts() when the shell is reinitializing instead of - delete_all_variables() - -builtins/common.c - - new function, get_job_by_name(), used by execute_simple_command() - for the `auto_resume' stuff and get_job_spec() - -builtins/common.h - - new set of #defined constants for flags argument to - get_job_by_name() - - 2/12 - ---- -command.h - - new redirection operator: r_reading_string for `here strings' - -parse.y - - new token, LESS_LESS_LESS, for new redirection `here string' - operator: [N]<<< word - - recognize LESS_LESS_LESS and create the appropriate redirection - -{dispose_cmd,copy_cmd,make_cmd,print_cmd}.c - - recognize r_reading_string and do the right thing (dispose_redirects, - copy_redirect, print_redirection, and make_redirection, respectively) - -redir.c - - here_document_to_fd now takes the redirection operator as its - second argument - - new function, write_here_string, expands a here string and writes it - to the here document file descriptor - - here_document_to_fd calls write_here_string for r_reading_string - operator - - handle r_reading_string in do_redirection_internal() and - stdin_redirection() - - 2/18 - ---- -doc/{bash.1,bashref.texi} - - documented here strings - -{configure,Makefile}.in - - bumped version number up to bash-2.05b and the release status - to alpha1 - -expr.c - - make expr_streval understand that variables with the `invisible' - attribute are really unset, and accessing such a variable when - `set -u' is set should be an error - -variables.h - - new accessor macros: var_isset(var) and var_isnull(var), test - whether var->value is NULL - -{eval,subst,variables}.c, builtins/{declare,setattr}.def - - be more consistent about using value_cell(var) instead of - directly referencing var->value - - use var_isset and var_isnull where appropriate - -builtins/help.def - - augmented a couple of help strings with pointers to `info' and - `man -k' - - 2/14 - ---- -variables.h - - new macros to use when setting variable values directly instead of - through bind_variable and its siblings - -{arrayfunc,variables}.c - - use var_setarray and other lvalue macros instead of assigning to - var->value directly - -builtins/setattr.def - - change show_var_attributes to show function definitions separately - from function attributes. This allows the output of `declare -f' - (with other flags), `export -f', and `readonly -f' to be reused as - shell input, instead of the old - - declare -f[flags] func() - { - foo - } - - which has syntax errors. When in posix mode, `export -fp' and - `readonly -fp' still don't print function definitions - - 2/16 - ---- -parse.y - - comment out calls to discard_parser_constructs; no need to call - empty functions - - 2/18 - ---- -lib/sh/memset.c - - replacement function for memset(3) - -lib/sh/Makefile.in, Makefile.in - - additions for memset.c - -configure.in,config.h.in - - check for memset, define HAVE_MEMSET if found, add memset.o to - LIBOBJS if not - -lib/malloc/malloc.c - - removed zmemset(), replaced with calls to memset(3) - -{subst,execute_cmd,lib/sh/netopen}.c - - replaced calls to bzero with calls to memset - -subst.c - - word_split() now takes a second argument: the value of $IFS, so - it doesn't have to look up IFS every time - - word_list_split() now calls getifs() and passes the result to - each call to word_split() as its second arg - - do a quick scan for CTLNUL in remove_quoted_nulls before allocating - new string, copying old string to it, copying over original string - and freeing new string - -eval.c - - don't bother calling dispose_used_env_vars if temporary_env is NULL - -execute_cmd.c - - fix fix_assignment_words to only look up the builtin corresponding - to the first word if one of the words in the list is marked as - W_ASSIGNMENT - -hashlib.c - - renamed hash_string to hash_bucket, which better reflects what it - does - - extracted the portion of hash_bucket that computes the hash out - into a new hash_string() - - made new body of hash_bucket into a macro HASH_BUCKET; function - just calls the macro - - calls to hash_bucket in this file now call HASH_BUCKET macro - - in add_hash_item, just add a new item at the front of the appropriate - bucket list instead of at the end - -hashcmd.h - - reduced FILENAME_HASH_BUCKETS to 53 from 107 - - 2/19 - ---- -hashlib.[ch] - - find_hash_item, remove_hash_item, add_hash_item all take a new - third `flags' argument - - add_hash_item doesn't call find_hash_item if HASH_NOSRCH passed in - flags arg - - find_hash_item will create a new hash table entry if HASH_CREATE is - passed in flags arg - - new function, hash_walk, takes a pointer to a function and a table - and calls the function for each item in the table. If the function - returns < 0, the walk is terminated - - fixed flush_hash_table to set table->nentries to 0 after freeing - all entries - - BUCKET_CONTENTS now has a new `khash' member, what key hashes to; - set by HASH_BUCKET macro (which calls hash_string), assigned in - find_hash_item (HASH_CREATE) and add_hash_item - - find_hash_item and remove_hash_item check `khash' against the - hash of the string argument before calling strcmp - -{alias,hashlib,hashcmd,pcomplib,variables}.c - - changed all calls to {find,remove,add}_hash_item - -builtins/hash.def - - return immediately from print_hashed_commands if there are no - entries in the hash table (this eliminates need for `any_printed' - variable) - - change print_hashed_commands to use hash_walk - -alias.c - - short-circuit all_aliases and map_over_aliases if - HASH_ENTRIES(aliases) == 0 - - simplify map_over_aliases by just allocating enough room in the - returned list for all entries in the aliases hash table, instead - of doing the check and xrealloc - - add_alias now calls add_hash_item with HASH_NOSRCH argument - -pcomplete.h - - sh_csprint_func_t is no more; use hash_wfunc instead - -pcomplib.c - - short-circuit print_all_compspecs if HASH_ENTRIES(prog_completes) - is 0 - - print_all_compspecs now takes a `hash_wfunc *' argument - - print_all_compspecs now just calls hash_walk - -builtins/complete.def - - new function, print_compitem, takes a BUCKET_CONTENTS *, extracts - the right info, and calls print_one_completion - -variables.c - - short-circuit map_over_funcs if HASH_ENTRIES(shell_functions) == 0 - - short-circuit flatten if the passed table has no entries - - bind_variable_internal takes a new fourth argument: `hflags', - to pass to hash table functions - - make_new_variable now passes HASH_NOSRCH flag to add_hash_item - - set_if_not now calls bind_variable_internal and passes - HASH_NOSRCH as flags argument - - bind_function now calls add_hash_item with HASH_NOSRCH argument - - fixed make_local_variable: old_var == 0 && was_tmpvar can never - be true - - if we didn't find an old variable in make_local_variable, call - bind_variable_internal with HASH_NOSRCH argument - - fix push_temp_var to reset variable context to 0 if binding into - global_variables->table - -parse.y - - fix to parse_compound_assignment to avoid core dumps on empty - compound array assignments - -subst.c - - getifs() is now global so read_builtin can call it - -subst.h - - extern declaration for getifs() - - 2/20 - ---- -hashlib.c - - changed hash_string to use a better hash function - - changed HASH_BUCKET to use masking rather than modulus to hash a - string to a bucket -- HASH TABLES MUST NOW BE SIZED BY POWERS - OF TWO - -hashlib.h - - DEFAULT_HASH_BUCKETS is now 64 - -hashcmd.h - - FILENAME_HASH_BUCKETS is now 64 - -pcomplib.c - - COMPLETE_HASH_BUCKETS is now 32 - -variables.c - - TEMPENV_HASH_BUCKETS is now 4 - -alias.c - - new define, ALIAS_HASH_BUCKETS, set to 16, used to size alias table - -hashlib.c - - removed initialize_hash_table; folded code into make_hash_table - - fixed copy_bucket_array to copy the `khash' member of an item - - renamed functions to be more systematic and easier for me: - make_hash_table -> hash_create - hash_table_nentries -> hash_size - copy_hash_table -> hash_copy - find_hash_item -> hash_search - remove_hash_item -> hash_remove - add_hash_item -> hash_insert - flush_hash_table -> hash_flush - dispose_hash_table -> hash_dispose - print_table_stats -> hash_pstats - get_hash_bucket -> hash_items - - changed hash_search to short-circuit if table->nentries == 0 and - HASH_CREATE has not been passed in the flags argument - -{alias,variables,hashcmd,pcomplib}.c - - renamed calls to all renamed functions from hashlib.c - -builtins/kill.def - - don't drop a leading `-' in a pid argument - - call kill_pid with an explicit third argument of 1 if the pid - argument to kill is < -1, rather than rely on the behavior of - kill(2) - - 2/21 - ---- -subst.c - - quoted_strchr is no longer declared `inline' - - skip_double_quoted is no longer declared `inline' - - string_extract_double_quoted is no longer declared `inline' - -lib/readline/input.c - - rl_gather_tyi is now an `int' valued function; returns the number - of characters read (0 or 1) or -1 on error - - if rl_gather_tyi() returns -1 to rl_read_key(), set rl_done to 1 - and return a newline; something is wrong with the input fd - - 2/25 - ---- -variables.[ch] - - IFS is now a special variable - - new special var function, sv_ifs(), called when IFS is set or unset - - call setifs() when IFS is first set in initialize_shell_variables - - call setifs() from make_local_variable and assign_in_env if - appropriate - - if assign_in_env() is called with a var assignment like `VAR=', - make the value in the new SHELL_VAR created be "" like - do_assignment_internal does, since certain parts of the shell use - a NULL value as evidence that the variable is unset (though - attributes may have been assigned) - - if push_temp_var pushes something up to the global_variables table, - make sure that the context is set to 0 - - new function dispose_temporary_env, called by both - dispose_used_env_vars and merge_temporary_env with different `free - func' function pointers; calls sv_ifs after disposing the temporary - environment - - push_exported_var now calls bind_variable_internal instead of - bind_variable - - pop_scope and pop_context now call sv_ifs - -subst.[ch] - - new global variables used to keep track of IFS state, to avoid - having to call find_variable("IFS") all the time: - - ifs_var the SHELL_VAR for IFS - ifs_value ifs_var ? value_cell (ifs_var) : " \t\n" - ifs_cmap bitmap of characters in ifs_value - ifs_firstc first character in ifs_value - - - new function setifs(), sets the aforementioned ifs variables each - time IFS is set or unset, and at nested scope exit - - instead of calling getifs() from inside subst.c, use ifs_value - - getifs() now just returns ifs_value - - use ifs_firstc in string_list_dollar_star() - - only call member() in issep() if separators is more than one char - - don't cache a bitmap every time expand_word_internal() is called; - use ifs_cmap instead - - new macro, isifs(c), checks whether C is in ifs_cmap - -builtins/read.def - - use issep() and isifs() macros instead of looking at $IFS directly - -syntax.h - - make sure macros that access sh_syntaxtab cast the argument to - `unsigned char' before array access - - new macros: issyntype(c, type) and notsyntype(c, type), check - sh_syntaxtab[c] for a particular flag value `type' - - 2/26 - ---- -hashlib.h - - the `data' member of a `BUCKET_CONTENTS' is now a PTR_T - -{hashlib,alias,variables,hashcmd,pcomplib}.c - - removed some casts when assigning to and using `data' member of a - `BUCKET_CONTENTS' - -subst.c - - in split_at_delims, call make_word_list instead of allocating and - initializing a WORD_LIST * directly - -make_cmd.[ch] - - add_string_to_list is now just a macro that calls make_word_list - - make_simple_command now calls make_word_list instead of allocating - a WORD_LIST * directly - - 2/27 - ---- -copy_cmd.c - - copy_word now calls make_bare_word to allocate the copy - - copy_word_list now calls make_word_list to allocate the copy - -shell.h - - include `ocache.h' for simple object caching - - call cmd_init() to initialize the WORD_DESC and WORD_LIST object - caches - -{make,dispose}_cmd.c - - allocate WORD_DESC * and WORD_LIST * vars from their respective - ocaches, and return them to the cache when disposing - -jobs.c - - renamed old `waiting_for_job' variable to `queue_sigchld', which - better reflects its intent: sigchld_handler does not call waitchld - if `queue_sigchld' is non-zero, it simply increments the count of - waiting children - - cleanup_dead_jobs now just sets and clears queue_sigchld instead of - blocking and unblocking SIGCHLD; it calls waitchld at the end if - `sigchld' is non-zero, but that's not really necessary - - in setjstatus, only call xrealloc if `statsize' is less than the - number of processes passed -- no reason to do it if they're the - same - - 2/28 - ---- -sig.[ch] - - reinitialize_signals is no more; initialize_signals takes an - argument saying whether or not we are reinitializing - -builtins/exec.def - - reinitialize_signals() -> initialize_signals(1) - -test.c - - fix filecomp() to work right when one file has a non-positive - timestamp and the other file does not exist - -doc/{bash.1,bashref.texi} - - document what happens for test's -nt and -ot operators when one - file operand exists and the other does not - -jobs.c - - if we haven't messed with SIGTTOU, just manipulate queue_sigchld - in notify_of_job_status instead of calling sigprocmask() - - list_one_job now calls pretty_print_job directly instead of going - through print_job - - pretty_print_job now must be called with SIGCHLD blocked or held - instead of blocking SIGCHLD itself - - changed start_job so that it doesn't call UNBLOCK_CHILD and then - immediately call BLOCK_CHILD again (explicitly or via last_pid()), - call find_last_pid instead of last_pid and then UNBLOCK_CHILD - - changed wait_for_job the same way - - find_last_pid now takes a second argument: block; uses BLOCK_CHILD - if `block' is 1, not otherwise. Changed existing calls: - find_last_pid(j) -> find_last_pid(j, 0) - last_pid(j) -> find_last_pid(j, 1) - `last_pid()' is now gone - - rewrote wait_for_background_pids(); it was a little strange - -copy_cmd.c - - copy_if_command: don't copy null false_case commands - - copy_simple_command: don't copy a null redirection list - -subst.c - - in get_word_from_string and list_string, just check for " \t\n" - directly rather than calling strcmp - - in get_word_from_string and strip_trailing_ifs_whitespace, use - isifs() instead of issep(), since they're never called with - separators != $IFS - - change issep() to call isifs if separators is longer than one - character, since it's never called with anything but "", " ", - or $IFS - - 3/1 - --- -sig.h - - enclose the BLOCK_SIGNAL macro in a do {...} while (0) loop, at it - should have been all along - -lib/readline/doc/rltech.texinfo - - document that readline defaults to stdin/stdout if rl_instream/ - rl_outstream are NULL - -lib/readline/terminal.c - - if an application is using a custom redisplay function, - rl_resize_terminal just calls rl_forced_update_display to tell - (*rl_redisplay_func) to update the display, otherwise call - _rl_redisplay_after_sigwinch - -lib/readline/readline.c - - change readline_internal_setup() so the change to vi insertion mode - happens even if readline_echoing_p is 0 - - don't print the prompt to rl_outstream in readline_internal_setup - if we're not echoing and the caller has defined a custom redisplay - function -- let the redisplay function deal with it - -configure.in - - new option: --enable-mem-scramble, controls memory scrambling on - free() (on by default; only affects use of bash malloc) - -config.h.in - - new option MEMSCRAMBLE, controlled by --enable-mem-scramble - - 3/5 - --- -parse.y - - added ksh-like behavior of [...] to read_token_word: if a `[' is - seen in an assignment context and the previous characters in the - token form a valid identifier, parse the [...] with - parse_matched_pair to allow spaces (and newlines) in the subscript - -bashline.c - - new function bash_servicename_completion_function, for completing - service names from /etc/services - -bashline.h - - new extern declaration for bash_servicename_completion_function - -builtins/complete.def - - allow new `-s/-A service' option to complete and compgen builtins - -pcomplete.h - - new CA_SERVICE define, new ITEMLIST variable it_services - -pcomplete.c - - add callback to bash_servicename_completion_function to generate - list of matching service names for completion - -doc/bash.1,lib/readline/doc/rluser.texinfo - - documented new `-s/-A service' option to complete and compgen - - 3/6 - --- -builtins/read.def - - change hard-coded `0' to new variable `fd' (initially 0) in - preparation for adding `-u fd' option - -bashline.c - - bash_directory_completion_hook calls expand_prompt_string instead - of expand_string (it does the right thing). This keeps expansion - errors from causing a longjmp, which shouldn't happen because of - completion - - command_subst_completion_function was augmented very slightly to - do filename completion on a non-command-word in a command - substitution - - command_subst_completion_function now skips over the lcd that - rl_completion_matches puts in matches[0] if there is more than - one possible completion - - 3/7 - --- -builtins/read.def - - only add the unwind_protect to free `rlbuf' if `edit' is non-zero, - since we won't be using readline otherwise - -lib/sh/zread.c - - renamed zread1 -> zreadintr - -redir.c - - small change to redirection_error() to make a slightly better - guess about the invalid file descriptor if the redirection op is - r_duplicating_input or r_duplicating_output - -include/stdc.h - - new macro, SH_VA_START, to encapsulate the difference between - stdarg va_start and varargs va_start - -{error,pcomplete,print_cmd}.c,builtins/common.c,lib/sh/snprintf.c - - use SH_VA_START - - 3/8 - --- -builtins/read.def - - support for the ksh-like `-u fd' option - -general.c - - new function sh_validfd(fd), returns 1 if fd is a valid open file - descriptor - -general.h - - extern decl for sh_validfd - -bashline.c - - don't call posix_readline_initialize() from initialize_readline(); - sv_strict_posix() should already have taken care of it - - 3/11 - ---- -{error,pcomplete,print_cmd}.c, builtins/common.c - - removed non-varargs versions of functions - -builtins/printf.def - - if the string argument to %q has non-printing characters, call - ansic_quote to quote it rather than sh_backslash_quote - -variables.h - - new attribute: att_trace (and corresponding trace_p() macro). - Functions with this attribute will inherit the DEBUG trap. - Currently ignored for variables - -builtins/declare.def - - new `-t' option to declare/typeset toggle the `att_trace' attribute - -builtins/setattr.def - - check for att_trace and output `-t' flag in show_var_attributes - -execute_cmd.c - - if a function is being traced (it has the `-t' attribute set), - don't turn off the DEBUG trap when it executes - -doc/{bash.1,bashref.texi} - - document the new `-t' option to declare/typeset - - 3/12 - ---- -execute_cmd.c - - don't execute the debug trap in the `cm_simple:' case of - execute_command_internal; run it in execute_simple_command so we - get the line number information right when executing in a shell - function - - run a DEBUG trap before executing ((...)) arithmetic commands, - like ksh93 - - run a DEBUG trap before executing [[...]] conditional commands, - like ksh93 - -eval.c - - add a static forward declaration for alrm_catcher() - -general.c - - add static forward declarations for bash_special_tilde_expansions, - unquoted_tilde_word, initialize_group_array - -variables.h - - add extern declarations for sh_get_env_value, map_over_funcs, - local_exported_variables - -variables.c - - add static forward declarations for dispose_temporary_env, - make_func_export_array - -bashhist.c - - add static forward declaration for check_history_control - -configure.in - - add a call to AC_CHECK_DECLS for strcpy - -config.h.in - - add placeholder for HAVE_DECL_STRCPY define, set by configure - -general.h - - don't declare strcpy if HAVE_DECL_STRCPY is defined with a non-zero - value - -sig.h - - add prototype to typedef of SigHandler - -lib/readline/histlib.h - - removed extern declaration of strcpy() - - include string.h/strings.h directly in histlib.h instead of source - files - -lib/readline/{histexpand,histfile,history,histsearch}.c - - don't include string.h/strings.h now that histlib.h includes it - -lib/tilde/tilde.c - - removed extern declaration of strcpy(), rely on string.h/strings.h - -command.h - - four new redirection types: r_move_input, r_move_output, - r_move_input_word, r_move_output_word, for - [N]<&word- and [N]>&word- from ksh93 - -print_cmd.c - - changes to print r_move_input[_word] and r_move_output[_word] - -copy_cmd.c - - changes to copy r_move_input[_word] and r_move_output[_word] - -dispose_cmd.c - - changes to dispose r_move_input_word and r_move_output_word - -make_cmd.c - - changes to make r_move_input[_word] and r_move_output[_word] from - r_duplicating_{input,output}_word, which is how the new redirs - are passed by the parser - -redir.c - - changes to make r_move_input[_word] and r_move_output[_word] do - the right thing when executed - -builtins/read.def - - print an error message and return failure immediately if zread/zreadc - return < 0 - -doc/{bash.1,bashref.texi} - - documented new [n]<&word- and [n]>&word- redirections - - 3/13 - ---- -lib/readline/isearch.c - - enabled code to allow chars bound to rl_rubout to delete characters - from the incremental search string - -shell.c - - add `-l' invocation option to parse_shell_options; equivalent to - `--login' - - fixed set_login_shell to check first char of base pathname of argv0 - for `-', like other shells - - move the check for make_login_shell after the call to - parse_shell_options because the `-l' option might set it - -doc/{bash.1,bashref.texi} - - documented new `-l' invocation option - -array.c - - new function, array_shift, shifts an array left by a specified - number of elements - - array_walk is now compiled in by default - - array_to_assignment_string now takes a second argument: int quoted. - If non-zero, the result is single-quoted before being returned - - quoted_array_assignment_string has been removed - -array.[ch] - - renamed most of the array functions so that all have an array_ - prefix and are more systematically named - - array_slice now preserves the indicies from the original array - - change array_to_assign to use a static buffer for expanding the - array indices, instead of malloc/free - -{arrayfunc,subst,variables}.c, builtins/read.def - - changed calls to various array functions to use new names - -lib/sh/stringvec.c, externs.h - - renamed all of the functions to have a strvec_ prefix and to have - a more sensible name scheme - - strvec_search's arguments are now supplied in reverse order, so - the char **array is first, like the other functions - - new function, strvec_resize, xrealloc for strvecs - -{alias,array,bracecomp,braces,bashline,execute_cmd,findcmd,general,pathexp, -pcomplete,variables}.c -lib/sh/stringlist.c -builtins/{bind,complete,exec,getopts,pushd,set}.def - - change calls to all functions from lib/sh/stringvec.c - - use strvec_resize where appropriate - -externs.h - - only declare dup2() if HAVE_DUP2 is undefined or DUP2_BROKEN is - defined - -lib/readline/{macro,readline,util}.c, lib/readline/rlprivate.h - - _rl_defining_kbd_macro is gone, use RL_ISSTATE(RL_STATE_MACRODEF) - -lib/readline/readline.h - - new struct readline_state, encapsulates most of readline's internal - state in case you need reentrancy or nested calls to readline() - - extern declarations for rl_save_state, rl_restore_state - -lib/readline/readline.c - - add (undocumented) int rl_save_state (struct readline_state *), - int rl_restore_state (struct readline_state *) - - 3/14 - ---- -array.[ch] - - new function, array_rshift, shifts an array right by a specified - number of elements, optionally inserting a new element 0 - -examples/bashdb/bashdb - - new single-file version of bash debugger, originally modified from - version in bash-2.04 by Gary Vaughan (the old debugger still - appears in examples/obashdb). This version has a more gdb-like - command set - -examples/bashdb/bashdb.el - - new emacs bashdb debugger mode from Masatake YAMATO - -execute_cmd.c - - don't make $LINENO relative to function start unless the shell is - currently interactive -- this is what ksh93 does and what I - believe to be the intent of POSIX.2 (this required changing some - of the test checks because the output has changed) - - run the debug trap for each command in an arithmetic for expression, - like ksh93 does - -lib/readline/vi_mode.c - - redid rl_vi_subst (binding func for `s' and `S') in terms of - rl_vi_change_to: `S' == `cc' and `s' == `c '. This makes undo - work right - - 3/18 - ---- -hashlib.c - - fixed hash_walk to return if the item function returns < 0, instead - of breaking out of the current hash chain - -array.c - - fixed array_walk to return if the item function returns < 0, like - hash_walk - -lib/sh/stringlist.c, externs.h - - new function: strlist_walk, takes a stringlist and a pointer to an - item func. Like other _walk funcs, if item func returns < 0 the - walk is cancelled - - new function: strlist_flush, frees items in the contained list - with strvec_flush - - renamed functions to have a strlist_ prefix and be more systematic - -pcomplib.c,pcomplete.h - - removed redundant `progcomp_initialized' variable - - renamed functions to have `progcomp_' or `compspec_' prefixes - like the hash library - -{bashline,pcomplete}.c,builtins/complete.def - - fixed calls to stringlist functions to use new names - - fixed calls to functions in pcomplib.c to use new names - -pcomplete.c - - made the debugging code #ifdef DEBUG -- it should be mature enough - -builtins/hash.def,parse.y - - use REVERSE_LIST(x, t) instead of (t)reverse_list(x) - -list.c,{externs,general}.h - - renamed the list functions to have a list_ prefix, changed callers - -externs.h,{execute_cmd,stringlib,subst}.c,builtins/common.c,lib/sh/stringvec.c - - word_list_to_argv -> strvec_from_word_list - - argv_to_word_list -> strvec_to_word_list - - moved functions to lib/sh/stringvec.c - -lib/sh/stringvec.c - - changed name of second argument to strvec_from_word_list from `copy' - to `alloc' so the use of `copy' between strvec_from_word_list and - strvec_to_word_list isn't as confusing - - changed name and sense of second argument to - strvec_to_word_list from `copy' to `alloc' for the same reason -- - now both functions agree on semantics of second argument - -lib/sh/stringlist.c - - ditto for strlist_from_word_list and strlist_to_word_list - -subst.c - - changed callers of strvec_to_word_list - - 3/19 - ---- -builtins/hash.def - - added `-l' option to list table or individual targets in reusable - format - - added `-d' option to remove one or more names from the table of - hashed commands (provides `unhash' or `unalias -t' functionality) - -doc/{bash.1,bashref.texi} - - documented new `-l' and `-d' options to `hash' - -hashcmd.[ch] - - renamed functions to have a `phash_' prefix and follow new naming - convention - - phash_remove now returns an int: 1 if command not in hash table, - 0 if filename removed OK - -{findcmd,variables}.c, builtins/{hash,type}.def - - changed callers to use new names from hashcmd.c - -builtins/common.[ch] - - new function, sh_notfound(s), prints standard `not found' message - - new function, sh_invalidid(s), prints standard `invalid identifier' - message - - new function, sh_restricted(s), prints standard `restricted' message - for restricted shells - - new function, sh_invalidnum(s), prints standard `invalid number' - message - - renamed bad_option to sh_invalidopt, changed to print - `invalid option' instead of `unknown option' - - new function, sh_invalidoptname, prints standard `invalid option - name' for long options - - new function, sh_badjob (s), prints standard `no such job' message - - new function, sh_invalidsig (s), prints standard `invalid signal - specification' message - - new function, sh_nojobs (s), prints standard `no job control' message - - new function, sh_needarg (s), prints standard `option requires an - argument' message - - new function, sh_neednumarg (s), prints standard `numeric - argument required' message - - new function, sh_badpid(s), prints standard `not a pid...' message - - new function, sh_erange (s, desc) prints standard `out of range' - message, optionally using `desc' to say what the argument is - -builtins/{alias,command,declare,exec,hash,type}.def - - call sh_notfound() instead of calling builtin_error directly - -builtins/{declare,getopts,read,set,setattr}.def - - call sh_invalidid() instead of calling builtin_error directly - -builtins/{cd,command,enable,exec,hash,source}.def - - call sh_restricted() instead of calling builtin_error directly - -builtins/{printf,read,ulimit}.def, builtins/common.c - - call sh_invalidnum instead of calling builtin_error directly - -builtins/{complete,declare,pushd,set}.def, builtins/bashgetopt.c - - call sh_invalidopt instead of bad_option or builtin_error directly - -builtins/{complete,set,shopt}.def - - call sh_invalidoptname instead of builtin_error directly - -builtins/{fg_bg,jobs,kill,wait}.def - - call sh_badjob instead of calling builtin_error directly - -builtins/common.c, builtins/{kill,signal}.def - - call sh_invalidsig instead of calling builtin_error directly - -builtins/{fg_bg,suspend,wait}.def - - call sh_nojobs instead of calling builtin_error directly - -builtins/{common,bashgetopt}.c, builtins/{hash,kill}.def - - call sh_neednumarg and sh_needarg where required - -builtins/{kill,wait}.def - - call sh_badpid where required - -builtins/{break,fc,history,pushd,shift,ulimit,umask}.def - - call sh_erange where appropriate - -builtins/printf.def - - new static function, printf_erange, prints standard out-of-range - warning message - -builtins/set.def - - changed so that calls to sh_invalidopt always include the leading - `+' or `-' - -builtins/shopt.def - - changed SHOPT_ERROR macro to shopt_error function - -builtins/bind.def - - regularized error messages to `bind: object: error string' like - other error messages - -builtins.h - - the `short_doc' member of a `struct builtin' is now of type - `const char *' - - the strings in `long_doc' array of a struct builtin are now const - -builtins/mkbuiltins.c - - changes for new `const' members of struct builtin - - 3/20 - ---- -lib/readline/histfile.c - - use pointers instead of indexing into buffer when reading the - contents of the history file in read_history_range and - history_truncate_file - - 3/21 - ---- -lib/readline/histfile.c - - new file, with code to mmap the history file for reading and - writing (depends on HAVE_MMAP, currently nothing checks for that) - - 3/25 - ---- -error.[ch] - - new function, err_badarraysub(s), calls report_error with standard - `bad array subscript' message - - new function, err_unboundvar(s), calls report_error with standard - `unbound variable' message - - new function, err_readonly(s), calls report_error with standard - `readonly variable' message - -{arrayfunc,subst}.c - - call err_badarraysub where appropriate - -{expr,subst}.c - - call err_unboundvar where appropriate - -{arrayfunc,variables}.c - - call err_readonly where appropriate - -shell.c - - changed text of bad option error messages to be the same as that - printed for builtin errors - -builtins/common.c - - changed sh_invalidopt to print the invalid option before the rest - of the error message (required some tests to be modified) - - new function, sh_readonly, calls builtin_error with standard - `readonly variable' message - -variables.c,builtins/declare.def - - call sh_readonly where appropriate - -lib/sh/stringvec.c - - added strvec_remove (sv, s), removes S from SV and shuffles rest of - elements down 1 - -lib/sh/stringlist.c - - added strlist_remove(sl, s), just calls strvec_remove on the - component list - -externs.h - - new extern declarations for strvec_remove and strlist_remove - - fixed extern declaration for strvec_search; the arguments were - reversed (unimportant, it's not compiled into the shell) - -subst.c - - change param_expand to call quote_escapes on values retrieved when - expanding the positional parameters - - change parameter_brace_expand_word to quote escapes on values - retrieved when expanding the positional parameters - - fix parameter_brace_substring to quote escape characters on unquoted - substrings extracted from variable values (needed to separate case - VT_VARIABLE from VT_ARRAYMEMBER for this, since, because - get_var_and_type calls array_value for VT_ARRAYMEMBER, we need to - skip over quoted characters in an already-appropriately-quoted - string to find the substring we want) - - fix parameter_brace_substring to quote escape characters in the - value returned by pos_params when expanding subsets of the - positional parameters and not within double quotes (in which case - pos_params() quotes the string for us) - - fix parameter_brace_substring to quote escape characters in the - value returned by array_subrange when expanding subsets of an - array and not within double quotes (in which case - array_subrange() quotes the string for us) - - new function, quoted_strlen(s), does strlen(s) while skipping over - characters quoted with CTLESC (#ifdef INCLUDE_UNUSED, since it's - not used yet) - - changed pos_params() so it always returns a list whose members are - quoted strings if (quoted&(Q_HERE_DOCUMENT|Q_DOUBLE_QUOTES)) != 0 - -arrayfunc.c - - fix array_value to consistently call quote_escapes, even when a - non-array variable is being subscripted with element 0, in which - case we return the variable value - -lib/sh/strtrans.c - - make the for_echo parameter to ansicstr a `flags' parameter that - has its old `for echo' meaning if flags&1 is non-zero (which is - consistent with the old code) - - Added code to the `flags' parameter to ansicstr so that if flags&2 - is non-zero, CTLESC and CTLNUL are escaped with CTLESC in the - expanded string - - change ansiexpand() to call ansicstr with a `flags' parameter of 2 - - 3/26 - ---- -lib/readline/histfile.c - - when reading and writing the history file, use malloc instead of - xmalloc and handle failures gracefully, so the application doesn't - abort if the history file or history list is too big - - 3/27 - ---- -arrayfunc.c - - changed array_value_internal to take an additional `int *' - parameter, in which is returned the type of array indexing - performed (array[@] vs. array or array[index]) - - changed array_value and get_array_value to take a corresponding - extra parameter and pass it to array_value_internal - - changed array_value_internal to no longer return newly-allocated - memory or quote CTLESC and CTLNUL in the returned string if - `simple' array indexing (subscript not `@' or `*') is being - performed. This makes it more like a variable lookup - -arrayfunc.h - - changed prototypes for array_value and get_array_value - -expr.c - - added new parameter to call to get_array_value in expr_streval - - don't need to free memory returned by get_array_value any more - -subst.c - - quote_escapes now works with multibyte characters - - dequote_string now works with multibyte characters - - dequote_escapes is now needed, so it's compiled in, and it - now works with multibyte characters - - remove_quoted_escapes now just calls dequote_escapes and copies the - result over the argument string - - remove_quoted_nulls now returns its char * argument, parallels - remove_quoted_escapes - - parameter_brace_expand_word now passes the new argument to - array_value and quotes CTLESC and CTLNUL in the result if it's a - `simple' array expansion by calling quote_escapes - - get_var_and_type now returns VT_ARRAYMEMBER for references like - ${array} where `array' is an array variable (just like ${array[0]}). - Documented (in comment) that a VT_VARIABLE return value means that - quote_escapes has been called at some point - - changed callers of get_var_and_type to no longer free value if - VT_ARRAYMEMBER is returned as type - - changed parameter_brace_substring and parameter_brace_patsub to - call dequote_escapes on the value from get_var_and_type if the - type is VT_VARIABLE, since the substring and pattern substitution - code doesn't understand CTLESC quoting - - parameter_brace_substring no longer needs to call quoted_substring - for the VT_ARRAYMEMBER case - - changed parameter_brace_patsub to call quote_escapes on the result - of pat_subst for the VT_VARIABLE and VT_ARRAYMEMBER cases, and to - quote the returned string in the VT_ARRAYVAR and VT_POSPARAMS cases - if the `MATCH_QUOTED' flag isn't set (if it is, the pattern - substitution functions perform any necessary quoting) - - quoted_substring is no longer used; it's now #ifdef INCLUDE_UNUSED - -lib/malloc/mstats.h - - new member in _malstats: u_bits32_t bytesreq, the total number of - bytes requested by the caller via calls to malloc() and realloc() - -lib/malloc/stats.c - - print bytesreq member in _print_malloc_stats - - don't print statistics for buckets for which nmal == 0 (no mallocs) - -lib/malloc/malloc.c - - modified internal_malloc, internal_realloc to keep running total of - number of bytes requested by calling application - -shell.c - - sh_exit is now compiled in; exit_shell calls sh_exit - -error.c - - changed fatal_error, report_error, parser_error to call sh_exit - - 3/28 - ---- -subst.[ch] - - changed Q_NOQUOTE to Q_PATQUOTE; it makes the intent more clear - -subst.c - - moved code from parameter_brace_expand into a new function that - dispatches for pattern substitution: parameter_brace_remove_pattern - - changed structure of parameter_brace_remove_pattern to be like - parameter_brace_patsub and its ilk: call get_var_and_type to - isolate the variable name, move the pattern isolation code out of - the various *_remove_pattern functions into - parameter_brace_remove_pattern and pass the results to the various - functions, use a switch on the return value from get_var_and_type - to decide which function to call, regularized the arguments to the - separate pattern removal functions - - parameter_brace_remove_pattern now properly quotes escape chars in - the returned value - - changed get_var_and_type to call dequote_escapes on the `value' - parameter for case VT_VARIABLE and return the result in *valp, - so the calling functions don't have to do it themselves; changed - callers appropriately - - fixed getpattern() where it broke posix compliance: if you enclose - a pattern removal spec in double quotes, the outer double quotes - have no effect on the pattern (POSIX.1-200x 2.6.2). This uncovered - a bug in the test suite (!) - -pathexp.c - - fixed a problem with quote_string_for_globbing where it would change - consecutive CTLESC chars all to \ instead of changing every other - quoted char - - 3/31 - ---- -lib/malloc/{malloc,stats}.c - - moved declaration of _mstats to malloc.c so stats.o doesn't get - linked into the shell if the stats functions aren't called - - 4/2 - --- -lib/glob/smatch.c - - introduce `XCHAR' define, which is the type of arguments passed to - strcoll/strcmp/strlen and their wide-character equivalents, added - appropriate casts - - static arrays in single-byte version of rangecmp() are `char', not - `unsigned char', so compilers don't complain about calls to strcoll - -lib/glob/sm_loop.c - - casts for `XCHAR' and `XCHAR *' arguments to libc functions - - use prototype declaration for BRACKMATCH if `PROTOTYPES' is defined - to avoid problems with type promotion (unsigned char -> int) - -lib/glob/collsyms.h - - `name' member of struct _COLLSYM is now of type `XCHAR *', since - some compilers don't like `unsigned char *' initializers from - constant strings - -[bash-2.05b-alpha1 released] - - 4/3 - --- -builtins/{evalstring.c,common.h} - - new flag for parse_and_execute, SEVAL_NOFREE, means to not free - the argument string when finished - -lib/readline/text.c - - fixed a trivial typo in _rl_insert_char when reading multibyte - char sequences - - replace calls to ding() with rl_ding() - -include/chartypes.h - - remove SIGN_EXTEND_CHAR and TOASCII macros; they're unused - -make_cmd.c - - include dispose_cmd.h for extern function declarations - -lib/glob/glob.c - - include `shmbutil.h' and `xmalloc.h' for extern function declarations - -lib/glob/smatch.c - - include `xmalloc.h' for extern function declarations - -shell.c - - fix maybe_make_restricted to use its argument instead of global - `shell_name' - -version.c - - update copyright message to include this year - -lib/readline/display.c - - fixes from Jiro SEKIBA to fix autowrapping - when using multibyte characters - -lib/glob/sm_loop.c - - fixed a problem in BRACKMATCH where not enough memory was allocated - to hold a multibyte character when parsing POSIX.2 char class names - -support/config.{guess,sub} - - updated via patch from Paul Eggert with latest GNU additions - -variables.c - - var_lookup should use its `vcontext' argument instead of - unconditionally using `shell_variables' - - 4/4 - --- -builtins/bind.def,doc/{bash.1,bashref.texi} - - changed the usage summary and help text to make it clear that any - readline command that may appear in ~/.inputrc may be supplied as - one of the non-option arguments to `bind' - -builtins/mkbuiltins.c - - added support for `-H' option, which means to write long documentation - for each builtin to a separate file in the `helpfiles' directory - -builtins/Makefile.in - - new target `helpdoc', just creates long doc files in helpfiles - directory - -lib/sh/zcatfd.c - - new file, with zcatfd(int fd, int ofd, char *fn); dumps data from - FD to OFD - -Makefile.in,lib/sh/Makefile.in - - added zcatfd.c, zcatfd.o member of libsh.a - -builtins/evalstring.c - - changed cat_file to call zcatfd(fd, 1, fn) - -builtins/{shopt,colon}.def - - removed the $DOCNAME directive for `shopt', `true', and `false'; - just use the names - - changed $DOCNAME for `:' to just be `colon' instead of - `colon_builtin' - -builtins/reserved.def - - added help entries for ((, [[, `for ((' - -builtins/let.def - - add id++, id--, ++id, --id, ** to help text - - 4/8 - --- -builtins/bashgetopt.[ch] - - changed to allow options beginning with `+', enabled by a leading - `+' in the option string - - new variable, list_opttype, set to `-' or `+' - -builtins/{common.c,{builtin,eval,exit,fg_bg,let,printf,pushd,return,source,wait}.def - - changes to allow a `--' option for every builtin that accepts - operands but not options, as per posix.1-2001 - -builtins/{declare,setattr}.def - - use internal_getopt for parsing options, now that it supports `+' - -builtins/set.def - - use internal_getopt for initial option parse, now that it supports - a leading `+' - - -{configure,Makefile}.in, builtins/{Makefile.in,help.def,mkbuiltins.c} - - support for a new configure option, ``--enable-separate-helpfiles'', - moves the `long' help text to separate help files, installed by - default into ${datadir}/bash, one file per builtin. Off by - default -- it saves 47K, but it's only 47K, and it's in the text - segment - -flags.c - - build internal_getopt() option string argument from flags array at - runtime in shell.c - -shell.c - - new variable to control writing malloc stats at exit: - malloc_trace_at_exit, 0 by default - -lib/malloc/malloc.c - - heavily updated: - o partial page allocated on first call to malloc to make - subsequent sbrks page-aligned no longer wasted - o begin and end range guards are now the same value: the chunk - requested - o coalescing code was changed to attempt to coalesce first two - adjacent blocks on the free list; enabled by default - o blocks of size 32 are now candidates for larger block - splitting, since 32 is the most popular size - o blocks of size 32 are now candidates for smaller block - coalescing - o the IN_BUCKET check was changed to just make sure that the - size isn't too big for the bucket, since the `busy block' - checking code may increase the bucket by one or more, - meaning that the old check would fail and cause a panic when - a chunk allocated in such a way was freed - o bin sizes are now precomputed and looked up in an array - rather than being computed at runtime - o moved the _mstats declaration here to avoid the stats code - being linked in even when no stats functions were called - (only matters if MALLOC_DEBUG is defined) - o malloc now keeps track of the address of the top of the heap - and will return large chunks to the system with calls to - sbrk with a negative argument when freeing the top chunk. - Two thresholds: LESSCORE_FRC means to unconditionally return - memory to the system; LESSCORE_MIN means to return memory if - there's at least one block already on the free list - -lib/malloc/mstats.h - - stats struct now keeps track of number of block coalesces by bin, - and the number of times memory was returned to the system by bin - -lib/malloc/stats.c - - trace_malloc_stats now takes a second argument: the name of the file - to write to. The first `%p' in the template file name is replaced - by the pid - - 4/9 - --- -lib/malloc/imalloc.h - - added some macros derived from dlmalloc and glibc malloc to inline - memcpy and memset if the requested size is <= 32 bytes - -lib/malloc/malloc.c - - use MALLOC_MEMSET instead of memset in internal_{malloc,free} - -include/ocache.h - - use OC_MEMSET (variant of MALLOC_MEMSET) in ocache_free - -configure.in, config.h.in - - check for getservent(), define HAVE_GETSERVENT if found - -bashline.c - - punt immediately from bash_servicename_completion_function if - HAVE_GETSERVENT is not defined (cygwin seems to not define it) - - include "input.h" for extern save_token_state() and - restore_token_state() declarations - - change bash_execute_unix_command to call parse_and_execute with - SEVAL_NOHIST flag so the command doesn't get saved on the history - list - - change bash_execute_unix_command to save and restore the current - command line count and the token state (last_read_token, etc.). - Everything else is saved by either parse_and_execute directly or - the call it makes to push_stream(). The shell_input_line stuff - doesn't need to be saved and restored; it's not computed until - readline() returns - - 4/10 - ---- -lib/glob/glob.[ch] - - glob_filename and glob_vector now take an additional `flags' arg - - define GX_MARKDIRS as possible flag value for glob_filename and - glob_vector - -lib/sh/snprintf.c - - fixed some bugs with handling of `g' and `G' formats - - make sure numtoa returns the fractional part correctly when passed 0 - - implemented thousands grouping for `'' flag character - -lib/sh/rename.c - - a few changes to make it more bulletproof - - 4/11 - ---- -lib/glob/glob.c - - added the couple of dozen lines of code to glob_dir_to_array to - finish implementing GX_MARKDIRS - -builtins/set.def - - changed unset builtin so that it no longer considers unsetting an - unset variable or function to be an error - -lib/readline/display.c - - fix to rl_redisplay for a problem which caused display to be messed - up when the last line of a multi-line prompt (possibly containing - invisible characters) was longer than the screen width - - 4/15 - ---- -aclocal.m4 - - use AC_DEFINE_UNQUOTED in BASH_SYS_DEFAULT_MAIL_DIR instead of - enumerating all of the possible values and using AC_DEFINE - - 4/16 - ---- -Makefile.in, {builtins,support}/Makefile.in - - new variables, CFLAGS_FOR_BUILD and CPPFLAGS_FOR_BUILD, substituted - by `configure' - - changed CCFLAGS_FOR_BUILD to BASE_CCFLAGS, removing $(CPPFLAGS); - CCFLAGS and CCFLAGS_FOR_BUILD now include $(BASE_CCFLAGS) with - (possibly) different values for CPPFLAGS and CFLAGS - - GCC_LINT_CFLAGS now includes $(BASE_CCFLAGS) and $(CPPFLAGS) - instead of CCFLAGS_FOR_BUILD - - new variable, LDFLAGS_FOR_BUILD, right now equivalent to LDFLAGS - - remove $(CPPFLAGS) from recipes for buildversion, mksignames, and - mksyntax - -configure.in - - compute and substitute CFLAGS_FOR_BUILD, CPPFLAGS_FOR_BUILD, and - LDFLAGS_FOR_BUILD - - changed qnx to use LOCAL_LDFLAGS and LOCAL_LIBS instead of putting - everything in LOCAL_LDFLAGS - -builtins/Makefile.in - - remove $(PROFILE_FLAGS) from recipe for building `mkbuiltins' - - use LDFLAGS_FOR_BUILD instead of LDFLAGS in recipe for building - `mkbuiltins' - -Makefile.in - - use $(CC_FOR_BUILD) and $(CCFLAGS_FOR_BUILD) to build auxiliary - test programs (printenv, recho, zecho) - -support/Makefile.in - - use CC_FOR_BUILD and CCFLAGS_FOR_BUILD in recipe for building - `man2html' - -lib/tilde/Makefile.in - - substitute PROFILE_FLAGS, use PROFILE_FLAGS in $(CCFLAGS) - - 4/25 - ---- -Makefile.in, configure.in - - moved RELSTATUS to configure.in; configure substitutes it into - the generated Makefile - -lib/sh/snprintf.c - - fix wchars() to deal with systems where MB_CUR_MAX is not a - constant expression - - 5/2 - --- -lib/sh/shquote.c - - add `,' to list of chars that are backslash-quoted. It doesn't - hurt normal usage and prevents filenames with commas from being - inappropriately split by brace expansion after using - complete-into-braces - - 5/6 - --- -lib/sh/xstrchr.c - - we only need the check of MB_CUR_MAX and the slow code for a - few encodings, and even then only for a subset of the charset - -arrayfunc.c - - some speedups for skipsubscript and multibyte chars from Bruno Haible - -locale.c - - changed set_lang to call setlocale(LC_ALL, ...) if LC_ALL doesn't - already have a value, but doesn't change any shell variables - -include/shmbutil.h - - major speedups from Bruno Haible, mostly concerned with reducing - the number of strlen(3) calls - -subst.c - - change callers of macros in shmbutil.h to add extra argument as - necessary - - skip_single_quoted and skip_double_quoted take another argument: - the length of the string; mostly useful when using multibyte chars - - many speedups from precomputing string lengths at function start - - fixed a small bug in de_backslash in the midst of rewriting for - better efficiency - -{braces,make_cmd,pathexp}.c - - change callers of macros in shmbutil.h to add extra argument as - necessary - -pathexp.c - - fix a one-too-far problem with multibyte chars in - unquoted_glob_pattern_p - -braces.c - - brace_gobbler takes a new argument, the length of the passed string - - expand_amble takes a new argument, the length of the passed string - - 5/7 - --- -subst.c - - modified remove_quoted_nulls to eliminate the memory allocation and - do the copy in place using the same strategy as de_backslash - -lib/readline/{rldefs.h,complete.c} - - new define RL_QF_OTHER_QUOTE, so _rl_find_completion_word can note - that it found a quoting character other than \'" that appears in - rl_completer_quote_characters - - 5/9 - --- -jobs.c - - save and restore old value of jobs_list_frozen when calling trap - handlers from set_job_status_and_cleanup to avoid seg faults when - running recursive trap handlers - - 5/10 - ---- -builtins/common.h - - new #defines to use for value of changed_dollar_vars (provides - information about the caller who wants to blow away the old dollar - variables) - -builtins/common.c - - changed set_dollar_vars_changed to set changed_dollar_vars to one - of the ARGS_* values depending on the caller and environment - -builtins/source.def - - source restores the positional parameters unless the `set' builtin - was called to specify a new set while not executing a shell function - - 5/13 - ---- -POSIX - - new file, was in CWRU/POSIX.NOTES - -doc/{Makefile.in,Makefile} - - changed `posix' rule to modify ../POSIX - -doc/mkposix - - write to `POSIX' by default - -lib/sh/strtrans.c - - when ansicstr is parsing a format string for `echo -e' (or the - equivalent xpg_echo option is enabled), obey the POSIX-2001/SUSv3 - standard and accept 0-3 octal digits after a leading `0' - -doc/{bash.1,bashref.texi} - - updated `echo' description to note that up to three octal digits - are now accepted following `\0' - - 5/16 - ---- -doc/Makefile.in - - remove the generated documentation on `make distclean' if the - build directory and source directory are not the same - -Makefile.in - - descend into `support' subdirectory on a `make clean' and - `make distclean' - - remove parser-built, y.tab[ch] on a `make distclean' if the build - directory and source directory are not the same - -support/Makefile.in - - support various `clean' targets and remove man2html.o and man2html - -{configure,Makefile}.in - - move values for DEBUG and MALLOC_DEBUG into configure.in; on by - default for development versions; off by default for releases - (off for profiling, too) - - 5/21 - ---- -parse.y - - modified the grammar to allow a simple_list followed by yacc_EOF - to terminate a command. This fixes problems with things like - a backslash-newline at the end of an `eval'd string - - change handle_eof_input_unit() to reset the token state before - calling prompt_again(), in case the prompt to be evaluated contains - a command substitution - - 5/23 - ---- -lib/readline/vi_mode.c - - fix `r' command (rl_vi_change_char) when HANDLE_MULTIBYTE is defined - but MB_CUR_MAX == 1 - - 5/24 - ---- -lib/malloc/watch.c - - don't try to print `file' argument to _watch_warn if it's null - -lib/malloc/malloc.c - - changed guard checking code in internal_{malloc,free,realloc} to - access memory as (char *) and copy into a union instead of - casting and dereferencing a pointer to u_bits32_t, since that - results in unaligned accesses which will cause Sparcs to upchuck - - 5/30 - ---- -[bash-2.05b-beta1 released] - -lib/readline/text.c - - fixed a problem with rl_transpose_chars on systems supporting - multibyte characters with a locale that doesn't have any multibyte - chars - - 6/4 - --- -expr.c - - fix a/=0 and a%=0 to throw evaluation errors rather than core dumps - -lib/readline/display.c - - fix core dump when line wrapping a multibyte character (line - accidentally dropped from the original patch) - -lib/readline/mbutil.c - - fix reversed return value from _rl_is_mbchar_matched; fixes problem - with backward-char-search - - 6/10 - ---- -lib/sh/getenv.c - - fix getenv to not free value returned by find_tempenv_variable - - add setenv, putenv, unsetenv for completeness - - 6/12 - ---- -shell.c - - change init_noninteractive to init expand_aliases to the value of - posixly_correct - - don't initialize expand_aliases to posixly_correct anywhere else. - This allows the -O expand_aliases invocation option to work correctly - -general.c - - fix move_to_high_fd to not try the dup2 unless the fd loop results - in an fd > 3; just return the passed file descriptor otherwise - - use HIGH_FD_MAX, defined in general.h, instead of hard-coded 256 - as highest file descriptor to try - -subst.c - - in process_substitute, call move_to_high_fd with `maxfd' parameter - of -1 instead of 64, so move_to_high_fd will use its maximum - - 6/21 - ---- -lib/malloc/malloc.c - - don't bother calling MALLOC_MEMSET if the requested size is 0 - -builtins/setattr.def - - note in short doc that export and readonly can take assignment - statements as arguments - -error.c - - new function, error_prolog(), to capture common error message - prefix code (except for parser errors) - - 6/25 - ---- -aclocal.m4 - - add tests for standard-conforming declarations for putenv and - unsetenv in system header files - -{configure,config.h}.in - - call BASH_FUNC_STD_PUTENV and BASH_FUNC_STD_UNSETENV, define - HAVE_STD_GETENV and HAVE_STD_UNSETENV, respectively, if they - succeed - -lib/sh/getenv.c - - change putenv and unsetenv to take differing prototypes in - stdlib.h into account - - 6/27 - ---- -[bash-2.05b-beta2 released] - - 6/28 - ---- -builtins/common.c - - fix get_job_spec so that %N works when N is the size of the jobs - list (%8 means job 8, but the 7th member of the jobs array, so - it's OK if N == job_slots because the function returns N-1) - - 7/1 - --- -shell.c - - turn off line editing if $EMACS is set to `t' - - 7/10 - ---- -builtins/set.def - - remove mention of `-i' from long help doc, since it has no effect - - 7/17 - ---- -[bash-2.05b released] - - 7/18 - ---- - -lib/malloc/malloc.c - - make sure that the `free_return' label has a non-empty statement - to branch to - - 7/19 - ---- -locale.c - - only call setlocale() from set_lang() if HAVE_SETLOCALE is defined; - otherwise just return 0 - -lib/readline/mbutil.c - - only try to memset `ps' in _rl_get_char_len if it's non-NULL. Ditto - for _rl_adjust_point - - 7/23 - ---- -execute_cmd.c - - fix for executing_line_number() when compiling without conditional - commands, dparen arithmetic or the arithmetic for command - - - 7/24 - ---- -support/Makefile.in - - fix maintainer-clean, distclean, mostlyclean targets - -builtins/common.c - - fix bug in sh_nojobs where it doesn't pass the right number of args - to builtin_error - -bashline.c - - when using command completion and trying to avoid appending a slash - if there's a directory with the same name in the current directory, - use absolute_pathname() instead of just checking whether the first - char of the match is a slash to catch things like ./ and ../ - -examples/complete/bashcc-1.0.1.tar.gz - - a package of completions for Clear Case, from Richard S. Smith - (http://www.rssnet.org/bashcc.html) - -input.c - - fix check_bash_input to call sync_buffered_stream if the passed fd - is 0 and the shell is currently reading input from fd 0 -- all it - should cost is maybe an additional read system call, and it fixes - the bug where an input redirection to a builtin inside a script - which is being read from stdin causes the already-read-and-buffered - part of the script to be thrown away, e.g.: - - bash < x1 - - where x1 is - - hostname - read Input < t.in - echo $Input - echo xxx - -execute_cmd.c - - in initialize_subshell(), call unset_bash_input (0) to not mess with - fd 0 if that's where bash thinks it's reading input from. Fixes - bug reported by jg@cs.tu-berlin.de on 17 July 2002. Should be a way - to check whether or not the current fd 0 at the time of the call has - not been redirected, like in the bug report. Also might eventually - want to throw in a sync_buffered_stream if bash is reading input - from fd 0 in a non-interactive shell into a buffered stream, so the - stream is sync'd -- might be necessary for some uses - - 7/25 - ---- -lib/readline/signals.c - - make sure rl_catch_sigwinch is declared even if SIGWINCH is not - defined, so the readline state saving and restoring functions in - readline.c are always the same size even if SIGWINCH is not defined, - and undefined references don't occur when SIGWINCH is not defined - - 7/30 - ---- -bashline.c - - augment patch from 7/24 to not disable rl_filename_completion_desired - if the first char of the match is `~' - -lib/readline/bind.c - - when creating `shadow' keymaps `bound' to ANYOTHERKEY, don't bind - a key whose type is ISFUNC but whose function is the `fake' - rl_do_lowercase_version (fixes debian bash bug #154123) - -lib/readline/readline.c - - don't call _rl_vi_set_last from _rl_dispatch_subseq if - key == ANYOTHERKEY (when truncated to `sizeof(char)', it will be 0, - which strchr will find in `vi_textmod') - - 7/31 - ---- -lib/readline/input.c - - fix rl_gather_tyi to only slurp up one line of available input, even - if more than one line is available (fixes debian bash bug #144585) - - 8/3 - --- -bashline.c - - better fix for command completion problem -- test for directory - explicitly with test_for_directory before turning off - rl_filename_completion_desired, since that's the case we're trying - to protect against - - 8/5 - --- -include/shmbutil.h - - fix ADVANCE_CHAR macro to advance the string pointer if mbrlen - returns 0, indicating that the null wide character (wide string - terminator) was found (debian bash bug #155436) - -lib/readline/mbutil.c - - fix _rl_adjust_point to increment the string pointer if mbrlen - returns 0 - -support/shobj-conf - - fix for the `-install_name' value in SHLIB_XLDFLAGS assignment for - Darwin from the fink folks - - 8/6 - --- -builtins/exit.def - - broke code that runs ~/.bash_logout out into a separate function: - bash_logout() - -builtins/common.h - - extern declaration for bash_logout() - -eval.c - - call bash_logout() from alrm_catcher(), so timed-out login shells - run ~/.bash_logout before processing the exit trap - -lib/sh/strtrans.c - - implemented $'\x{hexdigits}' expansion from ksh93 - -configure.in - - define RECYCLES_PIDS in LOCAL_CFLAGS for cygwin; don't bother to - link with -luser32 - -examples/loadables/strftime.c - - new loadable builtin, interface to strftime(3) - - 8/7 - --- -parse.y - - parse_arith_cmd now takes a second argument, a flag saying whether - or not to add double quotes to a parsed arithmetic command; changed - callers - - changed parse_dparen so it tells parse_arith_cmd to not add the - double quotes and therefore doesn't need to remove them - - change parse_dparen to add W_NOGLOB|W_NOSPLIT|W_QUOTED flags to word - created when parsing (( ... )) arithmetic command, since the double - quotes are no longer added - -make_cmd.c - - in make_arith_for_expr, set the flags on the created word to - W_NOGLOB|W_NOSPLIT|W_QUOTED - -execute_cmd.c - - change execute_arith_command to expand the expression with - expand_words_no_vars, like the arithmetic for command code does - - fix execute_arith_command to handle the case where the expanded - expression results in a NULL word without crashing - -tests/{arith-for,cprint}.tests - - change expected output to account for no longer adding quotes to - ((...)) commands - - 8/8 - --- -print_cmd.c - - take out the space after printing the `((' and before printing the - `))' in print_arith_command, print_arith_for_command, and - xtrace_print_arith_cmd - -tests/{arith-for,cprint}.tests - - change expected output to account for no longer adding leading and - trailing spaces when printing ((...)) and arithmetic for commands - - 8/17 - ---- -subst.c - - fix issep() define to handle case where separators[0] == '\0', in - which case it always returns false - -lib/readline/histexpand.c - - fix off-by-one error in history_expand_internal when using the `g' - modifier that causes it to skip every other match when matching a - single character (reported by gjyun90@resl.auto.inha.ac.kr) - -doc/{bash.1,bashref.texi} - - make sure that the name=word form of argument to declare/typeset, - export, and readonly is documented in the description - - 8/30 - ---- -lib/readline/histexpand.c - - make history_expand_internal understand double quotes, because - single quotes are not special inside double quotes, according to - our shell-like quoting conventions. We don't want unmatched - single quotes inside double-quoted strings inhibiting history - expansion - - make `a' modifier equivalent to `g' modifier for compatibility with - the BSD csh - - add a `G' modifier that performs a given substitution once per word - (tokenized as the shell would do it) like the BSD csh `g' modifier - - 8/31 - ---- -braces.c - - when compiling for the shell, treat ${...} like \{...} instead of - trying to peek backward when we see a `{'. This makes it easier - to handle things like \${, which should be brace expanded because - the $ is quoted - - 9/7 - --- -aclocal.m4 - - redirect stdin from /dev/null in BASH_CHECK_DEV_FD before testing - the readability of /dev/fd/0, so we're dealing with a known quantity - - 9/11 - ---- -[prayers for the victims of 9/11/01] - -shell.c - - fix maybe_make_restricted to handle a restricted login shell with a - base pathname of `-rbash' and skip over any leading `-' - - 9/13 - ---- -builtins/evalstring.c - - in parse_and_execute, make sure we don't try to run unwind-protects - back to `pe_dispose' after a longjmp back to top_level if the - pe_dispose frame hasn't been initialized - -lib/readline/display.c - - fix problem with prompt overwriting previous output when the output - doesn't contain a newline in a multi-byte locale. This also should - fix the problem of bash slowing down drastically on long lines when - using a multi-byte locale, because it no longer tries to rewrite the - entire line each time. Patch from Jiro SEKIBA - -parse.y - - move the typedef for alias_t that is compiled in if ALIAS is not - defined up before the prototype for push_string, since that takes - an alias_t * parameter - -lib/readline/terminal.c - - bind the termcap description's left and right arrow keys to - rl_backward_char and rl_forward_char, respectively, instead of - rl_forward and rl_backward (which are just there for backwards - compatibility) - -aclocal.m4 - - when testing readability of /dev/stdin, redirect stdin from /dev/null - to make sure it's a readable file - - 9/17 - ---- -config-bot.h - - don't test __STDC__ when deciding whether or not to use stdarg.h; - just use it if it's present - -tests/read2.sub - - redirect from /dev/tty when using `read -t' - - 9/20 - ---- -builtins/history.def - - when reading `new' entries from the history file with `history -n', - fix increment of history_lines_this_session by taking any change - in history_base into account - -lib/sh/pathphys.c - - changes to sh_physpath to deal with pathnames that end up being - longer than PATH_MAX without dumping core - -lib/readline/doc/{history.3,hsuser.texinfo},doc/ bash.1 - - documented new `a' and `G' history modifiers - - 9/25 - ---- -lib/readline/misc.c - - when traversing the history list with arrow keys in vi insertion - mode, put the cursor at the end of the line (like in emacs mode) - -mksyntax.c - - don't try to use \a and \v unless __STDC__ is defined; use the - ascii integer equivalents otherwise - - include "config.h" in the generated syntax.c file for a possible - definition of `const' - -doc/{bash.1,bashref.texi} - - document the meaning of a null directory in $PATH - - 9/26 - ---- -parse.y - - fix set_line_mbstate to handle case where mbrlen() returns 0, - indicating the null wide character - - fix set_line_mbstate so we don't directly compare a char variable - to EOF, since char can (and is) unsigned on some machines - -bashline.c - - change bash_execute_unix_command to save a little bit more state: - last_shell_builtin, this_shell_builtin, last_command_exit_value - - 9/27 - ---- -execute_cmd.c - - tentative change to execute_simple_command to avoid freeing freed - memory in the case where bash forks early but still ends up calling - execute_disk_command, without passing newly-allocated memory to - make_child. This may fix the core dumps with the linux-from-scratch - folks - - 9/28 - ---- -Makefile.in,{builtins,lib/sh}/Makefile.in - - fix up dependencies, mostly on ${BUILD_DIR}/version.h, so that - parallel makes work with GNU and BSD makes - -shell.h - - new struct to save partial parsing state when doing things like - bash_execute_unix_command and other operations that execute - commands while a line is being entered and parsed - -parse.y - - new functions, save_parser_state() and restore_parser_state(), to - save and restore partial parsing state - -bashline.c - - change bash_execute_unix_command to call {save,restore}_parser_state - -builtins/jobs.def - - change execute_list_with_replacements to eliminate a run_unwind_frame - in favor of calling the cleanup explicitly and discarding the frame - -execute_cmd.c - - change execute_for_command to avoid a run_unwind_frame in the case - where the loop variable is readonly or otherwise not assignable - - change execute_select_command and execute_simple_command to use - discard_unwind_frame by running the cleanup code explicitly, instead - of using run_unwind_frame - - make sure execute_select_command decreases loop_level even on error - - 9/30 - ---- -doc/{bash.1,bashref.texi} - - fixed description of `unset' now that unsetting a previously-unset - variable is no longer an error - - 10/3 - ---- -{configure,config.h}.in - - augment check for strtold with additional check to detect the - horribly broken hp/ux 11.x implementation that returns `long_double'; - defines STRTOLD_BROKEN if so - -builtins/printf.def - - define floatmax_t as `double' if STRTOLD_BROKEN is defined - - 10/5 - ---- -lib/readline/keymaps.c - - don't automatically bind uppercase keys to rl_do_lowercase_version - in rl_make_bare_keymap - -lib/readline/readline.c - - explicitly check for ANYOTHERKEY binding to rl_do_lowercase_version - and dispatch to lowercase of key when a prefix is not matched - - 10/12 - ----- -bashline.c - - set COMP_WORDBREAKS in enable_hostname_completion to the value - of rl_completer_word_break_characters - -variables.c - - new special variable COMP_WORDBREAKS, controls the value of - rl_completer_word_break_characters - -variables.h - - new extern declaration for sv_comp_wordbreaks() - -subst.c - - change split_at_delims to behave more like shell word splitting if - the passed value for the delimiters is NULL, indicating that the - function is to use $IFS to split - -{execute_cmd,jobs,test,findcmd,input,make_cmd,redir,shell}.c -builtins/mkbuiltins.c,builtins/{fc,history,source,umask}.def -lib/sh/netconn.c -lib/termcap/termcap.c -lib/readline/histfile.c - - make sure all inclusions of are protected by - HAVE_SYS_FILE_H - -bashline.c - - don't turn off rl_filename_completion_desired in - attempt_shell_completion if the partial pathname contains a slash. - This still doesn't solve the problem of partial pathname completion - starting with a directory in the current directory without a - leading `./'. There's no way to tell the difference between that - and a file found in $PATH (which may contain `.') at the point that - attempt_shell_completion acts - - 10/18 - ----- -locale.c - - don't set lc_all to the default locale when LC_ALL is being unset - - new function, reset_locale_vars(), called to recompute the correct - locale variable values when LC_ALL is unset - - changed set_lang to not set LC_ALL, which it never should have been - doing in the first place, and to maintain a local variable `lang' - corresponding to $LANG - - change get_locale_var to use the precedence posix.2 specifies: - LC_ALL overrides individual variables; LANG, if set, is the default - - change set_locale_var to call get_locale_var to get the appropriate - value for the variable being set or unset - - call get_locale_var instead of using passed value in set_locale_var - to get the defaulting and precedence right - -lib/readline/nls.c - - new function, _rl_get_locale_var(), which does the same thing as - locale.c:get_locale_var(), with the right precedence and defaulting, - using sh_get_env_value to get the right bash variable values - - if HAVE_SETLOCALE is defined, _rl_init_eightbit first calls - _rl_get_locale_var to get the right value for LC_CTYPE, and uses - that in the call to setlocale. If _rl_get_locale_var returns NULL, - call setlocale() to get the current international environment, and, - finally, if that returns null, call setlocale with a second argument - of "" to force the implementation's `native' environment - -pcomplete.c - - change gen_wordlist_completions to dequote the text before comparing - it against the expanded word list - - changed gen_matches_from_itemlist to do the same thing - -bashline.c - - new global function, bash_dequote_word, calls bash_dequote_filename - on the text passed. Used by the programmable completion code - -lib/readline/histfile.c - - make sure that whenever read_history_range returns a non-zero value - that it sets errno to some useful value - - 10/19 - ----- -variables.c - - COMP_WORDBREAKS is now a dynamic variable, mirroring value of - rl_completer_word_break_characters. Makes sure that the variable - always points to dynamic memory if it's not null or the readline - default - -bashline.c - - change enable_hostname_completion to manage a dynamic value of - rl_completer_word_break_characters, since assignments to - COMP_WORDBREAKS can change its value unpredictably - -lib/readline/{complete.c,readline.h} - - rl_completer_word_break_characters no longer has `const' attribute - -bashline.c - - clean up necessary places due to rl_completer_word_break_characters - no longer being `const' - -doc/{bash.1,bashref.texi} - - document new COMP_WORDBREAKS variable - - 10/21 - ----- -print_cmd.c - - fix indirection_level_string to handle the case where the decoded - $PS4 is null without seg faulting - - 10/22 - ----- -builtins/shift.def - - make sure that there is actually an argument when reporting a shift - count that exceeds the number of positional paramters and - shift_verbose is enabled - -lib/readline/rltty.c - - change SET_SPECIAL to call a new function, set_special_char, since - it contains a block. It's called infrequently, so the performance - impact of making it a function should be negligible, and it helps - debugging - - 10/29 - ----- -bashline.c - - make sure the editor in VI_EDIT_COMMAND and EMACS_EDIT_COMMAND is - quoted; it might contain spaces (e.g., `emacs -nw') - -aclocal.m4 - - cache ac_cv_rl_version in RL_LIB_READLINE_VERSION macro - -configure.in - - change logic that sets RL_INCLUDEDIR so that it doesn't try to set - a bogus include path if the argument to --with-installed-readline - is `yes' -- helps with cross-compiling - -lib/readline/histexpand.c - - fix history_tokenize_word so that it handles <( and >( better - - 10/30 - ----- -redir.c - - fix write_here_string so it handles the case where `herestr' expands - to NULL without seg faulting - - 10/31 - ----- -mailcheck.c - - reverse logic flip from bash-2.05 that handled systems that don't - change the atime when the mailbox is accessed; make sure the file - is bigger before we report new mail. This is the case in the vast - majority of cases. Reported by jim@jtan.com - - 11/5 - ---- -parse.y - - change action for `for x; { list; }' and corresponding `select' - production to use \"$@\" instead of just $@, as it is with all the - other actions - - 11/9 - ---- -parse.y - - new flag for parse_matched_pair: P_DQUOTE, indicating that the - pair of characters being matched is between double quotes - - parse_matched_pair now passes P_DQUOTE down to recursive calls: - if the open char to be matched is a `"' or the passed-in flags - include P_DQUOTE, set the local `rflags' variable to P_DQUOTE and - pass `rflags' down to recursive calls - - if `rflags' includes P_DQUOTE, don't try to ansiexpand $'...' or - locale expand $"..."; consistent with other quoting constructs - - 11/11 - ----- -doc/{bash.1,bashref.texi} - - explicitly note that variables referenced in arithmetic expressions - without using `$' evaluate to 0 if they are null or unset - - note that a null variable value evaluates to 0 when used in an - arithmetic context, like when a variable with the `-i' attribute is - assigned a null value - - document the ${!prefix@} expansion as equivalent to ${!prefix*} - - 11/12 - ----- -doc/{bash.1,bashref.texi} - - note that the value of an arithmetic expression is as in C - - change the wording to note that `arithmetic evaluation' (not - arithmetic expansion, which has a different meaning) is performed - on the value assigned to a variable whose integer attribute is set - - 11/13 - ----- -execute_cmd.c - - fix execute_disk_command so it calls exit() after printing the error - message in a restricted shell context if the shell has already forked - (nofork != 0 && there are no pipes) - - 11/19 - ----- -builtins/type.def - - don't report on aliases unless expand_aliases is set and the parser - is performing alias expansion; changed tests/type.tests and - tests/type.right accordingly - - 11/25 - ----- -general.c - - fix for full pathnames including drive letters on cygwin from - Corinna (convert to posix-style paths, which the rest of the - code handles much better) - -lib/readline/text.c - - fixes to overwrite mode from jimmy@is-vn.bg: - o in _rl_overwrite_char, do the overwrite mode self-insert - as one group, even when overwriting more than 1 char - o in _rl_overwrite_char, do the insert before the delete so - that an undo positions the cursor on the character restored, - not to the right of it - o in _rl_overwrite_rubout, don't do rl_insert_char(' ') unless - rl_point < rl_end. Since overwrite-mode self-insert acts as - in insert-mode when at eol, make rubout behave like - insert-mode rubout - - 11/30 - ----- -lib/readline/misc.c - - call rl_replace_line with `1' as second parameter if we're going to - immediately overwrite the undo list - -lib/readline/search.c - - in make_history_line_current, use _rl_replace_text to make the line - replacement an undoable operation. Affects all non-incremental - search functions. - -parse.y - - make behavior introduced on 11/9 dependent on extended_quote - variable, controllable by extquote shopt option. Default setting is - on for backwards compatibility - -builtins/shopt.def - - new `extquote' option to control extended_quote variable - - 12/3 - ---- -jobs.c - - change message printed when attempting to put a background job in - the background with `bg' to include the job id and make the - statement declarative - - 12/10 - ----- -bashhist.h - - define explicit flag values for history_control - -variables.c - - change sv_history_control to use new flag values - - change sv_history_control to parse $HISTCONTROL as a colon-separated - list of values for the history_control variable - -bashhist.c - - change check_history_control to use new flag values and restructure - to remove case statement - - new function hc_erasedups(line); removes all entries matching LINE - from the history list - - call hc_erasedups() from check_add_history after we've determined - that we're saving the line - -doc/{bash.1,bashref.texi} - - documented new options available for $HISTCONTROL and that it can - be a colon-separated list of history control options - - 12/11 - ----- -subst.c - - fix pat_subst() to not increment `e' (pointer to the end of the - matched portion of the string) until after we're sure we're going - around the loop again; fixes problem with empty replacements for - a pattern that doesn't match (bug reported by Don Coleman - ) - - 12/17 - ----- -lib/readline/display.c - - fixes to multibyte redisplay from jir@yamato.ibm.com (Jiro SEKIBA): - o speed up calculation of first difference between old and new - lines in the common case - o don't try to see if we're in the middle of a multbyte char - in update_line (we'll see how this one works out) - - 12/18 - ----- -doc/bashref.texi - - make it clear that the `command-list' function definition may be - terminated by an ampersand before the closing brace - - 12/28 - ----- -redir.c - - set `expanding_redir' flag when expanding words in a redirection - -subst.c - - new function, exp_jump_to_top_level(), to do any word expansion - cleanup before a call to jump_to_top_level from within that file; - sets expanding_redir back to 0 before jump_to_top_level - -variables.c - - in find_variable(), don't call find_variable_internal with a second - parameter of 1 if expanding_redir is non-zero - - in find_variable_internal(), don't search the temporary env if - subshell_environment includes SUBSHELL_FORK (indicating a simple - command) and expanding_redir is non-zero - -parse.y - - increment line_number when we read a \ pair - -array.c - - added array_unshift_element and array_shift_element (which just call - array_shift and array_rshift, respectively), for bash debugger - support - - 1/4/2003 - -------- -doc/{bash.1,bashref.texi} - - note in the section describing the execution environment passed to - children that subshells inherit shell functions marked for export - - note in the section describing shell functions the possibility - that exported functions may result in two entries in the environment - with the same name - -parse.y - - when pushing an alias expansion onto the pushed_string list, append - a space to the expanded definition to make the parser's lookahead - work without using the `mustpop' hack in shell_getc - - 1/8 - --- -shell.c - - change calls to exit() with EX_USAGE as a parameter to use - EX_BADUSAGE instead, since EX_USAGE is defined as 258 and is - technically out of range - - 1/14 - ---- -aclocal.m4 - - check for the termcap functions in libc first: if we don't have - to link in another library, let's not do it - - change the test for mbstate_t to use AC_TRY_COMPILE instead of - AC_TRY_RUN - -doc/{bash.1,bashref.texi} - - document that bash turns line editing off if environment variable - EMACS is set to `t' when it starts up - -doc/bash.1 - - minor change to give the ftp url for the latest version of bash in - the bug reports section - -lib/readline/histexpand.c - - in get_history_event, cast a couple of `const char *' variables to - `char *' in function call parameter lists to avoid compiler warnings - - 1/21 - ---- -builtins/cd.def - - change `cd -' so it prints the current working directory after a - successful chdir even when the shell is not interactive - - 1/31 - ---- -lib/readline/doc/rltech.texinfo - - clarified exactly what is meant by the term `application-specific - completion function', made its use consistent, and documented - what variables are changed before such a function is called - -lib/readline/input.c - - new function, _rl_pushed_input_available(), returns non-zero if - there are characters in the input queue managed by rl_get_char - and _rl_unget_char - -lib/readline/rlprivate.h - - new extern declaration for _rl_pushed_input_available - -lib/readline/callback.c - - change rl_callback_read_char to check _rl_pushed_input_available - and loop if there's something there, so characters don't languish - until more keyboard input is read - -execute_cmd.c - - new variable, last_command_exit_signal, non-zero if - last_command_exit_value result from wait_for was result of a signal - -nojobs.c - - keep track of whether or not a given pid was killed by a signal with - a new flag in the pid_list array - - new function int find_termsig_by_pid(pid_t pid) to get the - terminating signal, if any, for a particular pid - - new function int get_termsig(WAIT status) returns the terminating - signal corresponding to status - - set last_command_exit_signal in wait_for and the various wait_for_xx - functions - -jobs.c - - new functions, process_exit_signal and job_exit_signal, return the - signal that killed a given process or job, if a signal caused its - death - - set last_command_exit_signal in wait_for by calling job_exit_signal - or process_exit_signal appropriately - -subst.c - - don't resend SIGINT to ourselves unless last_command_exit_signal is - SIGINT and last_command_exit_value == 128 + SIGINT. This fixes the - $(exit 130) bug reported by Paul Jarc - -expr.c - - new function, expr_bind_variable, calls bind_int_variable and - then stupidly_hack_special_variables. This fixes the - `let OPTIND=1' bug - -bashline.c - - change history_and_alias_expand_line and shell_expand_line to call - history_expand_line_internal so calls to pre_process_line are - localized - - change history_expand_line_internal and cleanup_expansion_error to - temporarily turn off hist_verify before calling pre_process_line - to avoid the effects described by teirllm@dms.auburn.edu - -parse.y - - don't unconditionally turn off PST_ALEXPNEXT in push_string. This - fixes the multiple alias expansion bug reported by Paul Jarc. - -lib/readline/vi_mode.c - - change rl_vi_subst to push `l' instead of ` ' -- it should be - equivalent, but this has been reported to fix a problem in multibyte - locales - -lib/readline/readline.h - - new state flag value RL_STATE_TTYCSAVED, indicates that save_tty_chars - has been called. Since it's only used and visible internally, it's - undocumented - -lib/readline/rltty.h - - changed all of the members of _rl_tty_chars struct to `unsigned char' - -lib/readline/rltty.c - - set the RL_STATE_TTYCSAVED after save_tty_chars is called - - new function, rl_tty_unset_default_bindings(), resets bindings for - everything rl_tty_set_default_bindings() messes with back to - rl_insert, so rl_tty_set_default_bindings can be called again with - possible changes - - new function that does the bulk of the work for - rltty_set_default_bindings: _rl_bind_tty_special_chars() - - change prepare_terminal_settings so that it can track changes to the - terminal special chars made by stty(1): unset the bindings with - rl_tty_unset_default_bindings before calling save_tty_chars, and - _rl_tty_set_default_bindings after, with the new values from - get_tty_settings(). This implements a long-standing request, most - recently made by Tim Waugh of Red Hat. - -lib/readline/readline.h - - extern declaration for rl_tty_unset_default_bindings() - -lib/readline/readline.c - - new function, reset_default_bindings, calls - rl_tty_unset_default_bindings() to reset the terminal special chars - back to rl_insert and then read the new ones - -lib/readline/doc/rltech.texinfo - - documented rl_tty_unset_default_bindings() - - 2/1 - --- -[prayers and condolences to the families of the space shuttle crew members] - -aclocal.m4 - - add checks for mbrtowc and mbrlen in BASH_CHECK_MULTIBYTE - - new check, BASH_FUNC_CTYPE_NONASCII, checks whether or not the ctype - functions handle non-ascii characters correctly - -config.h.in - - add HAVE_MBRTOWC and HAVE_MBRLEN - - add NO_MULTIBYTE_SUPPORT for new configure argument - - add CTYPE_NON_ASCII - -config-bot.h, lib/readline/rlmbutil.h - - make sure that mbrtowc, mbrlen, and wcwidth are all present before - turning on HANDLE_MULTIBYTE - - turn off multibyte chars if NO_MULTIBYTE_SUPPORT is defined - -configure.in - - new argument --enable-multibyte (enabled by default), allows - multibyte support to be turned off even on systems that support it - -lib/readline/chardefs.h - - define NON_NEGATIVE as 1 if CTYPE_NON_ASCII is defined - - 2/3 - --- -config.h.in - - add HAVE_WCTOMB - -aclocal.m4 - - check for wctomb in BASH_CHECK_MULTIBYTE - - 2/4 - --- -lib/readline/vi_mode.c - - in _rl_vi_change_mbchar_case, make sure the result from wctomb() - is NULL-terminated before trying to insert it with rl_insert_text() - - 2/5 - --- -lib/readline/display.c - - fix to update_line to avoid problems on systems with multibyte - characters when moving between history lines when the new line - has more glyphs but fewer bytes (twaugh@redhat.com) - -lib/readline/vi_mode.c - - use wcrtomb() instead of wctomb() in _rl_vi_change_mbchar_case - -pcomplete.c - - fix init_itemlist_from_varlist to handle the case where the - `varlist' is NULL - -doc/{bash.1,bashref.texi} - - clarified when a simple command may fail without the shell exiting - when -e is set - - 2/13 - ---- -parse.y - - when bash is started with --nolineediting, ignore \[ and \] when - decoding the prompt string - -subst.c - - fix remove_quoted_nulls so that a string with a CTLESC appearing - after a CTLNUL (which was removed) does not leave characters in - the string inappropriately - - 2/14 - ---- -builtins/common.h - - new flag value for parse_and_execute(): SEVAL_RESETLINE, which - allows the caller to specify whether or not the internal idea - of the line number should be reset to 1 - -builtins/evalstring.c - - parse_and_execute() now tells push_string to reset the line - number only if the SEVAL_RESETLINE flag is set by the caller - - 2/15 - ---- -builtins/evalfile.c - - pass SEVAL_RESETLINE from _evalfile() to parse_and_execute() - -subst.c - - if the shell is currently interactive, pass SEVAL_RESETLINE to - parse_and_execute() when doing command substitution - -jobs.c - - add SEVAL_RESETLINE to parse_and_execute while running SIGCHLD trap - -command.h - - add `line' members to case_com, for_com, select_com - - rearranged order of members in some of the command structs, so - `flags' and `line' are first - - added a `source_file' member to the function_def struct; keeps - track of where the function was defined - -doc/Makefile.in - - add some new suffix rules: .dvi.ps - -doc/{bash.1,bashref.texi} - - added text to the description of the `trap' builtin tightening up - the language describing when the ERR trap will be run - -error.c - - if $BASH_SOURCE (internally-maintained) exists, use BASH_SOURCE[0] - in get_name_for_error if the shell is not interactive - -array.h - - new convenience defines: array_push and array_pop - -variables.c - - change get_funcname to return this_shell_function->name only if - arrays have not been compiled into the shell - - change init_funcname_var to initialize FUNCNAME as an array variable - if we have arrays - - new function: get_self(SHELL_VAR *self), a degenerate `dynamic_value' - function for dynamic variables - - new function: init_dynamic_array_var(), a generic dynamic array - variable initializer to handle the common case - - use init_dynamic_array_var() instead of explicit init_dirstack_var() - - use init_dynamic_array_var() instead of explicit init_groups_var() - - new dynamic array variables: BASH_ARGC, BASH_ARGV, BASH_SOURCE, - BASH_LINENO, initialized with init_dynamic_array_var - -shell.c - - initialize BASH_LINENO, BASH_SOURCE, FUNCNAME in open_shell_script - -{execute_cmd,trap}.c - - take out trap_line_number, since parse_and_execute doesn't reset the - line number any more when running the trap commands - -make_cmd.c - - augment make_function_def to get source file name and call - bind_function_def to save the entire FUNCTION_DEF - -variables.c - - new hash table: shell_function_defs, keeps table of shell function - definitions including source file and line number info corresponding - to shell_functions table - - new functions: find_function_def and bind_function_def to manage - the shell_function_defs hash table - - new function: unbind_function_def to remove a function definition - from the shell_function_defs table (right now uncalled) - -variables.h - - extern declaration for bind_function_def, find_function_def - - new extern declaration for unbind_function_def - -execute_cmd.c - - in function prologue and epilogue, push and pop FUNCNAME, - BASH_SOURCE, and BASH_LINENO information - -dispose_cmd.c - - broke the code that disposes a FUNCTION_DEF out into two new - functions: dispose_function_def and dispose_function_def_contents - -dispose_cmd.h - - new extern declarations for dispose_function_def_contents and - dispose_function_def - -copy_cmd.c - - move body of copy_function_def (other than allocating a new - FUNCTION_DEF) to copy_function_def_contents - - make sure to copy the new source_file member of a function_def in - copy_function_def_contents - - copy_function_def is no longer static, copy_function_def_contents - is not either - -command.h - - new extern declaration for copy_function_def_contents and - copy_function_def - -parse.y - - keep a stack of line numbers where case, select, and for commands - start, with a maximum nesting level of 128; increment when reading - word after `for', `select' or `case' in read_token_word; decrement - in grammar actions after parsing a complete for, arith_for, select, - or case command - - create for, case, arith_for, and select commands with an extra - line number (word_lineno[word_top]) argument - -make_cmd.c - - make_for_or_select, make_for_command, make_case_command, and - make_select_command all take an extra `line_number' argument - -make_cmd.h - - corresponding changes to extern declarations for those functions - - 2/16 - ---- -{execute_cmd,shell,variables}.c - - follow each call to remember_args with a call to push_args or - pop_args to manage the BASH_ARGV and BASH_ARGC arrays. Only set - when the shell is started to run shell script or runs a shell - function. Doesn't handle `set' or `shift' yet, nor `source'. - -execute_cmd.c - - keep track of the level of subshells with a new variable, manipulated - in execute_in_subshell - - set currently_executing_command in execute_command_internal(), - even if we're running a trap - - better line number management when executing simple commands, - conditional commands, for commands in execute_command_internal() - and the various functions that implement the commands - (execute_cond_command, execute_for_command, execute_etc.) - -variables.c - - new dynamic variable BASH_SUBSHELL, with new get_subshell and - assign_subshell functions to manipulate it - - new functions push_args (WORD_LIST *list) and pop_args (void) to - manage the BASH_ARGC and BASH_ARGV dynamic array variables - -variables.h - - new extern declarations for push_args and pop_args - -builtins/evalfile.c - - in _evalfile, do appropriate things to the FUNCNAME, BASH_ARGV, - BASH_ARGC, BASH_SOURCE, and BASH_LINENO variables - -support/mksignames.c - - add another fake signal for `trap'; make NSIG+2 == `RETURN' - -trap.c - - _run_trap_internal now returns an int: the exit value of the command - run as the result of the trap - - run_debug_trap now returns an int: the exit value of the command - run as the result of the trap - - RETURN is a new special trap - - new function: set_return_trap(char *command) interface for the rest - of the shell, like set_{debug,error}_trap - - new function: run_return_trap() - - command substitution and other child processes don't inherit the - return trap - -trap.h - - new extern declaration for set_return_trap() and run_return_trap - - new defines for RETURN_TRAP; increment BASH_NSIG - - change extern declaration for run_debug_trap() since it now returns - an int - -shell.c - - new invocation long option: --debugger, turns on debugging and - sets internal `debugging_mode' variable - -execute_cmd.c - - new code to save return trap when executing a shell function, so - shell functions don't inherit it - - run debug trap before binding the variable and running the action - list in a `for' command - - run debug trap before binding the selection variable and running - the query in a `select' command - - run debug trap before running matcher in a `case' command - -builtins/set.def - - new `set -o functrace' (set -T), causes DEBUG trap to be inherited - by shell functions - - new `set -o errtrace' (set -E), causes ERR trap to be inherited - by shell functions - -flags.c - - new flags -E and -T, control error_trace_mode and - function_trace_mode respectively - -flags.h - - new extern declarations for error_trace_mode and function_trace_mode - - 2/17 - ---- -doc/bashref.texi - - changed the `dircategory' as per Karl Berry's suggestion - -doc/texinfo.tex - - update to version of 2003/02/04 from texinfo.org - -support/texi2dvi - - update to version 1.14 from texinfo-4.5 distribution - - 2/20 - ---- -support/config.{guess,sub} - - update to versions of 2002/11/30 - -lib/readline/doc/manvers.texinfo - - renamed to version.texi to match other GNU software - - UPDATE-MONTH variable is now `UPDATED-MONTH' - -lib/readline/doc/{hist,rlman,rluserman}.texinfo - - include version.texi - -doc/version.texi - - new file, with standard stuff matching other GNU distributions - -{doc,lib/readline/doc}/Makefile.in - - include right stuff for `version.texi' - -lib/readline/doc/{rluserman,rlman,hist}.texinfo - - use @copying and @insertcopying and @ifnottex instead of @ifinfo - - add FDL as an appendix entitled `Copying This Manual' - -lib/readline/doc/{rltech,rluser,hstech,hsuser}.texi - - changed the suffix from `texinfo' to `texi' - -lib/readline/doc/{rlman,rluserman}.texinfo, doc/bashref.texi - - include rltech.texi,rluser.texi,hstech.texi, and hsuser.texi - -lib/readline/doc/Makefile.in,doc/Makefile.in - - made appropriate changes for {{rl,hs}tech,{rl,hs}user}.texi - -lib/readline/doc/{rlman,rluserman}.texinfo - - changed the suffix from `texinfo' to `texi' - -lib/readline/doc/hist.texinfo - - renamed to history.texi - - 2/25 - ---- -pathnames.h.in - - moved pathnames.h here so value of DEBUGGER_START_FILE can be - substituted by configure - -aclocal.m4 - - added AM_PATH_LISPDIR for debugger - -configure.in - - added some variables: `bashvers', `relstatus' to use info in more - than one place - - call AM_PATH_LISPDIR - - new option: --enable-debugger, sets DEBUGGER cpp option - - new option with AC_ARG_VAR: DEBUGGER_START_FILE - - make `pathnames.h' a file generated by configure - -Makefile.in - - add rule to create pathnames.h - -builtins/declare.def - - added extra line number and source file name to `declare -F' output - if `--debugger' is used at startup - -builtins/evalfile.c - - call run_return_trap from source_file before returning the result - from _evalfile() - -execute_cmd.c - - call run_return_trap in execute_function before restoring the old - context - -builtins/source.def - - arrange to save and restore DEBUG traps when sourcing files if - function_trace_mode (set -o functrace) is not set - -print_cmd.c - - broke print_for_command, print_select_command, print_case_command - into two functions each: one to print the `header' and one for - the body - - print_cond_command is no longer static - - print_arith_command now takes a WORD_LIST *, since it doesn't - actually do anything with the ARITH_COM it's passed except print - the enclosed WORD_LIST - - print_arith_command is no longer static - -externs.h - - extern declarations for print_{for,select,case}_command_head, - print_cond_command, print_arith_command - -{.,builtins,lib/sh}/Makefile.in - - corrected dependencies on pathnames.h, since it's now created in - the build directory - - 3/5 - --- -lib/glob/glob.c - - handle alloca() failing (it's supposed to return NULL) - - use malloc() (with its attendent bookkeeping) instead of alloca() - in glob_filename() - -subst.c - - check whether shell_glob_filename returns NULL in - glob_expand_word_list - - change parameter_brace_expand_rhs to handle cases like - ${a[2]:=value} by properly creating the array element instead of a - variable named `a[2]' (reported by ) - -variables.c - - change bind_int_variable to use valid_array_reference instead - of looking for `[' - -lib/readline/vi_mode.c - - check for `a' in _rl_vi_done_inserting so the text inserted by an - `a' command can be reinserted with a `.' - -lib/readline/readline.c - - when entering vi insertion mode in readline_internal_setup(), make - sure that _rl_vi_last_key_before_insert is set to `i' so that undo - groups and redo work better (reported by ) - -lib/glob/sm_loop.c - - handle ?(...) in a pattern immediately following a `*', instead of - ignoring the `(' and treating the `?' as a single-char match, as - long as FNM_EXTFLAG is set (reported by ) - -aclocal.m4 - - new test for presence of struct timezone, BASH_STRUCT_TIMEZONE - -config.h.in - - add HAVE_STRUCT_TIMEZONE - -configure.in - - call BASH_STRUCT_TIMEZONE - -execute_cmd.c - - don't try to use `struct timezone' in calls to gettimeofday unless - HAVE_STRUCT_TIMEZONE is defined; use (void *)NULL otherwise - - 3/20 - ---- -execute_cmd.c - - new variable, the_printed_command_except_trap, saves the command - being executed before a trap is executed, for the debugger - -trap.c - - if in debugging mode, let command substitutions and other child - processes inherit the DEBUG and ERR traps if the `functrace' - (which is really a bad name, given this semantic) or `errtrace' - options, respectively, have been set - -shell.c - - local_pending_command renamed to command_execution_string; no longer - static - -variables.c - - new dynamic variable, BASH_COMMAND, set to the command string - currently executing, or the one that caused a trap to execute - (mapped to the_printed_command_except_trap) - - new variable, BASH_EXECUTION_STRING, set to the argument to the - -c invocation option, if the shell was started that way - - 3/22 - ---- -execute_cmd.c - - changed execute_for_command, eval_arith_for_expr, - execute_select_command, execute_arith_command, execute_cond_command, - execute_simple_command to implement new DEBUG trap semantics - for the debugger: if the DEBUG trap commands return a non-zero - status and debugging_mode is non-zero, we skip the command to be - executed - -trap.c - - change run_debug_trap for the debugger: if we're in the debugger - and the DEBUG trap returns 2 while we're in a function or sourced - script, we force a `return' - -shell.c - - new function, start_debugger(), that sources the debugger start file - and turns the debugger on - -builtins/shopt.def - - new settable option, `extdebug', turns on debugging_mode, as if - --debugger had been supplied at invocation (but does not source - debugger startup file) - -trap.c - - make sure that run_exit_trap arranges for `returns' to come back - there, too, so a `return' executed by an `exit' invoked within a - shell function behaves correctly - -support/shobj-conf - - change darwin/MacOS X stanza based on advice from mac os x developers - -lib/sh/mailstat.c - - set the atime member of the synthesized stat struct to 0 if `cur/' - is empty, rather than leaving it undefined - - 3/24 - ---- -builtins/caller.def - - new builtin to provide a call stack for the debugger - -builtins/evalfile.c - - added a second `flags' argument to source_file() - - new flag value for flags argument to _evalfile(): FEVAL_NOPUSHARGS. - If included in flags arg, it means to not manipulate the BASH_ARGV - and BASH_ARGC arrays - -builtins/common.h - - change prototype for source_file() - -builtins/source.def - - add flag value to call to source_file(): set to 1 if we replaced - the positional parameters - - add call to push_args if additional arguments supplied to the - source builtin - - add call to pop_args in maybe_pop_dollar_vars - -execute_cmd.c - - run the debug trap in execute_function so the debugger can stop - before the first command in a function body is executed - - modify subshell_level before executing a builtin or function in a - subshell - - print `for', `select', `case' command heads when set -x is enabled - -print_cmd.c - - `xtrace_print_word_list' now takes an additional flags argument, - which, if non-zero, says to print indirection_level_string() - - new functions to print for, select, and case command heads when - set -x is enabled - - add spaces after `((' and before `))' in xtrace_print_arith_command - -externs.h - - changed extern declaration for xtrace_print_word_list - - new declarations for xtrace_print_{for,case,select}_command_head() - -subst.c - - modify subshell_level when executing a command substitution - - 3/25 - ---- -execute_cmd.c - - use `line_number' in executing_line_number instead of looking into - the current command if it's a simple command; rearrange code to - make this simpler to compile in and out - - need to save and restore value of currently_executing_command around - calls to debug trap and return trap in execute_function - -make_cmd.c - - make sure make_arith_for_command() disposes the WORD_LIST * it is - passed, since nothing else does and it's not used directly - - 3/28 - ---- -Makefile.in - - fixed dependencies for `error.o' on shell.h and version.h -- makes - parallel makes (gmake -j 4) work correctly - -doc/{bash.1,bashref.texi} - - documented all new features added to support the debugger - - 4/1 - --- -lib/sh/shquote.c - - make sure CTLESC and CTLNUL characters are escaped with CTLESC - by sh_double_quote, sh_backslash_quote and - sh_backslash_quote_for_double_quotes - Fixes vulnerability reported by svdb@stack.nl - -shell.h - - new `pipestatus' member of sh_parser_state_t, to save and restore - $PIPESTATUS - -parse.y - - changes to save_parser_state and restore_parser_state to save and - restore $PIPESTATUS - -builtins/read.def - - add a call to word_list_remove_quoted_nulls before assigning the - word list read from standard input to an array variable. Fixes - bug reported by holzhey@ppprs1.phy.tu-dresden.de - - 4/3 - --- -execute_cmd.c - - in execute_null_command, if redirections are supplied, make sure - things like 3 for possible definitions of intmax_t, uintmax_t - (reported by ro@techfak.uni-bielefeld.de) - - 7/30 - ---- -parse.y - - remove checking for `time' reserved word from special_case_tokens(); - use regular mechanism in CHECK_FOR_RESERVED_WORD. This allows `time' - to be aliased. (Reported by Glenn Morris - ) - - 7/31 - ---- -lib/readline/history.h - - extern declaration for history_write_timestamps - -lib/readline/histfile.c - - don't write timestamps to the history file in history_do_write - unless history_write_timestamps is set to non-zero by the application - (set to 0 by default) - -lib/readline/doc/{hstech.texi,history.3} - - document history_write_timestamps - -variables.[ch] - - new special variable function, HISTTIMEFORMAT; special function - sets history_write_timestamps to 1 if HISTTIMEFORMAT is set - - 8/4 - --- -builtins/history.def - - added support for printing time stamps based on the value of the - HISTTIMEFORMAT variable when displaying history entries - -doc/{bash.1,bashref.texi} - - added description of new HISTTIMEFORMAT variable - - 8/5 - --- -config-top.h - - remove /usr/ucb from any default paths - -mailcheck.c - - make_default_mailpath now returns NULL if DEFAULT_MAIL_DIRECTORY - is not defined - - remember_mail_dates now returns if make_default_mailpath returns - NULL - -config-bot.h - - reorganized the sections; provide an explicit placeholder for - builders to #undef any feature defines they don't want that - configure creates for them, like the default mail path - - 8/9 - --- -config.h.in - - add HAVE_REGEX_H, HAVE_REGCOMP, HAVE_REGEXEC for detection of POSIX.2 - regular expression functions - - add COND_REGEXP define to enable and disable the =~ operator for - matching extended regular expressions in [[...]] commands - -configure.in - - new option, --enable-cond-regexp, enables =~ and code to perform - regular expression matching in [[...]] - -config-bot.h - - undef COND_REGEXP if the OS doesn't provide posix regexp support - -doc/bashref.texi - - documnent new --enable-cond-regexp option to configure - - 8/18 - ---- -support/shobj-conf - - support for shared objects on FreeBSD-gnu (from Robert Millan) - - 8/25 - ---- -lib/sh/shmatch.c - - new file, shell interface to posix extended regular expression - matching - -externs.h - - new extern declarations for functions in shmatch.c - -execute_cmd.c - - incorporate code into execute_cond_node that does extended regular - expression matching for the =~ operator - -parse.y - - add `=~' to the list of binary operators accepted by the conditional - command parser - -doc/{bash.1,bashref.texi} - - documented =~ conditional binary operator and the BASH_REMATCH - variable - - 8/27 - ---- -lib/readline/display.c - - take multibyte characters into account when looking for quoted - substrings on which to do completion (fix from jir@yamato.ibm.com) - -lib/readline/util.c - - fix typo in _rl_strpbrk - -lib/readline/rldefs.h - - use function version of _rl_strpbrk in multibyte locales, because - it understands to skip over special characters in multibyte - character sequences - - 8/28 - ---- -jobs.c - - in wait_for, check for window size changes if a job that exits due - to a signal or is stopped was in the foreground, not just if it's - the current job - - 9/10 - ---- -support/config.{guess,sub} - - add support to recognize FreeBSD running on the amd64 - -subst.c - - if the new `fail_glob_expansion' variable is non-zero, globbing that - fails to match anything causes an expansion error - -builtins/shopt.def - - new `failglob' expansion: if enabled, failed globs cause an error - -test/shopt.right - - take `failglob' into account - -doc/{bash.1,bashref.texi} - - documented new `failglob' option and its effects - - 9/12 - ---- -findcmd.c - - fix file_status to treat the mode bits and uid right -- in particular, - don't assume the `other' bits always apply. Bug reported by - ; fix inspired by - -command.h - - new word flag: W_NOCOMSUB, meaning to not perform command - substitution on a word - -subst.c - - new flag for param_expand: PF_NOCOMSUB. If non-zero, $(...) - command substitutions are not expanded, but returned unchanged - - change expand_word_internal to pass through `` command substitutions - unchanged if (word->flags & W_NOCOMSUB) != 0 - - change expand_word_internal to pass PF_NOCOMSUB to param_expand - if (word->flags & W_NOCOMSUB) != 0 - -builtins/shopt.def - - rename set_interactive_comments to set_shellopts_after_change, which - more accurately reflects its purpose - -syntax.h - - add a define for isblank() in case the system doesn't provide one - -jobs.c - - change raw_job_exit_status to understand `pipefail', using the new - `pipefail_opt' variable - -flags.[ch] - - declare pipefail_opt - - reset pipefail_opt to 0 in reset_shell_flags - -builtins/set.def - - add `set -o pipefail' and document it in help output - -doc/{bash.1,bashref.texi} - - document `set -o pipefail' and the effect of the pipefail option - -mksyntax.c,syntax.h - - sh_syntaxtab is no longer `const' - - new generated variable, sh_syntabsiz, set to number of entries in - sh_syntaxtab, written to generated syntax.c - -locale.c - - new function, locale_setblanks(), sets each member of the current - locale's class to have the CSHBRK flag in sh_syntaxtab - - 9/17 - ---- -arrayfunc.c - - change convert_var_to_array to not set array[0] to a NULL value - (if the scalar variable had no value; e.g., after being created - with `local arrayvar') - -lib/readline/display.c - - save and restore the value of prompt_invis_chars_first_line in - rl_{save,restore}_prompt, and reinitialize it to 0 before printing - something in the message area - -lib/readline/bind.c - - new functions: rl_bind_keyseq_if_unbound_in_map(ks, func, kmap); - binds key sequence KS to function FUNC in keymap KMAP, and - rl_bind_keyseq_if_unbound (ks, func); binds key sequence KS to - function FUNC in the current keymap - -lib/readline/readline.h - - extern function declarations for rl_bind_keyseq_if_unbound_in_map and - rl_bind_keyseq_if_unbound - -lib/readline/{readline,terminal}.c - - _rl_bind_if_unbound -> rl_bind_keyseq_if_unbound - -lib/readline/{bind.c,rlprivate.h} - - remove _rl_bind_if_unbound - - 9/18 - ---- -lib/readline/doc/rltech.texi - - document rl_bind_keyseq_if_unbound and - rl_bind_keyseq_if_unbound_in_map - - 9/19 - ---- -lib/readline/bind.c - - new functions rl_bind_key_if_unbound_in_map and - rl_bind_key_if_unbound; analogous to (and implemented in terms of) - keyseq functions - - rl_bind_keyseq_in_map: a new function, equivalent to rl_set_key - (which remains for backwards compatibility); changed callers to - use it - - new function, rl_bind_keyseq, equivalent to rl_bind_keyseq_in_map - with a third argument of _rl_keymap - -lib/readline/readline.h - - extern declarations for rl_bind_key_if_unbound_in_map and - rl_bind_key_if_unbound - - extern declarations for rl_bind_keyseq_in_map and rl_bind_keyseq - -lib/readline/doc/rltech.texi - - document rl_bind_keyseq and rl_bind_keyseq_in_map - -configure.in - - require at least readline-5.0 - -config-bot.h - - define SYS_SIGLIST_DECLARED if it's not defined, but - HAVE_DECL_SYS_SIGLIST is, to deal with differences between - autoconf versions - -bashline.c - - use rl_bind_key_if_unbound_in_map when binding bash keybindings in - initialize_readline(), so inputrc files can override them - - 9/22 - ---- -lib/readline/histsearch.c - - do better bounds checking for history_offset and history_length in - history_search_internal - -builtins/history.def - - in delete_last_history(), make sure we don't leave the history - offset longer than the history length after calling delete_histent - - 9/23 - ---- -jobs.c - - small change to notify_of_job_status so job status messages get - printed even if the shell was started to run `-c command'. The - old behavior was intentional, but I cannot remember why, so we'll - try it the other way for a while (debian bash bug #211693) - - 9/24 - ---- -jobs.c - - slightly modify change from 9/23 so that jobs started to run - command substitutions don't print job status messages - - 9/25 - ---- -lib/readline/search.c - - when reading a non-incremental search string from the terminal, - use a separate undo list rather than chaining it to the undo list - from the rest of the line, since the whole undo list will get - freed when the search string is complete - -lib/readline/readline.h - - changed the defines guarding the stdarg prototype for rl_message to - match what's actually used in display.c, where it's defined - - 9/26 - ---- -[bash-3.0-alpha released] - - 9/29 - ---- -lib/sh/shmatch.c - - fix to build correctly when arrays are not compiled into the shell - -subst.c - - fix command substitution to run any exit trap defined in the - command substitution before returning; the exit trap is not inherited - from the calling shell - -lib/readline/shell.c - - change sh_set_lines_and_columns to free the memory allocated and - passed to setenv(), since setenv is specified by POSIX to allocate - new memory and copy its arguments - -jobs.c - - change logic in make_child so that every child process attempts to - set the terminal's process group to the pipeline's process group - when PGRP_PIPE is defined, just like when it's undefined. This is - reported to fix some tricky synchronization problems on Red Hat - Enterprise Linux 3. Fix from Ernie Petrides . - - 9/30 - ---- -builtins/printf.def - - tescape no longer needs a `trans_squote' argument, since it's the - same as the `sawc' argument. The `sawc' argument now means to do - the %b argument processing if non-null - - fix processing of octal constants for %b arguments (\0 followed by - up to three octal digits) and other escape sequences (\ followed by - up to three octal digits) - - hex constants `\xHHH' are now allowed to contain any positive - number of digits; previously they were restricted to two [removed] - - allow two new escape sequences: \" and \?, for compatibility with - ksh93 and ANSI C - -doc/{bash.1,bashref.texi} - - documented processing that printf performs for arguments to %b - escape sequences - -lib/sh/strtrans.c - - add \" and \? to escape sequences recognized by `echo -e' - - 10/1 - ---- -version.c - - use snprintf instead of sprintf if configure tells us we have it - - 10/3 - ---- -subst.c - - in list_remove_pattern, take into account the fact that one of the - list elements may be NULL, and don't free the result of - remove_pattern() without checking - - in remove_pattern, return savestring(param) if *param == '\0', - since callers expect to free() non-null return values - - 10/4 - ---- -subst.c - - change verify_substring_values to make it clearer that the first - offset deals with array indices and the second deals with numbers - of elements, when doing array subranges with ${a[@]:e1:e2} - -array.c - - change array_subrange to make it explicit that the second offset - argument is a count of the desired number of elements, not an - ending index. This deals with sparse arrays correctly. - - 10/6 - ---- -variables.c - - fix memory leak in assign_in_env - - 10/8 - ---- -subst.c - - in parameter_brace_expand, check that the last characters are `]}' - before checking for ${!array[@]} - -execute_cmd.c,builtins/source.def - - push and pop the args (BASH_ARGV and BASH_ARGC) when executing a - shell function or sourcing a script only when in debugging mode - - 10/11 - ----- -arrayfunc.c - - make sure array_variable_name returns values for the SUBP and LENP - arguments if they're non-null, since callers expect to use them - even if the array subscript is bad - -error.c - - call exit_shell instead of sh_exit from parser_error and - report_error so the right things happen (running exit trap, doing - the right interactive cleanup, etc.) - -lib/readline/complete.c - - new variable, rl_completion_quote_character, set to any quote char - readline thinks it finds before any application completion - function is called - - new variable, rl_completion_suppress_quote, settable by an - application-specific completion function. If set to non-zero, the - completion code does not append a closing quote in append_to_match - -lib/readline/readline.h - - extern declarations for rl_completion_quote_character and - rl_completion_suppress_quote - -bashline.c - - set rl_completion_suppress_quote in command_subst_completion_function - because that would be inserted before any closing "`" or ")", which - is somewhat disconcerting - -lib/readline/doc/rltech.texi - - documented rl_completion_suppress_quote and - rl_completion_quote_character - - 10/13 - ----- -bashhist.c - - use sv_histchars instead of setting history_comment_char directly in - bash_initialize_history so assignments to $histchars made in - ~/.bashrc are honored - - 10/21 - ----- -trap.c - - make sure run_exit_trap sets `running_trap' appropriately - - new variable, trap_saved_exit_value, set to last_command_exit_value - before running any trap commands; available to the rest of the - shell; use trap_saved_exit_value to replace some function-local - variables - -builtins/exit.def - - if the shell is running the exit trap, and no argument is given - to `exit', use trap_saved_exit_value as the exit status instead - of the last command exit value (which could be the previous command - run in the exit trap), as required by POSIX.2 - - 10/25 - ----- -doc/{bash.1,bashref.texi} - - add `alias' to the list of documented `assignment statement' builtins - - 11/1 - ---- -doc/bash.1 - - remove the `.' from the sample $PATH value - -parse.y - - make sure parse_compound_assignment prompts with $PS2 if it reads - a newline while parsing the compound assignment statement. Bug - reported by Stephane Chazelas - - parse_string_to_word_list now takes a new second argument: `int flags' - - new parser state flag: PST_COMPASSIGN; indicates that the shell is - parsing a compound assignment statement - - parse_string_to_word_list turns on PST_COMPASSIGN if `flags' arg - has low bit set - - turn PST_COMPASSIGN on and off in parse_compound_assignment - -externs.h - - change prototype declaration for parse_string_to_word_list - -arrayfunc.c - - change call to parse_string_to_word_list to add new flags arg - -general.c - - assignment() takes a new `flags' second argument - - if `flags' is non-zero, accept `[' as a legal assignment statement - starter character (for parsing compound array assignments) - -general.h - - add new argument to prototype declaration for assignment() - -parse.y,{subst,variables}.c, builtins/{setattr,declare}.def - - change calls to assignment() (parse.y calls with flags == 1 when - parser_state inlcudes PST_COMPASSIGN) - -arrayfunc.c - - in assign_array_var_from_string(), don't treat an expanded word - of the form [ind]=value specially unless the W_ASSIGNMENT flag is - set. This means that words that are the result of expansions but - happen to have the same format as compound assignment statement - words will not be treated as such. For instance - - v='[12]=foobar' - a=( $v ) - - will result in a[0]='[12]=foobar' instead of a[12]=foobar. This - is closer to how `regular' assignment statements are treated and - compatible with ksh93. Bug reported by Stephane Chazelas - -shell.c - - new --protected argument, disables command substitution when used - with --wordexp (like --wordexp, it remains undocumented) - - change run_wordexp to turn on the W_NOCOMSUB flag in each word - to be expanded if protected_mode is set - - 11/7 - ---- -doc/{bash.1,bashref.texi} - - clarified the language concerning inherited signal dispositions and - when traps are run - -support/shobj-conf - - slight changes to the darwin (Mac OS X) stanza for MacOS X 10.3 - (for the readline shared library builds, which shares this script) - -lib/readline/histexpand.c - - change to make `^' behave as equivalent to word one, as csh does, - and as the documentation states - -lib/readline/display.c - - in update_line, make sure to use col_lendiff in all calculations - where the cursor position is concerned (like when calculating - the value of _rl_last_c_pos). Fixes bug reported by Andreas - Schwab - - 11/12 - ----- -trap.c - - make _run_trap_internal catch `return' builtin longjmps and clean - up before longjmping on to where the return was intended to go - (fixes bug with not turning off SIG_INPROGRESS flag when `return' - executed in trap command) - - 11/18 - ----- -builtins/cd.def - - in posix mode, set errno to ENOTDIR if canonicalization fails, - unless the canonicalization functions leave it set to ENOENT - - 11/25 - ----- -make_cmd.c - - in make_simple_command, don't blindly dereference element.redirect - -parse.y - - the list_terminator production now has an `int' value so it can be - used in other grammar productions - - add a rule that makes `time' on a line by itself time a null - command (this is iffy) - - 11/28 - ----- -subst.c - - change the pattern substitution code (${var//pat/rep}) to use the - same pattern expansion function (getpattern()) as the pattern - removal expansions. This has the effect of no longer performing - quote removal on the pattern before trying to match it. This - fixes an incompatibility with ksh93 reported on comp.unix.shell - -nojobs.c - - add replacement function for siginterrupt on the off chance that a - system has posix signals but lacks siginterrrupt - -lib/readline/display.c - - fix from Tim Waugh at Red Hat to speed up inserting characters into - long lines in a UTF-8 environment by optimizing the calculation of - the first difference between old and new lines by checking to see - whether the old line is a subset of the new - - 11/29 - ----- -lib/malloc/stats.c - - break code that opens file (and interprets %p) into separate function - _imalloc_fopen(char *s, char *fn, char *def, char *defbuf, size_t defsiz) - for use by rest of library - - default stats file is now `stats.PID' - -lib/malloc/trace.c - - new function, malloc_set_tracefn (char *s, char *fn), sets tracing - to the file named by FN (with %p interpolated as the pid), using - some default if FN is NULL - -lib/malloc/shmalloc.h - - new extern declaration for malloc_set_tracefn - - 12/4 - ---- -execute_cmd.c - - combined several common strings from do_piping() into one - dup_error() function - -builtins/common.[ch] - - new function, `sh_notbuiltin(s)' prints error message about s not - being a shell builtin - -builtins/{builtin,enable}.def - - call sh_notbuiltin instead of using literal string - -{arrayfunc,expr,error}.c - - use one string variable for `bad array subscript' error message; use - in calls to various error reporting functions - -Makefile.in - - add variables for localedir and the PACKAGE_* variables, auto-set - by configure - -configure.in - - un-cache values for gettext, textdomain, and bindtextdomain if they're - not in libc but in libintl so the right variables get set - -bashintl.h - - add necessary defines for marking strings to be translated using - gettext - -locale.c - - set textdomain and directory in set_default_locale - - don't call textdomain with the value of $TEXTDOMAIN, since we don't - want to override the default domain ("bash") - - don't call bindtextdomain unless default_domain already has a value - - when translating $"..." strings, use dgettext with the script's - default domain (value of $TEXTDOMAIN) - - 12/9 - ---- -builtins/mkbuiltins.c - - include "bashintl.h" in the generated "builtins.c" - -support/{config.rpath,mkinstalldirs} - - new files to support gettext i18n - -ABOUT-NLS - - new readme file for gettext internationalization - -po/{Makefile.in.in,Rules-quot,boldquot.sed,en@boldquot.header,en@quot.header,insert-header.sin,quot.sed,remove-potcdate.sin} -po/{POTFILES.in,bash.pot} - - new files for gettext - -lib/intl - - new directory, with libintl stuff from gettext - -aclocal.m4 - - add m4 files from gettext distribution needed by libintl - -configure.in - - create po/Makefile.in and lib/intl/Makefile in AC_OUTPUT - - add call to AM_GNU_GETTEXT to initialize gettext stuff - -Makefile.in - - use mkinstalldirs instead of mkdirs in the `installdirs' target - - changes for intl/ and po/ subdirectories in build and install - - changes to have libintl linked in, as determined by configure - - changes to have libintl built, just in case it's used (though I'd - rather not) - - 12/10 - ----- -config.h.in - - additional #defines required by the libintl library - - add ENABLE_NLS define for AM_GNU_GETTEXT - - take out defines for HAVE_{BINDTEXTDOMAIN,GETTEXT,TEXTDOMAIN} - -configure.in - - removed old tests for libintl and gettext/textdomain/bindtextdomain - -locale.c - - remove HAVE_GETTEXT code; we have gettext unconditionally now - -bashintl.h - - change to include "gettext.h" and remove the conditional code based - on whether or not gettext is present - - 12/16 - ----- -lib/readline/vi_mode.c - - fix problem with rl_vi_eWord that caused it to skip over the last - character of a word if invoked while point was on the next-to-last - character - - 12/18 - ----- -{arrayfunc,bashhist,bashline,error,eval,execute_cmd,expr,general,input,jobs}.c -{mailcheck,make_cmd,nojobs,pcomplete,pcomplib,print_cmd,redir,shell,sig}.c -{subst,test,trap,variables,version,xmalloc}.c -parse.y -builtins/{common,evalfile,getopt}.c -builtins/{bind,break,caller,cd,complete,declare,enable,exec,exit,fc,fg_bg}.def -builtins/{hash,help,history,jobs,kill,printf,pushd,read,return,set,setattr}.def -builtins/{shift,shopt,source,suspend,type,ulimit,umask}.def -lib/sh/{fmtulong,netopen}.c - - include "bashintl.h" for gettext defines - -Makefile.in - - add `-DBUILDTOOL' to CFLAGS for buildversion.o - -bashintl.h - - if `BUILDTOOL' is defined, define ENABLE_NLS to 0 so we don't have - to compile and link in the gettext stuff - -Makefile.in,lib/sh/Makefile.in,builtins/Makefile.in - - update dependencies on bashintl.h and include/gettext.h - - 12/19 - ----- -{arrayfunc,bashhist,bashline,error,eval,execute_cmd,expr,general,input,jobs}.c -{mailcheck,make_cmd,nojobs,pcomplete,pcomplib,print_cmd,redir,shell,sig}.c -{subst,test,trap,variables,version,xmalloc}.c -builtins/{common,evalfile,getopt}.c -builtins/{bind,break,caller,cd,complete,declare,enable,exec,exit,fc,fg_bg}.def -builtins/{hash,help,history,jobs,kill,let,printf,pushd,read,return,set}.def -builtins/{setattr,shift,shopt,source,suspend,type,ulimit,umask}.def -lib/sh/{fmtulong,netopen}.c -lib/malloc/{malloc,stats,table,watch}.c - - mark up strings in source files for gettext processing - -lib/malloc/imalloc.h - - include "bashintl.h" if SHELL is defined, otherwise make _(x) an - identity define - -lib/malloc/Makefile.in - - add dependencies on ${topdir}/bashintl.h and ${BASHINCDIR}/gettext.h - - 12/21 - ----- -bashline.c - - make sure we index into rl_line_buffer with indexes > 0 in - attempt_shell_completion - - 12/31 - ----- -Makefile.in - - descend into `po' and run make recursively for the various clean - targets - - 1/4 - --- -include/shmbutil.h - - two new macros: BACKUP_CHAR(str, strsize, i), which backs up one - multibyte character in STR starting at index I, and - BACKUP_CHAR_P(str, strsize, p), which backs up one multibyte - character in STR starting at P, which is a char * - - 1/6 - --- -pcomplete.c - - in pcomp_filename_completion_function, use the quote character - readline found (and assigned to rl_complete_quote_character) when - dequoting the filename by a completion call from readline (when - rl_dispatching != 0) - -bashline.c - - ditto for bash_directory_completion_matches - - 1/7 - --- -lib/readline/complete.c - - new variable, rl_completion_found_quote, set to non-zero value if - readline finds what it thinks is quoting in the word to be completed - -lib/readline/readline.h - - extern declaration for rl_completion_found_quote - - 1/8 - --- -lib/readline/doc/rltech.texi - - documented rl_completion_found_quote - -lib/readline/complete.c - - in compute_lcd_of_matches, if it looks like what the user typed was - dequoted before generating filename matches, dequote the user's - text again before figuring out the case-insensitive lcd - - 1/9 - --- -lib/readline/display.c - - fix from Edward Catmur to logic that handles - invisible characters in prompt string. Original code was wrong - about local_prompt_prefix; it gave incorrect results when prompt - contained invisible characters after a line break - - 1/10 - ---- -subst.c - - new function, mb_substring(), does character (possibly multibyte) - oriented rather than strictly byte-oriented substring extraction. - The passed indices, rather than strictly indexing into the string, - indicate character positions that need to be calculated. From - Tim Waugh - - change parameter_brace_substring to use mb_substring if necessary - -included/shmbutil.h - - new define SADD_MBQCHAR_BODY, common code for adding a quoted - (preceded by CTLESC) multibyte character to an accumulating string - in the subst.c expansion code - -subst.c - - use SADD_MBQCHAR_BODY in expand_word_internal - - new static function, mb_getcharlens, allocates and returns an array - of character lengths for (possibly multibyte) characters in the - argument string - - change pattern matching operations to use while loops instead of - for loops to handle multibyte characters better (no more simple - increment or decrement) - - change pattern matching operations to use multibyte character - operations instead of simple increments and decrements. Don't - use BACKUP_CHAR_P -- use the mblen array instead, because that - avoids the N**2 behavior of having to count from the beginning - of the string each time you want to back up one character. Changes - to remove_pattern and match_pattern - - 1/12 - ---- -lib/readline/display.c - - make expand_prompt count multbyte characters in the prompt string - by using _rl_find_next_mbchar (and copying possibly more than one - byte) instead of a simple increment and single byte copy - - 1/13 - ---- -lib/readline/display.c - - expand_prompt takes a new reference argument -- it returns - the actual count of (possibly multibyte) characters displayed - on the screen - - don't short-circuit in expand_prompt unless we're not going to - be using any multibyte characters - - change calls to expand_prompt to pass an argument for the - number of physical characters the prompt occupies - (prompt_physical_chars) - - initialize `lpos' (the physical cursor position) from - prompt_physical_chars in rl_redisplay - -lib/readline/mbutil.c - - in _rl_find_prev_mbchar_internal, if mbrtowc returns -1 or -2, and - we assume that the character is a single-byte char, make sure we - update `prev' so it doesn't get lost. Fixes problems encountered - when a non-ascii char is the last char on the line and we're moving - back past it with ^B, and other display problems caused by the same - situation - - 1/15 - ---- -lib/readline/doc/rltech.texi - - document RL_PROMPT_START_IGNORE and RL_PROMPT_END_IGNORE in the - description of rl_expand_prompt() - - 1/20 - ---- -bashline.c - - in initialize_readline, make sure M-C-j and M-C-m are still bound to - vi-editing-mode before unbinding them -- they may have been rebound - in an inputrc - -variables.c - - in unbind_variable, unset attributes other than `local' and exported - (if the variable came from a temporary environment) when unsetting a - local variable inside a function - - 1/21 - ---- -configure.in - - add libintl build directory to the list of include directories if - it's being built (using INTL_BUILDDIR) - -Makefile.in,{builtins,lib/{sh,malloc}}/Makefile.in - - substitute LIBBUILD as ${BUILD_DIR}/${LIBSUBDIR} - - define INTL_BUILDDIR as ${LIBBUILD}/intl - -{builtins,lib/sh}/Makefile.in - - make sure INTL_INC is added to the list of include directories - - make sure INTL_LIBSRC is defined with the correct value - -{configure,Makefile,{builtins,lib/sh}/Makefile}.in - - substitute LIBINTL_H as ${INTL_BUILDDIR}/libintl.h - -Makefile.in,builtins/Makefile.iin - - all files depending on bashintl.h also depend on ${LIBINTL_H} - (which may be empty) - -Makefile.in - - make a rule telling how to build lib/intl/libintl.h if necessary - - 1/24 - ---- -builtins/read.def - - make sure that the array name supplied as an argument to -a is a - valid identifier - -parse.y - - make the \W expansion abbreviate $HOME with a ~ (seems to be more - useful) - -doc/{bash.1,bashref.texi} - - document new behavior of \W - -subst.c - - make sure parameter_brace_expand_rhs uses the first character of - $IFS when making the string to return from the expanded word - (which, in the case of "$@" or $@, contains multiple words that - need to be separated) - - 1/25 - ---- -builtins/common.c - - change get_job_spec to make `%' by itself or an empty argument - return NO_JOB - -jobs.h - - new possible value for a job spec return value: BAD_JOBSPEC - (for syntactically invalid specs, like the empty string) - -shell.c - - in open_shell_script, check to see whether or not we can find and - open the filename argument before setting dollar_vars[0] or - manipulating BASH_SOURCE, so the error messages come out better - -subst.c - - in string_list_internal, short-circuit right away to savestring() - if the list only has a single element - - 1/28 - ---- -lib/readline/rltypedefs.h - - new set of typedefs for functions returning char * with various - arguments (standard set) - -lib/readline/complete.c - - new function pointer, rl_completion_word_break_hook, called by - _rl_find_completion_word, used to set word break characters at - completion time, allowing them to be position-based - -lib/readline/doc/rltech.texi - - documented rl_completion_word_break_hook - -lib/readline/kill.c - - added new rl_unix_filename_rubout, which deletes one filename - component in a Unix pathname backward (delimiters are whitespace - and `/') - -lib/readline/readline.h - - extern declaration for rl_unix_filename_rubout - -lib/readline/funmap.c - - new bindable readline command `unix-filename-rubout' - -lib/readline/doc/{readline.3,rluser.texi},doc/bash.1 - - documented `unix-filename-rubout' - - 1/29 - ---- -lib/readline/histexpand.c - - change history_tokenize_internal to handle non-whitespace delimiter - characters by creating separate fields (like the shell does when - splitting on $IFS) - - 1/30 - ---- -lib/glob/xmbsrtowcs.c - - new function, xdupmbstowcs, for convenience: calls xmbsrtowcs - while allocating memory for the new wide character string - - some small efficiency improvments to xmbsrtowcs - -include/shmbutil.h - - extern declaration for xdupmbstowcs - -lib/glob/strmatch.h - - include config.h for definition of HANDLE_MULTIBYTE - - remove the HAVE_LIBC_FNM_EXTMATCH tests - - new extern declaration for wcsmatch(whchar_t *, wchar_t *, int) - -configure.in - - remove call to BASH_FUNC_FNMATCH_EXTMATCH; it's no longer used - -lib/glob/smatch.c - - simplify xstrmatch() by using xdupmbstowcs() instead of inline code - -lib/glob/glob.c - - modify mbskipname() to avoid the use of alloca - - simplify mbskipname() by using xdupmbstowcs() instead of inline code - - simplify glob_pattern_p() by using xdupmbstowcs() instead of - inline code - - fix memory leak in wdequote_pathname - - simplify wdequote_pathname() by using xdupmbstowcs() instead of - inline code - -lib/glob/strmatch.c - - new function, wcsmatch(), `exported' wide-character equivalent of - strmatch() - -subst.c - - old match_pattern is now match_upattern - - match_pattern now either calls match_upattern or converts - mbstrings to wide chars and calls match_wpattern - - match_upattern reverted to old non-multibyte code - - new function: match_pattern_wchar, wide character version of - match_pattern_char - - 2/1 - --- -subst.c - - old remove_pattern is now remove_upattern - - remove_upattern reverted to old non-multibyte code (pre-Waugh patch) - - new multibyte version of remove_pattern: remove_wpattern - - remove_pattern now calls either remove_upattern or converts a - multibyte string to a wide character string and calls - remove_wpattern - - new function, wcsdup, wide-character version of strdup(3) - - 2/4 - --- -print_cmd.c - - temporarily translate a >&filename redirection from - r_duplicating_output_word to r_err_and_out (as the expansion code - in redir.c does) so it prints without a leading `1' (file - descriptor) - - 2/5 - --- -aclocal.m4 - - add a check for wcsdup to BASH_CHECK_MULTIBYTE - -config.h.in - - add HAVE_WCSDUP define - - 2/9 - --- -builtins/shift.def - - fix a call to sh_erange that possibly dereferences a NULL pointer - - 2/12 - ---- -general.c - - start at a general set of file property checking functions: - file_isdir(), file_iswdir() (is writable directory) - -general.h - - extern declarations for new functions - -lib/sh/tmpfile.c - - use file_iswdir() to make sure the temporary directory used for - here documents and other temp files is writable in get_sys_tmpdir() - - 2/17 - ---- -bashline.c - - fix conditional binding of emacs-mode M-~ -- there is a default - binding for it (rl_tilde_expand), so a straight call to - rl_bind_key_if_unbound_in_map doesn't do the right thing - - 2/27 - ---- -[bash-3.0-beta1 released] - - 2/29 - ---- -subst.c - - fixed expansion so referencing $a, when a is an array variable - without an element assigned to index 0, exits the shell when - `-u' is enabled - -expr.c - - make the exponentiation operator (**) associative, so things like - 2**3**4 work right (change `if' to `while') - - 3/3 - --- -lib/sh/strftime.c - - SCO Unix 3.2, like Solaris, requires that the system's `timezone' - variable be declared as long - -lib/readline/{bind,histfile,input,parens}.c - - changes for Tandem (including `floss.h' (?)) - - 3/4 - --- -subst.c - - change param_expand to quote the entire expanded string instead - of just the escape characters if the expansion appears between - double quotes or in a here-document (for simple variable expansions - or expansions of positional parameters) - - 3/8 - --- -subst.c - - analogous changes to parameter_brace_expand_word to fix the same - quoting problem as on 3/4; fix callers to understand that the - value returned might be quoted now and should be dequoted if - necessary - - add a `quoted' argument to get_var_and_type, change callers - - change today's fix and fix from 3/4 to not call quote_string if the - value is "" (because quote_string turns that into CTLNUL\0) - - 3/9 - --- -builtins/cd.def - - resetpwd() now takes a `caller' argument so it can be used by pwd - as well as cd - - change pwd_builtin to call resetpwd() if sh_physpath() fails to - return a valid pathname - - 3/14 - ---- -expr.c - - reworked exp0 and readtok() to make post-increment and post-decrement - into real tokens, which may be separated from their accompanying - variables by whitesapce - - made analogous changes to readtok() to make pre-increment and - pre-decrement work when separated from their accompanying identifier - by whitespace - - 3/18 - ---- -lib/readline/misc.c - - in rl_maybe_unsave_line, don't force rl_replace_line to clear - the undo_list, since it might point directly at an undo list - from a history entry (to which we have no handle) - - 3/19 - ---- -lib/readline/display.c - - rl_save_prompt and rl_restore_prompt now save and restore the value - of prompt_physical_chars - - set prompt_physical_chars in rl_redisplay when expand_prompt has - not been called (e.g., when rl_display_prompt is set and is not - equal to rl_prompt, like when searching) - -lib/readline/histexpand.c - - don't call add_history in history_expand if the `:p' modifier is - supplied; leave that to the calling application. This means that - `history -p', for example, will not add anything to the history - list (as documented), nor will history expansions invoked by - emacs-mode M-C-e line editing - -config-bot.h - - check whether HAVE_DECL_SYS_SIGLIST is defined to 1 rather than just - defined, to work around newer versions of autoconf defining it to 0 - -config.h.in - - change default status of HAVE_MALLOC to #undef instead of #define - -bashhist.c - - extern declarations for rl_done and rl_dispatching - - don't call re_edit from pre_process_line unless rl_dispatcing is zero, - so we don't call it from something like shell-expand-line - - change pre_process_line to add an expanded history specification - that returned `print only' to the history list, since history_expand - no longer does it (and, when using readline, do it only when - rl_dispatching is zero) - - 3/22 - ---- -config.h.in,aclocal.m4 - - change bash-specific functions that look in struct dirent to define - HAVE_STRUCT_DIRENT_xxx, like AC_CHECK_MEMBERS does (though the - functions are otherwise the same) - - new function, BASH_STRUCT_DIRENT_D_NAMLEN, define - HAVE_STRUCT_DIRENT_D_NAMLEN if struct dirent has a `d_namlen' member - -configure.in - - call BASH_STRUCT_DIRENT_D_NAMLEN - -include/posixdir.h - - use new and renamed HAVE_STRUCT_DIRENT_D_xxx defines - - 4/7 - --- -builtins/cd.def - - ensure that we print out a non-null pathname after getting a - directory from CDPATH and canonicalizing it (e.g., if the result - exceeds PATH_MAX in length and the_current_working_directory is - set to NULL) - - 4/12 - ---- -print_cmd.c - - new function to print out assignment statements when `set -x' has - been enabled: xtrace_print_assignment - -externs.h - - extern declaration for xtrace_print_assignment - - 4/13 - ---- -{subst,variables}.c - - call xtrace_print_assignment instead of using inline code - -jobs.c - - if turning on job control when it was previously off, set - pipeline_pgrp to 0 in set_job_control so make_child puts - subsequent children in their own process group - - 4/14 - ---- -general.c - - new function, legal_alias_name, called to decide whether an - argument to add_alias is a valid alias name -- essentially any - character except one which must be quoted to the shell parser - and `/' - -general.h - - new extern declaration for legal_alias_name - -builtins/alias.def - - `unalias' now returns failure status if no NAME arguments are - supplied and -a is not given - - call legal_alias_name to make sure alias name is valid before - calling add_alias from alias_builtin - - 4/19 - ---- -include/shmbutil.h - - include for definition of HANDLE_MULTIBYTE rather than - duplicating logic - - 4/20 - ---- - -doc/{bash.1,bashref.texi} - - make sure $0 is consistently referred to as a `special parameter' - - document which characters are now not allowed in alias names - - 4/23 - ---- - -builtins/{jobs,kill,wait}.def - - removed requirement that job control be enabled to use job control - notation, as SUSv3 implies - -subst.c - - based on a message from David Korn, change param_expand to not call - string_list_dollar_star if the only quoting is Q_HERE_DOCUMENT -- - quoted here documents are like double quoting, but not exactly - - analogous changes to list_remove_pattern and pos_params - - 4/24 - ---- -lib/readline/doc/rluser.texi - - fix error in description of emacs-mode C-xC-e command (uses $VISUAL - instead of $FCEDIT) - - 4/28 - ---- -support/bashbug.sh - - integrate a patch from Stefan Nordhausen - that reduces race conditions - by using a temporary directory inside $TMPDIR and creating the - temp files in that - - 4/30 - ---- -builtins/common.c - - use pathconf(".", _PC_PATH_MAX) where available to size the argument - to getcwd() rather than using a straight PATH_MAX - -builtins/cd.def - - if get_working_directory fails and returns null (causing resetpwd - to return NULL), use set_working_directory to set $PWD to the - absolute pathname for which chdir just succeeded - - 5/1 - --- -lib/readline/vi_mode.c - - in rl_vi_change_to, call _rl_vi_set_last with rl_numeric_arg instead - of `last', since they're equal at call time and rl_vi_domove can - change rl_numeric_arg (which vi apparently updates). Fixes redo bug - of `c2....' reported by Marion Berryman - - 5/4 - --- -parse.y - - fix decode_prompt_string to properly deal with strftime() returning 0 - - 5/6 - --- -variables.c - - in make_local_array_variable, return an already-existing local array - variable immediately rather than creating a new array (causing a - memory leak) - - 5/8 - --- -lib/readline/vi_mode.c - - change rl_vi_domove to set rl_explicit_arg before calling - rl_digit_loop1 so that multi-digit numeric arguments work right - - _rl_vi_last_command is no longer static - -lib/readline/rlprivate.h - - new extern declaration for _rl_vi_last_command - -lib/readline/text.c - - change rl_newline to only call _rl_vi_reset_last if the last command - (_rl_vi_last_command) is not a text modification command. This lets - the last-command and last-argument work across command lines - - 5/13 - ---- -builtins/common.c - - use getcwd(0,0) rather than providing a fixed pathname with a fixed - length (PATH_MAX) so getcwd() will allocate sufficient memory - -aclocal.m4 - - change BASH_FUNC_GETCWD to check whether or not getcwd(0,0) will - allocate memory for the returned value -- nobody implements that - and getcwd-via-popen, so it should capture the old test as well - - 5/27 - ---- - -builtins/trap.def - - the historical behavior of assuming that a signal's handling should - be set to its original disposition is only in effect if a single - argument is given, otherwise the first argument is assumed to be a - command to execute - - when in posix mode, if trap gets a single argument, display an - error message and return EX_USAGE - - change the help message and usage string to better explain trap's - behavior - -doc/{bash.1,bashref.texi} - - describe the new default behavior when the first argument is a - signal spec - - note that signal names are case insensitive and the SIG prefix is - optional in arguments to `trap' - - note that signal name arguments to `kill' are case-insensitive - -lib/readline/display.c - - make sure rl_on_new_line_with_prompt sets rl_display_prompt to - rl_prompt (just to make sure it's set) - - have rl_on_new_line_with_prompt use local_prompt if it's set - - 6/2 - --- -subst.c - - in string_extract_double_quoted, cope with extract_delimited_string - returning NULL, as it can when attempting completion on an unclosed - command substitution - - 6/24 - ---- -lib/readline/complete.c - - change print_filename to add a `/' to listed directory names if - `mark-directories' has been enabled - -builtins/umask.def - - make sure that the mask passed to parse_symbolic_mode has all but - the operative low eight bits masked off, to avoid complementing - all 0s to -1, which is the error return code. This makes things - like `a=rwx' and `ugo=rwx' work and turn off the umask - - 6/26 - ---- -builtins/getopts.def - - when `getopts' reaches the end of options, unset OPTARG before - returning EOF. In response to a bug report from Apple - -configure.in - - when cross-compiling, don't set CPPFLAGS_FOR_BUILD and - LDFLAGS_FOR_BUILD from CPPFLAGS and LDFLAGS, respectively, since - those are for the target instead of the build platform (report - from robert@schwebel.de) - -shell.c - - a shell whose standard error (but not standard output) is directed - to a terminal should be interactive, according to POSIX/SUS. This - means that sh > sh.out will start an interactive shell. Bug report - from llattanzi@apple.com - -doc/{bash.1,bashref.texi} - - change mention of standard output to standard error in definition - of interactive shell - -lib/readline/vi_mode.c - - new convenience function, rl_vi_start_inserting, calls - _rl_vi_set_last to save the last textmod command state and then calls - rl_vi_insertion_mode to enter insert mode - - change functions to use rl_vi_start_inserting - -lib/readline/readline.h - - extern declaration for rl_vi_start_inserting - -bashline.c - - new function for vi-mode completion, bash_vi_complete. Does - filename expansion as POSIX specifies, unlike the default readline - bindings (which don't know about globbing). Bound to `\', `*', - and `=' in vi command keymap. Internals very similar to - rl_vi_complete; just calls bash glob expansion functions - -lib/readline/vi_mode.c - - change rl_vi_change_char so that an entire change is a single - undoable event, rather than each individual change in a [count]r - command - - fix rl_vi_change_char so that replacing characters up to EOL works - rather than generating rl_ding - - fix rl_vi_change_case so that replacing characters up to EOL works - rather than generating rl_ding - - 6/28 - ---- -builtins/echo.def - - call clearerr(stdout) before writing anything and testing its - failure or success - - 6/29 - ---- -bashline.c - - only set rl_explicit_arg in bash_glob_complete_word if readline is - in emacs mode; let bash_vi_complete take care of setting it in vi - mode - - fix bash_vi_complete to only set rl_explicit_arg unless the posix - conditions are met: no globbing characters in the vi `bigword' - being completed - - 6/30 - ---- -[bash-3.0-rc1 released] - - 7/1 - --- -lib/readline/complete.c - - make sure `extension_char' is initialized before deciding whether - or not the append a `/' to a possible completion when visible-stats - is not enabled - - 7/2 - --- -subst.c - - fix a boundary overrun in string_extract_double_quoted that could - occur when the word completion code attempts to expand an incomplete - construct (like a quoted unclosed command substitution) - - 7/4 - --- -subst.c - - set tempenv_assign_error to non-zero if an assignment to the - temporary environment fails for some reason (e.g., attempted - assignment to a readonly variable) - -execute_cmd.c - - fix execute_simple_command to force a non-interactive shell in - POSIX mode to exit if an assignment to the temporary environment - preceding a special builtin fails (bug report from - llattanzi@apple.com) - - 7/5 - --- -bashline.c - - in bash_directory_completion_hook, don't perform word expansions - if the filename appears to have been completed from the file - system rather than typed in by the user. Bug reported by Tim - Waugh - - 7/7 - --- -lib/readline/misc.c - - if _rl_maybe_save_line is being asked to save a line other than - what's already saved, free up the current saved line and save the - current contents of rl_line_buffer. Bug reported by - llattanzi@apple.com - - 7/12 - ---- -lib/readline/input.c - - do better EOF detection in rl_gather_tyi -- if a read returns 0 when - the fd is in non-blocking mode, stuff an EOF into the input stream - (reported by mattias@virtutech.se) - - 7/13 - ---- -lib/readline/vi_mode.c - - make sure rl_vi_put honors `count' arguments and yanks things - multiple times if requested - - 7/16 - ---- -builtins/umask.def - - make sure that the `who' part of the umask symbolic mode argument - defaults to `a' if it's missing - -flags.c - - make sure that maybe_make_restricted only gets called after the - shell is initialized, so `bash -r' doesn't result in inappropriate - error messages - -[bash-3.0 frozen] diff --git a/CWRU/changelog b/CWRU/changelog new file mode 120000 index 00000000..d2d81b30 --- /dev/null +++ b/CWRU/changelog @@ -0,0 +1 @@ +CWRU.chlog \ No newline at end of file diff --git a/CWRU/old/set.def.save b/CWRU/old/set.def.save new file mode 100644 index 00000000..87b78d7c --- /dev/null +++ b/CWRU/old/set.def.save @@ -0,0 +1,544 @@ +This file is set.def, from which is created set.c. +It implements the "set" and "unset" builtins in Bash. + +Copyright (C) 1987, 1989, 1991 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, 675 Mass Ave, Cambridge, MA 02139, USA. + +$PRODUCES set.c + +#include +#include "../shell.h" +#include "../flags.h" + +#include "bashgetopt.h" + +extern int interactive; +extern int noclobber, posixly_correct; +#if defined (READLINE) +extern int rl_editing_mode, no_line_editing; +#endif /* READLINE */ + +$BUILTIN set +$FUNCTION set_builtin +$SHORT_DOC set [--abefhkmnptuvxldBCHP] [-o option] [arg ...] + -a Mark variables which are modified or created for export. + -b Notify of job termination immediately. + -e Exit immediately if a command exits with a non-zero status. + -f Disable file name generation (globbing). + -h Locate and remember function commands as functions are + defined. Function commands are normally looked up when + the function is executed. + -i Force the shell to be an "interactive" one. Interactive shells + always read `~/.bashrc' on startup. + -k All keyword arguments are placed in the environment for a + command, not just those that precede the command name. + -m Job control is enabled. + -n Read commands but do not execute them. + -o option-name + Set the variable corresponding to option-name: + allexport same as -a + braceexpand same as -B +#if defined (READLINE) + emacs use an emacs-style line editing interface +#endif /* READLINE */ + errexit same as -e + histexpand same as -H + ignoreeof the shell will not exit upon reading EOF + interactive-comments + allow comments to appear in interactive commands + monitor same as -m + noclobber disallow redirection to existing files + noexec same as -n + noglob same as -f + nohash same as -d + notify save as -b + nounset same as -u + physical same as -P + posix change the behavior of bash where the default + operation differs from the 1003.2 standard to + match the standard + privileged same as -p + verbose same as -v +#if defined (READLINE) + vi use a vi-style line editing interface +#endif /* READLINE */ + xtrace same as -x + -p Turned on whenever the real and effective user ids do not match. + Disables processing of the $ENV file and importing of shell + functions. Turning this option off causes the effective uid and + gid to be set to the real uid and gid. + -t Exit after reading and executing one command. + -u Treat unset variables as an error when substituting. + -v Print shell input lines as they are read. + -x Print commands and their arguments as they are executed. + -l Save and restore the binding of the NAME in a FOR command. + -d Disable the hashing of commands that are looked up for execution. + Normally, commands are remembered in a hash table, and once + found, do not have to be looked up again. +#if defined (BRACE_EXPANSION) + -B the shell will perform brace expansion +#endif /* BRACE_EXPANSION */ +#if defined (BANG_HISTORY) + -H Enable ! style history substitution. This flag is on + by default. +#endif /* BANG_HISTORY */ + -C If set, disallow existing regular files to be overwritten + by redirection of output. + -P If set, do not follow symbolic links when executing commands + such as cd which change the current directory. + +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 ARGs are positional +parameters and are assigned, in order, to $1, $2, .. $n. If no +ARGs are given, all shell variables are printed. +$END + +/* An a-list used to match long options for set -o to the corresponding + option letter. */ +struct { + char *name; + int letter; +} o_options[] = { + { "allexport", 'a' }, +#if defined (BRACE_EXPANSION) + { "braceexpand",'B' }, +#endif + { "errexit", 'e' }, + { "histexpand", 'H' }, + { "monitor", 'm' }, + { "noexec", 'n' }, + { "noglob", 'f' }, + { "nohash", 'd' }, +#if defined (JOB_CONTROL) + { "notify", 'b' }, +#endif /* JOB_CONTROL */ + {"nounset", 'u' }, + {"physical", 'P' }, + {"privileged", 'p' }, + {"verbose", 'v' }, + {"xtrace", 'x' }, + {(char *)NULL, 0}, +}; + +#define MINUS_O_FORMAT "%-15s\t%s\n" + +void +list_minus_o_opts () +{ + register int i; + char *on = "on", *off = "off"; + + printf (MINUS_O_FORMAT, "noclobber", (noclobber == 1) ? on : off); + + if (find_variable ("ignoreeof") || find_variable ("IGNOREEOF")) + printf (MINUS_O_FORMAT, "ignoreeof", on); + else + printf (MINUS_O_FORMAT, "ignoreeof", off); + + printf (MINUS_O_FORMAT, "interactive-comments", + interactive_comments ? on : off); + + printf (MINUS_O_FORMAT, "posix", posixly_correct ? on : off); + +#if defined (READLINE) + if (no_line_editing) + { + printf (MINUS_O_FORMAT, "emacs", off); + printf (MINUS_O_FORMAT, "vi", off); + } + else + { + /* Magic. This code `knows' how readline handles rl_editing_mode. */ + printf (MINUS_O_FORMAT, "emacs", (rl_editing_mode == 1) ? on : off); + printf (MINUS_O_FORMAT, "vi", (rl_editing_mode == 0) ? on : off); + } +#endif /* READLINE */ + + for (i = 0; o_options[i].name; i++) + { + int *on_or_off, zero = 0; + + on_or_off = find_flag (o_options[i].letter); + if (on_or_off == FLAG_UNKNOWN) + on_or_off = &zero; + printf (MINUS_O_FORMAT, o_options[i].name, (*on_or_off == 1) ? on : off); + } +} + +set_minus_o_option (on_or_off, option_name) + int on_or_off; + char *option_name; +{ + int option_char = -1; + + if (STREQ (option_name, "noclobber")) + { + if (on_or_off == FLAG_ON) + bind_variable ("noclobber", ""); + else + unbind_variable ("noclobber"); + stupidly_hack_special_variables ("noclobber"); + } + else if (STREQ (option_name, "ignoreeof")) + { + unbind_variable ("ignoreeof"); + unbind_variable ("IGNOREEOF"); + if (on_or_off == FLAG_ON) + bind_variable ("IGNOREEOF", "10"); + stupidly_hack_special_variables ("IGNOREEOF"); + } + +#if defined (READLINE) + else if ((STREQ (option_name, "emacs")) || (STREQ (option_name, "vi"))) + { + if (on_or_off == FLAG_ON) + { + rl_variable_bind ("editing-mode", option_name); + + if (interactive) + with_input_from_stdin (); + no_line_editing = 0; + } + else + { + int isemacs = (rl_editing_mode == 1); + if ((isemacs && STREQ (option_name, "emacs")) || + (!isemacs && STREQ (option_name, "vi"))) + { + if (interactive) + with_input_from_stream (stdin, "stdin"); + no_line_editing = 1; + } + else + builtin_error ("not in %s editing mode", option_name); + } + } +#endif /* READLINE */ + else if (STREQ (option_name, "interactive-comments")) + interactive_comments = (on_or_off == FLAG_ON); + else if (STREQ (option_name, "posix")) + { + posixly_correct = (on_or_off == FLAG_ON); + unbind_variable ("POSIXLY_CORRECT"); + unbind_variable ("POSIX_PEDANTIC"); + if (on_or_off == FLAG_ON) + { + bind_variable ("POSIXLY_CORRECT", ""); + stupidly_hack_special_variables ("POSIXLY_CORRECT"); + } + } + else + { + register int i; + for (i = 0; o_options[i].name; i++) + { + if (STREQ (option_name, o_options[i].name)) + { + option_char = o_options[i].letter; + break; + } + } + if (option_char == -1) + { + builtin_error ("%s: unknown option name", option_name); + return (EXECUTION_FAILURE); + } + if (change_flag (option_char, on_or_off) == FLAG_ERROR) + { + bad_option (option_name); + return (EXECUTION_FAILURE); + } + } + return (EXECUTION_SUCCESS); +} + +/* Set some flags from the word values in the input list. If LIST is empty, + then print out the values of the variables instead. If LIST contains + non-flags, then set $1 - $9 to the successive words of LIST. */ +set_builtin (list) + WORD_LIST *list; +{ + int on_or_off, flag_name, force_assignment = 0; + + if (!list) + { + SHELL_VAR **vars; + + vars = all_shell_variables (); + if (vars) + { + print_var_list (vars); + free (vars); + } + + vars = all_shell_functions (); + if (vars) + { + print_var_list (vars); + free (vars); + } + + return (EXECUTION_SUCCESS); + } + + /* Check validity of flag arguments. */ + if (*list->word->word == '-' || *list->word->word == '+') + { + register char *arg; + WORD_LIST *save_list = list; + + while (list && (arg = list->word->word)) + { + char c; + + if (arg[0] != '-' && arg[0] != '+') + break; + + /* `-' or `--' signifies end of flag arguments. */ + if (arg[0] == '-' && + (!arg[1] || (arg[1] == '-' && !arg[2]))) + break; + + while (c = *++arg) + { + if (find_flag (c) == FLAG_UNKNOWN && c != 'o') + { + char s[2]; + s[0] = c; s[1] = '\0'; + bad_option (s); + if (c == '?') + builtin_usage (); + return (c == '?' ? EXECUTION_SUCCESS : EXECUTION_FAILURE); + } + } + list = list->next; + } + list = save_list; + } + + /* Do the set command. While the list consists of words starting with + '-' or '+' treat them as flags, otherwise, start assigning them to + $1 ... $n. */ + while (list) + { + char *string = list->word->word; + + /* If the argument is `--' or `-' then signal the end of the list + and remember the remaining arguments. */ + if (string[0] == '-' && (!string[1] || (string[1] == '-' && !string[2]))) + { + list = list->next; + + /* `set --' unsets the positional parameters. */ + if (string[1] == '-') + force_assignment = 1; + + /* Until told differently, the old shell behaviour of + `set - [arg ...]' being equivalent to `set +xv [arg ...]' + stands. Posix.2 says the behaviour is marked as obsolescent. */ + else + { + change_flag ('x', '+'); + change_flag ('v', '+'); + } + + break; + } + + if ((on_or_off = *string) && + (on_or_off == '-' || on_or_off == '+')) + { + int i = 1; + while (flag_name = string[i++]) + { + if (flag_name == '?') + { + builtin_usage (); + return (EXECUTION_SUCCESS); + } + else if (flag_name == 'o') /* -+o option-name */ + { + char *option_name; + WORD_LIST *opt; + + opt = list->next; + + if (!opt) + { + list_minus_o_opts (); + continue; + } + + option_name = opt->word->word; + + if (!option_name || !*option_name || (*option_name == '-')) + { + list_minus_o_opts (); + continue; + } + list = list->next; /* Skip over option name. */ + + if (set_minus_o_option (on_or_off, option_name) != EXECUTION_SUCCESS) + return (EXECUTION_FAILURE); + } + else + { + if (change_flag (flag_name, on_or_off) == FLAG_ERROR) + { + char opt[3]; + opt[0] = on_or_off; + opt[1] = flag_name; + opt[2] = '\0'; + bad_option (opt); + builtin_usage (); + return (EXECUTION_FAILURE); + } + } + } + } + else + { + break; + } + list = list->next; + } + + /* Assigning $1 ... $n */ + if (list || force_assignment) + remember_args (list, 1); + return (EXECUTION_SUCCESS); +} + +$BUILTIN unset +$FUNCTION unset_builtin +$SHORT_DOC unset [-f] [-v] [name ...] +For each NAME, remove the corresponding variable or function. Given +the `-v', unset will only act on variables. Given the `-f' flag, +unset will only act on functions. With neither flag, unset first +tries to unset a variable, and if that fails, then tries to unset a +function. Some variables (such as PATH and IFS) cannot be unset; also +see readonly. +$END + +#define NEXT_VARIABLE() any_failed++; list = list->next; continue; + +unset_builtin (list) + WORD_LIST *list; +{ + int unset_function, unset_variable, unset_array, opt, any_failed; + char *name; + + unset_function = unset_variable = unset_array = any_failed = 0; + + reset_internal_getopt (); + while ((opt = internal_getopt (list, "fv")) != -1) + { + switch (opt) + { + case 'f': + unset_function = 1; + break; + case 'v': + unset_variable = 1; + break; + default: + builtin_usage (); + return (EXECUTION_FAILURE); + } + } + + list = loptend; + + if (unset_function && unset_variable) + { + builtin_error ("cannot simultaneously unset a function and a variable"); + return (EXECUTION_FAILURE); + } + + while (list) + { + SHELL_VAR *var; + int tem; +#if defined (ARRAY_VARS) + char *t; +#endif + + name = list->word->word; + +#if defined (ARRAY_VARS) + if (!unset_function && valid_array_reference (name)) + { + t = strchr (name, '['); + *t++ = '\0'; + unset_array++; + } +#endif + + var = unset_function ? find_function (name) : find_variable (name); + + if (var && !unset_function && non_unsettable_p (var)) + { + builtin_error ("%s: cannot unset", name); + NEXT_VARIABLE (); + } + + /* Posix.2 says that unsetting readonly variables is an error. */ + if (var && readonly_p (var)) + { + builtin_error ("%s: cannot unset: readonly %s", + name, unset_function ? "function" : "variable"); + NEXT_VARIABLE (); + } + + /* Unless the -f option is supplied, the name refers to a variable. */ +#if defined (ARRAY_VARS) + if (var && unset_array) + { + if (array_p (var) == 0) + { + builtin_error ("%s: not an array variable", name); + NEXT_VARIABLE (); + } + else + tem = unbind_array_element (var, t); + } + else +#endif /* ARRAY_VARS */ + tem = makunbound (name, unset_function ? shell_functions : shell_variables); + + /* This is what Posix.2 draft 11+ says. ``If neither -f nor -v + is specified, the name refers to a variable; if a variable by + that name does not exist, a function by that name, if any, + shall be unset.'' */ + if ((tem == -1) && !unset_function && !unset_variable) + tem = makunbound (name, shell_functions); + + if (tem == -1) + any_failed++; + else if (!unset_function) + stupidly_hack_special_variables (name); + + list = list->next; + } + + if (any_failed) + return (EXECUTION_FAILURE); + else + return (EXECUTION_SUCCESS); +} diff --git a/CWRU/save/unwind_prot.h.save b/CWRU/save/unwind_prot.h.save new file mode 100644 index 00000000..998fd72b --- /dev/null +++ b/CWRU/save/unwind_prot.h.save @@ -0,0 +1,50 @@ +/* unwind_prot.h - Macros and functions for hacking unwind protection. */ + +/* Copyright (C) 1993 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 2, 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, 675 Mass Ave, Cambridge, MA 02139, USA. */ + +#if !defined (_UNWIND_PROT_H) +#define _UNWIND_PROT_H + +/* Run a function without interrupts. */ +extern void begin_unwind_frame (); +extern void discard_unwind_frame (); +extern void run_unwind_frame (); +extern void add_unwind_protect (); +extern void remove_unwind_protect (); +extern void run_unwind_protects (); +extern void unwind_protect_var (); + +/* Define for people who like their code to look a certain way. */ +#define end_unwind_frame() + +/* How to protect an integer. */ +#define unwind_protect_int(X) unwind_protect_var (&(X), (char *)(X), sizeof (int)) + +/* How to protect a pointer to a string. */ +#define unwind_protect_string(X) \ + unwind_protect_var ((int *)&(X), (X), sizeof (char *)) + +/* How to protect any old pointer. */ +#define unwind_protect_pointer(X) unwind_protect_string (X) + +/* How to protect the contents of a jmp_buf. */ +#define unwind_protect_jmp_buf(X) \ + unwind_protect_var ((int *)(X), (char *)(X), sizeof (procenv_t)) + +#endif /* _UNWIND_PROT_H */ diff --git a/MANIFEST b/MANIFEST index 121135fe..b5b377d6 100644 --- a/MANIFEST +++ b/MANIFEST @@ -463,7 +463,6 @@ po/Rules-builtins f po/Rules-quot f po/bash.pot f po/boldquot.sed f -po/builtins.pot f po/en@quot.header f po/en@boldquot.header f po/en@quot.po f diff --git a/array.c b/array.c index 7b0a5d7b..bfc83c38 100644 --- a/array.c +++ b/array.c @@ -451,7 +451,7 @@ char *v; */ array_dispose_element(new); free(element_value(ae)); - ae->value = savestring(v); + ae->value = v ? savestring(v) : (char *)NULL; return(0); } else if (element_index(ae) > i) { ADD_BEFORE(ae, new); diff --git a/autom4te.cache/output.0 b/autom4te.cache/output.0 index 141a689b..703bc0bd 100644 --- a/autom4te.cache/output.0 +++ b/autom4te.cache/output.0 @@ -1,5 +1,5 @@ @%:@! /bin/sh -@%:@ From configure.in for Bash 3.0, version 3.165, from autoconf version AC_ACVERSION. +@%:@ From configure.in for Bash 3.0, version 3.166, from autoconf version AC_ACVERSION. @%:@ Guess values for system-dependent variables and create Makefiles. @%:@ Generated by GNU Autoconf 2.57 for bash 3.0-release. @%:@ @@ -13074,223 +13074,6 @@ done -for ac_header in stdlib.h -do -as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` -if eval "test \"\${$as_ac_Header+set}\" = set"; then - echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 -if eval "test \"\${$as_ac_Header+set}\" = set"; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 -else - # Is the header compilable? -echo "$as_me:$LINENO: checking $ac_header usability" >&5 -echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6 -cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -@%:@include <$ac_header> -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_header_compiler=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_header_compiler=no -fi -rm -f conftest.$ac_objext conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -echo "${ECHO_T}$ac_header_compiler" >&6 - -# Is the header present? -echo "$as_me:$LINENO: checking $ac_header presence" >&5 -echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6 -cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -@%:@include <$ac_header> -_ACEOF -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_c_preproc_warn_flag - else - ac_cpp_err= - fi -else - ac_cpp_err=yes -fi -if test -z "$ac_cpp_err"; then - ac_header_preproc=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_header_preproc=no -fi -rm -f conftest.err conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -echo "${ECHO_T}$ac_header_preproc" >&6 - -# So? What about this header? -case $ac_header_compiler:$ac_header_preproc in - yes:no ) - { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 -echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} - ( - cat <<\_ASBOX -@%:@@%:@ ------------------------------------ @%:@@%:@ -@%:@@%:@ Report this to bug-autoconf@gnu.org. @%:@@%:@ -@%:@@%:@ ------------------------------------ @%:@@%:@ -_ASBOX - ) | - sed "s/^/$as_me: WARNING: /" >&2 - ;; - no:yes ) - { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 -echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 -echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} - ( - cat <<\_ASBOX -@%:@@%:@ ------------------------------------ @%:@@%:@ -@%:@@%:@ Report this to bug-autoconf@gnu.org. @%:@@%:@ -@%:@@%:@ ------------------------------------ @%:@@%:@ -_ASBOX - ) | - sed "s/^/$as_me: WARNING: /" >&2 - ;; -esac -echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 -if eval "test \"\${$as_ac_Header+set}\" = set"; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - eval "$as_ac_Header=$ac_header_preproc" -fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 - -fi -if test `eval echo '${'$as_ac_Header'}'` = yes; then - cat >>confdefs.h <<_ACEOF -@%:@define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 -_ACEOF - -fi - -done - -echo "$as_me:$LINENO: checking for GNU libc compatible malloc" >&5 -echo $ECHO_N "checking for GNU libc compatible malloc... $ECHO_C" >&6 -if test "${ac_cv_func_malloc_0_nonnull+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if test "$cross_compiling" = yes; then - ac_cv_func_malloc_0_nonnull=no -else - cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#if STDC_HEADERS || HAVE_STDLIB_H -# include -#else -char *malloc (); -#endif - -int -main () -{ -exit (malloc (0) ? 0 : 1); - ; - return 0; -} -_ACEOF -rm -f conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_func_malloc_0_nonnull=yes -else - echo "$as_me: program exited with status $ac_status" >&5 -echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -( exit $ac_status ) -ac_cv_func_malloc_0_nonnull=no -fi -rm -f core core.* *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext -fi -fi -echo "$as_me:$LINENO: result: $ac_cv_func_malloc_0_nonnull" >&5 -echo "${ECHO_T}$ac_cv_func_malloc_0_nonnull" >&6 -if test $ac_cv_func_malloc_0_nonnull = yes; then - -cat >>confdefs.h <<\_ACEOF -@%:@define HAVE_MALLOC 1 -_ACEOF - -else - cat >>confdefs.h <<\_ACEOF -@%:@define HAVE_MALLOC 0 -_ACEOF - - LIB@&t@OBJS="$LIB@&t@OBJS malloc.$ac_objext" - -cat >>confdefs.h <<\_ACEOF -@%:@define malloc rpl_malloc -_ACEOF - -fi - - - - for ac_header in stdlib.h unistd.h do diff --git a/autom4te.cache/requests b/autom4te.cache/requests index f2d7826a..9f0cac67 100644 --- a/autom4te.cache/requests +++ b/autom4te.cache/requests @@ -15,96 +15,96 @@ 'configure.in' ], { - 'AC_HEADER_DIRENT' => 1, - 'AC_PROG_CC' => 1, + 'AC_STRUCT_TM' => 1, 'AC_TYPE_PID_T' => 1, - 'AC_FUNC_MALLOC' => 1, - 'AC_FUNC_MBRTOWC' => 1, - 'AC_FUNC_LSTAT' => 1, - 'AC_HEADER_TIME' => 1, - 'AH_OUTPUT' => 1, + 'AC_CANONICAL_SYSTEM' => 1, + 'm4_pattern_forbid' => 1, + 'AC_FUNC_OBSTACK' => 1, + 'AC_PROG_LEX' => 1, 'AC_FUNC_GETMNTENT' => 1, - 'AC_PROG_CPP' => 1, + 'AC_FUNC_REALLOC' => 1, + 'AC_FUNC_MEMCMP' => 1, + 'AC_FUNC_GETPGRP' => 1, + 'AC_CANONICAL_HOST' => 1, + 'AC_HEADER_DIRENT' => 1, + 'AC_PROG_AWK' => 1, + 'AC_HEADER_SYS_WAIT' => 1, + 'AM_CONDITIONAL' => 1, + 'AC_FUNC_ALLOCA' => 1, + 'AC_FUNC_MMAP' => 1, 'AC_TYPE_MODE_T' => 1, - 'm4_pattern_allow' => 1, - 'AC_PROG_YACC' => 1, + 'AC_TYPE_SIZE_T' => 1, + 'AC_C_INLINE' => 1, + 'AC_FUNC_GETGROUPS' => 1, + 'AC_FUNC_FSEEKO' => 1, + 'AM_AUTOMAKE_VERSION' => 1, + 'AC_FUNC_STRCOLL' => 1, + 'AC_INIT' => 1, + 'AC_CONFIG_SUBDIRS' => 1, + 'AM_MAINTAINER_MODE' => 1, + 'AM_PROG_CC_C_O' => 1, + 'AC_FUNC_STRFTIME' => 1, + 'AM_INIT_AUTOMAKE' => 1, + 'AC_TYPE_OFF_T' => 1, + 'AC_PROG_LN_S' => 1, 'AC_FUNC_MKTIME' => 1, - 'AC_CHECK_TYPES' => 1, - 'AC_PROG_CXX' => 1, + 'AC_PROG_LIBTOOL' => 1, + 'AC_TYPE_UID_T' => 1, + 'AC_FUNC_MALLOC' => 1, 'AC_HEADER_MAJOR' => 1, - 'AC_CHECK_FUNCS' => 1, + 'AC_FUNC_MBRTOWC' => 1, + 'AC_PROG_CPP' => 1, + 'AC_FUNC_UTIME_NULL' => 1, + 'AC_DECL_SYS_SIGLIST' => 1, 'AC_CHECK_HEADERS' => 1, - 'AC_INIT' => 1, - 'AC_STRUCT_TIMEZONE' => 1, - 'AM_MAINTAINER_MODE' => 1, - 'AC_PROG_MAKE_SET' => 1, - 'AC_FUNC_CHOWN' => 1, - 'AC_FUNC_ERROR_AT_LINE' => 1, - 'AC_CONFIG_FILES' => 1, - 'AC_CANONICAL_HOST' => 1, - 'AC_LIBSOURCE' => 1, + 'm4_include' => 1, + 'AC_HEADER_STAT' => 1, + 'AC_FUNC_GETLOADAVG' => 1, + 'AC_PROG_GCC_TRADITIONAL' => 1, + 'AC_TYPE_SIGNAL' => 1, 'AC_PROG_RANLIB' => 1, - 'AC_FUNC_MMAP' => 1, - 'AC_CHECK_MEMBERS' => 1, - 'AC_FUNC_STRTOD' => 1, - 'AM_PROG_CC_C_O' => 1, - 'AC_FUNC_CLOSEDIR_VOID' => 1, 'AC_FUNC_VPRINTF' => 1, - 'AC_PROG_LEX' => 1, - 'AC_FUNC_STAT' => 1, - 'AC_REPLACE_FNMATCH' => 1, - 'AC_STRUCT_TM' => 1, - 'AC_FUNC_STRCOLL' => 1, + 'AC_PROG_YACC' => 1, 'AC_FUNC_STRNLEN' => 1, - 'm4_include' => 1, - 'AC_CONFIG_AUX_DIR' => 1, - 'AC_FUNC_STRERROR_R' => 1, - 'AC_CANONICAL_SYSTEM' => 1, - 'AC_CHECK_LIB' => 1, - 'AC_STRUCT_ST_BLOCKS' => 1, - 'AC_PATH_X' => 1, + 'AC_FUNC_FORK' => 1, + 'AH_OUTPUT' => 1, + 'AC_STRUCT_TIMEZONE' => 1, + 'AC_HEADER_TIME' => 1, + 'AC_FUNC_STAT' => 1, 'AC_FUNC_SELECT_ARGTYPES' => 1, - 'AC_FUNC_MEMCMP' => 1, + 'AC_PROG_CC' => 1, 'include' => 1, - 'AC_C_VOLATILE' => 1, + 'AC_CHECK_MEMBERS' => 1, + 'AC_PROG_INSTALL' => 1, + 'AC_FUNC_ERROR_AT_LINE' => 1, 'AM_GNU_GETTEXT' => 1, - 'AC_DECL_SYS_SIGLIST' => 1, + 'AC_FUNC_STRTOD' => 1, + 'AC_HEADER_STDC' => 1, + 'AC_CHECK_FUNCS' => 1, + 'AC_LIBSOURCE' => 1, + 'AC_REPLACE_FNMATCH' => 1, + 'AC_CONFIG_FILES' => 1, + 'AC_CHECK_TYPES' => 1, + 'AC_CONFIG_HEADERS' => 1, + 'AC_FUNC_CLOSEDIR_VOID' => 1, + 'AC_C_CONST' => 1, + 'AC_FUNC_STRERROR_R' => 1, + 'AC_FUNC_CHOWN' => 1, 'AC_FUNC_SETPGRP' => 1, - 'AC_FUNC_OBSTACK' => 1, - 'AM_CONDITIONAL' => 1, - 'AC_FUNC_REALLOC' => 1, - 'AC_FUNC_WAIT3' => 1, - 'AC_FUNC_STRFTIME' => 1, - 'AC_SUBST' => 1, - 'AC_PROG_LIBTOOL' => 1, - 'AC_FUNC_FSEEKO' => 1, - 'AC_HEADER_STAT' => 1, - 'AC_C_INLINE' => 1, - 'AC_DEFINE_TRACE_LITERAL' => 1, - 'AC_FUNC_GETGROUPS' => 1, - 'AC_FUNC_GETLOADAVG' => 1, - 'AC_PROG_INSTALL' => 1, - 'm4_pattern_forbid' => 1, 'AC_FUNC_SETVBUF_REVERSED' => 1, - 'AC_TYPE_SIGNAL' => 1, - 'AC_PROG_GCC_TRADITIONAL' => 1, - 'AC_PROG_LN_S' => 1, - 'AM_INIT_AUTOMAKE' => 1, - 'AM_AUTOMAKE_VERSION' => 1, - 'AC_FUNC_ALLOCA' => 1, - 'AC_PROG_AWK' => 1, - 'AC_CONFIG_HEADERS' => 1, - 'AC_FUNC_GETPGRP' => 1, - 'AC_TYPE_OFF_T' => 1, - 'AC_FUNC_UTIME_NULL' => 1, - 'AC_TYPE_SIZE_T' => 1, + 'AC_CHECK_LIB' => 1, + 'AC_FUNC_WAIT3' => 1, + 'AC_PROG_MAKE_SET' => 1, 'AC_FUNC_LSTAT_FOLLOWS_SLASHED_SYMLINK' => 1, - 'AC_CONFIG_SUBDIRS' => 1, - 'AC_FUNC_FORK' => 1, - 'AC_TYPE_UID_T' => 1, - 'AC_HEADER_SYS_WAIT' => 1, - 'AC_HEADER_STDC' => 1, - 'AC_C_CONST' => 1 + 'AC_FUNC_LSTAT' => 1, + 'm4_pattern_allow' => 1, + 'AC_CONFIG_AUX_DIR' => 1, + 'AC_PROG_CXX' => 1, + 'AC_DEFINE_TRACE_LITERAL' => 1, + 'AC_C_VOLATILE' => 1, + 'AC_PATH_X' => 1, + 'AC_STRUCT_ST_BLOCKS' => 1, + 'AC_SUBST' => 1 } ], 'Request' ) ); diff --git a/autom4te.cache/traces.0 b/autom4te.cache/traces.0 index 64b184d2..542a0a61 100644 --- a/autom4te.cache/traces.0 +++ b/autom4te.cache/traces.0 @@ -823,20 +823,6 @@ m4trace:configure.in:682: -1- AH_OUTPUT([HAVE_MALLOC_H], [/* Define to 1 if you #undef HAVE_MALLOC_H]) m4trace:configure.in:682: -1- AH_OUTPUT([HAVE_STDIO_EXT_H], [/* Define to 1 if you have the header file. */ #undef HAVE_STDIO_EXT_H]) -m4trace:configure.in:684: -1- AC_FUNC_MALLOC -m4trace:configure.in:684: -1- AC_CHECK_HEADERS([stdlib.h]) -m4trace:configure.in:684: -1- AH_OUTPUT([HAVE_STDLIB_H], [/* Define to 1 if you have the header file. */ -#undef HAVE_STDLIB_H]) -m4trace:configure.in:684: -1- AC_DEFINE_TRACE_LITERAL([HAVE_MALLOC]) -m4trace:configure.in:684: -1- AH_OUTPUT([HAVE_MALLOC], [/* Define to 1 if your system has a GNU libc compatible `malloc\' function, and - to 0 otherwise. */ -#undef HAVE_MALLOC]) -m4trace:configure.in:684: -1- AC_DEFINE_TRACE_LITERAL([HAVE_MALLOC]) -m4trace:configure.in:684: -1- AC_LIBSOURCE([malloc.c]) -m4trace:configure.in:684: -1- AC_SUBST([LIB@&t@OBJS]) -m4trace:configure.in:684: -1- AC_DEFINE_TRACE_LITERAL([malloc]) -m4trace:configure.in:684: -1- AH_OUTPUT([malloc], [/* Define to rpl_malloc if the replacement function should be used. */ -#undef malloc]) m4trace:configure.in:685: -1- AC_FUNC_MMAP m4trace:configure.in:685: -1- AC_CHECK_HEADERS([stdlib.h unistd.h]) m4trace:configure.in:685: -1- AH_OUTPUT([HAVE_STDLIB_H], [/* Define to 1 if you have the header file. */ diff --git a/bashline.c b/bashline.c index 6a4963ad..6e8c8141 100644 --- a/bashline.c +++ b/bashline.c @@ -292,7 +292,7 @@ enable_hostname_completion (on_or_off) /* See if we have anything to do. */ at = strchr (rl_completer_word_break_characters, '@'); if ((at == 0 && on_or_off == 0) || (at != 0 && on_or_off != 0)) - return; + return old_value; /* We have something to do. Do it. */ nval = (char *)xmalloc (strlen (rl_completer_word_break_characters) + 1 + on_or_off); diff --git a/builtins/evalfile.c b/builtins/evalfile.c index c17e547b..c87991a7 100644 --- a/builtins/evalfile.c +++ b/builtins/evalfile.c @@ -39,6 +39,7 @@ #include "../flags.h" #include "../input.h" #include "../execute_cmd.h" +#include "../trap.h" #if defined (HISTORY) # include "../bashhist.h" diff --git a/builtins/reserved.def b/builtins/reserved.def index 0f293d39..50a942f8 100644 --- a/builtins/reserved.def +++ b/builtins/reserved.def @@ -145,9 +145,8 @@ $BUILTIN variables $DOCNAME variable_help $SHORT_DOC variables - Some variable names and meanings BASH_VERSION Version information for this Bash. -CDPATH A colon separated list of directories to search - when the argument to `cd' is not found in the current - directory. +CDPATH A colon-separated list of directories to search + for directries given as arguments to `cd'. GLOBIGNORE A colon-separated list of patterns describing filenames to be ignored by pathname expansion. #if defined (HISTORY) diff --git a/doc/FAQ-2.05b b/doc/FAQ-2.05b new file mode 100644 index 00000000..f0f3d1b6 --- /dev/null +++ b/doc/FAQ-2.05b @@ -0,0 +1,1771 @@ +This is the Bash FAQ, version 3.26, for Bash version 2.05b. + +This document contains a set of frequently-asked questions concerning +Bash, the GNU Bourne-Again Shell. Bash is a freely-available command +interpreter with advanced features for both interactive use and shell +programming. + +Another good source of basic information about shells is the collection +of FAQ articles periodically posted to comp.unix.shell. + +Questions and comments concerning this document should be sent to +chet@po.cwru.edu. + +This document is available for anonymous FTP with the URL + +ftp://ftp.cwru.edu/pub/bash/FAQ + +The Bash home page is http://cnswww.cns.cwru.edu/~chet/bash/bashtop.html + +---------- +Contents: + +Section A: The Basics + +A1) What is it? +A2) What's the latest version? +A3) Where can I get it? +A4) On what machines will bash run? +A5) Will bash run on operating systems other than Unix? +A6) How can I build bash with gcc? +A7) How can I make bash my login shell? +A8) I just changed my login shell to bash, and now I can't FTP into my + machine. Why not? +A9) What's the `POSIX Shell and Utilities standard'? +A10) What is the bash `posix mode'? + +Section B: The latest version + +B1) What's new in version 2.05b? +B2) Are there any user-visible incompatibilities between bash-2.05b and + bash-1.14.7? + +Section C: Differences from other Unix shells + +C1) How does bash differ from sh, the Bourne shell? +C2) How does bash differ from the Korn shell, version ksh88? +C3) Which new features in ksh-93 are not in bash, and which are? + +Section D: Why does bash do some things differently than other Unix shells? + +D1) Why does bash run a different version of `command' than + `which command' says it will? +D2) Why doesn't bash treat brace expansions exactly like csh? +D3) Why doesn't bash have csh variable modifiers? +D4) How can I make my csh aliases work when I convert to bash? +D5) How can I pipe standard output and standard error from one command to + another, like csh does with `|&'? +D6) Now that I've converted from ksh to bash, are there equivalents to + ksh features like autoloaded functions and the `whence' command? + +Section E: Why does bash do certain things the way it does? + +E1) Why is the bash builtin `test' slightly different from /bin/test? +E2) Why does bash sometimes say `Broken pipe'? +E3) When I have terminal escape sequences in my prompt, why does bash + wrap lines at the wrong column? +E4) If I pipe the output of a command into `read variable', why doesn't + the output show up in $variable when the read command finishes? +E5) I have a bunch of shell scripts that use backslash-escaped characters + in arguments to `echo'. Bash doesn't interpret these characters. Why + not, and how can I make it understand them? +E6) Why doesn't a while or for loop get suspended when I type ^Z? +E7) What about empty for loops in Makefiles? +E8) Why does the arithmetic evaluation code complain about `08'? +E9) Why does the pattern matching expression [A-Z]* match files beginning + with every letter except `z'? +E10) Why does `cd //' leave $PWD as `//'? +E11) If I resize my xterm while another program is running, why doesn't bash + notice the change? +E12) Why don't negative offsets in substring expansion work like I expect? + +Section F: Things to watch out for on certain Unix versions + +F1) Why can't I use command line editing in my `cmdtool'? +F2) I built bash on Solaris 2. Why do globbing expansions and filename + completion chop off the first few characters of each filename? +F3) Why does bash dump core after I interrupt username completion or + `~user' tilde expansion on a machine running NIS? +F4) I'm running SVR4.2. Why is the line erased every time I type `@'? +F5) Why does bash report syntax errors when my C News scripts use a + redirection before a subshell command? +F6) Why can't I use vi-mode editing on Red Hat Linux 6.1? +F7) Why do bash-2.05a and bash-2.05b fail to compile `printf.def' on + HP/UX 11.x? + +Section G: How can I get bash to do certain common things? + +G1) How can I get bash to read and display eight-bit characters? +G2) How do I write a function `x' to replace builtin command `x', but + still invoke the command from within the function? +G3) How can I find the value of a shell variable whose name is the value + of another shell variable? +G4) How can I make the bash `time' reserved word print timing output that + looks like the output from my system's /usr/bin/time? +G5) How do I get the current directory into my prompt? +G6) How can I rename "*.foo" to "*.bar"? +G7) How can I translate a filename from uppercase to lowercase? +G8) How can I write a filename expansion (globbing) pattern that will match + all files in the current directory except "." and ".."? + +Section H: Where do I go from here? + +H1) How do I report bugs in bash, and where should I look for fixes and + advice? +H2) What kind of bash documentation is there? +H3) What's coming in future versions? +H4) What's on the bash `wish list'? +H5) When will the next release appear? + +---------- +Section A: The Basics + +A1) What is it? + +Bash is a Unix command interpreter (shell). It is an implementation of +the Posix 1003.2 shell standard, and resembles the Korn and System V +shells. + +Bash contains a number of enhancements over those shells, both +for interactive use and shell programming. Features geared +toward interactive use include command line editing, command +history, job control, aliases, and prompt expansion. Programming +features include additional variable expansions, shell +arithmetic, and a number of variables and options to control +shell behavior. + +Bash was originally written by Brian Fox of the Free Software +Foundation. The current developer and maintainer is Chet Ramey +of Case Western Reserve University. + +A2) What's the latest version? + +The latest version is 2.05b, first made available on Wednesday, 17 +July, 2002. + +A3) Where can I get it? + +Bash is the GNU project's shell, and so is available from the +master GNU archive site, ftp.gnu.org, and its mirrors. The +latest version is also available for FTP from ftp.cwru.edu. +The following URLs tell how to get version 2.05b: + +ftp://ftp.gnu.org/pub/gnu/bash/bash-2.05b.tar.gz +ftp://ftp.cwru.edu/pub/bash/bash-2.05b.tar.gz + +Formatted versions of the documentation are available with the URLs: + +ftp://ftp.gnu.org/pub/gnu/bash/bash-doc-2.05b.tar.gz +ftp://ftp.cwru.edu/pub/bash/bash-doc-2.05b.tar.gz + +A4) On what machines will bash run? + +Bash has been ported to nearly every version of UNIX. All you +should have to do to build it on a machine for which a port +exists is to type `configure' and then `make'. The build process +will attempt to discover the version of UNIX you have and tailor +itself accordingly, using a script created by GNU autoconf. + +More information appears in the file `INSTALL' in the distribution. + +The Bash web page (http://cnswww.cns.cwru.edu/~chet/bash/bashtop.html) +explains how to obtain binary versions of bash for most of the major +commercial Unix systems. + +A5) Will bash run on operating systems other than Unix? + +Configuration specifics for Unix-like systems such as QNX and +LynxOS are included in the distribution. Bash-2.05 and later +versions should compile and run on Minix 2.0 (patches were +contributed), but I don't believe anyone has built bash-2.x on +earlier Minix versions yet. + +Bash has been ported to versions of Windows implementing the Win32 +programming interface. This includes Windows 95 and Windows NT. +The port was done by Cygnus Solutions as part of their CYGWIN +project. For more information about the project, look at the URLs + +http://www.cygwin.com/ +http://sourceware.cygnus.com/cygwin + +Cygnus originally ported bash-1.14.7, and that port was part of their +early GNU-Win32 (the original name) releases. Cygnus has also done a +port of bash-2.05 to the CYGWIN environment, and it is available as +part of their current release. + +Bash-2.05b should require no local Cygnus changes to build and run under +CYGWIN. + +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 + +DJ Delorie has a port of bash-2.x which runs under MS-DOS, as part +of the DJGPP project. For more information on the project, see + +http://www.delorie.com/djgpp/ + +I have been told that the original DJGPP port was done by Daisuke Aoyama. + +Mark Elbrecht has sent me notice that bash-2.04 +is available for DJGPP V2. The files are available as: + +ftp://ftp.simtel.net/pub/simtelnet/gnu/djgpp/v2gnu/bsh204b.zip binary +ftp://ftp.simtel.net/pub/simtelnet/gnu/djgpp/v2gnu/bsh204d.zip documentation +ftp://ftp.simtel.net/pub/simtelnet/gnu/djgpp/v2gnu/bsh204s.zip source + +Mark has begun to work with bash-2.05, but I don't know the status. + +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. + +I have received word that Bash (I'm not sure which version, but I +believe that it's at least bash-2.02.1) is the standard shell on +BeOS. + +A6) How can I build bash with gcc? + +Bash configures to use gcc by default if it is available. Read the +file INSTALL in the distribution for more information. + +A7) How can I make bash my login shell? + +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 +you need to perform some tricks. The basic idea is to add a command +to your login shell's startup file to replace your login shell with +bash. + +For example, if your login shell is csh or tcsh, and you have installed +bash in /usr/gnu/bin/bash, add the following line to ~/.login: + + if ( -f /usr/gnu/bin/bash ) exec /usr/gnu/bin/bash --login + +(the `--login' tells bash that it is a login shell). + +It's not a good idea to put this command into ~/.cshrc, because every +csh you run without the `-f' option, even ones started to run csh scripts, +reads that file. If you must put the command in ~/.cshrc, use something +like + + if ( $?prompt ) exec /usr/gnu/bin/bash --login + +to ensure that bash is exec'd only when the csh is interactive. + +If your login shell is sh or ksh, you have to do two things. + +First, create an empty file in your home directory named `.bash_profile'. +The existence of this file will prevent the exec'd bash from trying to +read ~/.profile, and re-execing itself over and over again. ~/.bash_profile +is the first file bash tries to read initialization commands from when +it is invoked as a login shell. + +Next, add a line similar to the above to ~/.profile: + + [ -f /usr/gnu/bin/bash ] && [ -x /usr/gnu/bin/bash ] && \ + exec /usr/gnu/bin/bash --login + +This will cause login shells to replace themselves with bash running as +a login shell. Once you have this working, you can copy your initialization +code from ~/.profile to ~/.bash_profile. + +I have received word that the recipe supplied above is insufficient for +machines running CDE. CDE has a maze of twisty little startup files, all +slightly different. + +If you cannot change your login shell in the password file to bash, you +will have to (apparently) live with CDE using the shell in the password +file to run its startup scripts. If you have changed your shell to bash, +there is code in the CDE startup files (on Solaris, at least) that attempts +to do the right thing. It is, however, often broken, and may require that +you use the $BASH_ENV trick described below. + +`dtterm' claims to use $SHELL as the default program to start, so if you +can change $SHELL in the CDE startup files, you should be able to use bash +in your terminal windows. + +Setting DTSOURCEPROFILE in ~/.dtprofile will cause the `Xsession' program +to read your login shell's startup files. You may be able to use bash for +the rest of the CDE programs by setting SHELL to bash in ~/.dtprofile as +well, but I have not tried this. + +You can use the above `exec' recipe to start bash when not logging in with +CDE by testing the value of the DT variable: + + if [ -n "$DT" ]; then + [ -f /usr/gnu/bin/bash ] && exec /usr/gnu/bin/bash --login + fi + +If CDE starts its shells non-interactively during login, the login shell +startup files (~/.profile, ~/.bash_profile) will not be sourced at login. +To get around this problem, append a line similar to the following to your +~/.dtprofile: + + BASH_ENV=${HOME}/.bash_profile ; export BASH_ENV + +and add the following line to the beginning of ~/.bash_profile: + + unset BASH_ENV + +A8) I just changed my login shell to bash, and now I can't FTP into my + machine. Why not? + +You must add the full pathname to bash to the file /etc/shells. As +noted in the answer to the previous question, many systems require +this before you can make bash your login shell. + +Most versions of ftpd use this file to prohibit `special' users +such as `uucp' and `news' from using FTP. + +A9) What's the `POSIX Shell and Utilities standard'? + +POSIX is a name originally coined by Richard Stallman for a +family of open system standards based on UNIX. There are a +number of aspects of UNIX under consideration for +standardization, from the basic system services at the system +call and C library level to applications and tools to system +administration and management. Each area of standardization is +assigned to a working group in the 1003 series. + +The POSIX Shell and Utilities standard was originally developed by +IEEE Working Group 1003.2 (POSIX.2). Today it has been merged with +the original 1003.1 Working Group and is maintained by the Austin +Group (a joint working group of the IEEE, The Open Group and +ISO/IEC SC22/WG15). Today the Shell and Utilities are a volume +within the set of documents that make up IEEE Std 1003.1-2001, and +thus now the former POSIX.2 (from 1992) is now part of the current +POSIX.1 standard (POSIX 1003.1-2001). + +The Shell and Utilities volume concentrates on the command +interpreter interface and utility programs commonly executed from +the command line or by other programs. The standard is freely +available on the web at http://www.UNIX-systems.org/version3/ . +Work continues at the Austin Group on maintenance issues; see +http://www.opengroup.org/austin/ to join the discussions. + +Bash is concerned with the aspects of the shell's behavior defined +by the POSIX Shell and Utilities volume. The shell command +language has of course been standardized, including the basic flow +control and program execution constructs, I/O redirection and +pipelining, argument handling, variable expansion, and quoting. + +The `special' builtins, which must be implemented as part of the +shell to provide the desired functionality, are specified as +being part of the shell; examples of these are `eval' and +`export'. Other utilities appear in the sections of POSIX not +devoted to the shell which are commonly (and in some cases must +be) implemented as builtin commands, such as `read' and `test'. +POSIX also specifies aspects of the shell's interactive +behavior as part of the UPE, including job control and command +line editing. Only vi-style line editing commands have been +standardized; emacs editing commands were left out due to +objections. + +The latest version of the POSIX Shell and Utilities standard is +available (now updated to the 2003 Edition incorporating the +Technical Corrigendum 1), as part of the Single UNIX Specification +Version 3 at + +http://www.UNIX-systems.org/version3/ + +A10) What is the bash `posix mode'? + +Although bash is an implementation of the POSIX shell +specification, there are areas where the bash default behavior +differs from that spec. The bash `posix mode' changes the bash +behavior in these areas so that it obeys the spec more closely. + +Posix mode is entered by starting bash with the --posix or +'-o posix' option or executing `set -o posix' after bash is running. + +The specific aspects of bash which change when posix mode is +active are listed in the file POSIX in the bash distribution. +They are also listed in a section in the Bash Reference Manual +(from which that file is generated). + +Section B: The latest version + +B1) What's new in version 2.05b? + +The raison d'etre for bash-2.05b is to make a second intermediate +release containing the first of the new features to be available +in bash-3.0 and get feedback on those features before proceeding. +The major new feature is multibyte character support in both Bash +and Readline. + +Bash-2.05b contains the following new features (see the manual page for +complete descriptions and the CHANGES and NEWS files in the bash-2.05b +distribution): + +o support for multibyte characters has been added to both bash and readline + +o the DEBUG trap is now run *before* simple commands, ((...)) commands, + [[...]] conditional commands, and for ((...)) loops + +o the shell now performs arithmetic in the largest integer size the machine + supports (intmax_t) + +o there is a new \D{...} prompt expansion; passes the `...' to strftime(3) + and inserts the result into the expanded prompt + +o there is a new `here-string' redirection operator: <<< word + +o when displaying variables, function attributes and definitions are shown + separately, allowing them to be re-used as input (attempting to re-use + the old output would result in syntax errors). + +o `read' has a new `-u fd' option to read from a specified file descriptor + +o the bash debugger in examples/bashdb has been modified to work with the + new DEBUG trap semantics, the command set has been made more gdb-like, + and the changes to $LINENO make debugging functions work better + +o the expansion of $LINENO inside a shell function is only relative to the + function start if the shell is interactive -- if the shell is running a + script, $LINENO expands to the line number in the script. This is as + POSIX-2001 requires + + +A short feature history dating from Bash-2.0: + +Bash-2.05a introduced the following new features: + +o The `printf' builtin has undergone major work + +o There is a new read-only `shopt' option: login_shell, which is set by + login shells and unset otherwise + +o New `\A' prompt string escape sequence; expanding to time in 24-hour + HH:MM format + +o New `-A group/-g' option to complete and compgen; goes group name + completion + +o New [+-]O invocation option to set and unset `shopt' options at startup + +o ksh-like `ERR' trap + +o `for' loops now allow empty word lists after the `in' reserved word + +o new `hard' and `soft' arguments for the `ulimit' builtin + +o Readline can be configured to place the user at the same point on the line + when retrieving commands from the history list + +o Readline can be configured to skip `hidden' files (filenames with a leading + `.' on Unix) when performing completion + +Bash-2.05 introduced the following new features: + +o This version has once again reverted to using locales and strcoll(3) when + processing pattern matching bracket expressions, as POSIX requires. +o Added a new `--init-file' invocation argument as a synonym for `--rcfile', + per the new GNU coding standards. +o The /dev/tcp and /dev/udp redirections now accept service names as well as + port numbers. +o `complete' and `compgen' now take a `-o value' option, which controls some + of the aspects of that compspec. Valid values are: + + default - perform bash default completion if programmable + completion produces no matches + dirnames - perform directory name completion if programmable + completion produces no matches + filenames - tell readline that the compspec produces filenames, + so it can do things like append slashes to + directory names and suppress trailing spaces +o A new loadable builtin, realpath, which canonicalizes and expands symlinks + in pathname arguments. +o When `set' is called without options, it prints function defintions in a + way that allows them to be reused as input. This affects `declare' and + `declare -p' as well. This only happens when the shell is not in POSIX + mode, since POSIX.2 forbids this behavior. + +Bash-2.04 introduced the following new features: + +o Programmable word completion with the new `complete' and `compgen' builtins; + examples are provided in examples/complete/complete-examples +o `history' has a new `-d' option to delete a history entry +o `bind' has a new `-x' option to bind key sequences to shell commands +o The prompt expansion code has new `\j' and `\l' escape sequences +o The `no_empty_cmd_completion' shell option, if enabled, inhibits + command completion when TAB is typed on an empty line +o `help' has a new `-s' option to print a usage synopsis +o New arithmetic operators: var++, var--, ++var, --var, expr1,expr2 (comma) +o New ksh93-style arithmetic for command: + for ((expr1 ; expr2; expr3 )); do list; done +o `read' has new options: `-t', `-n', `-d', `-s' +o The redirection code handles several filenames specially: /dev/fd/N, + /dev/stdin, /dev/stdout, /dev/stderr +o The redirection code now recognizes /dev/tcp/HOST/PORT and + /dev/udp/HOST/PORT and tries to open a TCP or UDP socket, respectively, + to the specified port on the specified host +o The ${!prefix*} expansion has been implemented +o A new FUNCNAME variable, which expands to the name of a currently-executing + function +o The GROUPS variable is no longer readonly +o A new shopt `xpg_echo' variable, to control the behavior of echo with + respect to backslash-escape sequences at runtime +o The NON_INTERACTIVE_LOGIN_SHELLS #define has returned + +The version of Readline released with Bash-2.04, Readline-4.1, had several +new features as well: + +o Parentheses matching is always compiled into readline, and controllable + with the new `blink-matching-paren' variable +o The history-search-forward and history-search-backward functions now leave + point at the end of the line when the search string is empty, like + reverse-search-history, and forward-search-history +o A new function for applications: rl_on_new_line_with_prompt() +o New variables for applications: rl_already_prompted, and rl_gnu_readline_p + + +Bash-2.03 had very few new features, in keeping with the convention +that odd-numbered releases provide mainly bug fixes. A number of new +features were added to Readline, mostly at the request of the Cygnus +folks. + +A new shopt option, `restricted_shell', so that startup files can test + whether or not the shell was started in restricted mode +Filename generation is now performed on the words between ( and ) in + compound array assignments (this is really a bug fix) +OLDPWD is now auto-exported, as POSIX.2 requires +ENV and BASH_ENV are read-only variables in a restricted shell +Bash may now be linked against an already-installed Readline library, + as long as the Readline library is version 4 or newer +All shells begun with the `--login' option will source the login shell + startup files, even if the shell is not interactive + +There were lots of changes to the version of the Readline library released +along with Bash-2.03. For a complete list of the changes, read the file +CHANGES in the Bash-2.03 distribution. + +Bash-2.02 contained the following new features: + +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 $(, &>, >|, <<<, [n]<&word-, [n]>&word- + prompt string special char translation and variable expansion + auto-export of variables in initial environment + command search finds functions before builtins + bash return builtin will exit a file sourced with `.' + builtins: cd -/-L/-P, exec -l/-c/-a, echo -e/-E, hash -d/-l/-p/-t. + export -n/-f/-p/name=value, pwd -L/-P, + read -e/-p/-a/-t/-n/-d/-s/-u, + readonly -a/-f/name=value, trap -l, set +o, + set -b/-m/-o option/-h/-p/-B/-C/-H/-P, + unset -f/-v, ulimit -m/-p/-u, + type -a/-p/-t/-f/-P, suspend -f, kill -n, + test -o optname/s1 == s2/s1 < s2/s1 > s2/-nt/-ot/-ef/-O/-G/-S + bash reads ~/.bashrc for interactive shells, $ENV for non-interactive + bash restricted shell mode is more extensive + bash allows functions and variables with the same name + brace expansion + tilde expansion + arithmetic expansion with $((...)) and `let' builtin + the `[[...]]' extended conditional command + process substitution + aliases and alias/unalias builtins + local variables in functions and `local' builtin + readline and command-line editing with programmable completion + command history and history/fc builtins + csh-like history expansion + other new bash builtins: bind, command, compgen, complete, builtin, + declare/typeset, dirs, enable, fc, help, + history, logout, popd, pushd, disown, shopt, + printf + exported functions + filename generation when using output redirection (command >a*) + POSIX.2-style globbing character classes + POSIX.2-style globbing equivalence classes + POSIX.2-style globbing collating symbols + egrep-like extended pattern matching operators + case-insensitive pattern matching and globbing + variable assignments preceding commands affect only that command, + even for builtins and functions + posix mode + redirection to /dev/fd/N, /dev/stdin, /dev/stdout, /dev/stderr, + /dev/tcp/host/port, /dev/udp/host/port + +Things sh has that bash does not: + uses variable SHACCT to do shell accounting + includes `stop' builtin (bash can use alias stop='kill -s STOP') + `newgrp' builtin + turns on job control if called as `jsh' + $TIMEOUT (like bash $TMOUT) + `^' is a synonym for `|' + new SVR4.2 sh builtins: mldmode, priv + +Implementation differences: + redirection to/from compound commands causes sh to create a subshell + bash does not allow unbalanced quotes; sh silently inserts them at EOF + bash does not mess with signal 11 + sh sets (euid, egid) to (uid, gid) if -p not supplied and uid < 100 + bash splits only the results of expansions on IFS, using POSIX.2 + field splitting rules; sh splits all words on IFS + sh does not allow MAILCHECK to be unset (?) + sh does not allow traps on SIGALRM or SIGCHLD + bash allows multiple option arguments when invoked (e.g. -x -v); + sh allows only a single option argument (`sh -x -v' attempts + to open a file named `-v', and, on SunOS 4.1.4, dumps core. + On Solaris 2.4 and earlier versions, sh goes into an infinite + loop.) + sh exits a script if any builtin fails; bash exits only if one of + the POSIX.2 `special' builtins fails + +C2) How does bash differ from the Korn shell, version ksh88? + +Things bash has or uses that ksh88 does not: + long invocation options + [-+]O invocation option + -l invocation option + `!' reserved word + arithmetic for command: for ((expr1 ; expr2; expr3 )); do list; done + arithmetic in largest machine-supported size (intmax_t) + posix mode and posix conformance + command hashing + tilde expansion for assignment statements that look like $PATH + process substitution with named pipes if /dev/fd is not available + the ${!param} indirect parameter expansion operator + the ${!param*} prefix expansion operator + the ${param:offset[:length]} parameter substring operator + the ${param/pat[/string]} parameter pattern substitution operator + variables: BASH, BASH_VERSION, BASH_VERSINFO, UID, EUID, SHLVL, + TIMEFORMAT, HISTCMD, HOSTTYPE, OSTYPE, MACHTYPE, + HISTFILESIZE, HISTIGNORE, HISTCONTROL, PROMPT_COMMAND, + IGNOREEOF, FIGNORE, INPUTRC, HOSTFILE, DIRSTACK, + PIPESTATUS, HOSTNAME, OPTERR, SHELLOPTS, GLOBIGNORE, + GROUPS, FUNCNAME, histchars, auto_resume + prompt expansion with backslash escapes and command substitution + redirection: &> (stdout and stderr), <<<, [n]<&word-, [n]>&word- + more extensive and extensible editing and programmable completion + builtins: bind, builtin, command, declare, dirs, echo -e/-E, enable, + exec -l/-c/-a, fc -s, export -n/-f/-p, hash, help, history, + jobs -x/-r/-s, kill -s/-n/-l, local, logout, popd, pushd, + read -e/-p/-a/-t/-n/-d/-s, readonly -a/-n/-f/-p, + set -o braceexpand/-o histexpand/-o interactive-comments/ + -o notify/-o physical/-o posix/-o hashall/-o onecmd/ + -h/-B/-C/-b/-H/-P, set +o, suspend, trap -l, type, + typeset -a/-F/-p, ulimit -u, umask -S, alias -p, shopt, + disown, printf, complete, compgen + `!' csh-style history expansion + POSIX.2-style globbing character classes + POSIX.2-style globbing equivalence classes + POSIX.2-style globbing collating symbols + egrep-like extended pattern matching operators + case-insensitive pattern matching and globbing + `**' arithmetic operator to do exponentiation + redirection to /dev/fd/N, /dev/stdin, /dev/stdout, /dev/stderr + arrays of unlimited size + TMOUT is default timeout for `read' and `select' + +Things ksh88 has or uses that bash does not: + tracked aliases (alias -t) + variables: ERRNO, FPATH, EDITOR, VISUAL + co-processes (|&, >&p, <&p) + weirdly-scoped functions + typeset +f to list all function names without definitions + text of command history kept in a file, not memory + builtins: alias -x, cd old new, fc -e -, newgrp, print, + read -p/-s/var?prompt, set -A/-o gmacs/ + -o bgnice/-o markdirs/-o nolog/-o trackall/-o viraw/-s, + typeset -H/-L/-R/-Z/-A/-ft/-fu/-fx/-l/-u/-t, whence + using environment to pass attributes of exported variables + arithmetic evaluation done on arguments to some builtins + reads .profile from $PWD when invoked as login shell + +Implementation differences: + ksh runs last command of a pipeline in parent shell context + bash has brace expansion by default (ksh88 compile-time option) + bash has fixed startup file for all interactive shells; ksh reads $ENV + bash has exported functions + bash command search finds functions before builtins + bash waits for all commands in pipeline to exit before returning status + emacs-mode editing has some slightly different key bindings + +C3) Which new features in ksh-93 are not in bash, and which are? + +New things in ksh-93 not in bash-2.05b: + associative arrays + floating point arithmetic and variables + math library functions + ${!name[sub]} name of subscript for associative array + `.' is allowed in variable names to create a hierarchical namespace + more extensive compound assignment syntax + discipline functions + `sleep' and `getconf' builtins (bash has loadable versions) + typeset -n and `nameref' variables + KEYBD trap + variables: .sh.edchar, .sh.edmode, .sh.edcol, .sh.edtext, .sh.version, + .sh.name, .sh.subscript, .sh.value, .sh.match, HISTEDIT + backreferences in pattern matching (\N) + `&' operator in pattern lists for matching + print -f (bash uses printf) + `fc' has been renamed to `hist' + `.' can execute shell functions + exit statuses between 0 and 255 + set -o pipefail + `+=' variable assignment operator + FPATH and PATH mixing + getopts -a + -I invocation option + DEBUG trap now executed before each simple command, instead of after + printf %H, %P, %T, %Z modifiers, output base for %d + lexical scoping for local variables in `ksh' functions + no scoping for local variables in `POSIX' functions + +New things in ksh-93 present in bash-2.05b: + [n]<&word- and [n]>&word- redirections (combination dup and close) + for (( expr1; expr2; expr3 )) ; do list; done - arithmetic for command + ?:, ++, --, `expr1 , expr2' arithmetic operators + expansions: ${!param}, ${param:offset[:len]}, ${param/pat[/str]}, + ${!param*} + compound array assignment + the `!' reserved word + loadable builtins -- but ksh uses `builtin' while bash uses `enable' + `command', `builtin', `disown' builtins + new $'...' and $"..." quoting + FIGNORE (but bash uses GLOBIGNORE), HISTCMD + set -o notify/-C + changes to kill builtin + read -A (bash uses read -a) + read -t/-d + trap -p + exec -c/-a + `.' restores the positional parameters when it completes + POSIX.2 `test' + umask -S + unalias -a + command and arithmetic substitution performed on PS1, PS4, and ENV + command name completion + ENV processed only for interactive shells + +Section D: Why does bash do some things differently than other Unix shells? + +D1) Why does bash run a different version of `command' than + `which command' says it will? + +On many systems, `which' is actually a csh script that assumes +you're running csh. In tcsh, `which' and its cousin `where' +are builtins. On other Unix systems, `which' is a perl script +that uses the PATH environment variable. + +The csh script version reads the csh startup files from your +home directory and uses those to determine which `command' will +be invoked. Since bash doesn't use any of those startup files, +there's a good chance that your bash environment differs from +your csh environment. The bash `type' builtin does everything +`which' does, and will report correct results for the running +shell. If you're really wedded to the name `which', try adding +the following function definition to your .bashrc: + + which() + { + builtin type "$@" + } + +If you're moving from tcsh and would like to bring `where' along +as well, use this function: + + where() + { + builtin type -a "$@" + } + +D2) Why doesn't bash treat brace expansions exactly like csh? + +The only difference between bash and csh brace expansion is that +bash requires a brace expression to contain at least one unquoted +comma if it is to be expanded. Any brace-surrounded word not +containing an unquoted comma is left unchanged by the brace +expansion code. This affords the greatest degree of sh +compatibility. + +Bash, ksh, zsh, and pd-ksh all implement brace expansion this way. + +D3) Why doesn't bash have csh variable modifiers? + +Posix has specified a more powerful, albeit somewhat more cryptic, +mechanism cribbed from ksh, and bash implements it. + +${parameter%word} + Remove smallest suffix pattern. The WORD is expanded to produce + a pattern. It then expands to the value of PARAMETER, with the + smallest portion of the suffix matched by the pattern deleted. + + x=file.c + echo ${x%.c}.o + -->file.o + +${parameter%%word} + + Remove largest suffix pattern. The WORD is expanded to produce + a pattern. It then expands to the value of PARAMETER, with the + largest portion of the suffix matched by the pattern deleted. + + x=posix/src/std + echo ${x%%/*} + -->posix + +${parameter#word} + Remove smallest prefix pattern. The WORD is expanded to produce + a pattern. It then expands to the value of PARAMETER, with the + smallest portion of the prefix matched by the pattern deleted. + + x=$HOME/src/cmd + echo ${x#$HOME} + -->/src/cmd + +${parameter##word} + Remove largest prefix pattern. The WORD is expanded to produce + a pattern. It then expands to the value of PARAMETER, with the + largest portion of the prefix matched by the pattern deleted. + + x=/one/two/three + echo ${x##*/} + -->three + + +Given + a=/a/b/c/d + b=b.xxx + + csh bash result + --- ---- ------ + $a:h ${a%/*} /a/b/c + $a:t ${a##*/} d + $b:r ${b%.*} b + $b:e ${b##*.} xxx + + +D4) How can I make my csh aliases work when I convert to bash? + +Bash uses a different syntax to support aliases than csh does. +The details can be found in the documentation. We have provided +a shell script which does most of the work of conversion for you; +this script can be found in ./examples/misc/aliasconv.sh. Here is +how you use it: + +Start csh in the normal way for you. (e.g., `csh') + +Pipe the output of `alias' through `aliasconv.sh', saving the +results into `bash_aliases': + + alias | bash aliasconv.sh >bash_aliases + +Edit `bash_aliases', carefully reading through any created +functions. You will need to change the names of some csh specific +variables to the bash equivalents. The script converts $cwd to +$PWD, $term to $TERM, $home to $HOME, $user to $USER, and $prompt +to $PS1. You may also have to add quotes to avoid unwanted +expansion. + +For example, the csh alias: + + alias cd 'cd \!*; echo $cwd' + +is converted to the bash function: + + cd () { command cd "$@"; echo $PWD ; } + +The only thing that needs to be done is to quote $PWD: + + cd () { command cd "$@"; echo "$PWD" ; } + +Merge the edited file into your ~/.bashrc. + +There is an additional, more ambitious, script in +examples/misc/cshtobash that attempts to convert your entire csh +environment to its bash equivalent. This script can be run as +simply `cshtobash' to convert your normal interactive +environment, or as `cshtobash ~/.login' to convert your login +environment. + +D5) How can I pipe standard output and standard error from one command to + another, like csh does with `|&'? + +Use + command 2>&1 | command2 + +The key is to remember that piping is performed before redirection, so +file descriptor 1 points to the pipe when it is duplicated onto file +descriptor 2. + +D6) Now that I've converted from ksh to bash, are there equivalents to + ksh features like autoloaded functions and the `whence' command? + +There are features in ksh-88 and ksh-93 that do not have direct bash +equivalents. Most, however, can be emulated with very little trouble. + +ksh-88 feature Bash equivalent +-------------- --------------- +compiled-in aliases set up aliases in .bashrc; some ksh aliases are + bash builtins (hash, history, type) +coprocesses named pipe pairs (one for read, one for write) +typeset +f declare -F +cd, print, whence function substitutes in examples/functions/kshenv +autoloaded functions examples/functions/autoload is the same as typeset -fu +read var?prompt read -p prompt var + +ksh-93 feature Bash equivalent +-------------- --------------- +sleep, getconf Bash has loadable versions in examples/loadables +${.sh.version} $BASH_VERSION +print -f printf +hist alias hist=fc +$HISTEDIT $FCEDIT + +Section E: How can I get bash to do certain things, and why does bash do + things the way it does? + +E1) Why is the bash builtin `test' slightly different from /bin/test? + +The specific example used here is [ ! x -o x ], which is false. + +Bash's builtin `test' implements the Posix.2 spec, which can be +summarized as follows (the wording is due to David Korn): + +Here is the set of rules for processing test arguments. + + 0 Args: False + 1 Arg: True iff argument is not null. + 2 Args: If first arg is !, True iff second argument is null. + If first argument is unary, then true if unary test is true + Otherwise error. + 3 Args: If second argument is a binary operator, do binary test of $1 $3 + If first argument is !, negate two argument test of $2 $3 + If first argument is `(' and third argument is `)', do the + one-argument test of the second argument. + Otherwise error. + 4 Args: If first argument is !, negate three argument test of $2 $3 $4. + Otherwise unspecified + 5 or more Args: unspecified. (Historical shells would use their + current algorithm). + +The operators -a and -o are considered binary operators for the purpose +of the 3 Arg case. + +As you can see, the test becomes (not (x or x)), which is false. + +E2) Why does bash sometimes say `Broken pipe'? + +If a sequence of commands appears in a pipeline, and one of the +reading commands finishes before the writer has finished, the +writer receives a SIGPIPE signal. Many other shells special-case +SIGPIPE as an exit status in the pipeline and do not report it. +For example, in: + + ps -aux | head + +`head' can finish before `ps' writes all of its output, and ps +will try to write on a pipe without a reader. In that case, bash +will print `Broken pipe' to stderr when ps is killed by a +SIGPIPE. + +You can build a version of bash that will not report SIGPIPE errors +by uncommenting the definition of DONT_REPORT_SIGPIPE in the file +config-top.h. + +E3) When I have terminal escape sequences in my prompt, why does bash + wrap lines at the wrong column? + +Readline, the line editing library that bash uses, does not know +that the terminal escape sequences do not take up space on the +screen. The redisplay code assumes, unless told otherwise, that +each character in the prompt is a `printable' character that +takes up one character position on the screen. + +You can use the bash prompt expansion facility (see the PROMPTING +section in the manual page) to tell readline that sequences of +characters in the prompt strings take up no screen space. + +Use the \[ escape to begin a sequence of non-printing characters, +and the \] escape to signal the end of such a sequence. + +E4) If I pipe the output of a command into `read variable', why doesn't + the output show up in $variable when the read command finishes? + +This has to do with the parent-child relationship between Unix +processes. It affects all commands run in pipelines, not just +simple calls to `read'. For example, piping a command's output +into a `while' loop that repeatedly calls `read' will result in +the same behavior. + +Each element of a pipeline runs in a separate process, a child of +the shell running the pipeline. A subprocess cannot affect its +parent's environment. When the `read' command sets the variable +to the input, that variable is set only in the subshell, not the +parent shell. When the subshell exits, the value of the variable +is lost. + +Many pipelines that end with `read variable' can be converted +into command substitutions, which will capture the output of +a specified command. The output can then be assigned to a +variable: + + grep ^gnu /usr/lib/news/active | wc -l | read ngroup + +can be converted into + + ngroup=$(grep ^gnu /usr/lib/news/active | wc -l) + +This does not, unfortunately, work to split the text among +multiple variables, as read does when given multiple variable +arguments. If you need to do this, you can either use the +command substitution above to read the output into a variable +and chop up the variable using the bash pattern removal +expansion operators or use some variant of the following +approach. + +Say /usr/local/bin/ipaddr is the following shell script: + +#! /bin/sh +host `hostname` | awk '/address/ {print $NF}' + +Instead of using + + /usr/local/bin/ipaddr | read A B C D + +to break the local machine's IP address into separate octets, use + + OIFS="$IFS" + IFS=. + set -- $(/usr/local/bin/ipaddr) + IFS="$OIFS" + A="$1" B="$2" C="$3" D="$4" + +Beware, however, that this will change the shell's positional +parameters. If you need them, you should save them before doing +this. + +This is the general approach -- in most cases you will not need to +set $IFS to a different value. + +Some other user-supplied alternatives include: + +read A B C D << HERE + $(IFS=.; echo $(/usr/local/bin/ipaddr)) +HERE + +and, where process substitution is available, + +read A B C D < <(IFS=.; echo $(/usr/local/bin/ipaddr)) + +E5) I have a bunch of shell scripts that use backslash-escaped characters + in arguments to `echo'. Bash doesn't interpret these characters. Why + not, and how can I make it understand them? + +This is the behavior of echo on most Unix System V machines. + +The bash builtin `echo' is modeled after the 9th Edition +Research Unix version of `echo'. It does not interpret +backslash-escaped characters in its argument strings by default; +it requires the use of the -e option to enable the +interpretation. The System V echo provides no way to disable the +special characters; the bash echo has a -E option to disable +them. + +There is a configuration option that will make bash behave like +the System V echo and interpret things like `\t' by default. Run +configure with the --enable-xpg-echo-default option to turn this +on. Be aware that this will cause some of the tests run when you +type `make tests' to fail. + +There is a shell option, `xpg_echo', settable with `shopt', that will +change the behavior of echo at runtime. Enabling this option turns +on expansion of backslash-escape sequences. + +E6) Why doesn't a while or for loop get suspended when I type ^Z? + +This is a consequence of how job control works on Unix. The only +thing that can be suspended is the process group. This is a single +command or pipeline of commands that the shell forks and executes. + +When you run a while or for loop, the only thing that the shell forks +and executes are any commands in the while loop test and commands in +the loop bodies. These, therefore, are the only things that can be +suspended when you type ^Z. + +If you want to be able to stop the entire loop, you need to put it +within parentheses, which will force the loop into a subshell that +may be stopped (and subsequently restarted) as a single unit. + +E7) What about empty for loops in Makefiles? + +It's fairly common to see constructs like this in automatically-generated +Makefiles: + +SUBDIRS = @SUBDIRS@ + + ... + +subdirs-clean: + for d in ${SUBDIRS}; do \ + ( cd $$d && ${MAKE} ${MFLAGS} clean ) \ + done + +When SUBDIRS is empty, this results in a command like this being passed to +bash: + + for d in ; do + ( cd $d && ${MAKE} ${MFLAGS} clean ) + done + +In versions of bash before bash-2.05a, this was a syntax error. If the +reserved word `in' was present, a word must follow it before the semicolon +or newline. The language in the manual page referring to the list of words +being empty referred to the list after it is expanded. These versions of +bash required that there be at least one word following the `in' when the +construct was parsed. + +The idiomatic Makefile solution is something like: + +SUBDIRS = @SUBDIRS@ + +subdirs-clean: + subdirs=$SUBDIRS ; for d in $$subdirs; do \ + ( cd $$d && ${MAKE} ${MFLAGS} clean ) \ + done + +The latest drafts of the updated POSIX standard have changed this: the +word list is no longer required. Bash versions 2.05a and later accept +the new syntax. + +E8) Why does the arithmetic evaluation code complain about `08'? + +The bash arithmetic evaluation code (used for `let', $(()), (()), and in +other places), interprets a leading `0' in numeric constants as denoting +an octal number, and a leading `0x' as denoting hexadecimal. This is +in accordance with the POSIX.2 spec, section 2.9.2.1, which states that +arithmetic constants should be handled as signed long integers as defined +by the ANSI/ISO C standard. + +The POSIX.2 interpretation committee has confirmed this: + +http://www.pasc.org/interps/unofficial/db/p1003.2/pasc-1003.2-173.html + +E9) Why does the pattern matching expression [A-Z]* match files beginning + with every letter except `z'? + +Bash-2.03, Bash-2.05 and later versions honor the current locale setting +when processing ranges within pattern matching bracket expressions ([A-Z]). +This is what POSIX.2 and SUSv3/XPG6 specify. + +The behavior of the matcher in bash-2.05 and later versions depends on the +current LC_COLLATE setting. Setting this variable to `C' or `POSIX' will +result in the traditional behavior ([A-Z] matches all uppercase ASCII +characters). Many other locales, including the en_US locale (the default +on many US versions of Linux) collate the upper and lower case letters like +this: + + AaBb...Zz + +which means that [A-Z] matches every letter except `z'. Others collate like + + aAbBcC...zZ + +which means that [A-Z] matches every letter except `a'. + +The portable way to specify upper case letters is [:upper:] instead of +A-Z; lower case may be specified as [:lower:] instead of a-z. + +Look at the manual pages for setlocale(3), strcoll(3), and, if it is +present, locale(1). If you have locale(1), you can use it to find +your current locale information even if you do not have any of the +LC_ variables set. + +My advice is to put + + export LC_COLLATE=C + +into /etc/profile and inspect any shell scripts run from cron for +constructs like [A-Z]. This will prevent things like + + rm [A-Z]* + +from removing every file in the current directory except those beginning +with `z' and still allow individual users to change the collation order. +Users may put the above command into their own profiles as well, of course. + +E10) Why does `cd //' leave $PWD as `//'? + +POSIX.2, in its description of `cd', says that *three* or more leading +slashes may be replaced with a single slash when canonicalizing the +current working directory. + +This is, I presume, for historical compatibility. Certain versions of +Unix, and early network file systems, used paths of the form +//hostname/path to access `path' on server `hostname'. + +E11) If I resize my xterm while another program is running, why doesn't bash + notice the change? + +This is another issue that deals with job control. + +The kernel maintains a notion of a current terminal process group. Members +of this process group (processes whose process group ID is equal to the +current terminal process group ID) receive terminal-generated signals like +SIGWINCH. (For more details, see the JOB CONTROL section of the bash +man page.) + +If a terminal is resized, the kernel sends SIGWINCH to each member of +the terminal's current process group (the `foreground' process group). + +When bash is running with job control enabled, each pipeline (which may be +a single command) is run in its own process group, different from bash's +process group. This foreground process group receives the SIGWINCH; bash +does not. Bash has no way of knowing that the terminal has been resized. + +There is a `checkwinsize' option, settable with the `shopt' builtin, that +will cause bash to check the window size and adjust its idea of the +terminal's dimensions each time a process stops or exits and returns control +of the terminal to bash. Enable it with `shopt -s checkwinsize'. + +E12) Why don't negative offsets in substring expansion work like I expect? + +When substring expansion of the form ${param:offset[:length} is used, +an `offset' that evaluates to a number less than zero counts back from +the end of the expanded value of $param. + +When a negative `offset' begins with a minus sign, however, unexpected things +can happen. Consider + + a=12345678 + echo ${a:-4} + +intending to print the last four characters of $a. The problem is that +${param:-word} already has a well-defined meaning: expand to word if the +expanded value of param is unset or null, and $param otherwise. + +To use negative offsets that begin with a minus sign, separate the +minus sign and the colon with a space. + +Section F: Things to watch out for on certain Unix versions + +F1) Why can't I use command line editing in my `cmdtool'? + +The problem is `cmdtool' and bash fighting over the input. When +scrolling is enabled in a cmdtool window, cmdtool puts the tty in +`raw mode' to permit command-line editing using the mouse for +applications that cannot do it themselves. As a result, bash and +cmdtool each try to read keyboard input immediately, with neither +getting enough of it to be useful. + +This mode also causes cmdtool to not implement many of the +terminal functions and control sequences appearing in the +`sun-cmd' termcap entry. For a more complete explanation, see +that file examples/suncmd.termcap in the bash distribution. + +`xterm' is a better choice, and gets along with bash much more +smoothly. + +If you must use cmdtool, you can use the termcap description in +examples/suncmd.termcap. Set the TERMCAP variable to the terminal +description contained in that file, i.e. + +TERMCAP='Mu|sun-cmd:am:bs:km:pt:li#34:co#80:cl=^L:ce=\E[K:cd=\E[J:rs=\E[s:' + +Then export TERMCAP and start a new cmdtool window from that shell. +The bash command-line editing should behave better in the new +cmdtool. If this works, you can put the assignment to TERMCAP +in your bashrc file. + +F2) I built bash on Solaris 2. Why do globbing expansions and filename + completion chop off the first few characters of each filename? + +This is the consequence of building bash on SunOS 5 and linking +with the libraries in /usr/ucblib, but using the definitions +and structures from files in /usr/include. + +The actual conflict is between the dirent structure in +/usr/include/dirent.h and the struct returned by the version of +`readdir' in libucb.a (a 4.3-BSD style `struct direct'). + +Make sure you've got /usr/ccs/bin ahead of /usr/ucb in your $PATH +when configuring and building bash. This will ensure that you +use /usr/ccs/bin/cc or acc instead of /usr/ucb/cc and that you +link with libc before libucb. + +If you have installed the Sun C compiler, you may also need to +put /usr/ccs/bin and /opt/SUNWspro/bin into your $PATH before +/usr/ucb. + +F3) Why does bash dump core after I interrupt username completion or + `~user' tilde expansion on a machine running NIS? + +This is a famous and long-standing bug in the SunOS YP (sorry, NIS) +client library, which is part of libc. + +The YP library code keeps static state -- a pointer into the data +returned from the server. When YP initializes itself (setpwent), +it looks at this pointer and calls free on it if it's non-null. +So far, so good. + +If one of the YP functions is interrupted during getpwent (the +exact function is interpretwithsave()), and returns NULL, the +pointer is freed without being reset to NULL, and the function +returns. The next time getpwent is called, it sees that this +pointer is non-null, calls free, and the bash free() blows up +because it's being asked to free freed memory. + +The traditional Unix mallocs allow memory to be freed multiple +times; that's probably why this has never been fixed. You can +run configure with the `--without-gnu-malloc' option to use +the C library malloc and avoid the problem. + +F4) I'm running SVR4.2. Why is the line erased every time I type `@'? + +The `@' character is the default `line kill' character in most +versions of System V, including SVR4.2. You can change this +character to whatever you want using `stty'. For example, to +change the line kill character to control-u, type + + stty kill ^U + +where the `^' and `U' can be two separate characters. + +F5) Why does bash report syntax errors when my C News scripts use a + redirection before a subshell command? + +The actual command in question is something like + + < file ( command ) + +According to the grammar given in the POSIX.2 standard, this construct +is, in fact, a syntax error. Redirections may only precede `simple +commands'. A subshell construct such as the above is one of the shell's +`compound commands'. A redirection may only follow a compound command. + +This affects the mechanical transformation of commands that use `cat' +to pipe a file into a command (a favorite Useless-Use-Of-Cat topic on +comp.unix.shell). While most commands of the form + + cat file | command + +can be converted to `< file command', shell control structures such as +loops and subshells require `command < file'. + +The file CWRU/sh-redir-hack in the bash-2.05a distribution is an +(unofficial) patch to parse.y that will modify the grammar to +support this construct. It will not apply with `patch'; you must +modify parse.y by hand. Note that if you apply this, you must +recompile with -DREDIRECTION_HACK. This introduces a large +number of reduce/reduce conflicts into the shell grammar. + +F6) Why can't I use vi-mode editing on Red Hat Linux 6.1? + +The short answer is that Red Hat screwed up. + +The long answer is that they shipped an /etc/inputrc that only works +for emacs mode editing, and then screwed all the vi users by setting +INPUTRC to /etc/inputrc in /etc/profile. + +The short fix is to do one of the following: remove or rename +/etc/inputrc, set INPUTRC=~/.inputrc in ~/.bashrc (or .bash_profile, +but make sure you export it if you do), remove the assignment to +INPUTRC from /etc/profile, add + + set keymap emacs + +to the beginning of /etc/inputrc, or bracket the key bindings in +/etc/inputrc with these lines + + $if mode=emacs + [...] + $endif + +F7) Why do bash-2.05a and bash-2.05b fail to compile `printf.def' on + HP/UX 11.x? + +HP/UX's support for long double is imperfect at best. + +GCC will support it without problems, but the HP C library functions +like strtold(3) and printf(3) don't actually work with long doubles. +HP implemented a `long_double' type as a 4-element array of 32-bit +ints, and that is what the library functions use. The ANSI C +`long double' type is a 128-bit floating point scalar. + +The easiest fix, until HP fixes things up, is to edit the generated +config.h and #undef the HAVE_LONG_DOUBLE line. After doing that, +the compilation should complete successfully. + +Section G: How can I get bash to do certain common things? + +G1) How can I get bash to read and display eight-bit characters? + +This is a process requiring several steps. + +First, you must ensure that the `physical' data path is a full eight +bits. For xterms, for example, the `vt100' resources `eightBitInput' +and `eightBitOutput' should be set to `true'. + +Once you have set up an eight-bit path, you must tell the kernel and +tty driver to leave the eighth bit of characters alone when processing +keyboard input. Use `stty' to do this: + + stty cs8 -istrip -parenb + +For old BSD-style systems, you can use + + stty pass8 + +You may also need + + stty even odd + +Finally, you need to tell readline that you will be inputting and +displaying eight-bit characters. You use readline variables to do +this. These variables can be set in your .inputrc or using the bash +`bind' builtin. Here's an example using `bind': + + bash$ bind 'set convert-meta off' + bash$ bind 'set meta-flag on' + bash$ bind 'set output-meta on' + +The `set' commands between the single quotes may also be placed +in ~/.inputrc. + +G2) How do I write a function `x' to replace builtin command `x', but + still invoke the command from within the function? + +This is why the `command' and `builtin' builtins exist. The +`command' builtin executes the command supplied as its first +argument, skipping over any function defined with that name. The +`builtin' builtin executes the builtin command given as its first +argument directly. + +For example, to write a function to replace `cd' that writes the +hostname and current directory to an xterm title bar, use +something like the following: + + cd() + { + builtin cd "$@" && xtitle "$HOST: $PWD" + } + +This could also be written using `command' instead of `builtin'; +the version above is marginally more efficient. + +G3) How can I find the value of a shell variable whose name is the value + of another shell variable? + +Versions of Bash newer than Bash-2.0 support this directly. You can use + + ${!var} + +For example, the following sequence of commands will echo `z': + + var1=var2 + var2=z + echo ${!var1} + +For sh compatibility, use the `eval' builtin. The important +thing to remember is that `eval' expands the arguments you give +it again, so you need to quote the parts of the arguments that +you want `eval' to act on. + +For example, this expression prints the value of the last positional +parameter: + + eval echo \"\$\{$#\}\" + +The expansion of the quoted portions of this expression will be +deferred until `eval' runs, while the `$#' will be expanded +before `eval' is executed. In versions of bash later than bash-2.0, + + echo ${!#} + +does the same thing. + +This is not the same thing as ksh93 `nameref' variables, though the syntax +is similar. I may add namerefs in a future bash version. + +G4) How can I make the bash `time' reserved word print timing output that + looks like the output from my system's /usr/bin/time? + +The bash command timing code looks for a variable `TIMEFORMAT' and +uses its value as a format string to decide how to display the +timing statistics. + +The value of TIMEFORMAT is a string with `%' escapes expanded in a +fashion similar in spirit to printf(3). The manual page explains +the meanings of the escape sequences in the format string. + +If TIMEFORMAT is not set, bash acts as if the following assignment had +been performed: + + TIMEFORMAT=$'\nreal\t%3lR\nuser\t%3lU\nsys\t%3lS' + +The POSIX.2 default time format (used by `time -p command') is + + TIMEFORMAT=$'real %2R\nuser %2U\nsys %2S' + +The BSD /usr/bin/time format can be emulated with: + + TIMEFORMAT=$'\t%1R real\t%1U user\t%1S sys' + +The System V /usr/bin/time format can be emulated with: + + TIMEFORMAT=$'\nreal\t%1R\nuser\t%1U\nsys\t%1S' + +The ksh format can be emulated with: + + TIMEFORMAT=$'\nreal\t%2lR\nuser\t%2lU\nsys\t%2lS' + +G5) How do I get the current directory into my prompt? + +Bash provides a number of backslash-escape sequences which are expanded +when the prompt string (PS1 or PS2) is displayed. The full list is in +the manual page. + +The \w expansion gives the full pathname of the current directory, with +a tilde (`~') substituted for the current value of $HOME. The \W +expansion gives the basename of the current directory. To put the full +pathname of the current directory into the path without any tilde +subsitution, use $PWD. Here are some examples: + + PS1='\w$ ' # current directory with tilde + PS1='\W$ ' # basename of current directory + PS1='$PWD$ ' # full pathname of current directory + +The single quotes are important in the final example to prevent $PWD from +being expanded when the assignment to PS1 is performed. + +G6) How can I rename "*.foo" to "*.bar"? + +Use the pattern removal functionality described in D3. The following `for' +loop will do the trick: + + for f in *.foo; do + mv $f ${f%foo}bar + done + +G7) How can I translate a filename from uppercase to lowercase? + +The script examples/functions/lowercase, originally written by John DuBois, +will do the trick. The converse is left as an exercise. + +G8) How can I write a filename expansion (globbing) pattern that will match + all files in the current directory except "." and ".."? + +You must have set the `extglob' shell option using `shopt -s extglob' to use +this: + + echo .!(.|) * + +A solution that works without extended globbing is given in the Unix Shell +FAQ, posted periodically to comp.unix.shell. + +Section H: Where do I go from here? + +H1) How do I report bugs in bash, and where should I look for fixes and + advice? + +Use the `bashbug' script to report bugs. It is built and +installed at the same time as bash. It provides a standard +template for reporting a problem and automatically includes +information about your configuration and build environment. + +`bashbug' sends its reports to bug-bash@gnu.org, which +is a large mailing list gatewayed to the usenet newsgroup gnu.bash.bug. + +Bug fixes, answers to questions, and announcements of new releases +are all posted to gnu.bash.bug. Discussions concerning bash features +and problems also take place there. + +To reach the bash maintainers directly, send mail to +bash-maintainers@gnu.org. + +H2) What kind of bash documentation is there? + +First, look in the doc directory in the bash distribution. It should +contain at least the following files: + +bash.1 an extensive, thorough Unix-style manual page +builtins.1 a manual page covering just bash builtin commands +bashref.texi a reference manual in GNU tex`info format +bashref.info an info version of the reference manual +FAQ this file +article.ms text of an article written for The Linux Journal +readline.3 a man page describing readline + +Postscript, HTML, and ASCII files created from the above source are +available in the documentation distribution. + +There is additional documentation available for anonymous FTP from host +ftp.cwru.edu in the `pub/bash' directory. + +Cameron Newham and Bill Rosenblatt have written a book on bash, published +by O'Reilly and Associates. The book is based on Bill Rosenblatt's Korn +Shell book. The title is ``Learning the Bash Shell'', and the ISBN number +is 1-56592-147-X. Look for it in fine bookstores near you. This book +covers bash-1.14, but has an appendix describing some of the new features +in bash-2.0. + +A second edition of this book is available, published in January, 1998. +The ISBN number is 1-56592-347-2. Look for it in the same fine bookstores +or on the web. + +The GNU Bash Reference Manual has been published as a printed book by +Network Theory Ltd (Paperback, ISBN: 0-9541617-7-7, Feb 2003). It covers +bash-2.0 and is available from most online bookstores (see +http://www.network-theory.co.uk/bash/manual/ for details). The publisher +will donate $1 to the Free Software Foundation for each copy sold. + +H3) What's coming in future versions? + +These are features I hope to include in a future version of bash. + +a better bash debugger (a minimally-tested version is included with bash-2.05b) +associative arrays +co-processes, but with a new-style syntax that looks like function declaration + +H4) What's on the bash `wish list' for future versions? + +These are features that may or may not appear in a future version of bash. + +breaking some of the shell functionality into embeddable libraries +a module system like zsh's, using dynamic loading like builtins +better internationalization using GNU `gettext' +date-stamped command history +a bash programmer's guide with a chapter on creating loadable builtins +a better loadable interface to perl with access to the shell builtins and + variables (contributions gratefully accepted) +ksh93-like `nameref' variables +ksh93-like `+=' variable assignment operator +ksh93-like `xx.yy' variables (including some of the .sh.* variables) and + associated disipline functions +Some of the new ksh93 pattern matching operators, like backreferencing + +H5) When will the next release appear? + +The next version will appear sometime in 2003. Never make predictions. + + +This document is Copyright 1995-2003 by Chester Ramey. + +Permission is hereby granted, without written agreement and +without license or royalty fees, to use, copy, and distribute +this document for any purpose, provided that the above copyright +notice appears in all copies of this document and that the +contents of this document remain unaltered. diff --git a/doc/FAQ.orig b/doc/FAQ.orig new file mode 100644 index 00000000..1cff3c8e --- /dev/null +++ b/doc/FAQ.orig @@ -0,0 +1,1745 @@ +This is the Bash FAQ, version 3.24, for Bash version 2.05b. + +This document contains a set of frequently-asked questions concerning +Bash, the GNU Bourne-Again Shell. Bash is a freely-available command +interpreter with advanced features for both interactive use and shell +programming. + +Another good source of basic information about shells is the collection +of FAQ articles periodically posted to comp.unix.shell. + +Questions and comments concerning this document should be sent to +chet@po.cwru.edu. + +This document is available for anonymous FTP with the URL + +ftp://ftp.cwru.edu/pub/bash/FAQ + +The Bash home page is http://cnswww.cns.cwru.edu/~chet/bash/bashtop.html + +---------- +Contents: + +Section A: The Basics + +A1) What is it? +A2) What's the latest version? +A3) Where can I get it? +A4) On what machines will bash run? +A5) Will bash run on operating systems other than Unix? +A6) How can I build bash with gcc? +A7) How can I make bash my login shell? +A8) I just changed my login shell to bash, and now I can't FTP into my + machine. Why not? +A9) What's the `POSIX 1003.2 standard'? +A10) What is the bash `posix mode'? + +Section B: The latest version + +B1) What's new in version 2.05b? +B2) Are there any user-visible incompatibilities between bash-2.05b and + bash-1.14.7? + +Section C: Differences from other Unix shells + +C1) How does bash differ from sh, the Bourne shell? +C2) How does bash differ from the Korn shell, version ksh88? +C3) Which new features in ksh-93 are not in bash, and which are? + +Section D: Why does bash do some things differently than other Unix shells? + +D1) Why does bash run a different version of `command' than + `which command' says it will? +D2) Why doesn't bash treat brace expansions exactly like csh? +D3) Why doesn't bash have csh variable modifiers? +D4) How can I make my csh aliases work when I convert to bash? +D5) How can I pipe standard output and standard error from one command to + another, like csh does with `|&'? +D6) Now that I've converted from ksh to bash, are there equivalents to + ksh features like autoloaded functions and the `whence' command? + +Section E: Why does bash do certain things the way it does? + +E1) Why is the bash builtin `test' slightly different from /bin/test? +E2) Why does bash sometimes say `Broken pipe'? +E3) When I have terminal escape sequences in my prompt, why does bash + wrap lines at the wrong column? +E4) If I pipe the output of a command into `read variable', why doesn't + the output show up in $variable when the read command finishes? +E5) I have a bunch of shell scripts that use backslash-escaped characters + in arguments to `echo'. Bash doesn't interpret these characters. Why + not, and how can I make it understand them? +E6) Why doesn't a while or for loop get suspended when I type ^Z? +E7) What about empty for loops in Makefiles? +E8) Why does the arithmetic evaluation code complain about `08'? +E9) Why does the pattern matching expression [A-Z]* match files beginning + with every letter except `z'? +E10) Why does `cd //' leave $PWD as `//'? +E11) If I resize my xterm while another program is running, why doesn't bash + notice the change? + +Section F: Things to watch out for on certain Unix versions + +F1) Why can't I use command line editing in my `cmdtool'? +F2) I built bash on Solaris 2. Why do globbing expansions and filename + completion chop off the first few characters of each filename? +F3) Why does bash dump core after I interrupt username completion or + `~user' tilde expansion on a machine running NIS? +F4) I'm running SVR4.2. Why is the line erased every time I type `@'? +F5) Why does bash report syntax errors when my C News scripts use a + redirection before a subshell command? +F6) Why can't I use vi-mode editing on Red Hat Linux 6.1? +F7) Why do bash-2.05a and bash-2.05b fail to compile `printf.def' on + HP/UX 11.x? + +Section G: How can I get bash to do certain common things? + +G1) How can I get bash to read and display eight-bit characters? +G2) How do I write a function `x' to replace builtin command `x', but + still invoke the command from within the function? +G3) How can I find the value of a shell variable whose name is the value + of another shell variable? +G4) How can I make the bash `time' reserved word print timing output that + looks like the output from my system's /usr/bin/time? +G5) How do I get the current directory into my prompt? +G6) How can I rename "*.foo" to "*.bar"? +G7) How can I translate a filename from uppercase to lowercase? +G8) How can I write a filename expansion (globbing) pattern that will match + all files in the current directory except "." and ".."? + +Section H: Where do I go from here? + +H1) How do I report bugs in bash, and where should I look for fixes and + advice? +H2) What kind of bash documentation is there? +H3) What's coming in future versions? +H4) What's on the bash `wish list'? +H5) When will the next release appear? + +---------- +Section A: The Basics + +A1) What is it? + +Bash is a Unix command interpreter (shell). It is an implementation of +the Posix 1003.2 shell standard, and resembles the Korn and System V +shells. + +Bash contains a number of enhancements over those shells, both +for interactive use and shell programming. Features geared +toward interactive use include command line editing, command +history, job control, aliases, and prompt expansion. Programming +features include additional variable expansions, shell +arithmetic, and a number of variables and options to control +shell behavior. + +Bash was originally written by Brian Fox of the Free Software +Foundation. The current developer and maintainer is Chet Ramey +of Case Western Reserve University. + +A2) What's the latest version? + +The latest version is 2.05b, first made available on Wednesday, 17 +July, 2002. + +A3) Where can I get it? + +Bash is the GNU project's shell, and so is available from the +master GNU archive site, ftp.gnu.org, and its mirrors. The +latest version is also available for FTP from ftp.cwru.edu. +The following URLs tell how to get version 2.05b: + +ftp://ftp.gnu.org/pub/gnu/bash/bash-2.05b.tar.gz +ftp://ftp.cwru.edu/pub/bash/bash-2.05b.tar.gz + +Formatted versions of the documentation are available with the URLs: + +ftp://ftp.gnu.org/pub/gnu/bash/bash-doc-2.05b.tar.gz +ftp://ftp.cwru.edu/pub/bash/bash-doc-2.05b.tar.gz + +A4) On what machines will bash run? + +Bash has been ported to nearly every version of UNIX. All you +should have to do to build it on a machine for which a port +exists is to type `configure' and then `make'. The build process +will attempt to discover the version of UNIX you have and tailor +itself accordingly, using a script created by GNU autoconf. + +More information appears in the file `INSTALL' in the distribution. + +The Bash web page (http://cnswww.cns.cwru.edu/~chet/bash/bashtop.html) +explains how to obtain binary versions of bash for most of the major +commercial Unix systems. + +A5) Will bash run on operating systems other than Unix? + +Configuration specifics for Unix-like systems such as QNX and +LynxOS are included in the distribution. Bash-2.05 and later +versions should compile and run on Minix 2.0 (patches were +contributed), but I don't believe anyone has built bash-2.x on +earlier Minix versions yet. + +Bash has been ported to versions of Windows implementing the Win32 +programming interface. This includes Windows 95 and Windows NT. +The port was done by Cygnus Solutions as part of their CYGWIN +project. For more information about the project, look at the URLs + +http://www.cygwin.com/ +http://sourceware.cygnus.com/cygwin + +Cygnus originally ported bash-1.14.7, and that port was part of their +early GNU-Win32 (the original name) releases. Cygnus has also done a +port of bash-2.05 to the CYGWIN environment, and it is available as +part of their current release. + +Bash-2.05b should require no local Cygnus changes to build and run under +CYGWIN. + +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 + +DJ Delorie has a port of bash-2.x which runs under MS-DOS, as part +of the DJGPP project. For more information on the project, see + +http://www.delorie.com/djgpp/ + +I have been told that the original DJGPP port was done by Daisuke Aoyama. + +Mark Elbrecht has sent me notice that bash-2.04 +is available for DJGPP V2. The files are available as: + +ftp://ftp.simtel.net/pub/simtelnet/gnu/djgpp/v2gnu/bsh204b.zip binary +ftp://ftp.simtel.net/pub/simtelnet/gnu/djgpp/v2gnu/bsh204d.zip documentation +ftp://ftp.simtel.net/pub/simtelnet/gnu/djgpp/v2gnu/bsh204s.zip source + +Mark has begun to work with bash-2.05, but I don't know the status. + +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. + +I have received word that Bash (I'm not sure which version, but I +believe that it's at least bash-2.02.1) is the standard shell on +BeOS. + +A6) How can I build bash with gcc? + +Bash configures to use gcc by default if it is available. Read the +file INSTALL in the distribution for more information. + +A7) How can I make bash my login shell? + +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 +you need to perform some tricks. The basic idea is to add a command +to your login shell's startup file to replace your login shell with +bash. + +For example, if your login shell is csh or tcsh, and you have installed +bash in /usr/gnu/bin/bash, add the following line to ~/.login: + + if ( -f /usr/gnu/bin/bash ) exec /usr/gnu/bin/bash --login + +(the `--login' tells bash that it is a login shell). + +It's not a good idea to put this command into ~/.cshrc, because every +csh you run without the `-f' option, even ones started to run csh scripts, +reads that file. If you must put the command in ~/.cshrc, use something +like + + if ( $?prompt ) exec /usr/gnu/bin/bash --login + +to ensure that bash is exec'd only when the csh is interactive. + +If your login shell is sh or ksh, you have to do two things. + +First, create an empty file in your home directory named `.bash_profile'. +The existence of this file will prevent the exec'd bash from trying to +read ~/.profile, and re-execing itself over and over again. ~/.bash_profile +is the first file bash tries to read initialization commands from when +it is invoked as a login shell. + +Next, add a line similar to the above to ~/.profile: + + [ -f /usr/gnu/bin/bash ] && [ -x /usr/gnu/bin/bash ] && \ + exec /usr/gnu/bin/bash --login + +This will cause login shells to replace themselves with bash running as +a login shell. Once you have this working, you can copy your initialization +code from ~/.profile to ~/.bash_profile. + +I have received word that the recipe supplied above is insufficient for +machines running CDE. CDE has a maze of twisty little startup files, all +slightly different. + +If you cannot change your login shell in the password file to bash, you +will have to (apparently) live with CDE using the shell in the password +file to run its startup scripts. If you have changed your shell to bash, +there is code in the CDE startup files (on Solaris, at least) that attempts +to do the right thing. It is, however, often broken, and may require that +you use the $BASH_ENV trick described below. + +`dtterm' claims to use $SHELL as the default program to start, so if you +can change $SHELL in the CDE startup files, you should be able to use bash +in your terminal windows. + +Setting DTSOURCEPROFILE in ~/.dtprofile will cause the `Xsession' program +to read your login shell's startup files. You may be able to use bash for +the rest of the CDE programs by setting SHELL to bash in ~/.dtprofile as +well, but I have not tried this. + +You can use the above `exec' recipe to start bash when not logging in with +CDE by testing the value of the DT variable: + + if [ -n "$DT" ]; then + [ -f /usr/gnu/bin/bash ] && exec /usr/gnu/bin/bash --login + fi + +If CDE starts its shells non-interactively during login, the login shell +startup files (~/.profile, ~/.bash_profile) will not be sourced at login. +To get around this problem, append a line similar to the following to your +~/.dtprofile: + + BASH_ENV=${HOME}/.bash_profile ; export BASH_ENV + +and add the following line to the beginning of ~/.bash_profile: + + unset BASH_ENV + +A8) I just changed my login shell to bash, and now I can't FTP into my + machine. Why not? + +You must add the full pathname to bash to the file /etc/shells. As +noted in the answer to the previous question, many systems require +this before you can make bash your login shell. + +Most versions of ftpd use this file to prohibit `special' users +such as `uucp' and `news' from using FTP. + +A9) What's the `POSIX 1003.2 standard'? + +POSIX is a name originally coined by Richard Stallman for a +family of open system standards based on UNIX. There are a +number of aspects of UNIX under consideration for +standardization, from the basic system services at the system +call and C library level to applications and tools to system +administration and management. Each area of standardization is +assigned to a working group in the 1003 series. + +The POSIX Shell and Utilities standard has been developed by IEEE +Working Group 1003.2 (POSIX.2). It concentrates on the command +interpreter interface and utility programs commonly executed from +the command line or by other programs. An initial version of the +standard has been approved and published by the IEEE, and work is +currently underway to update it. + +Bash is concerned with the aspects of the shell's behavior +defined by POSIX.2. The shell command language has of course +been standardized, including the basic flow control and program +execution constructs, I/O redirection and pipelining, argument +handling, variable expansion, and quoting. + +The `special' builtins, which must be implemented as part of the +shell to provide the desired functionality, are specified as +being part of the shell; examples of these are `eval' and +`export'. Other utilities appear in the sections of POSIX.2 not +devoted to the shell which are commonly (and in some cases must +be) implemented as builtin commands, such as `read' and `test'. +POSIX.2 also specifies aspects of the shell's interactive +behavior as part of the UPE, including job control and command +line editing. Only vi-style line editing commands have been +standardized; emacs editing commands were left out due to +objections. + +The Open Group has made an older version of its Single Unix +Specification (version 2), which is very similar to POSIX.2, +available on the web at + +http://www.opengroup.org/onlinepubs/007908799/ + +The Single Unix Specification, version 3, is available on the web at + +http://www.opengroup.org/onlinepubs/007904975/ + +A10) What is the bash `posix mode'? + +Although bash is an implementation of the POSIX.2 shell +specification, there are areas where the bash default behavior +differs from that spec. The bash `posix mode' changes the bash +behavior in these areas so that it obeys the spec more closely. + +Posix mode is entered by starting bash with the --posix or +'-o posix' option or executing `set -o posix' after bash is running. + +The specific aspects of bash which change when posix mode is +active are listed in the file POSIX in the bash distribution. +They are also listed in a section in the Bash Reference Manual +(from which that file is generated). + +Section B: The latest version + +B1) What's new in version 2.05b? + +The raison d'etre for bash-2.05b is to make a second intermediate +release containing the first of the new features to be available +in bash-3.0 and get feedback on those features before proceeding. +The major new feature is multibyte character support in both Bash +and Readline. + +Bash-2.05b contains the following new features (see the manual page for +complete descriptions and the CHANGES and NEWS files in the bash-2.05b +distribution): + +o support for multibyte characters has been added to both bash and readline + +o the DEBUG trap is now run *before* simple commands, ((...)) commands, + [[...]] conditional commands, and for ((...)) loops + +o the shell now performs arithmetic in the largest integer size the machine + supports (intmax_t) + +o there is a new \D{...} prompt expansion; passes the `...' to strftime(3) + and inserts the result into the expanded prompt + +o there is a new `here-string' redirection operator: <<< word + +o when displaying variables, function attributes and definitions are shown + separately, allowing them to be re-used as input (attempting to re-use + the old output would result in syntax errors). + +o `read' has a new `-u fd' option to read from a specified file descriptor + +o the bash debugger in examples/bashdb has been modified to work with the + new DEBUG trap semantics, the command set has been made more gdb-like, + and the changes to $LINENO make debugging functions work better + +o the expansion of $LINENO inside a shell function is only relative to the + function start if the shell is interactive -- if the shell is running a + script, $LINENO expands to the line number in the script. This is as + POSIX-2001 requires + + +A short feature history dating from Bash-2.0: + +Bash-2.05a introduced the following new features: + +o The `printf' builtin has undergone major work + +o There is a new read-only `shopt' option: login_shell, which is set by + login shells and unset otherwise + +o New `\A' prompt string escape sequence; expanding to time in 24-hour + HH:MM format + +o New `-A group/-g' option to complete and compgen; goes group name + completion + +o New [+-]O invocation option to set and unset `shopt' options at startup + +o ksh-like `ERR' trap + +o `for' loops now allow empty word lists after the `in' reserved word + +o new `hard' and `soft' arguments for the `ulimit' builtin + +o Readline can be configured to place the user at the same point on the line + when retrieving commands from the history list + +o Readline can be configured to skip `hidden' files (filenames with a leading + `.' on Unix) when performing completion + +Bash-2.05 introduced the following new features: + +o This version has once again reverted to using locales and strcoll(3) when + processing pattern matching bracket expressions, as POSIX requires. +o Added a new `--init-file' invocation argument as a synonym for `--rcfile', + per the new GNU coding standards. +o The /dev/tcp and /dev/udp redirections now accept service names as well as + port numbers. +o `complete' and `compgen' now take a `-o value' option, which controls some + of the aspects of that compspec. Valid values are: + + default - perform bash default completion if programmable + completion produces no matches + dirnames - perform directory name completion if programmable + completion produces no matches + filenames - tell readline that the compspec produces filenames, + so it can do things like append slashes to + directory names and suppress trailing spaces +o A new loadable builtin, realpath, which canonicalizes and expands symlinks + in pathname arguments. +o When `set' is called without options, it prints function defintions in a + way that allows them to be reused as input. This affects `declare' and + `declare -p' as well. This only happens when the shell is not in POSIX + mode, since POSIX.2 forbids this behavior. + +Bash-2.04 introduced the following new features: + +o Programmable word completion with the new `complete' and `compgen' builtins; + examples are provided in examples/complete/complete-examples +o `history' has a new `-d' option to delete a history entry +o `bind' has a new `-x' option to bind key sequences to shell commands +o The prompt expansion code has new `\j' and `\l' escape sequences +o The `no_empty_cmd_completion' shell option, if enabled, inhibits + command completion when TAB is typed on an empty line +o `help' has a new `-s' option to print a usage synopsis +o New arithmetic operators: var++, var--, ++var, --var, expr1,expr2 (comma) +o New ksh93-style arithmetic for command: + for ((expr1 ; expr2; expr3 )); do list; done +o `read' has new options: `-t', `-n', `-d', `-s' +o The redirection code handles several filenames specially: /dev/fd/N, + /dev/stdin, /dev/stdout, /dev/stderr +o The redirection code now recognizes /dev/tcp/HOST/PORT and + /dev/udp/HOST/PORT and tries to open a TCP or UDP socket, respectively, + to the specified port on the specified host +o The ${!prefix*} expansion has been implemented +o A new FUNCNAME variable, which expands to the name of a currently-executing + function +o The GROUPS variable is no longer readonly +o A new shopt `xpg_echo' variable, to control the behavior of echo with + respect to backslash-escape sequences at runtime +o The NON_INTERACTIVE_LOGIN_SHELLS #define has returned + +The version of Readline released with Bash-2.04, Readline-4.1, had several +new features as well: + +o Parentheses matching is always compiled into readline, and controllable + with the new `blink-matching-paren' variable +o The history-search-forward and history-search-backward functions now leave + point at the end of the line when the search string is empty, like + reverse-search-history, and forward-search-history +o A new function for applications: rl_on_new_line_with_prompt() +o New variables for applications: rl_already_prompted, and rl_gnu_readline_p + + +Bash-2.03 had very few new features, in keeping with the convention +that odd-numbered releases provide mainly bug fixes. A number of new +features were added to Readline, mostly at the request of the Cygnus +folks. + +A new shopt option, `restricted_shell', so that startup files can test + whether or not the shell was started in restricted mode +Filename generation is now performed on the words between ( and ) in + compound array assignments (this is really a bug fix) +OLDPWD is now auto-exported, as POSIX.2 requires +ENV and BASH_ENV are read-only variables in a restricted shell +Bash may now be linked against an already-installed Readline library, + as long as the Readline library is version 4 or newer +All shells begun with the `--login' option will source the login shell + startup files, even if the shell is not interactive + +There were lots of changes to the version of the Readline library released +along with Bash-2.03. For a complete list of the changes, read the file +CHANGES in the Bash-2.03 distribution. + +Bash-2.02 contained the following new features: + +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 $(, &>, >|, <<<, [n]<&word-, [n]>&word- + prompt string special char translation and variable expansion + auto-export of variables in initial environment + command search finds functions before builtins + bash return builtin will exit a file sourced with `.' + builtins: cd -/-L/-P, exec -l/-c/-a, echo -e/-E, hash -d/-l/-p/-t. + export -n/-f/-p/name=value, pwd -L/-P, + read -e/-p/-a/-t/-n/-d/-s/-u, + readonly -a/-f/name=value, trap -l, set +o, + set -b/-m/-o option/-h/-p/-B/-C/-H/-P, + unset -f/-v, ulimit -m/-p/-u, + type -a/-p/-t/-f/-P, suspend -f, kill -n, + test -o optname/s1 == s2/s1 < s2/s1 > s2/-nt/-ot/-ef/-O/-G/-S + bash reads ~/.bashrc for interactive shells, $ENV for non-interactive + bash restricted shell mode is more extensive + bash allows functions and variables with the same name + brace expansion + tilde expansion + arithmetic expansion with $((...)) and `let' builtin + the `[[...]]' extended conditional command + process substitution + aliases and alias/unalias builtins + local variables in functions and `local' builtin + readline and command-line editing with programmable completion + command history and history/fc builtins + csh-like history expansion + other new bash builtins: bind, command, compgen, complete, builtin, + declare/typeset, dirs, enable, fc, help, + history, logout, popd, pushd, disown, shopt, + printf + exported functions + filename generation when using output redirection (command >a*) + POSIX.2-style globbing character classes + POSIX.2-style globbing equivalence classes + POSIX.2-style globbing collating symbols + egrep-like extended pattern matching operators + case-insensitive pattern matching and globbing + variable assignments preceding commands affect only that command, + even for builtins and functions + posix mode + redirection to /dev/fd/N, /dev/stdin, /dev/stdout, /dev/stderr, + /dev/tcp/host/port, /dev/udp/host/port + +Things sh has that bash does not: + uses variable SHACCT to do shell accounting + includes `stop' builtin (bash can use alias stop='kill -s STOP') + `newgrp' builtin + turns on job control if called as `jsh' + $TIMEOUT (like bash $TMOUT) + `^' is a synonym for `|' + new SVR4.2 sh builtins: mldmode, priv + +Implementation differences: + redirection to/from compound commands causes sh to create a subshell + bash does not allow unbalanced quotes; sh silently inserts them at EOF + bash does not mess with signal 11 + sh sets (euid, egid) to (uid, gid) if -p not supplied and uid < 100 + bash splits only the results of expansions on IFS, using POSIX.2 + field splitting rules; sh splits all words on IFS + sh does not allow MAILCHECK to be unset (?) + sh does not allow traps on SIGALRM or SIGCHLD + bash allows multiple option arguments when invoked (e.g. -x -v); + sh allows only a single option argument (`sh -x -v' attempts + to open a file named `-v', and, on SunOS 4.1.4, dumps core. + On Solaris 2.4 and earlier versions, sh goes into an infinite + loop.) + sh exits a script if any builtin fails; bash exits only if one of + the POSIX.2 `special' builtins fails + +C2) How does bash differ from the Korn shell, version ksh88? + +Things bash has or uses that ksh88 does not: + long invocation options + [-+]O invocation option + -l invocation option + `!' reserved word + arithmetic for command: for ((expr1 ; expr2; expr3 )); do list; done + arithmetic in largest machine-supported size (intmax_t) + posix mode and posix conformance + command hashing + tilde expansion for assignment statements that look like $PATH + process substitution with named pipes if /dev/fd is not available + the ${!param} indirect parameter expansion operator + the ${!param*} prefix expansion operator + the ${param:offset[:length]} parameter substring operator + the ${param/pat[/string]} parameter pattern substitution operator + variables: BASH, BASH_VERSION, BASH_VERSINFO, UID, EUID, SHLVL, + TIMEFORMAT, HISTCMD, HOSTTYPE, OSTYPE, MACHTYPE, + HISTFILESIZE, HISTIGNORE, HISTCONTROL, PROMPT_COMMAND, + IGNOREEOF, FIGNORE, INPUTRC, HOSTFILE, DIRSTACK, + PIPESTATUS, HOSTNAME, OPTERR, SHELLOPTS, GLOBIGNORE, + GROUPS, FUNCNAME, histchars, auto_resume + prompt expansion with backslash escapes and command substitution + redirection: &> (stdout and stderr), <<<, [n]<&word-, [n]>&word- + more extensive and extensible editing and programmable completion + builtins: bind, builtin, command, declare, dirs, echo -e/-E, enable, + exec -l/-c/-a, fc -s, export -n/-f/-p, hash, help, history, + jobs -x/-r/-s, kill -s/-n/-l, local, logout, popd, pushd, + read -e/-p/-a/-t/-n/-d/-s, readonly -a/-n/-f/-p, + set -o braceexpand/-o histexpand/-o interactive-comments/ + -o notify/-o physical/-o posix/-o hashall/-o onecmd/ + -h/-B/-C/-b/-H/-P, set +o, suspend, trap -l, type, + typeset -a/-F/-p, ulimit -u, umask -S, alias -p, shopt, + disown, printf, complete, compgen + `!' csh-style history expansion + POSIX.2-style globbing character classes + POSIX.2-style globbing equivalence classes + POSIX.2-style globbing collating symbols + egrep-like extended pattern matching operators + case-insensitive pattern matching and globbing + `**' arithmetic operator to do exponentiation + redirection to /dev/fd/N, /dev/stdin, /dev/stdout, /dev/stderr + arrays of unlimited size + TMOUT is default timeout for `read' and `select' + +Things ksh88 has or uses that bash does not: + tracked aliases (alias -t) + variables: ERRNO, FPATH, EDITOR, VISUAL + co-processes (|&, >&p, <&p) + weirdly-scoped functions + typeset +f to list all function names without definitions + text of command history kept in a file, not memory + builtins: alias -x, cd old new, fc -e -, newgrp, print, + read -p/-s/var?prompt, set -A/-o gmacs/ + -o bgnice/-o markdirs/-o nolog/-o trackall/-o viraw/-s, + typeset -H/-L/-R/-Z/-A/-ft/-fu/-fx/-l/-u/-t, whence + using environment to pass attributes of exported variables + arithmetic evaluation done on arguments to some builtins + reads .profile from $PWD when invoked as login shell + +Implementation differences: + ksh runs last command of a pipeline in parent shell context + bash has brace expansion by default (ksh88 compile-time option) + bash has fixed startup file for all interactive shells; ksh reads $ENV + bash has exported functions + bash command search finds functions before builtins + bash waits for all commands in pipeline to exit before returning status + emacs-mode editing has some slightly different key bindings + +C3) Which new features in ksh-93 are not in bash, and which are? + +New things in ksh-93 not in bash-2.05b: + associative arrays + floating point arithmetic and variables + math library functions + ${!name[sub]} name of subscript for associative array + `.' is allowed in variable names to create a hierarchical namespace + more extensive compound assignment syntax + discipline functions + `sleep' and `getconf' builtins (bash has loadable versions) + typeset -n and `nameref' variables + KEYBD trap + variables: .sh.edchar, .sh.edmode, .sh.edcol, .sh.edtext, .sh.version, + .sh.name, .sh.subscript, .sh.value, .sh.match, HISTEDIT + backreferences in pattern matching (\N) + `&' operator in pattern lists for matching + print -f (bash uses printf) + `fc' has been renamed to `hist' + `.' can execute shell functions + exit statuses between 0 and 255 + set -o pipefail + `+=' variable assignment operator + FPATH and PATH mixing + getopts -a + -I invocation option + DEBUG trap now executed before each simple command, instead of after + printf %H, %P, %T, %Z modifiers, output base for %d + lexical scoping for local variables in `ksh' functions + no scoping for local variables in `POSIX' functions + +New things in ksh-93 present in bash-2.05b: + [n]<&word- and [n]>&word- redirections (combination dup and close) + for (( expr1; expr2; expr3 )) ; do list; done - arithmetic for command + ?:, ++, --, `expr1 , expr2' arithmetic operators + expansions: ${!param}, ${param:offset[:len]}, ${param/pat[/str]}, + ${!param*} + compound array assignment + the `!' reserved word + loadable builtins -- but ksh uses `builtin' while bash uses `enable' + `command', `builtin', `disown' builtins + new $'...' and $"..." quoting + FIGNORE (but bash uses GLOBIGNORE), HISTCMD + set -o notify/-C + changes to kill builtin + read -A (bash uses read -a) + read -t/-d + trap -p + exec -c/-a + `.' restores the positional parameters when it completes + POSIX.2 `test' + umask -S + unalias -a + command and arithmetic substitution performed on PS1, PS4, and ENV + command name completion + ENV processed only for interactive shells + +Section D: Why does bash do some things differently than other Unix shells? + +D1) Why does bash run a different version of `command' than + `which command' says it will? + +On many systems, `which' is actually a csh script that assumes +you're running csh. In tcsh, `which' and its cousin `where' +are builtins. On other Unix systems, `which' is a perl script +that uses the PATH environment variable. + +The csh script version reads the csh startup files from your +home directory and uses those to determine which `command' will +be invoked. Since bash doesn't use any of those startup files, +there's a good chance that your bash environment differs from +your csh environment. The bash `type' builtin does everything +`which' does, and will report correct results for the running +shell. If you're really wedded to the name `which', try adding +the following function definition to your .bashrc: + + which() + { + builtin type "$@" + } + +If you're moving from tcsh and would like to bring `where' along +as well, use this function: + + where() + { + builtin type -a "$@" + } + +D2) Why doesn't bash treat brace expansions exactly like csh? + +The only difference between bash and csh brace expansion is that +bash requires a brace expression to contain at least one unquoted +comma if it is to be expanded. Any brace-surrounded word not +containing an unquoted comma is left unchanged by the brace +expansion code. This affords the greatest degree of sh +compatibility. + +Bash, ksh, zsh, and pd-ksh all implement brace expansion this way. + +D3) Why doesn't bash have csh variable modifiers? + +Posix has specified a more powerful, albeit somewhat more cryptic, +mechanism cribbed from ksh, and bash implements it. + +${parameter%word} + Remove smallest suffix pattern. The WORD is expanded to produce + a pattern. It then expands to the value of PARAMETER, with the + smallest portion of the suffix matched by the pattern deleted. + + x=file.c + echo ${x%.c}.o + -->file.o + +${parameter%%word} + + Remove largest suffix pattern. The WORD is expanded to produce + a pattern. It then expands to the value of PARAMETER, with the + largest portion of the suffix matched by the pattern deleted. + + x=posix/src/std + echo ${x%%/*} + -->posix + +${parameter#word} + Remove smallest prefix pattern. The WORD is expanded to produce + a pattern. It then expands to the value of PARAMETER, with the + smallest portion of the prefix matched by the pattern deleted. + + x=$HOME/src/cmd + echo ${x#$HOME} + -->/src/cmd + +${parameter##word} + Remove largest prefix pattern. The WORD is expanded to produce + a pattern. It then expands to the value of PARAMETER, with the + largest portion of the prefix matched by the pattern deleted. + + x=/one/two/three + echo ${x##*/} + -->three + + +Given + a=/a/b/c/d + b=b.xxx + + csh bash result + --- ---- ------ + $a:h ${a%/*} /a/b/c + $a:t ${a##*/} d + $b:r ${b%.*} b + $b:e ${b##*.} xxx + + +D4) How can I make my csh aliases work when I convert to bash? + +Bash uses a different syntax to support aliases than csh does. +The details can be found in the documentation. We have provided +a shell script which does most of the work of conversion for you; +this script can be found in ./examples/misc/aliasconv.sh. Here is +how you use it: + +Start csh in the normal way for you. (e.g., `csh') + +Pipe the output of `alias' through `aliasconv.sh', saving the +results into `bash_aliases': + + alias | bash aliasconv.sh >bash_aliases + +Edit `bash_aliases', carefully reading through any created +functions. You will need to change the names of some csh specific +variables to the bash equivalents. The script converts $cwd to +$PWD, $term to $TERM, $home to $HOME, $user to $USER, and $prompt +to $PS1. You may also have to add quotes to avoid unwanted +expansion. + +For example, the csh alias: + + alias cd 'cd \!*; echo $cwd' + +is converted to the bash function: + + cd () { command cd "$@"; echo $PWD ; } + +The only thing that needs to be done is to quote $PWD: + + cd () { command cd "$@"; echo "$PWD" ; } + +Merge the edited file into your ~/.bashrc. + +There is an additional, more ambitious, script in +examples/misc/cshtobash that attempts to convert your entire csh +environment to its bash equivalent. This script can be run as +simply `cshtobash' to convert your normal interactive +environment, or as `cshtobash ~/.login' to convert your login +environment. + +D5) How can I pipe standard output and standard error from one command to + another, like csh does with `|&'? + +Use + command 2>&1 | command2 + +The key is to remember that piping is performed before redirection, so +file descriptor 1 points to the pipe when it is duplicated onto file +descriptor 2. + +D6) Now that I've converted from ksh to bash, are there equivalents to + ksh features like autoloaded functions and the `whence' command? + +There are features in ksh-88 and ksh-93 that do not have direct bash +equivalents. Most, however, can be emulated with very little trouble. + +ksh-88 feature Bash equivalent +-------------- --------------- +compiled-in aliases set up aliases in .bashrc; some ksh aliases are + bash builtins (hash, history, type) +coprocesses named pipe pairs (one for read, one for write) +typeset +f declare -F +cd, print, whence function substitutes in examples/functions/kshenv +autoloaded functions examples/functions/autoload is the same as typeset -fu +read var?prompt read -p prompt var + +ksh-93 feature Bash equivalent +-------------- --------------- +sleep, getconf Bash has loadable versions in examples/loadables +${.sh.version} $BASH_VERSION +print -f printf +hist alias hist=fc +$HISTEDIT $FCEDIT + +Section E: How can I get bash to do certain things, and why does bash do + things the way it does? + +E1) Why is the bash builtin `test' slightly different from /bin/test? + +The specific example used here is [ ! x -o x ], which is false. + +Bash's builtin `test' implements the Posix.2 spec, which can be +summarized as follows (the wording is due to David Korn): + +Here is the set of rules for processing test arguments. + + 0 Args: False + 1 Arg: True iff argument is not null. + 2 Args: If first arg is !, True iff second argument is null. + If first argument is unary, then true if unary test is true + Otherwise error. + 3 Args: If second argument is a binary operator, do binary test of $1 $3 + If first argument is !, negate two argument test of $2 $3 + If first argument is `(' and third argument is `)', do the + one-argument test of the second argument. + Otherwise error. + 4 Args: If first argument is !, negate three argument test of $2 $3 $4. + Otherwise unspecified + 5 or more Args: unspecified. (Historical shells would use their + current algorithm). + +The operators -a and -o are considered binary operators for the purpose +of the 3 Arg case. + +As you can see, the test becomes (not (x or x)), which is false. + +E2) Why does bash sometimes say `Broken pipe'? + +If a sequence of commands appears in a pipeline, and one of the +reading commands finishes before the writer has finished, the +writer receives a SIGPIPE signal. Many other shells special-case +SIGPIPE as an exit status in the pipeline and do not report it. +For example, in: + + ps -aux | head + +`head' can finish before `ps' writes all of its output, and ps +will try to write on a pipe without a reader. In that case, bash +will print `Broken pipe' to stderr when ps is killed by a +SIGPIPE. + +You can build a version of bash that will not report SIGPIPE errors +by uncommenting the definition of DONT_REPORT_SIGPIPE in the file +config-top.h. + +E3) When I have terminal escape sequences in my prompt, why does bash + wrap lines at the wrong column? + +Readline, the line editing library that bash uses, does not know +that the terminal escape sequences do not take up space on the +screen. The redisplay code assumes, unless told otherwise, that +each character in the prompt is a `printable' character that +takes up one character position on the screen. + +You can use the bash prompt expansion facility (see the PROMPTING +section in the manual page) to tell readline that sequences of +characters in the prompt strings take up no screen space. + +Use the \[ escape to begin a sequence of non-printing characters, +and the \] escape to signal the end of such a sequence. + +E4) If I pipe the output of a command into `read variable', why doesn't + the output show up in $variable when the read command finishes? + +This has to do with the parent-child relationship between Unix +processes. It affects all commands run in pipelines, not just +simple calls to `read'. For example, piping a command's output +into a `while' loop that repeatedly calls `read' will result in +the same behavior. + +Each element of a pipeline runs in a separate process, a child of +the shell running the pipeline. A subprocess cannot affect its +parent's environment. When the `read' command sets the variable +to the input, that variable is set only in the subshell, not the +parent shell. When the subshell exits, the value of the variable +is lost. + +Many pipelines that end with `read variable' can be converted +into command substitutions, which will capture the output of +a specified command. The output can then be assigned to a +variable: + + grep ^gnu /usr/lib/news/active | wc -l | read ngroup + +can be converted into + + ngroup=$(grep ^gnu /usr/lib/news/active | wc -l) + +This does not, unfortunately, work to split the text among +multiple variables, as read does when given multiple variable +arguments. If you need to do this, you can either use the +command substitution above to read the output into a variable +and chop up the variable using the bash pattern removal +expansion operators or use some variant of the following +approach. + +Say /usr/local/bin/ipaddr is the following shell script: + +#! /bin/sh +host `hostname` | awk '/address/ {print $NF}' + +Instead of using + + /usr/local/bin/ipaddr | read A B C D + +to break the local machine's IP address into separate octets, use + + OIFS="$IFS" + IFS=. + set -- $(/usr/local/bin/ipaddr) + IFS="$OIFS" + A="$1" B="$2" C="$3" D="$4" + +Beware, however, that this will change the shell's positional +parameters. If you need them, you should save them before doing +this. + +This is the general approach -- in most cases you will not need to +set $IFS to a different value. + +Some other user-supplied alternatives include: + +read A B C D << HERE + $(IFS=.; echo $(/usr/local/bin/ipaddr)) +HERE + +and, where process substitution is available, + +read A B C D < <(IFS=.; echo $(/usr/local/bin/ipaddr)) + +E5) I have a bunch of shell scripts that use backslash-escaped characters + in arguments to `echo'. Bash doesn't interpret these characters. Why + not, and how can I make it understand them? + +This is the behavior of echo on most Unix System V machines. + +The bash builtin `echo' is modeled after the 9th Edition +Research Unix version of `echo'. It does not interpret +backslash-escaped characters in its argument strings by default; +it requires the use of the -e option to enable the +interpretation. The System V echo provides no way to disable the +special characters; the bash echo has a -E option to disable +them. + +There is a configuration option that will make bash behave like +the System V echo and interpret things like `\t' by default. Run +configure with the --enable-xpg-echo-default option to turn this +on. Be aware that this will cause some of the tests run when you +type `make tests' to fail. + +There is a shell option, `xpg_echo', settable with `shopt', that will +change the behavior of echo at runtime. Enabling this option turns +on expansion of backslash-escape sequences. + +E6) Why doesn't a while or for loop get suspended when I type ^Z? + +This is a consequence of how job control works on Unix. The only +thing that can be suspended is the process group. This is a single +command or pipeline of commands that the shell forks and executes. + +When you run a while or for loop, the only thing that the shell forks +and executes are any commands in the while loop test and commands in +the loop bodies. These, therefore, are the only things that can be +suspended when you type ^Z. + +If you want to be able to stop the entire loop, you need to put it +within parentheses, which will force the loop into a subshell that +may be stopped (and subsequently restarted) as a single unit. + +E7) What about empty for loops in Makefiles? + +It's fairly common to see constructs like this in automatically-generated +Makefiles: + +SUBDIRS = @SUBDIRS@ + + ... + +subdirs-clean: + for d in ${SUBDIRS}; do \ + ( cd $$d && ${MAKE} ${MFLAGS} clean ) \ + done + +When SUBDIRS is empty, this results in a command like this being passed to +bash: + + for d in ; do + ( cd $d && ${MAKE} ${MFLAGS} clean ) + done + +In versions of bash before bash-2.05a, this was a syntax error. If the +reserved word `in' was present, a word must follow it before the semicolon +or newline. The language in the manual page referring to the list of words +being empty referred to the list after it is expanded. These versions of +bash required that there be at least one word following the `in' when the +construct was parsed. + +The idiomatic Makefile solution is something like: + +SUBDIRS = @SUBDIRS@ + +subdirs-clean: + subdirs=$SUBDIRS ; for d in $$subdirs; do \ + ( cd $$d && ${MAKE} ${MFLAGS} clean ) \ + done + +The latest drafts of the updated POSIX standard have changed this: the +word list is no longer required. Bash versions 2.05a and later accept +the new syntax. + +E8) Why does the arithmetic evaluation code complain about `08'? + +The bash arithmetic evaluation code (used for `let', $(()), (()), and in +other places), interprets a leading `0' in numeric constants as denoting +an octal number, and a leading `0x' as denoting hexadecimal. This is +in accordance with the POSIX.2 spec, section 2.9.2.1, which states that +arithmetic constants should be handled as signed long integers as defined +by the ANSI/ISO C standard. + +The POSIX.2 interpretation committee has confirmed this: + +http://www.pasc.org/interps/unofficial/db/p1003.2/pasc-1003.2-173.html + +E9) Why does the pattern matching expression [A-Z]* match files beginning + with every letter except `z'? + +Bash-2.03, Bash-2.05 and later versions honor the current locale setting +when processing ranges within pattern matching bracket expressions ([A-Z]). +This is what POSIX.2 and SUSv3/XPG6 specify. + +The behavior of the matcher in bash-2.05 and later versions depends on the +current LC_COLLATE setting. Setting this variable to `C' or `POSIX' will +result in the traditional behavior ([A-Z] matches all uppercase ASCII +characters). Many other locales, including the en_US locale (the default +on many US versions of Linux) collate the upper and lower case letters like +this: + + AaBb...Zz + +which means that [A-Z] matches every letter except `z'. Others collate like + + aAbBcC...zZ + +which means that [A-Z] matches every letter except `a'. + +The portable way to specify upper case letters is [:upper:] instead of +A-Z; lower case may be specified as [:lower:] instead of a-z. + +Look at the manual pages for setlocale(3), strcoll(3), and, if it is +present, locale(1). If you have locale(1), you can use it to find +your current locale information even if you do not have any of the +LC_ variables set. + +My advice is to put + + export LC_COLLATE=C + +into /etc/profile and inspect any shell scripts run from cron for +constructs like [A-Z]. This will prevent things like + + rm [A-Z]* + +from removing every file in the current directory except those beginning +with `z' and still allow individual users to change the collation order. +Users may put the above command into their own profiles as well, of course. + +E10) Why does `cd //' leave $PWD as `//'? + +POSIX.2, in its description of `cd', says that *three* or more leading +slashes may be replaced with a single slash when canonicalizing the +current working directory. + +This is, I presume, for historical compatibility. Certain versions of +Unix, and early network file systems, used paths of the form +//hostname/path to access `path' on server `hostname'. + +E11) If I resize my xterm while another program is running, why doesn't bash + notice the change? + +This is another issue that deals with job control. + +The kernel maintains a notion of a current terminal process group. Members +of this process group (processes whose process group ID is equal to the +current terminal process group ID) receive terminal-generated signals like +SIGWINCH. (For more details, see the JOB CONTROL section of the bash +man page.) + +If a terminal is resized, the kernel sends SIGWINCH to each member of +the terminal's current process group (the `foreground' process group). + +When bash is running with job control enabled, each pipeline (which may be +a single command) is run in its own process group, different from bash's +process group. This foreground process group receives the SIGWINCH; bash +does not. Bash has no way of knowing that the terminal has been resized. + +There is a `checkwinsize' option, settable with the `shopt' builtin, that +will cause bash to check the window size and adjust its idea of the +terminal's dimensions each time a process stops or exits and returns control +of the terminal to bash. Enable it with `shopt -s checkwinsize'. + +Section F: Things to watch out for on certain Unix versions + +F1) Why can't I use command line editing in my `cmdtool'? + +The problem is `cmdtool' and bash fighting over the input. When +scrolling is enabled in a cmdtool window, cmdtool puts the tty in +`raw mode' to permit command-line editing using the mouse for +applications that cannot do it themselves. As a result, bash and +cmdtool each try to read keyboard input immediately, with neither +getting enough of it to be useful. + +This mode also causes cmdtool to not implement many of the +terminal functions and control sequences appearing in the +`sun-cmd' termcap entry. For a more complete explanation, see +that file examples/suncmd.termcap in the bash distribution. + +`xterm' is a better choice, and gets along with bash much more +smoothly. + +If you must use cmdtool, you can use the termcap description in +examples/suncmd.termcap. Set the TERMCAP variable to the terminal +description contained in that file, i.e. + +TERMCAP='Mu|sun-cmd:am:bs:km:pt:li#34:co#80:cl=^L:ce=\E[K:cd=\E[J:rs=\E[s:' + +Then export TERMCAP and start a new cmdtool window from that shell. +The bash command-line editing should behave better in the new +cmdtool. If this works, you can put the assignment to TERMCAP +in your bashrc file. + +F2) I built bash on Solaris 2. Why do globbing expansions and filename + completion chop off the first few characters of each filename? + +This is the consequence of building bash on SunOS 5 and linking +with the libraries in /usr/ucblib, but using the definitions +and structures from files in /usr/include. + +The actual conflict is between the dirent structure in +/usr/include/dirent.h and the struct returned by the version of +`readdir' in libucb.a (a 4.3-BSD style `struct direct'). + +Make sure you've got /usr/ccs/bin ahead of /usr/ucb in your $PATH +when configuring and building bash. This will ensure that you +use /usr/ccs/bin/cc or acc instead of /usr/ucb/cc and that you +link with libc before libucb. + +If you have installed the Sun C compiler, you may also need to +put /usr/ccs/bin and /opt/SUNWspro/bin into your $PATH before +/usr/ucb. + +F3) Why does bash dump core after I interrupt username completion or + `~user' tilde expansion on a machine running NIS? + +This is a famous and long-standing bug in the SunOS YP (sorry, NIS) +client library, which is part of libc. + +The YP library code keeps static state -- a pointer into the data +returned from the server. When YP initializes itself (setpwent), +it looks at this pointer and calls free on it if it's non-null. +So far, so good. + +If one of the YP functions is interrupted during getpwent (the +exact function is interpretwithsave()), and returns NULL, the +pointer is freed without being reset to NULL, and the function +returns. The next time getpwent is called, it sees that this +pointer is non-null, calls free, and the bash free() blows up +because it's being asked to free freed memory. + +The traditional Unix mallocs allow memory to be freed multiple +times; that's probably why this has never been fixed. You can +run configure with the `--without-gnu-malloc' option to use +the C library malloc and avoid the problem. + +F4) I'm running SVR4.2. Why is the line erased every time I type `@'? + +The `@' character is the default `line kill' character in most +versions of System V, including SVR4.2. You can change this +character to whatever you want using `stty'. For example, to +change the line kill character to control-u, type + + stty kill ^U + +where the `^' and `U' can be two separate characters. + +F5) Why does bash report syntax errors when my C News scripts use a + redirection before a subshell command? + +The actual command in question is something like + + < file ( command ) + +According to the grammar given in the POSIX.2 standard, this construct +is, in fact, a syntax error. Redirections may only precede `simple +commands'. A subshell construct such as the above is one of the shell's +`compound commands'. A redirection may only follow a compound command. + +This affects the mechanical transformation of commands that use `cat' +to pipe a file into a command (a favorite Useless-Use-Of-Cat topic on +comp.unix.shell). While most commands of the form + + cat file | command + +can be converted to `< file command', shell control structures such as +loops and subshells require `command < file'. + +The file CWRU/sh-redir-hack in the bash-2.05a distribution is an +(unofficial) patch to parse.y that will modify the grammar to +support this construct. It will not apply with `patch'; you must +modify parse.y by hand. Note that if you apply this, you must +recompile with -DREDIRECTION_HACK. This introduces a large +number of reduce/reduce conflicts into the shell grammar. + +F6) Why can't I use vi-mode editing on Red Hat Linux 6.1? + +The short answer is that Red Hat screwed up. + +The long answer is that they shipped an /etc/inputrc that only works +for emacs mode editing, and then screwed all the vi users by setting +INPUTRC to /etc/inputrc in /etc/profile. + +The short fix is to do one of the following: remove or rename +/etc/inputrc, set INPUTRC=~/.inputrc in ~/.bashrc (or .bash_profile, +but make sure you export it if you do), remove the assignment to +INPUTRC from /etc/profile, add + + set keymap emacs + +to the beginning of /etc/inputrc, or bracket the key bindings in +/etc/inputrc with these lines + + $if mode=emacs + [...] + $endif + +F7) Why do bash-2.05a and bash-2.05b fail to compile `printf.def' on + HP/UX 11.x? + +HP/UX's support for long double is imperfect at best. + +GCC will support it without problems, but the HP C library functions +like strtold(3) and printf(3) don't actually work with long doubles. +HP implemented a `long_double' type as a 4-element array of 32-bit +ints, and that is what the library functions use. The ANSI C +`long double' type is a 128-bit floating point scalar. + +The easiest fix, until HP fixes things up, is to edit the generated +config.h and #undef the HAVE_LONG_DOUBLE line. After doing that, +the compilation should complete successfully. + +Section G: How can I get bash to do certain common things? + +G1) How can I get bash to read and display eight-bit characters? + +This is a process requiring several steps. + +First, you must ensure that the `physical' data path is a full eight +bits. For xterms, for example, the `vt100' resources `eightBitInput' +and `eightBitOutput' should be set to `true'. + +Once you have set up an eight-bit path, you must tell the kernel and +tty driver to leave the eighth bit of characters alone when processing +keyboard input. Use `stty' to do this: + + stty cs8 -istrip -parenb + +For old BSD-style systems, you can use + + stty pass8 + +You may also need + + stty even odd + +Finally, you need to tell readline that you will be inputting and +displaying eight-bit characters. You use readline variables to do +this. These variables can be set in your .inputrc or using the bash +`bind' builtin. Here's an example using `bind': + + bash$ bind 'set convert-meta off' + bash$ bind 'set meta-flag on' + bash$ bind 'set output-meta on' + +The `set' commands between the single quotes may also be placed +in ~/.inputrc. + +G2) How do I write a function `x' to replace builtin command `x', but + still invoke the command from within the function? + +This is why the `command' and `builtin' builtins exist. The +`command' builtin executes the command supplied as its first +argument, skipping over any function defined with that name. The +`builtin' builtin executes the builtin command given as its first +argument directly. + +For example, to write a function to replace `cd' that writes the +hostname and current directory to an xterm title bar, use +something like the following: + + cd() + { + builtin cd "$@" && xtitle "$HOST: $PWD" + } + +This could also be written using `command' instead of `builtin'; +the version above is marginally more efficient. + +G3) How can I find the value of a shell variable whose name is the value + of another shell variable? + +Versions of Bash newer than Bash-2.0 support this directly. You can use + + ${!var} + +For example, the following sequence of commands will echo `z': + + var1=var2 + var2=z + echo ${!var1} + +For sh compatibility, use the `eval' builtin. The important +thing to remember is that `eval' expands the arguments you give +it again, so you need to quote the parts of the arguments that +you want `eval' to act on. + +For example, this expression prints the value of the last positional +parameter: + + eval echo \"\$\{$#\}\" + +The expansion of the quoted portions of this expression will be +deferred until `eval' runs, while the `$#' will be expanded +before `eval' is executed. In versions of bash later than bash-2.0, + + echo ${!#} + +does the same thing. + +This is not the same thing as ksh93 `nameref' variables, though the syntax +is similar. I may add namerefs in a future bash version. + +G4) How can I make the bash `time' reserved word print timing output that + looks like the output from my system's /usr/bin/time? + +The bash command timing code looks for a variable `TIMEFORMAT' and +uses its value as a format string to decide how to display the +timing statistics. + +The value of TIMEFORMAT is a string with `%' escapes expanded in a +fashion similar in spirit to printf(3). The manual page explains +the meanings of the escape sequences in the format string. + +If TIMEFORMAT is not set, bash acts as if the following assignment had +been performed: + + TIMEFORMAT=$'\nreal\t%3lR\nuser\t%3lU\nsys\t%3lS' + +The POSIX.2 default time format (used by `time -p command') is + + TIMEFORMAT=$'real %2R\nuser %2U\nsys %2S' + +The BSD /usr/bin/time format can be emulated with: + + TIMEFORMAT=$'\t%1R real\t%1U user\t%1S sys' + +The System V /usr/bin/time format can be emulated with: + + TIMEFORMAT=$'\nreal\t%1R\nuser\t%1U\nsys\t%1S' + +The ksh format can be emulated with: + + TIMEFORMAT=$'\nreal\t%2lR\nuser\t%2lU\nsys\t%2lS' + +G5) How do I get the current directory into my prompt? + +Bash provides a number of backslash-escape sequences which are expanded +when the prompt string (PS1 or PS2) is displayed. The full list is in +the manual page. + +The \w expansion gives the full pathname of the current directory, with +a tilde (`~') substituted for the current value of $HOME. The \W +expansion gives the basename of the current directory. To put the full +pathname of the current directory into the path without any tilde +subsitution, use $PWD. Here are some examples: + + PS1='\w$ ' # current directory with tilde + PS1='\W$ ' # basename of current directory + PS1='$PWD$ ' # full pathname of current directory + +The single quotes are important in the final example to prevent $PWD from +being expanded when the assignment to PS1 is performed. + +G6) How can I rename "*.foo" to "*.bar"? + +Use the pattern removal functionality described in D3. The following `for' +loop will do the trick: + + for f in *.foo; do + mv $f ${f%foo}bar + done + +G7) How can I translate a filename from uppercase to lowercase? + +The script examples/functions/lowercase, originally written by John DuBois, +will do the trick. The converse is left as an exercise. + +G8) How can I write a filename expansion (globbing) pattern that will match + all files in the current directory except "." and ".."? + +You must have set the `extglob' shell option using `shopt -s extglob' to use +this: + + echo .!(.|) * + +A solution that works without extended globbing is given in the Unix Shell +FAQ, posted periodically to comp.unix.shell. + +Section H: Where do I go from here? + +H1) How do I report bugs in bash, and where should I look for fixes and + advice? + +Use the `bashbug' script to report bugs. It is built and +installed at the same time as bash. It provides a standard +template for reporting a problem and automatically includes +information about your configuration and build environment. + +`bashbug' sends its reports to bug-bash@gnu.org, which +is a large mailing list gatewayed to the usenet newsgroup gnu.bash.bug. + +Bug fixes, answers to questions, and announcements of new releases +are all posted to gnu.bash.bug. Discussions concerning bash features +and problems also take place there. + +To reach the bash maintainers directly, send mail to +bash-maintainers@gnu.org. + +H2) What kind of bash documentation is there? + +First, look in the doc directory in the bash distribution. It should +contain at least the following files: + +bash.1 an extensive, thorough Unix-style manual page +builtins.1 a manual page covering just bash builtin commands +bashref.texi a reference manual in GNU tex`info format +bashref.info an info version of the reference manual +FAQ this file +article.ms text of an article written for The Linux Journal +readline.3 a man page describing readline + +Postscript, HTML, and ASCII files created from the above source are +available in the documentation distribution. + +There is additional documentation available for anonymous FTP from host +ftp.cwru.edu in the `pub/bash' directory. + +Cameron Newham and Bill Rosenblatt have written a book on bash, published +by O'Reilly and Associates. The book is based on Bill Rosenblatt's Korn +Shell book. The title is ``Learning the Bash Shell'', and the ISBN number +is 1-56592-147-X. Look for it in fine bookstores near you. This book +covers bash-1.14, but has an appendix describing some of the new features +in bash-2.0. + +A second edition of this book is available, published in January, 1998. +The ISBN number is 1-56592-347-2. Look for it in the same fine bookstores +or on the web. + +The GNU Bash Reference Manual has been published as a printed book by +Network Theory Ltd (Paperback, ISBN: 0-9541617-7-7, Feb 2003). It covers +bash-2.0 and is available from most online bookstores (see +http://www.network-theory.co.uk/bash/manual/ for details). The publisher +will donate $1 to the Free Software Foundation for each copy sold. + +H3) What's coming in future versions? + +These are features I hope to include in a future version of bash. + +a better bash debugger (a minimally-tested version is included with bash-2.05b) +associative arrays +co-processes, but with a new-style syntax that looks like function declaration + +H4) What's on the bash `wish list' for future versions? + +These are features that may or may not appear in a future version of bash. + +breaking some of the shell functionality into embeddable libraries +a module system like zsh's, using dynamic loading like builtins +better internationalization using GNU `gettext' +date-stamped command history +a bash programmer's guide with a chapter on creating loadable builtins +a better loadable interface to perl with access to the shell builtins and + variables (contributions gratefully accepted) +ksh93-like `nameref' variables +ksh93-like `+=' variable assignment operator +ksh93-like `xx.yy' variables (including some of the .sh.* variables) and + associated disipline functions +Some of the new ksh93 pattern matching operators, like backreferencing + +H5) When will the next release appear? + +The next version will appear sometime in 2002. Never make predictions. + + +This document is Copyright 1995-2003 by Chester Ramey. + +Permission is hereby granted, without written agreement and +without license or royalty fees, to use, copy, and distribute +this document for any purpose, provided that the above copyright +notice appears in all copies of this document and that the +contents of this document remain unaltered. diff --git a/doc/FAQ.save b/doc/FAQ.save new file mode 100644 index 00000000..1cff3c8e --- /dev/null +++ b/doc/FAQ.save @@ -0,0 +1,1745 @@ +This is the Bash FAQ, version 3.24, for Bash version 2.05b. + +This document contains a set of frequently-asked questions concerning +Bash, the GNU Bourne-Again Shell. Bash is a freely-available command +interpreter with advanced features for both interactive use and shell +programming. + +Another good source of basic information about shells is the collection +of FAQ articles periodically posted to comp.unix.shell. + +Questions and comments concerning this document should be sent to +chet@po.cwru.edu. + +This document is available for anonymous FTP with the URL + +ftp://ftp.cwru.edu/pub/bash/FAQ + +The Bash home page is http://cnswww.cns.cwru.edu/~chet/bash/bashtop.html + +---------- +Contents: + +Section A: The Basics + +A1) What is it? +A2) What's the latest version? +A3) Where can I get it? +A4) On what machines will bash run? +A5) Will bash run on operating systems other than Unix? +A6) How can I build bash with gcc? +A7) How can I make bash my login shell? +A8) I just changed my login shell to bash, and now I can't FTP into my + machine. Why not? +A9) What's the `POSIX 1003.2 standard'? +A10) What is the bash `posix mode'? + +Section B: The latest version + +B1) What's new in version 2.05b? +B2) Are there any user-visible incompatibilities between bash-2.05b and + bash-1.14.7? + +Section C: Differences from other Unix shells + +C1) How does bash differ from sh, the Bourne shell? +C2) How does bash differ from the Korn shell, version ksh88? +C3) Which new features in ksh-93 are not in bash, and which are? + +Section D: Why does bash do some things differently than other Unix shells? + +D1) Why does bash run a different version of `command' than + `which command' says it will? +D2) Why doesn't bash treat brace expansions exactly like csh? +D3) Why doesn't bash have csh variable modifiers? +D4) How can I make my csh aliases work when I convert to bash? +D5) How can I pipe standard output and standard error from one command to + another, like csh does with `|&'? +D6) Now that I've converted from ksh to bash, are there equivalents to + ksh features like autoloaded functions and the `whence' command? + +Section E: Why does bash do certain things the way it does? + +E1) Why is the bash builtin `test' slightly different from /bin/test? +E2) Why does bash sometimes say `Broken pipe'? +E3) When I have terminal escape sequences in my prompt, why does bash + wrap lines at the wrong column? +E4) If I pipe the output of a command into `read variable', why doesn't + the output show up in $variable when the read command finishes? +E5) I have a bunch of shell scripts that use backslash-escaped characters + in arguments to `echo'. Bash doesn't interpret these characters. Why + not, and how can I make it understand them? +E6) Why doesn't a while or for loop get suspended when I type ^Z? +E7) What about empty for loops in Makefiles? +E8) Why does the arithmetic evaluation code complain about `08'? +E9) Why does the pattern matching expression [A-Z]* match files beginning + with every letter except `z'? +E10) Why does `cd //' leave $PWD as `//'? +E11) If I resize my xterm while another program is running, why doesn't bash + notice the change? + +Section F: Things to watch out for on certain Unix versions + +F1) Why can't I use command line editing in my `cmdtool'? +F2) I built bash on Solaris 2. Why do globbing expansions and filename + completion chop off the first few characters of each filename? +F3) Why does bash dump core after I interrupt username completion or + `~user' tilde expansion on a machine running NIS? +F4) I'm running SVR4.2. Why is the line erased every time I type `@'? +F5) Why does bash report syntax errors when my C News scripts use a + redirection before a subshell command? +F6) Why can't I use vi-mode editing on Red Hat Linux 6.1? +F7) Why do bash-2.05a and bash-2.05b fail to compile `printf.def' on + HP/UX 11.x? + +Section G: How can I get bash to do certain common things? + +G1) How can I get bash to read and display eight-bit characters? +G2) How do I write a function `x' to replace builtin command `x', but + still invoke the command from within the function? +G3) How can I find the value of a shell variable whose name is the value + of another shell variable? +G4) How can I make the bash `time' reserved word print timing output that + looks like the output from my system's /usr/bin/time? +G5) How do I get the current directory into my prompt? +G6) How can I rename "*.foo" to "*.bar"? +G7) How can I translate a filename from uppercase to lowercase? +G8) How can I write a filename expansion (globbing) pattern that will match + all files in the current directory except "." and ".."? + +Section H: Where do I go from here? + +H1) How do I report bugs in bash, and where should I look for fixes and + advice? +H2) What kind of bash documentation is there? +H3) What's coming in future versions? +H4) What's on the bash `wish list'? +H5) When will the next release appear? + +---------- +Section A: The Basics + +A1) What is it? + +Bash is a Unix command interpreter (shell). It is an implementation of +the Posix 1003.2 shell standard, and resembles the Korn and System V +shells. + +Bash contains a number of enhancements over those shells, both +for interactive use and shell programming. Features geared +toward interactive use include command line editing, command +history, job control, aliases, and prompt expansion. Programming +features include additional variable expansions, shell +arithmetic, and a number of variables and options to control +shell behavior. + +Bash was originally written by Brian Fox of the Free Software +Foundation. The current developer and maintainer is Chet Ramey +of Case Western Reserve University. + +A2) What's the latest version? + +The latest version is 2.05b, first made available on Wednesday, 17 +July, 2002. + +A3) Where can I get it? + +Bash is the GNU project's shell, and so is available from the +master GNU archive site, ftp.gnu.org, and its mirrors. The +latest version is also available for FTP from ftp.cwru.edu. +The following URLs tell how to get version 2.05b: + +ftp://ftp.gnu.org/pub/gnu/bash/bash-2.05b.tar.gz +ftp://ftp.cwru.edu/pub/bash/bash-2.05b.tar.gz + +Formatted versions of the documentation are available with the URLs: + +ftp://ftp.gnu.org/pub/gnu/bash/bash-doc-2.05b.tar.gz +ftp://ftp.cwru.edu/pub/bash/bash-doc-2.05b.tar.gz + +A4) On what machines will bash run? + +Bash has been ported to nearly every version of UNIX. All you +should have to do to build it on a machine for which a port +exists is to type `configure' and then `make'. The build process +will attempt to discover the version of UNIX you have and tailor +itself accordingly, using a script created by GNU autoconf. + +More information appears in the file `INSTALL' in the distribution. + +The Bash web page (http://cnswww.cns.cwru.edu/~chet/bash/bashtop.html) +explains how to obtain binary versions of bash for most of the major +commercial Unix systems. + +A5) Will bash run on operating systems other than Unix? + +Configuration specifics for Unix-like systems such as QNX and +LynxOS are included in the distribution. Bash-2.05 and later +versions should compile and run on Minix 2.0 (patches were +contributed), but I don't believe anyone has built bash-2.x on +earlier Minix versions yet. + +Bash has been ported to versions of Windows implementing the Win32 +programming interface. This includes Windows 95 and Windows NT. +The port was done by Cygnus Solutions as part of their CYGWIN +project. For more information about the project, look at the URLs + +http://www.cygwin.com/ +http://sourceware.cygnus.com/cygwin + +Cygnus originally ported bash-1.14.7, and that port was part of their +early GNU-Win32 (the original name) releases. Cygnus has also done a +port of bash-2.05 to the CYGWIN environment, and it is available as +part of their current release. + +Bash-2.05b should require no local Cygnus changes to build and run under +CYGWIN. + +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 + +DJ Delorie has a port of bash-2.x which runs under MS-DOS, as part +of the DJGPP project. For more information on the project, see + +http://www.delorie.com/djgpp/ + +I have been told that the original DJGPP port was done by Daisuke Aoyama. + +Mark Elbrecht has sent me notice that bash-2.04 +is available for DJGPP V2. The files are available as: + +ftp://ftp.simtel.net/pub/simtelnet/gnu/djgpp/v2gnu/bsh204b.zip binary +ftp://ftp.simtel.net/pub/simtelnet/gnu/djgpp/v2gnu/bsh204d.zip documentation +ftp://ftp.simtel.net/pub/simtelnet/gnu/djgpp/v2gnu/bsh204s.zip source + +Mark has begun to work with bash-2.05, but I don't know the status. + +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. + +I have received word that Bash (I'm not sure which version, but I +believe that it's at least bash-2.02.1) is the standard shell on +BeOS. + +A6) How can I build bash with gcc? + +Bash configures to use gcc by default if it is available. Read the +file INSTALL in the distribution for more information. + +A7) How can I make bash my login shell? + +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 +you need to perform some tricks. The basic idea is to add a command +to your login shell's startup file to replace your login shell with +bash. + +For example, if your login shell is csh or tcsh, and you have installed +bash in /usr/gnu/bin/bash, add the following line to ~/.login: + + if ( -f /usr/gnu/bin/bash ) exec /usr/gnu/bin/bash --login + +(the `--login' tells bash that it is a login shell). + +It's not a good idea to put this command into ~/.cshrc, because every +csh you run without the `-f' option, even ones started to run csh scripts, +reads that file. If you must put the command in ~/.cshrc, use something +like + + if ( $?prompt ) exec /usr/gnu/bin/bash --login + +to ensure that bash is exec'd only when the csh is interactive. + +If your login shell is sh or ksh, you have to do two things. + +First, create an empty file in your home directory named `.bash_profile'. +The existence of this file will prevent the exec'd bash from trying to +read ~/.profile, and re-execing itself over and over again. ~/.bash_profile +is the first file bash tries to read initialization commands from when +it is invoked as a login shell. + +Next, add a line similar to the above to ~/.profile: + + [ -f /usr/gnu/bin/bash ] && [ -x /usr/gnu/bin/bash ] && \ + exec /usr/gnu/bin/bash --login + +This will cause login shells to replace themselves with bash running as +a login shell. Once you have this working, you can copy your initialization +code from ~/.profile to ~/.bash_profile. + +I have received word that the recipe supplied above is insufficient for +machines running CDE. CDE has a maze of twisty little startup files, all +slightly different. + +If you cannot change your login shell in the password file to bash, you +will have to (apparently) live with CDE using the shell in the password +file to run its startup scripts. If you have changed your shell to bash, +there is code in the CDE startup files (on Solaris, at least) that attempts +to do the right thing. It is, however, often broken, and may require that +you use the $BASH_ENV trick described below. + +`dtterm' claims to use $SHELL as the default program to start, so if you +can change $SHELL in the CDE startup files, you should be able to use bash +in your terminal windows. + +Setting DTSOURCEPROFILE in ~/.dtprofile will cause the `Xsession' program +to read your login shell's startup files. You may be able to use bash for +the rest of the CDE programs by setting SHELL to bash in ~/.dtprofile as +well, but I have not tried this. + +You can use the above `exec' recipe to start bash when not logging in with +CDE by testing the value of the DT variable: + + if [ -n "$DT" ]; then + [ -f /usr/gnu/bin/bash ] && exec /usr/gnu/bin/bash --login + fi + +If CDE starts its shells non-interactively during login, the login shell +startup files (~/.profile, ~/.bash_profile) will not be sourced at login. +To get around this problem, append a line similar to the following to your +~/.dtprofile: + + BASH_ENV=${HOME}/.bash_profile ; export BASH_ENV + +and add the following line to the beginning of ~/.bash_profile: + + unset BASH_ENV + +A8) I just changed my login shell to bash, and now I can't FTP into my + machine. Why not? + +You must add the full pathname to bash to the file /etc/shells. As +noted in the answer to the previous question, many systems require +this before you can make bash your login shell. + +Most versions of ftpd use this file to prohibit `special' users +such as `uucp' and `news' from using FTP. + +A9) What's the `POSIX 1003.2 standard'? + +POSIX is a name originally coined by Richard Stallman for a +family of open system standards based on UNIX. There are a +number of aspects of UNIX under consideration for +standardization, from the basic system services at the system +call and C library level to applications and tools to system +administration and management. Each area of standardization is +assigned to a working group in the 1003 series. + +The POSIX Shell and Utilities standard has been developed by IEEE +Working Group 1003.2 (POSIX.2). It concentrates on the command +interpreter interface and utility programs commonly executed from +the command line or by other programs. An initial version of the +standard has been approved and published by the IEEE, and work is +currently underway to update it. + +Bash is concerned with the aspects of the shell's behavior +defined by POSIX.2. The shell command language has of course +been standardized, including the basic flow control and program +execution constructs, I/O redirection and pipelining, argument +handling, variable expansion, and quoting. + +The `special' builtins, which must be implemented as part of the +shell to provide the desired functionality, are specified as +being part of the shell; examples of these are `eval' and +`export'. Other utilities appear in the sections of POSIX.2 not +devoted to the shell which are commonly (and in some cases must +be) implemented as builtin commands, such as `read' and `test'. +POSIX.2 also specifies aspects of the shell's interactive +behavior as part of the UPE, including job control and command +line editing. Only vi-style line editing commands have been +standardized; emacs editing commands were left out due to +objections. + +The Open Group has made an older version of its Single Unix +Specification (version 2), which is very similar to POSIX.2, +available on the web at + +http://www.opengroup.org/onlinepubs/007908799/ + +The Single Unix Specification, version 3, is available on the web at + +http://www.opengroup.org/onlinepubs/007904975/ + +A10) What is the bash `posix mode'? + +Although bash is an implementation of the POSIX.2 shell +specification, there are areas where the bash default behavior +differs from that spec. The bash `posix mode' changes the bash +behavior in these areas so that it obeys the spec more closely. + +Posix mode is entered by starting bash with the --posix or +'-o posix' option or executing `set -o posix' after bash is running. + +The specific aspects of bash which change when posix mode is +active are listed in the file POSIX in the bash distribution. +They are also listed in a section in the Bash Reference Manual +(from which that file is generated). + +Section B: The latest version + +B1) What's new in version 2.05b? + +The raison d'etre for bash-2.05b is to make a second intermediate +release containing the first of the new features to be available +in bash-3.0 and get feedback on those features before proceeding. +The major new feature is multibyte character support in both Bash +and Readline. + +Bash-2.05b contains the following new features (see the manual page for +complete descriptions and the CHANGES and NEWS files in the bash-2.05b +distribution): + +o support for multibyte characters has been added to both bash and readline + +o the DEBUG trap is now run *before* simple commands, ((...)) commands, + [[...]] conditional commands, and for ((...)) loops + +o the shell now performs arithmetic in the largest integer size the machine + supports (intmax_t) + +o there is a new \D{...} prompt expansion; passes the `...' to strftime(3) + and inserts the result into the expanded prompt + +o there is a new `here-string' redirection operator: <<< word + +o when displaying variables, function attributes and definitions are shown + separately, allowing them to be re-used as input (attempting to re-use + the old output would result in syntax errors). + +o `read' has a new `-u fd' option to read from a specified file descriptor + +o the bash debugger in examples/bashdb has been modified to work with the + new DEBUG trap semantics, the command set has been made more gdb-like, + and the changes to $LINENO make debugging functions work better + +o the expansion of $LINENO inside a shell function is only relative to the + function start if the shell is interactive -- if the shell is running a + script, $LINENO expands to the line number in the script. This is as + POSIX-2001 requires + + +A short feature history dating from Bash-2.0: + +Bash-2.05a introduced the following new features: + +o The `printf' builtin has undergone major work + +o There is a new read-only `shopt' option: login_shell, which is set by + login shells and unset otherwise + +o New `\A' prompt string escape sequence; expanding to time in 24-hour + HH:MM format + +o New `-A group/-g' option to complete and compgen; goes group name + completion + +o New [+-]O invocation option to set and unset `shopt' options at startup + +o ksh-like `ERR' trap + +o `for' loops now allow empty word lists after the `in' reserved word + +o new `hard' and `soft' arguments for the `ulimit' builtin + +o Readline can be configured to place the user at the same point on the line + when retrieving commands from the history list + +o Readline can be configured to skip `hidden' files (filenames with a leading + `.' on Unix) when performing completion + +Bash-2.05 introduced the following new features: + +o This version has once again reverted to using locales and strcoll(3) when + processing pattern matching bracket expressions, as POSIX requires. +o Added a new `--init-file' invocation argument as a synonym for `--rcfile', + per the new GNU coding standards. +o The /dev/tcp and /dev/udp redirections now accept service names as well as + port numbers. +o `complete' and `compgen' now take a `-o value' option, which controls some + of the aspects of that compspec. Valid values are: + + default - perform bash default completion if programmable + completion produces no matches + dirnames - perform directory name completion if programmable + completion produces no matches + filenames - tell readline that the compspec produces filenames, + so it can do things like append slashes to + directory names and suppress trailing spaces +o A new loadable builtin, realpath, which canonicalizes and expands symlinks + in pathname arguments. +o When `set' is called without options, it prints function defintions in a + way that allows them to be reused as input. This affects `declare' and + `declare -p' as well. This only happens when the shell is not in POSIX + mode, since POSIX.2 forbids this behavior. + +Bash-2.04 introduced the following new features: + +o Programmable word completion with the new `complete' and `compgen' builtins; + examples are provided in examples/complete/complete-examples +o `history' has a new `-d' option to delete a history entry +o `bind' has a new `-x' option to bind key sequences to shell commands +o The prompt expansion code has new `\j' and `\l' escape sequences +o The `no_empty_cmd_completion' shell option, if enabled, inhibits + command completion when TAB is typed on an empty line +o `help' has a new `-s' option to print a usage synopsis +o New arithmetic operators: var++, var--, ++var, --var, expr1,expr2 (comma) +o New ksh93-style arithmetic for command: + for ((expr1 ; expr2; expr3 )); do list; done +o `read' has new options: `-t', `-n', `-d', `-s' +o The redirection code handles several filenames specially: /dev/fd/N, + /dev/stdin, /dev/stdout, /dev/stderr +o The redirection code now recognizes /dev/tcp/HOST/PORT and + /dev/udp/HOST/PORT and tries to open a TCP or UDP socket, respectively, + to the specified port on the specified host +o The ${!prefix*} expansion has been implemented +o A new FUNCNAME variable, which expands to the name of a currently-executing + function +o The GROUPS variable is no longer readonly +o A new shopt `xpg_echo' variable, to control the behavior of echo with + respect to backslash-escape sequences at runtime +o The NON_INTERACTIVE_LOGIN_SHELLS #define has returned + +The version of Readline released with Bash-2.04, Readline-4.1, had several +new features as well: + +o Parentheses matching is always compiled into readline, and controllable + with the new `blink-matching-paren' variable +o The history-search-forward and history-search-backward functions now leave + point at the end of the line when the search string is empty, like + reverse-search-history, and forward-search-history +o A new function for applications: rl_on_new_line_with_prompt() +o New variables for applications: rl_already_prompted, and rl_gnu_readline_p + + +Bash-2.03 had very few new features, in keeping with the convention +that odd-numbered releases provide mainly bug fixes. A number of new +features were added to Readline, mostly at the request of the Cygnus +folks. + +A new shopt option, `restricted_shell', so that startup files can test + whether or not the shell was started in restricted mode +Filename generation is now performed on the words between ( and ) in + compound array assignments (this is really a bug fix) +OLDPWD is now auto-exported, as POSIX.2 requires +ENV and BASH_ENV are read-only variables in a restricted shell +Bash may now be linked against an already-installed Readline library, + as long as the Readline library is version 4 or newer +All shells begun with the `--login' option will source the login shell + startup files, even if the shell is not interactive + +There were lots of changes to the version of the Readline library released +along with Bash-2.03. For a complete list of the changes, read the file +CHANGES in the Bash-2.03 distribution. + +Bash-2.02 contained the following new features: + +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 $(, &>, >|, <<<, [n]<&word-, [n]>&word- + prompt string special char translation and variable expansion + auto-export of variables in initial environment + command search finds functions before builtins + bash return builtin will exit a file sourced with `.' + builtins: cd -/-L/-P, exec -l/-c/-a, echo -e/-E, hash -d/-l/-p/-t. + export -n/-f/-p/name=value, pwd -L/-P, + read -e/-p/-a/-t/-n/-d/-s/-u, + readonly -a/-f/name=value, trap -l, set +o, + set -b/-m/-o option/-h/-p/-B/-C/-H/-P, + unset -f/-v, ulimit -m/-p/-u, + type -a/-p/-t/-f/-P, suspend -f, kill -n, + test -o optname/s1 == s2/s1 < s2/s1 > s2/-nt/-ot/-ef/-O/-G/-S + bash reads ~/.bashrc for interactive shells, $ENV for non-interactive + bash restricted shell mode is more extensive + bash allows functions and variables with the same name + brace expansion + tilde expansion + arithmetic expansion with $((...)) and `let' builtin + the `[[...]]' extended conditional command + process substitution + aliases and alias/unalias builtins + local variables in functions and `local' builtin + readline and command-line editing with programmable completion + command history and history/fc builtins + csh-like history expansion + other new bash builtins: bind, command, compgen, complete, builtin, + declare/typeset, dirs, enable, fc, help, + history, logout, popd, pushd, disown, shopt, + printf + exported functions + filename generation when using output redirection (command >a*) + POSIX.2-style globbing character classes + POSIX.2-style globbing equivalence classes + POSIX.2-style globbing collating symbols + egrep-like extended pattern matching operators + case-insensitive pattern matching and globbing + variable assignments preceding commands affect only that command, + even for builtins and functions + posix mode + redirection to /dev/fd/N, /dev/stdin, /dev/stdout, /dev/stderr, + /dev/tcp/host/port, /dev/udp/host/port + +Things sh has that bash does not: + uses variable SHACCT to do shell accounting + includes `stop' builtin (bash can use alias stop='kill -s STOP') + `newgrp' builtin + turns on job control if called as `jsh' + $TIMEOUT (like bash $TMOUT) + `^' is a synonym for `|' + new SVR4.2 sh builtins: mldmode, priv + +Implementation differences: + redirection to/from compound commands causes sh to create a subshell + bash does not allow unbalanced quotes; sh silently inserts them at EOF + bash does not mess with signal 11 + sh sets (euid, egid) to (uid, gid) if -p not supplied and uid < 100 + bash splits only the results of expansions on IFS, using POSIX.2 + field splitting rules; sh splits all words on IFS + sh does not allow MAILCHECK to be unset (?) + sh does not allow traps on SIGALRM or SIGCHLD + bash allows multiple option arguments when invoked (e.g. -x -v); + sh allows only a single option argument (`sh -x -v' attempts + to open a file named `-v', and, on SunOS 4.1.4, dumps core. + On Solaris 2.4 and earlier versions, sh goes into an infinite + loop.) + sh exits a script if any builtin fails; bash exits only if one of + the POSIX.2 `special' builtins fails + +C2) How does bash differ from the Korn shell, version ksh88? + +Things bash has or uses that ksh88 does not: + long invocation options + [-+]O invocation option + -l invocation option + `!' reserved word + arithmetic for command: for ((expr1 ; expr2; expr3 )); do list; done + arithmetic in largest machine-supported size (intmax_t) + posix mode and posix conformance + command hashing + tilde expansion for assignment statements that look like $PATH + process substitution with named pipes if /dev/fd is not available + the ${!param} indirect parameter expansion operator + the ${!param*} prefix expansion operator + the ${param:offset[:length]} parameter substring operator + the ${param/pat[/string]} parameter pattern substitution operator + variables: BASH, BASH_VERSION, BASH_VERSINFO, UID, EUID, SHLVL, + TIMEFORMAT, HISTCMD, HOSTTYPE, OSTYPE, MACHTYPE, + HISTFILESIZE, HISTIGNORE, HISTCONTROL, PROMPT_COMMAND, + IGNOREEOF, FIGNORE, INPUTRC, HOSTFILE, DIRSTACK, + PIPESTATUS, HOSTNAME, OPTERR, SHELLOPTS, GLOBIGNORE, + GROUPS, FUNCNAME, histchars, auto_resume + prompt expansion with backslash escapes and command substitution + redirection: &> (stdout and stderr), <<<, [n]<&word-, [n]>&word- + more extensive and extensible editing and programmable completion + builtins: bind, builtin, command, declare, dirs, echo -e/-E, enable, + exec -l/-c/-a, fc -s, export -n/-f/-p, hash, help, history, + jobs -x/-r/-s, kill -s/-n/-l, local, logout, popd, pushd, + read -e/-p/-a/-t/-n/-d/-s, readonly -a/-n/-f/-p, + set -o braceexpand/-o histexpand/-o interactive-comments/ + -o notify/-o physical/-o posix/-o hashall/-o onecmd/ + -h/-B/-C/-b/-H/-P, set +o, suspend, trap -l, type, + typeset -a/-F/-p, ulimit -u, umask -S, alias -p, shopt, + disown, printf, complete, compgen + `!' csh-style history expansion + POSIX.2-style globbing character classes + POSIX.2-style globbing equivalence classes + POSIX.2-style globbing collating symbols + egrep-like extended pattern matching operators + case-insensitive pattern matching and globbing + `**' arithmetic operator to do exponentiation + redirection to /dev/fd/N, /dev/stdin, /dev/stdout, /dev/stderr + arrays of unlimited size + TMOUT is default timeout for `read' and `select' + +Things ksh88 has or uses that bash does not: + tracked aliases (alias -t) + variables: ERRNO, FPATH, EDITOR, VISUAL + co-processes (|&, >&p, <&p) + weirdly-scoped functions + typeset +f to list all function names without definitions + text of command history kept in a file, not memory + builtins: alias -x, cd old new, fc -e -, newgrp, print, + read -p/-s/var?prompt, set -A/-o gmacs/ + -o bgnice/-o markdirs/-o nolog/-o trackall/-o viraw/-s, + typeset -H/-L/-R/-Z/-A/-ft/-fu/-fx/-l/-u/-t, whence + using environment to pass attributes of exported variables + arithmetic evaluation done on arguments to some builtins + reads .profile from $PWD when invoked as login shell + +Implementation differences: + ksh runs last command of a pipeline in parent shell context + bash has brace expansion by default (ksh88 compile-time option) + bash has fixed startup file for all interactive shells; ksh reads $ENV + bash has exported functions + bash command search finds functions before builtins + bash waits for all commands in pipeline to exit before returning status + emacs-mode editing has some slightly different key bindings + +C3) Which new features in ksh-93 are not in bash, and which are? + +New things in ksh-93 not in bash-2.05b: + associative arrays + floating point arithmetic and variables + math library functions + ${!name[sub]} name of subscript for associative array + `.' is allowed in variable names to create a hierarchical namespace + more extensive compound assignment syntax + discipline functions + `sleep' and `getconf' builtins (bash has loadable versions) + typeset -n and `nameref' variables + KEYBD trap + variables: .sh.edchar, .sh.edmode, .sh.edcol, .sh.edtext, .sh.version, + .sh.name, .sh.subscript, .sh.value, .sh.match, HISTEDIT + backreferences in pattern matching (\N) + `&' operator in pattern lists for matching + print -f (bash uses printf) + `fc' has been renamed to `hist' + `.' can execute shell functions + exit statuses between 0 and 255 + set -o pipefail + `+=' variable assignment operator + FPATH and PATH mixing + getopts -a + -I invocation option + DEBUG trap now executed before each simple command, instead of after + printf %H, %P, %T, %Z modifiers, output base for %d + lexical scoping for local variables in `ksh' functions + no scoping for local variables in `POSIX' functions + +New things in ksh-93 present in bash-2.05b: + [n]<&word- and [n]>&word- redirections (combination dup and close) + for (( expr1; expr2; expr3 )) ; do list; done - arithmetic for command + ?:, ++, --, `expr1 , expr2' arithmetic operators + expansions: ${!param}, ${param:offset[:len]}, ${param/pat[/str]}, + ${!param*} + compound array assignment + the `!' reserved word + loadable builtins -- but ksh uses `builtin' while bash uses `enable' + `command', `builtin', `disown' builtins + new $'...' and $"..." quoting + FIGNORE (but bash uses GLOBIGNORE), HISTCMD + set -o notify/-C + changes to kill builtin + read -A (bash uses read -a) + read -t/-d + trap -p + exec -c/-a + `.' restores the positional parameters when it completes + POSIX.2 `test' + umask -S + unalias -a + command and arithmetic substitution performed on PS1, PS4, and ENV + command name completion + ENV processed only for interactive shells + +Section D: Why does bash do some things differently than other Unix shells? + +D1) Why does bash run a different version of `command' than + `which command' says it will? + +On many systems, `which' is actually a csh script that assumes +you're running csh. In tcsh, `which' and its cousin `where' +are builtins. On other Unix systems, `which' is a perl script +that uses the PATH environment variable. + +The csh script version reads the csh startup files from your +home directory and uses those to determine which `command' will +be invoked. Since bash doesn't use any of those startup files, +there's a good chance that your bash environment differs from +your csh environment. The bash `type' builtin does everything +`which' does, and will report correct results for the running +shell. If you're really wedded to the name `which', try adding +the following function definition to your .bashrc: + + which() + { + builtin type "$@" + } + +If you're moving from tcsh and would like to bring `where' along +as well, use this function: + + where() + { + builtin type -a "$@" + } + +D2) Why doesn't bash treat brace expansions exactly like csh? + +The only difference between bash and csh brace expansion is that +bash requires a brace expression to contain at least one unquoted +comma if it is to be expanded. Any brace-surrounded word not +containing an unquoted comma is left unchanged by the brace +expansion code. This affords the greatest degree of sh +compatibility. + +Bash, ksh, zsh, and pd-ksh all implement brace expansion this way. + +D3) Why doesn't bash have csh variable modifiers? + +Posix has specified a more powerful, albeit somewhat more cryptic, +mechanism cribbed from ksh, and bash implements it. + +${parameter%word} + Remove smallest suffix pattern. The WORD is expanded to produce + a pattern. It then expands to the value of PARAMETER, with the + smallest portion of the suffix matched by the pattern deleted. + + x=file.c + echo ${x%.c}.o + -->file.o + +${parameter%%word} + + Remove largest suffix pattern. The WORD is expanded to produce + a pattern. It then expands to the value of PARAMETER, with the + largest portion of the suffix matched by the pattern deleted. + + x=posix/src/std + echo ${x%%/*} + -->posix + +${parameter#word} + Remove smallest prefix pattern. The WORD is expanded to produce + a pattern. It then expands to the value of PARAMETER, with the + smallest portion of the prefix matched by the pattern deleted. + + x=$HOME/src/cmd + echo ${x#$HOME} + -->/src/cmd + +${parameter##word} + Remove largest prefix pattern. The WORD is expanded to produce + a pattern. It then expands to the value of PARAMETER, with the + largest portion of the prefix matched by the pattern deleted. + + x=/one/two/three + echo ${x##*/} + -->three + + +Given + a=/a/b/c/d + b=b.xxx + + csh bash result + --- ---- ------ + $a:h ${a%/*} /a/b/c + $a:t ${a##*/} d + $b:r ${b%.*} b + $b:e ${b##*.} xxx + + +D4) How can I make my csh aliases work when I convert to bash? + +Bash uses a different syntax to support aliases than csh does. +The details can be found in the documentation. We have provided +a shell script which does most of the work of conversion for you; +this script can be found in ./examples/misc/aliasconv.sh. Here is +how you use it: + +Start csh in the normal way for you. (e.g., `csh') + +Pipe the output of `alias' through `aliasconv.sh', saving the +results into `bash_aliases': + + alias | bash aliasconv.sh >bash_aliases + +Edit `bash_aliases', carefully reading through any created +functions. You will need to change the names of some csh specific +variables to the bash equivalents. The script converts $cwd to +$PWD, $term to $TERM, $home to $HOME, $user to $USER, and $prompt +to $PS1. You may also have to add quotes to avoid unwanted +expansion. + +For example, the csh alias: + + alias cd 'cd \!*; echo $cwd' + +is converted to the bash function: + + cd () { command cd "$@"; echo $PWD ; } + +The only thing that needs to be done is to quote $PWD: + + cd () { command cd "$@"; echo "$PWD" ; } + +Merge the edited file into your ~/.bashrc. + +There is an additional, more ambitious, script in +examples/misc/cshtobash that attempts to convert your entire csh +environment to its bash equivalent. This script can be run as +simply `cshtobash' to convert your normal interactive +environment, or as `cshtobash ~/.login' to convert your login +environment. + +D5) How can I pipe standard output and standard error from one command to + another, like csh does with `|&'? + +Use + command 2>&1 | command2 + +The key is to remember that piping is performed before redirection, so +file descriptor 1 points to the pipe when it is duplicated onto file +descriptor 2. + +D6) Now that I've converted from ksh to bash, are there equivalents to + ksh features like autoloaded functions and the `whence' command? + +There are features in ksh-88 and ksh-93 that do not have direct bash +equivalents. Most, however, can be emulated with very little trouble. + +ksh-88 feature Bash equivalent +-------------- --------------- +compiled-in aliases set up aliases in .bashrc; some ksh aliases are + bash builtins (hash, history, type) +coprocesses named pipe pairs (one for read, one for write) +typeset +f declare -F +cd, print, whence function substitutes in examples/functions/kshenv +autoloaded functions examples/functions/autoload is the same as typeset -fu +read var?prompt read -p prompt var + +ksh-93 feature Bash equivalent +-------------- --------------- +sleep, getconf Bash has loadable versions in examples/loadables +${.sh.version} $BASH_VERSION +print -f printf +hist alias hist=fc +$HISTEDIT $FCEDIT + +Section E: How can I get bash to do certain things, and why does bash do + things the way it does? + +E1) Why is the bash builtin `test' slightly different from /bin/test? + +The specific example used here is [ ! x -o x ], which is false. + +Bash's builtin `test' implements the Posix.2 spec, which can be +summarized as follows (the wording is due to David Korn): + +Here is the set of rules for processing test arguments. + + 0 Args: False + 1 Arg: True iff argument is not null. + 2 Args: If first arg is !, True iff second argument is null. + If first argument is unary, then true if unary test is true + Otherwise error. + 3 Args: If second argument is a binary operator, do binary test of $1 $3 + If first argument is !, negate two argument test of $2 $3 + If first argument is `(' and third argument is `)', do the + one-argument test of the second argument. + Otherwise error. + 4 Args: If first argument is !, negate three argument test of $2 $3 $4. + Otherwise unspecified + 5 or more Args: unspecified. (Historical shells would use their + current algorithm). + +The operators -a and -o are considered binary operators for the purpose +of the 3 Arg case. + +As you can see, the test becomes (not (x or x)), which is false. + +E2) Why does bash sometimes say `Broken pipe'? + +If a sequence of commands appears in a pipeline, and one of the +reading commands finishes before the writer has finished, the +writer receives a SIGPIPE signal. Many other shells special-case +SIGPIPE as an exit status in the pipeline and do not report it. +For example, in: + + ps -aux | head + +`head' can finish before `ps' writes all of its output, and ps +will try to write on a pipe without a reader. In that case, bash +will print `Broken pipe' to stderr when ps is killed by a +SIGPIPE. + +You can build a version of bash that will not report SIGPIPE errors +by uncommenting the definition of DONT_REPORT_SIGPIPE in the file +config-top.h. + +E3) When I have terminal escape sequences in my prompt, why does bash + wrap lines at the wrong column? + +Readline, the line editing library that bash uses, does not know +that the terminal escape sequences do not take up space on the +screen. The redisplay code assumes, unless told otherwise, that +each character in the prompt is a `printable' character that +takes up one character position on the screen. + +You can use the bash prompt expansion facility (see the PROMPTING +section in the manual page) to tell readline that sequences of +characters in the prompt strings take up no screen space. + +Use the \[ escape to begin a sequence of non-printing characters, +and the \] escape to signal the end of such a sequence. + +E4) If I pipe the output of a command into `read variable', why doesn't + the output show up in $variable when the read command finishes? + +This has to do with the parent-child relationship between Unix +processes. It affects all commands run in pipelines, not just +simple calls to `read'. For example, piping a command's output +into a `while' loop that repeatedly calls `read' will result in +the same behavior. + +Each element of a pipeline runs in a separate process, a child of +the shell running the pipeline. A subprocess cannot affect its +parent's environment. When the `read' command sets the variable +to the input, that variable is set only in the subshell, not the +parent shell. When the subshell exits, the value of the variable +is lost. + +Many pipelines that end with `read variable' can be converted +into command substitutions, which will capture the output of +a specified command. The output can then be assigned to a +variable: + + grep ^gnu /usr/lib/news/active | wc -l | read ngroup + +can be converted into + + ngroup=$(grep ^gnu /usr/lib/news/active | wc -l) + +This does not, unfortunately, work to split the text among +multiple variables, as read does when given multiple variable +arguments. If you need to do this, you can either use the +command substitution above to read the output into a variable +and chop up the variable using the bash pattern removal +expansion operators or use some variant of the following +approach. + +Say /usr/local/bin/ipaddr is the following shell script: + +#! /bin/sh +host `hostname` | awk '/address/ {print $NF}' + +Instead of using + + /usr/local/bin/ipaddr | read A B C D + +to break the local machine's IP address into separate octets, use + + OIFS="$IFS" + IFS=. + set -- $(/usr/local/bin/ipaddr) + IFS="$OIFS" + A="$1" B="$2" C="$3" D="$4" + +Beware, however, that this will change the shell's positional +parameters. If you need them, you should save them before doing +this. + +This is the general approach -- in most cases you will not need to +set $IFS to a different value. + +Some other user-supplied alternatives include: + +read A B C D << HERE + $(IFS=.; echo $(/usr/local/bin/ipaddr)) +HERE + +and, where process substitution is available, + +read A B C D < <(IFS=.; echo $(/usr/local/bin/ipaddr)) + +E5) I have a bunch of shell scripts that use backslash-escaped characters + in arguments to `echo'. Bash doesn't interpret these characters. Why + not, and how can I make it understand them? + +This is the behavior of echo on most Unix System V machines. + +The bash builtin `echo' is modeled after the 9th Edition +Research Unix version of `echo'. It does not interpret +backslash-escaped characters in its argument strings by default; +it requires the use of the -e option to enable the +interpretation. The System V echo provides no way to disable the +special characters; the bash echo has a -E option to disable +them. + +There is a configuration option that will make bash behave like +the System V echo and interpret things like `\t' by default. Run +configure with the --enable-xpg-echo-default option to turn this +on. Be aware that this will cause some of the tests run when you +type `make tests' to fail. + +There is a shell option, `xpg_echo', settable with `shopt', that will +change the behavior of echo at runtime. Enabling this option turns +on expansion of backslash-escape sequences. + +E6) Why doesn't a while or for loop get suspended when I type ^Z? + +This is a consequence of how job control works on Unix. The only +thing that can be suspended is the process group. This is a single +command or pipeline of commands that the shell forks and executes. + +When you run a while or for loop, the only thing that the shell forks +and executes are any commands in the while loop test and commands in +the loop bodies. These, therefore, are the only things that can be +suspended when you type ^Z. + +If you want to be able to stop the entire loop, you need to put it +within parentheses, which will force the loop into a subshell that +may be stopped (and subsequently restarted) as a single unit. + +E7) What about empty for loops in Makefiles? + +It's fairly common to see constructs like this in automatically-generated +Makefiles: + +SUBDIRS = @SUBDIRS@ + + ... + +subdirs-clean: + for d in ${SUBDIRS}; do \ + ( cd $$d && ${MAKE} ${MFLAGS} clean ) \ + done + +When SUBDIRS is empty, this results in a command like this being passed to +bash: + + for d in ; do + ( cd $d && ${MAKE} ${MFLAGS} clean ) + done + +In versions of bash before bash-2.05a, this was a syntax error. If the +reserved word `in' was present, a word must follow it before the semicolon +or newline. The language in the manual page referring to the list of words +being empty referred to the list after it is expanded. These versions of +bash required that there be at least one word following the `in' when the +construct was parsed. + +The idiomatic Makefile solution is something like: + +SUBDIRS = @SUBDIRS@ + +subdirs-clean: + subdirs=$SUBDIRS ; for d in $$subdirs; do \ + ( cd $$d && ${MAKE} ${MFLAGS} clean ) \ + done + +The latest drafts of the updated POSIX standard have changed this: the +word list is no longer required. Bash versions 2.05a and later accept +the new syntax. + +E8) Why does the arithmetic evaluation code complain about `08'? + +The bash arithmetic evaluation code (used for `let', $(()), (()), and in +other places), interprets a leading `0' in numeric constants as denoting +an octal number, and a leading `0x' as denoting hexadecimal. This is +in accordance with the POSIX.2 spec, section 2.9.2.1, which states that +arithmetic constants should be handled as signed long integers as defined +by the ANSI/ISO C standard. + +The POSIX.2 interpretation committee has confirmed this: + +http://www.pasc.org/interps/unofficial/db/p1003.2/pasc-1003.2-173.html + +E9) Why does the pattern matching expression [A-Z]* match files beginning + with every letter except `z'? + +Bash-2.03, Bash-2.05 and later versions honor the current locale setting +when processing ranges within pattern matching bracket expressions ([A-Z]). +This is what POSIX.2 and SUSv3/XPG6 specify. + +The behavior of the matcher in bash-2.05 and later versions depends on the +current LC_COLLATE setting. Setting this variable to `C' or `POSIX' will +result in the traditional behavior ([A-Z] matches all uppercase ASCII +characters). Many other locales, including the en_US locale (the default +on many US versions of Linux) collate the upper and lower case letters like +this: + + AaBb...Zz + +which means that [A-Z] matches every letter except `z'. Others collate like + + aAbBcC...zZ + +which means that [A-Z] matches every letter except `a'. + +The portable way to specify upper case letters is [:upper:] instead of +A-Z; lower case may be specified as [:lower:] instead of a-z. + +Look at the manual pages for setlocale(3), strcoll(3), and, if it is +present, locale(1). If you have locale(1), you can use it to find +your current locale information even if you do not have any of the +LC_ variables set. + +My advice is to put + + export LC_COLLATE=C + +into /etc/profile and inspect any shell scripts run from cron for +constructs like [A-Z]. This will prevent things like + + rm [A-Z]* + +from removing every file in the current directory except those beginning +with `z' and still allow individual users to change the collation order. +Users may put the above command into their own profiles as well, of course. + +E10) Why does `cd //' leave $PWD as `//'? + +POSIX.2, in its description of `cd', says that *three* or more leading +slashes may be replaced with a single slash when canonicalizing the +current working directory. + +This is, I presume, for historical compatibility. Certain versions of +Unix, and early network file systems, used paths of the form +//hostname/path to access `path' on server `hostname'. + +E11) If I resize my xterm while another program is running, why doesn't bash + notice the change? + +This is another issue that deals with job control. + +The kernel maintains a notion of a current terminal process group. Members +of this process group (processes whose process group ID is equal to the +current terminal process group ID) receive terminal-generated signals like +SIGWINCH. (For more details, see the JOB CONTROL section of the bash +man page.) + +If a terminal is resized, the kernel sends SIGWINCH to each member of +the terminal's current process group (the `foreground' process group). + +When bash is running with job control enabled, each pipeline (which may be +a single command) is run in its own process group, different from bash's +process group. This foreground process group receives the SIGWINCH; bash +does not. Bash has no way of knowing that the terminal has been resized. + +There is a `checkwinsize' option, settable with the `shopt' builtin, that +will cause bash to check the window size and adjust its idea of the +terminal's dimensions each time a process stops or exits and returns control +of the terminal to bash. Enable it with `shopt -s checkwinsize'. + +Section F: Things to watch out for on certain Unix versions + +F1) Why can't I use command line editing in my `cmdtool'? + +The problem is `cmdtool' and bash fighting over the input. When +scrolling is enabled in a cmdtool window, cmdtool puts the tty in +`raw mode' to permit command-line editing using the mouse for +applications that cannot do it themselves. As a result, bash and +cmdtool each try to read keyboard input immediately, with neither +getting enough of it to be useful. + +This mode also causes cmdtool to not implement many of the +terminal functions and control sequences appearing in the +`sun-cmd' termcap entry. For a more complete explanation, see +that file examples/suncmd.termcap in the bash distribution. + +`xterm' is a better choice, and gets along with bash much more +smoothly. + +If you must use cmdtool, you can use the termcap description in +examples/suncmd.termcap. Set the TERMCAP variable to the terminal +description contained in that file, i.e. + +TERMCAP='Mu|sun-cmd:am:bs:km:pt:li#34:co#80:cl=^L:ce=\E[K:cd=\E[J:rs=\E[s:' + +Then export TERMCAP and start a new cmdtool window from that shell. +The bash command-line editing should behave better in the new +cmdtool. If this works, you can put the assignment to TERMCAP +in your bashrc file. + +F2) I built bash on Solaris 2. Why do globbing expansions and filename + completion chop off the first few characters of each filename? + +This is the consequence of building bash on SunOS 5 and linking +with the libraries in /usr/ucblib, but using the definitions +and structures from files in /usr/include. + +The actual conflict is between the dirent structure in +/usr/include/dirent.h and the struct returned by the version of +`readdir' in libucb.a (a 4.3-BSD style `struct direct'). + +Make sure you've got /usr/ccs/bin ahead of /usr/ucb in your $PATH +when configuring and building bash. This will ensure that you +use /usr/ccs/bin/cc or acc instead of /usr/ucb/cc and that you +link with libc before libucb. + +If you have installed the Sun C compiler, you may also need to +put /usr/ccs/bin and /opt/SUNWspro/bin into your $PATH before +/usr/ucb. + +F3) Why does bash dump core after I interrupt username completion or + `~user' tilde expansion on a machine running NIS? + +This is a famous and long-standing bug in the SunOS YP (sorry, NIS) +client library, which is part of libc. + +The YP library code keeps static state -- a pointer into the data +returned from the server. When YP initializes itself (setpwent), +it looks at this pointer and calls free on it if it's non-null. +So far, so good. + +If one of the YP functions is interrupted during getpwent (the +exact function is interpretwithsave()), and returns NULL, the +pointer is freed without being reset to NULL, and the function +returns. The next time getpwent is called, it sees that this +pointer is non-null, calls free, and the bash free() blows up +because it's being asked to free freed memory. + +The traditional Unix mallocs allow memory to be freed multiple +times; that's probably why this has never been fixed. You can +run configure with the `--without-gnu-malloc' option to use +the C library malloc and avoid the problem. + +F4) I'm running SVR4.2. Why is the line erased every time I type `@'? + +The `@' character is the default `line kill' character in most +versions of System V, including SVR4.2. You can change this +character to whatever you want using `stty'. For example, to +change the line kill character to control-u, type + + stty kill ^U + +where the `^' and `U' can be two separate characters. + +F5) Why does bash report syntax errors when my C News scripts use a + redirection before a subshell command? + +The actual command in question is something like + + < file ( command ) + +According to the grammar given in the POSIX.2 standard, this construct +is, in fact, a syntax error. Redirections may only precede `simple +commands'. A subshell construct such as the above is one of the shell's +`compound commands'. A redirection may only follow a compound command. + +This affects the mechanical transformation of commands that use `cat' +to pipe a file into a command (a favorite Useless-Use-Of-Cat topic on +comp.unix.shell). While most commands of the form + + cat file | command + +can be converted to `< file command', shell control structures such as +loops and subshells require `command < file'. + +The file CWRU/sh-redir-hack in the bash-2.05a distribution is an +(unofficial) patch to parse.y that will modify the grammar to +support this construct. It will not apply with `patch'; you must +modify parse.y by hand. Note that if you apply this, you must +recompile with -DREDIRECTION_HACK. This introduces a large +number of reduce/reduce conflicts into the shell grammar. + +F6) Why can't I use vi-mode editing on Red Hat Linux 6.1? + +The short answer is that Red Hat screwed up. + +The long answer is that they shipped an /etc/inputrc that only works +for emacs mode editing, and then screwed all the vi users by setting +INPUTRC to /etc/inputrc in /etc/profile. + +The short fix is to do one of the following: remove or rename +/etc/inputrc, set INPUTRC=~/.inputrc in ~/.bashrc (or .bash_profile, +but make sure you export it if you do), remove the assignment to +INPUTRC from /etc/profile, add + + set keymap emacs + +to the beginning of /etc/inputrc, or bracket the key bindings in +/etc/inputrc with these lines + + $if mode=emacs + [...] + $endif + +F7) Why do bash-2.05a and bash-2.05b fail to compile `printf.def' on + HP/UX 11.x? + +HP/UX's support for long double is imperfect at best. + +GCC will support it without problems, but the HP C library functions +like strtold(3) and printf(3) don't actually work with long doubles. +HP implemented a `long_double' type as a 4-element array of 32-bit +ints, and that is what the library functions use. The ANSI C +`long double' type is a 128-bit floating point scalar. + +The easiest fix, until HP fixes things up, is to edit the generated +config.h and #undef the HAVE_LONG_DOUBLE line. After doing that, +the compilation should complete successfully. + +Section G: How can I get bash to do certain common things? + +G1) How can I get bash to read and display eight-bit characters? + +This is a process requiring several steps. + +First, you must ensure that the `physical' data path is a full eight +bits. For xterms, for example, the `vt100' resources `eightBitInput' +and `eightBitOutput' should be set to `true'. + +Once you have set up an eight-bit path, you must tell the kernel and +tty driver to leave the eighth bit of characters alone when processing +keyboard input. Use `stty' to do this: + + stty cs8 -istrip -parenb + +For old BSD-style systems, you can use + + stty pass8 + +You may also need + + stty even odd + +Finally, you need to tell readline that you will be inputting and +displaying eight-bit characters. You use readline variables to do +this. These variables can be set in your .inputrc or using the bash +`bind' builtin. Here's an example using `bind': + + bash$ bind 'set convert-meta off' + bash$ bind 'set meta-flag on' + bash$ bind 'set output-meta on' + +The `set' commands between the single quotes may also be placed +in ~/.inputrc. + +G2) How do I write a function `x' to replace builtin command `x', but + still invoke the command from within the function? + +This is why the `command' and `builtin' builtins exist. The +`command' builtin executes the command supplied as its first +argument, skipping over any function defined with that name. The +`builtin' builtin executes the builtin command given as its first +argument directly. + +For example, to write a function to replace `cd' that writes the +hostname and current directory to an xterm title bar, use +something like the following: + + cd() + { + builtin cd "$@" && xtitle "$HOST: $PWD" + } + +This could also be written using `command' instead of `builtin'; +the version above is marginally more efficient. + +G3) How can I find the value of a shell variable whose name is the value + of another shell variable? + +Versions of Bash newer than Bash-2.0 support this directly. You can use + + ${!var} + +For example, the following sequence of commands will echo `z': + + var1=var2 + var2=z + echo ${!var1} + +For sh compatibility, use the `eval' builtin. The important +thing to remember is that `eval' expands the arguments you give +it again, so you need to quote the parts of the arguments that +you want `eval' to act on. + +For example, this expression prints the value of the last positional +parameter: + + eval echo \"\$\{$#\}\" + +The expansion of the quoted portions of this expression will be +deferred until `eval' runs, while the `$#' will be expanded +before `eval' is executed. In versions of bash later than bash-2.0, + + echo ${!#} + +does the same thing. + +This is not the same thing as ksh93 `nameref' variables, though the syntax +is similar. I may add namerefs in a future bash version. + +G4) How can I make the bash `time' reserved word print timing output that + looks like the output from my system's /usr/bin/time? + +The bash command timing code looks for a variable `TIMEFORMAT' and +uses its value as a format string to decide how to display the +timing statistics. + +The value of TIMEFORMAT is a string with `%' escapes expanded in a +fashion similar in spirit to printf(3). The manual page explains +the meanings of the escape sequences in the format string. + +If TIMEFORMAT is not set, bash acts as if the following assignment had +been performed: + + TIMEFORMAT=$'\nreal\t%3lR\nuser\t%3lU\nsys\t%3lS' + +The POSIX.2 default time format (used by `time -p command') is + + TIMEFORMAT=$'real %2R\nuser %2U\nsys %2S' + +The BSD /usr/bin/time format can be emulated with: + + TIMEFORMAT=$'\t%1R real\t%1U user\t%1S sys' + +The System V /usr/bin/time format can be emulated with: + + TIMEFORMAT=$'\nreal\t%1R\nuser\t%1U\nsys\t%1S' + +The ksh format can be emulated with: + + TIMEFORMAT=$'\nreal\t%2lR\nuser\t%2lU\nsys\t%2lS' + +G5) How do I get the current directory into my prompt? + +Bash provides a number of backslash-escape sequences which are expanded +when the prompt string (PS1 or PS2) is displayed. The full list is in +the manual page. + +The \w expansion gives the full pathname of the current directory, with +a tilde (`~') substituted for the current value of $HOME. The \W +expansion gives the basename of the current directory. To put the full +pathname of the current directory into the path without any tilde +subsitution, use $PWD. Here are some examples: + + PS1='\w$ ' # current directory with tilde + PS1='\W$ ' # basename of current directory + PS1='$PWD$ ' # full pathname of current directory + +The single quotes are important in the final example to prevent $PWD from +being expanded when the assignment to PS1 is performed. + +G6) How can I rename "*.foo" to "*.bar"? + +Use the pattern removal functionality described in D3. The following `for' +loop will do the trick: + + for f in *.foo; do + mv $f ${f%foo}bar + done + +G7) How can I translate a filename from uppercase to lowercase? + +The script examples/functions/lowercase, originally written by John DuBois, +will do the trick. The converse is left as an exercise. + +G8) How can I write a filename expansion (globbing) pattern that will match + all files in the current directory except "." and ".."? + +You must have set the `extglob' shell option using `shopt -s extglob' to use +this: + + echo .!(.|) * + +A solution that works without extended globbing is given in the Unix Shell +FAQ, posted periodically to comp.unix.shell. + +Section H: Where do I go from here? + +H1) How do I report bugs in bash, and where should I look for fixes and + advice? + +Use the `bashbug' script to report bugs. It is built and +installed at the same time as bash. It provides a standard +template for reporting a problem and automatically includes +information about your configuration and build environment. + +`bashbug' sends its reports to bug-bash@gnu.org, which +is a large mailing list gatewayed to the usenet newsgroup gnu.bash.bug. + +Bug fixes, answers to questions, and announcements of new releases +are all posted to gnu.bash.bug. Discussions concerning bash features +and problems also take place there. + +To reach the bash maintainers directly, send mail to +bash-maintainers@gnu.org. + +H2) What kind of bash documentation is there? + +First, look in the doc directory in the bash distribution. It should +contain at least the following files: + +bash.1 an extensive, thorough Unix-style manual page +builtins.1 a manual page covering just bash builtin commands +bashref.texi a reference manual in GNU tex`info format +bashref.info an info version of the reference manual +FAQ this file +article.ms text of an article written for The Linux Journal +readline.3 a man page describing readline + +Postscript, HTML, and ASCII files created from the above source are +available in the documentation distribution. + +There is additional documentation available for anonymous FTP from host +ftp.cwru.edu in the `pub/bash' directory. + +Cameron Newham and Bill Rosenblatt have written a book on bash, published +by O'Reilly and Associates. The book is based on Bill Rosenblatt's Korn +Shell book. The title is ``Learning the Bash Shell'', and the ISBN number +is 1-56592-147-X. Look for it in fine bookstores near you. This book +covers bash-1.14, but has an appendix describing some of the new features +in bash-2.0. + +A second edition of this book is available, published in January, 1998. +The ISBN number is 1-56592-347-2. Look for it in the same fine bookstores +or on the web. + +The GNU Bash Reference Manual has been published as a printed book by +Network Theory Ltd (Paperback, ISBN: 0-9541617-7-7, Feb 2003). It covers +bash-2.0 and is available from most online bookstores (see +http://www.network-theory.co.uk/bash/manual/ for details). The publisher +will donate $1 to the Free Software Foundation for each copy sold. + +H3) What's coming in future versions? + +These are features I hope to include in a future version of bash. + +a better bash debugger (a minimally-tested version is included with bash-2.05b) +associative arrays +co-processes, but with a new-style syntax that looks like function declaration + +H4) What's on the bash `wish list' for future versions? + +These are features that may or may not appear in a future version of bash. + +breaking some of the shell functionality into embeddable libraries +a module system like zsh's, using dynamic loading like builtins +better internationalization using GNU `gettext' +date-stamped command history +a bash programmer's guide with a chapter on creating loadable builtins +a better loadable interface to perl with access to the shell builtins and + variables (contributions gratefully accepted) +ksh93-like `nameref' variables +ksh93-like `+=' variable assignment operator +ksh93-like `xx.yy' variables (including some of the .sh.* variables) and + associated disipline functions +Some of the new ksh93 pattern matching operators, like backreferencing + +H5) When will the next release appear? + +The next version will appear sometime in 2002. Never make predictions. + + +This document is Copyright 1995-2003 by Chester Ramey. + +Permission is hereby granted, without written agreement and +without license or royalty fees, to use, copy, and distribute +this document for any purpose, provided that the above copyright +notice appears in all copies of this document and that the +contents of this document remain unaltered. diff --git a/doc/bash.1.orig b/doc/bash.1.orig new file mode 100644 index 00000000..828ec966 --- /dev/null +++ b/doc/bash.1.orig @@ -0,0 +1,8583 @@ +.\" +.\" MAN PAGE COMMENTS to +.\" +.\" Chet Ramey +.\" Information Network Services +.\" Case Western Reserve University +.\" chet@po.CWRU.Edu +.\" +.\" Last Change: Mon Apr 14 17:57:24 EDT 2003 +.\" +.\" bash_builtins, strip all but Built-Ins section +.if \n(zZ=1 .ig zZ +.if \n(zY=1 .ig zY +.TH BASH 1 "2003 April 14" "GNU Bash-3.0" +.\" +.\" There's some problem with having a `@' +.\" in a tagged paragraph with the BSD man macros. +.\" It has to do with `@' appearing in the }1 macro. +.\" This is a problem on 4.3 BSD and Ultrix, but Sun +.\" appears to have fixed it. +.\" If you're seeing the characters +.\" `@u-3p' appearing before the lines reading +.\" `possible-hostname-completions +.\" and `complete-hostname' down in READLINE, +.\" then uncomment this redefinition. +.\" +.de }1 +.ds ]X \&\\*(]B\\ +.nr )E 0 +.if !"\\$1"" .nr )I \\$1n +.}f +.ll \\n(LLu +.in \\n()Ru+\\n(INu+\\n()Iu +.ti \\n(INu +.ie !\\n()Iu+\\n()Ru-\w\\*(]Xu-3p \{\\*(]X +.br\} +.el \\*(]X\h|\\n()Iu+\\n()Ru\c +.}f +.. +.\" +.\" File Name macro. This used to be `.PN', for Path Name, +.\" but Sun doesn't seem to like that very much. +.\" +.de FN +\fI\|\\$1\|\fP +.. +.SH NAME +bash \- GNU Bourne-Again SHell +.SH SYNOPSIS +.B bash +[options] +[file] +.SH COPYRIGHT +.if n Bash is Copyright (C) 1989-2002 by the Free Software Foundation, Inc. +.if t Bash is Copyright \(co 1989-2002 by the Free Software Foundation, Inc. +.SH DESCRIPTION +.B Bash +is an \fBsh\fR-compatible command language interpreter that +executes commands read from the standard input or from a file. +.B Bash +also incorporates useful features from the \fIKorn\fP and \fIC\fP +shells (\fBksh\fP and \fBcsh\fP). +.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 +.TP 10 +.BI \-c "\| string\^" +If the +.B \-c +option is present, then commands are read from +.IR string . +If there are arguments after the +.IR string , +they are assigned to the positional parameters, starting with +.BR $0 . +.TP +.B \-i +If the +.B \-i +option is present, the shell is +.IR interactive . +.TP +.B \-l +Make +.B bash +act as if it had been invoked as a login shell (see +.SM +.B INVOCATION +below). +.TP +.B \-r +If the +.B \-r +option is present, the shell becomes +.I restricted +(see +.SM +.B "RESTRICTED SHELL" +below). +.TP +.B \-s +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 +when invoking an interactive shell. +.TP +.B \-D +A list of all double-quoted strings preceded by \fB$\fP +is printed on the standard ouput. +These are the strings that +are subject to language translation when the current locale +is not \fBC\fP or \fBPOSIX\fP. +This implies the \fB\-n\fP option; no commands will be executed. +.TP +.B [\-+]O [\fIshopt_option\fP] +\fIshopt_option\fP is one of the shell options accepted by the +\fBshopt\fP builtin (see +.SM +.B SHELL BUILTIN COMMANDS +below). +If \fIshopt_option\fP is present, \fB\-O\fP sets the value of that option; +\fB+O\fP unsets it. +If \fIshopt_option\fP is not supplied, the names and values of the shell +options accepted by \fBshopt\fP are printed on the standard output. +If the invocation option is \fB+O\fP, the output is displayed in a format +that may be reused as input. +.TP +.B \-\- +A +.B \-\- +signals the end of options and disables further option processing. +Any arguments after the +.B \-\- +are treated as filenames and arguments. An argument of +.B \- +is equivalent to \fB\-\-\fP. +.PD +.PP +.B Bash +also interprets a number of multi-character options. +These options must appear on the command line before the +single-character options to be recognized. +.PP +.PD 0 +.TP +.B \-\-debugger +Arrange for the debugger profile to be executed before the shell +starts. Turns on extended debugging mode (see the description of the +.B extdebug +option to the +.B shopt +builtin below) and shell function tracing (see the description of the +\fB\-o functrace\fP option to the +.B set +builtin below). +.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. +.TP +.B \-\-help +Display a usage message on standard output and exit successfully. +.TP +\fB\-\-init\-file\fP \fIfile\fP +.PD 0 +.TP +\fB\-\-rcfile\fP \fIfile\fP +.PD +Execute commands from +.I file +instead of the standard personal initialization file +.I ~/.bashrc +if the shell is interactive (see +.SM +.B INVOCATION +below). +.TP +.B \-\-login +Equivalent to \fB\-l\fP. +.TP +.B \-\-noediting +Do not use the GNU +.B readline +library to read command lines when the shell is interactive. +.TP +.B \-\-noprofile +Do not read either the system-wide startup file +.FN /etc/profile +or any of the personal initialization files +.IR ~/.bash_profile , +.IR ~/.bash_login , +or +.IR ~/.profile . +By default, +.B bash +reads these files when it is invoked as a login shell (see +.SM +.B INVOCATION +below). +.TP +.B \-\-norc +Do not read and execute the personal initialization file +.I ~/.bashrc +if the shell is interactive. +This option is on by default if the shell is invoked as +.BR sh . +.TP +.B \-\-posix +Change the behavior of \fBbash\fP where the default operation differs +from the POSIX 1003.2 standard to match the standard (\fIposix mode\fP). +.TP +.B \-\-restricted +The shell becomes restricted (see +.SM +.B "RESTRICTED SHELL" +below). +.TP +.B \-\-verbose +Equivalent to \fB\-v\fP. +.TP +.B \-\-version +Show version information for this instance of +.B bash +on the standard output and exit successfully. +.PD +.SH ARGUMENTS +If arguments remain after option processing, and neither the +.B \-c +nor the +.B \-s +option has been supplied, the first argument is assumed to +be the name of a file containing shell commands. +If +.B bash +is invoked in this fashion, +.B $0 +is set to the name of the file, and the positional parameters +are set to the remaining arguments. +.B Bash +reads and executes commands from this file, then exits. +\fBBash\fP's exit status is the exit status of the last command +executed in the script. +If no commands are executed, the exit status is 0. +An attempt is first made to open the file in the current directory, and, +if no file is found, then the shell searches the directories in +.SM +.B PATH +for the script. +.SH INVOCATION +A \fIlogin shell\fP is one whose first character of argument zero is a +.BR \- , +or one started with the +.B \-\-login +option. +.PP +An \fIinteractive\fP shell is one started without non-option arguments +and without the +.B \-c +option +whose standard input and output are +both connected to terminals (as determined by +.IR isatty (3)), +or one started with the +.B \-i +option. +.SM +.B PS1 +is set and +.B $\- +includes +.B i +if +.B bash +is interactive, +allowing a shell script or a startup file to test this state. +.PP +The following paragraphs describe how +.B bash +executes its startup files. +If any of the files exist but cannot be read, +.B bash +reports an error. +Tildes are expanded in file names as described below under +.B "Tilde Expansion" +in the +.SM +.B EXPANSION +section. +.PP +When +.B bash +is invoked as an interactive login shell, or as a non-interactive shell +with the \fB\-\-login\fP option, it first reads and +executes commands from the file \fI/etc/profile\fP, if that +file exists. +After reading that file, it looks for \fI~/.bash_profile\fP, +\fI~/.bash_login\fP, and \fI~/.profile\fP, in that order, and reads +and executes commands from the first one that exists and is readable. +The +.B \-\-noprofile +option may be used when the shell is started to inhibit this behavior. +.PP +When a login shell exits, +.B bash +reads and executes commands from the file \fI~/.bash_logout\fP, if it +exists. +.PP +When an interactive shell that is not a login shell is started, +.B bash +reads and executes commands from \fI~/.bashrc\fP, if that file exists. +This may be inhibited by using the +.B \-\-norc +option. +The \fB\-\-rcfile\fP \fIfile\fP option will force +.B bash +to read and execute commands from \fIfile\fP instead of \fI~/.bashrc\fP. +.PP +When +.B bash +is started non-interactively, to run a shell script, for example, it +looks for the variable +.SM +.B BASH_ENV +in the environment, expands its value if it appears there, and uses the +expanded value as the name of a file to read and execute. +.B Bash +behaves as if the following command were executed: +.sp .5 +.RS +.if t \f(CWif [ \-n "$BASH_ENV" ]; then . "$BASH_ENV"; fi\fP +.if n if [ \-n "$BASH_ENV" ]; then . "$BASH_ENV"; fi +.RE +.sp .5 +but the value of the +.SM +.B PATH +variable is not used to search for the file name. +.PP +If +.B bash +is invoked with the name +.BR sh , +it tries to mimic the startup behavior of historical versions of +.B sh +as closely as possible, +while conforming to the POSIX standard as well. +When invoked as an interactive login shell, or a non-interactive +shell with the \fB\-\-login\fP option, it first attempts to +read and execute commands from +.I /etc/profile +and +.IR ~/.profile , +in that order. +The +.B \-\-noprofile +option may be used to inhibit this behavior. +When invoked as an interactive shell with the name +.BR sh , +.B bash +looks for the variable +.SM +.BR 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 +.B sh +does not attempt to read and execute commands from any other startup +files, the +.B \-\-rcfile +option has no effect. +A non-interactive shell invoked with the name +.B sh +does not attempt to read any other startup files. +When invoked as +.BR sh , +.B bash +enters +.I posix +mode after the startup files are read. +.PP +When +.B bash +is started in +.I posix +mode, as with the +.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 +attempts to determine when it is being run by the remote shell +daemon, usually \fIrshd\fP. +If +.B bash +determines it is being run by \fIrshd\fP, it reads and executes +commands from \fI~/.bashrc\fP, if that file exists and is readable. +It will not do this if invoked as \fBsh\fP. +The +.B \-\-norc +option may be used to inhibit this behavior, and the +.B \-\-rcfile +option may be used to force another file to be read, but +\fIrshd\fP does not generally invoke the shell with those options +or allow them to be specified. +.PP +If the shell is started with the effective user (group) id not equal to the +real user (group) id, and the \fB\-p\fP option is not supplied, no startup +files are read, shell functions are not inherited from the environment, the +.SM +.B SHELLOPTS +variable, if it appears in the environment, is ignored, +and the effective user id is set to the real user id. +If the \fB\-p\fP option is supplied at invocation, the startup behavior is +the same, but the effective user id is not reset. +.SH DEFINITIONS +.PP +The following definitions are used throughout the rest of this +document. +.PD 0 +.TP +.B blank +A space or tab. +.TP +.B word +A sequence of characters considered as a single unit by the shell. +Also known as a +.BR token . +.TP +.B name +A +.I word +consisting only of alphanumeric characters and underscores, and +beginning with an alphabetic character or an underscore. Also +referred to as an +.BR identifier . +.TP +.B metacharacter +A character that, when unquoted, separates words. One of the following: +.br +.RS +.PP +.if t \fB| & ; ( ) < > space tab\fP +.if n \fB| & ; ( ) < > space tab\fP +.RE +.PP +.TP +.B control operator +A \fItoken\fP that performs a control function. It is one of the following +symbols: +.RS +.PP +.if t \fB\(bv\(bv & && ; ;; ( ) | \fP +.if n \fB|| & && ; ;; ( ) | \fP +.RE +.PD +.SH "RESERVED WORDS" +\fIReserved words\fP are words that have a special meaning to the shell. +The following words are recognized as reserved when unquoted and either +the first word of a simple command (see +.SM +.B SHELL GRAMMAR +below) or the third word of a +.B case +or +.B for +command: +.if t .RS +.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 +.SH "SHELL GRAMMAR" +.SS Simple Commands +.PP +A \fIsimple command\fP is a sequence of optional variable assignments +followed by \fBblank\fP-separated words and redirections, and +terminated by a \fIcontrol operator\fP. The first word +specifies the command to be executed, and is passed as argument zero. +The remaining words are passed as arguments to the invoked command. +.PP +The return value of a \fIsimple command\fP is its exit status, or +128+\fIn\^\fP if the command is terminated by signal +.IR n . +.SS Pipelines +.PP +A \fIpipeline\fP is a sequence of one or more commands separated by +the character +.BR | . +The format for a pipeline is: +.RS +.PP +[\fBtime\fP [\fB\-p\fP]] [ ! ] \fIcommand\fP [ \fB|\fP \fIcommand2\fP ... ] +.RE +.PP +The standard output of +.I command +is connected via a pipe to the standard input of +.IR command2 . +This connection is performed before any redirections specified by the +command (see +.SM +.B REDIRECTION +below). +.PP +If the reserved word +.B ! +precedes a pipeline, the exit status of that +pipeline is the logical NOT of the exit status of the last command. +Otherwise, the status of the pipeline is the exit status of the last +command. +The shell waits for all commands in the pipeline to +terminate before returning a value. +.PP +If the +.B time +reserved word precedes a pipeline, the elapsed as well as user and +system time consumed by its execution are reported when the pipeline +terminates. +The \fB\-p\fP option changes the output format to that specified by POSIX. +The +.SM +.B TIMEFORMAT +variable may be set to a format string that specifies how the timing +information should be displayed; see the description of +.SM +.B TIMEFORMAT +under +.B "Shell Variables" +below. +.PP +Each command in a pipeline is executed as a separate process (i.e., in a +subshell). +.SS Lists +.PP +A \fIlist\fP is a sequence of one or more pipelines separated by one +of the operators +.BR ; , +.BR & , +.BR && , +or +.BR \(bv\(bv , +and optionally terminated by one of +.BR ; , +.BR & , +or +.BR . +.PP +Of these list operators, +.B && +and +.B \(bv\(bv +have equal precedence, followed by +.B ; +and +.BR &, +which have equal precedence. +.PP +A sequence of one or more newlines may appear in a \fIlist\fP instead +of a semicolon to delimit commands. +.PP +If a command is terminated by the control operator +.BR & , +the shell executes the command in the \fIbackground\fP +in a subshell. The shell does not wait for the command to +finish, and the return status is 0. Commands separated by a +.B ; +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. +.PP +The control operators +.B && +and +.B \(bv\(bv +denote AND lists and OR lists, respectively. +An AND list has the form +.RS +.PP +\fIcommand1\fP \fB&&\fP \fIcommand2\fP +.RE +.PP +.I command2 +is executed if, and only if, +.I command1 +returns an exit status of zero. +.PP +An OR list has the form +.RS +.PP +\fIcommand1\fP \fB\(bv\(bv\fP \fIcommand2\fP +.PP +.RE +.PP +.I command2 +is executed if and only if +.I command1 +returns a non-zero exit status. The return status of +AND and OR lists is the exit status of the last command +executed in the list. +.SS Compound Commands +.PP +A \fIcompound command\fP is one of the following: +.TP +(\fIlist\fP) +\fIlist\fP is executed in a subshell. Variable assignments and builtin +commands that affect the shell's environment do not remain in effect +after the command completes. The return status is the exit status of +\fIlist\fP. +.TP +{ \fIlist\fP; } +\fIlist\fP is simply executed in the current shell environment. +\fIlist\fP must be terminated with a newline or semicolon. +This is known as a \fIgroup command\fP. +The return status is the exit status of +\fIlist\fP. +Note that unlike the metacharacters \fB(\fP and \fB)\fP, \fB{\fP and +\fB}\fP are \fIreserved words\fP and must occur where a reserved +word is permitted to be recognized. Since they do not cause a word +break, they must be separated from \fIlist\fP by whitespace. +.TP +((\fIexpression\fP)) +The \fIexpression\fP is evaluated according to the rules described +below under +.SM +.BR "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 +\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. +Conditional operators such as \fB\-f\fP must be unquoted to be recognized +as primaries. +.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 +.LP +The \fB&&\fP and +.if t \fB\(bv\(bv\fP +.if n \fB||\fP +operators do not evaluate \fIexpression2\fP if the value of +\fIexpression1\fP is sufficient to determine the return value of +the entire conditional expression. +.RE +.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 +of items. +The variable \fIname\fP is set to each element of this list +in turn, and \fIlist\fP is executed each time. +If the \fBin\fP \fIword\fP is omitted, the \fBfor\fP command executes +\fIlist\fP once for each positional parameter that is set (see +.SM +.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 +\fBfor\fP (( \fIexpr1\fP ; \fIexpr2\fP ; \fIexpr3\fP )) ; \fBdo\fP \fIlist\fP ; \fBdone\fP +First, the arithmetic expression \fIexpr1\fP is evaluated according +to the rules described below under +.SM +.BR "ARITHMETIC EVALUATION" . +The arithmetic expression \fIexpr2\fP is then evaluated repeatedly +until it evaluates to zero. +Each time \fIexpr2\fP evaluates to a non-zero value, \fIlist\fP is +executed and the arithmetic expression \fIexpr3\fP is evaluated. +If any expression is omitted, it behaves as if it evaluates to 1. +The return value is the exit status of the last command in \fIlist\fP +that is executed, or false if any of the expressions is invalid. +.TP +\fBselect\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 +of items. The set of expanded words is printed on the standard +error, each preceded by a number. If the \fBin\fP +\fIword\fP is omitted, the positional parameters are printed (see +.SM +.B PARAMETERS +below). The +.B PS3 +prompt is then displayed and a line read from the standard input. +If the line consists of a number corresponding to one of +the displayed words, then the value of +.I name +is set to that word. If the line is empty, the words and prompt +are displayed again. If EOF is read, the command completes. Any +other value read causes +.I name +to be set to null. The line read is saved in the variable +.BR REPLY . +The +.I list +is executed after each selection until a +.B break +command is executed. +The exit status of +.B select +is the exit status of the last command executed in +.IR list , +or zero if no commands were executed. +.TP +\fBcase\fP \fIword\fP \fBin\fP [ [(] \fIpattern\fP [ \fB|\fP \fIpattern\fP ] \ +... ) \fIlist\fP ;; ] ... \fBesac\fP +A \fBcase\fP command first expands \fIword\fP, and tries to match +it against each \fIpattern\fP in turn, using the same matching rules +as for pathname expansion (see +.B Pathname Expansion +below). When a match is found, the +corresponding \fIlist\fP is executed. After the first match, no +subsequent matches are attempted. The exit status is zero if no +pattern matches. Otherwise, it is the exit status of the +last command executed in \fIlist\fP. +.TP +\fBif\fP \fIlist\fP; \fBthen\fP \fIlist;\fP \ +[ \fBelif\fP \fIlist\fP; \fBthen\fP \fIlist\fP; ] ... \ +[ \fBelse\fP \fIlist\fP; ] \fBfi\fP +The +.B if +.I list +is executed. If its exit status is zero, the +\fBthen\fP \fIlist\fP is executed. Otherwise, each \fBelif\fP +\fIlist\fP is executed in turn, and if its exit status is zero, +the corresponding \fBthen\fP \fIlist\fP is executed and the +command completes. Otherwise, the \fBelse\fP \fIlist\fP is +executed, if present. The exit status is the exit status of the +last command executed, or zero if no condition tested true. +.TP +\fBwhile\fP \fIlist\fP; \fBdo\fP \fIlist\fP; \fBdone\fP +.PD 0 +.TP +\fBuntil\fP \fIlist\fP; \fBdo\fP \fIlist\fP; \fBdone\fP +.PD +The \fBwhile\fP command continuously executes the \fBdo\fP +\fIlist\fP as long as the last command in \fIlist\fP returns +an exit status of zero. The \fBuntil\fP command is identical +to the \fBwhile\fP command, except that the test is negated; +the +.B do +.I list +is executed as long as the last command in +.I list +returns a non-zero exit status. +The exit status of the \fBwhile\fP and \fBuntil\fP commands +is the exit status +of the last \fBdo\fP \fIlist\fP command executed, or zero if +none was executed. +.TP +[ \fBfunction\fP ] \fIname\fP () { \fIlist\fP; } +This defines a function named \fIname\fP. The \fIbody\fP of the +function is the +.I list +of commands between { and }. This list +is executed whenever \fIname\fP is specified as the +name of a simple command. The exit status of a function is +the exit status of the last command executed in the body. (See +.SM +.B FUNCTIONS +below.) +.SH COMMENTS +In a non-interactive shell, or an interactive shell in which the +.B interactive_comments +option to the +.B shopt +builtin is enabled (see +.SM +.B "SHELL BUILTIN COMMANDS" +below), a word beginning with +.B # +causes that word and all remaining characters on that line to +be ignored. An interactive shell without the +.B interactive_comments +option enabled does not allow comments. The +.B interactive_comments +option is on by default in interactive shells. +.SH QUOTING +\fIQuoting\fP is used to remove the special meaning of certain +characters or words to the shell. Quoting can be used to +disable special treatment for special characters, to prevent +reserved words from being recognized as such, and to prevent +parameter expansion. +.PP +Each of the \fImetacharacters\fP listed above under +.SM +.B DEFINITIONS +has special meaning to the shell and must be quoted if it is to +represent itself. +.PP +When the command history expansion facilities are being used, the +\fIhistory expansion\fP character, usually \fB!\fP, must be quoted +to prevent history expansion. +.PP +There are three quoting mechanisms: the +.IR "escape character" , +single quotes, and double quotes. +.PP +A non-quoted backslash (\fB\e\fP) is the +.IR "escape character" . +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 +of each character within the quotes. A single quote may not occur +between single quotes, even when preceded by a backslash. +.PP +Enclosing characters in double quotes preserves the literal value +of all characters within the quotes, with the exception of +.BR $ , +.BR ` , +and +.BR \e . +The characters +.B $ +and +.B ` +retain their special meaning within double quotes. The backslash +retains its special meaning only when followed by one of the following +characters: +.BR $ , +.BR ` , +\^\fB"\fP\^, +.BR \e , +or +.BR . +A double quote may be quoted within double quotes by preceding it with +a backslash. +When command history is being used, the double quote may not be used to +quote the history expansion character. +.PP +The special parameters +.B * +and +.B @ +have special meaning when in double +quotes (see +.SM +.B PARAMETERS +below). +.PP +Words of the form \fB$\fP'\fIstring\fP' are treated specially. The +word expands to \fIstring\fP, with backslash-escaped characters replaced +as specifed by the ANSI C standard. Backslash escape sequences, if +present, are decoded as follows: +.RS +.PD 0 +.TP +.B \ea +alert (bell) +.TP +.B \eb +backspace +.TP +.B \ee +an escape character +.TP +.B \ef +form feed +.TP +.B \en +new line +.TP +.B \er +carriage return +.TP +.B \et +horizontal tab +.TP +.B \ev +vertical tab +.TP +.B \e\e +backslash +.TP +.B \e' +single quote +.TP +.B \e\fInnn\fP +the eight-bit character whose value is the octal value \fInnn\fP +(one to three digits) +.TP +.B \ex\fIHH\fP +the eight-bit character whose value is the hexadecimal value \fIHH\fP +(one or two hex digits) +.TP +.B \ec\fIx\fP +a control-\fIx\fP character +.PD +.RE +.LP +The expanded result is single-quoted, as if the dollar sign had +not been present. +.PP +A double-quoted string preceded by a dollar sign (\fB$\fP) will cause +the string to be translated according to the current locale. +If the current locale is \fBC\fP or \fBPOSIX\fP, the dollar sign +is ignored. +If the string is translated and replaced, the replacement is +double-quoted. +.SH PARAMETERS +A +.I parameter +is an entity that stores values. +It can be a +.IR name , +a number, or one of the special characters listed below under +.BR "Special Parameters" . +A +.I variable +is a parameter denoted by a +.IR name . +A variable has a \fIvalue\fP and zero or more \fIattributes\fP. +Attributes are assigned using the +.B declare +builtin command (see +.B declare +below in +.SM +.BR "SHELL BUILTIN COMMANDS" ). +.PP +A parameter is set if it has been assigned a value. The null string is +a valid value. Once a variable is set, it may be unset only by using +the +.B unset +builtin command (see +.SM +.B SHELL BUILTIN COMMANDS +below). +.PP +A +.I variable +may be assigned to by a statement of the form +.RS +.PP +\fIname\fP=[\fIvalue\fP] +.RE +.PP +If +.I value +is not given, the variable is assigned the null string. All +.I values +undergo tilde expansion, parameter and variable expansion, +command substitution, arithmetic expansion, and quote +removal (see +.SM +.B EXPANSION +below). If the variable has its +.B integer +attribute set, then +.I value +is evaluated as an arithmetic expression even if the $((...)) expansion is +not used (see +.B "Arithmetic Expansion" +below). +Word splitting is not performed, with the exception +of \fB"$@"\fP as explained below under +.BR "Special Parameters" . +Pathname expansion is not performed. +Assignment statements may also appear as arguments to the +.BR declare , +.BR typeset , +.BR export , +.BR readonly , +and +.B local +builtin commands. +.SS Positional Parameters +.PP +A +.I positional parameter +is a parameter denoted by one or more +digits, 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 +.B 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 (see +.SM +.B FUNCTIONS +below). +.PP +When a positional parameter consisting of more than a single +digit is expanded, it must be enclosed in braces (see +.SM +.B EXPANSION +below). +.SS Special Parameters +.PP +The shell treats several parameters specially. These parameters may +only be referenced; assignment to them is not allowed. +.PD 0 +.TP +.B * +Expands to the positional parameters, starting from one. When the +expansion occurs within double quotes, it expands to a single word +with the value of each parameter separated by the first character +of the +.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 +.SM +.B IFS +variable. If +.SM +.B IFS +is unset, the parameters are separated by spaces. +If +.SM +.B IFS +is null, the parameters are joined without intervening separators. +.TP +.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). +.TP +.B # +Expands to the number of positional parameters in decimal. +.TP +.B ? +Expands to the status of the most recently executed foreground +pipeline. +.TP +.B \- +Expands to the current option flags as specified upon invocation, +by the +.B set +builtin command, or those set by the shell itself +(such as the +.B \-i +option). +.TP +.B $ +Expands to the process ID of the shell. In a () subshell, it +expands to the process ID of the current shell, not the +subshell. +.TP +.B ! +Expands to the process ID of the most recently executed background +(asynchronous) command. +.TP +.B 0 +Expands to the name of the shell or shell script. This is set at +shell initialization. If +.B bash +is invoked with a file of commands, +.B $0 +is set to the name of that file. If +.B bash +is started with the +.B \-c +option, then +.B $0 +is set to the first argument after the string to be +executed, if one is present. Otherwise, it is set +to the file name used to invoke +.BR bash , +as given by argument zero. +.TP +.B _ +At shell startup, set to the absolute file name of the shell or 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 file name 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 +currently being checked. +.PD +.SS Shell Variables +.PP +The following variables are set by the shell: +.PP +.PD 0 +.TP +.B BASH +Expands to the full file name used to invoke this instance of +.BR bash . +.TP +.B BASH_ARGC +An array variable whose values are the number of parameters in each +frame of the current bash execution call stack. The number of +parameters to the current subroutine (shell function or script executed +with \fB.\fP or \fBsource\fP) is at the top of the stack. When a +subroutine is executed, the number of parameters passed is pushed onto +\fBBASH_ARGC\fP. +.TP +.B BASH_ARGV +An array variable containing all of the parameters in the current bash +execution call stack. The final parameter of the last subroutine call +is at the top of the stack; the first parameter of the initial call is +at the bottom. When a subroutine is executed, the parameters supplied +are pushed onto \fBBASH_ARGV\fP. +.TP +.B BASH_COMMAND +The command currently being executed or about to be executed, unless the +shell is executing a command as the result of a trap, +in which case it is the command executing at the time of the trap. +.TP +.B BASH_EXECUTION_STRING +The command argument to the \fB\-c\fP invocation option. +.TP +.B BASH_LINENO +An array variable whose members are the line numbers in source files +corresponding to each member of @var{FUNCNAME}. +\fB${BASH_LINENO[\fP\fI$i\fP\fB]}\fP is the line number in the source +file where \fB${FUNCNAME[\fP\fI$i + 1\fP\fB]}\fP was called. +The corresponding source file name is \fB${BASH_SOURCE[\fP\fI$i + 1\fP\fB]}\fB. +Use \fBLINENO\fP to obtain the current line number. +.TP +.B BASH_SOURCE +An array variable whose members are the source filenames corresponding +to the elements in the \fBFUNCNAME\fP array variable. +.TP +.B BASH_SUBSHELL +Incremented by one each time a subshell or subshell environment is spawned. +The initial value is 0. +.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: +.sp .5 +.RS +.PD 0 +.TP 24 +.B BASH_VERSINFO[\fR0\fP] +The major version number (the \fIrelease\fP). +.TP +.B BASH_VERSINFO[\fR1\fP] +The minor version number (the \fIversion\fP). +.TP +.B BASH_VERSINFO[\fR2\fP] +The patch level. +.TP +.B BASH_VERSINFO[\fR3\fP] +The build version. +.TP +.B BASH_VERSINFO[\fR4\fP] +The release status (e.g., \fIbeta1\fP). +.TP +.B BASH_VERSINFO[\fR5\fP] +The value of \fBMACHTYPE\fP. +.PD +.RE +.TP +.B BASH_VERSION +Expands to a string describing the version of this instance of +.BR bash . +.TP +.B COMP_CWORD +An index into \fB${COMP_WORDS}\fP of the word containing the current +cursor position. +This variable is available only in shell functions invoked by the +programmable completion facilities (see \fBProgrammable Completion\fP +below). +.TP +.B COMP_LINE +The current command line. +This variable is available only in shell functions and external +commands invoked by the +programmable completion facilities (see \fBProgrammable Completion\fP +below). +.TP +.B COMP_POINT +The index of the current cursor position relative to the beginning of +the current command. +If the current cursor position is at the end of the current command, +the value of this variable is equal to \fB${#COMP_LINE}\fP. +This variable is available only in shell functions and external +commands invoked by the +programmable completion facilities (see \fBProgrammable Completion\fP +below). +.TP +.B COMP_WORDBREAKS +The set of characters that the Readline library treats as word +separators when performing word completion. +If +.SM +.B COMP_WORDBREAKS +is unset, it loses its special properties, even if it is +subsequently reset. +.TP +.B COMP_WORDS +An array variable (see \fBArrays\fP below) consisting of the individual +words in the current command line. +This variable is available only in shell functions invoked by the +programmable completion facilities (see \fBProgrammable Completion\fP +below). +.TP +.B DIRSTACK +An array variable (see +.B Arrays +below) containing the current contents of the directory stack. +Directories appear in the stack in the order they are displayed by the +.B dirs +builtin. +Assigning to members of this array variable may be used to modify +directories already in the stack, but the +.B pushd +and +.B popd +builtins must be used to add and remove directories. +Assignment to this variable will not change the current directory. +If +.SM +.B DIRSTACK +is unset, it loses its special properties, even if it is +subsequently reset. +.TP +.B EUID +Expands to the effective user ID of the current user, initialized at +shell startup. This variable is readonly. +.TP +.B FUNCNAME +An array variable containing the names of all shell functions +currently in the execution call stack. +The element with index 0 is the name of any currently-executing +shell function. +The bottom-most element is "main". +This variable exists only when a shell function is executing. +Assignments to +.SM +.B FUNCNAME +have no effect and return an error status. +If +.SM +.B FUNCNAME +is unset, it loses its special properties, even if it is +subsequently reset. +.TP +.B GROUPS +An array variable containing the list of groups of which the current +user is a member. +Assignments to +.SM +.B GROUPS +have no effect and return an error status. +If +.SM +.B GROUPS +is unset, it loses its special properties, even if it is +subsequently reset. +.TP +.B HISTCMD +The history number, or index in the history list, of the current +command. +If +.SM +.B HISTCMD +is unset, it loses its special properties, even if it is +subsequently reset. +.TP +.B HOSTNAME +Automatically set to the name of the current host. +.TP +.B HOSTTYPE +Automatically set to a string that uniquely +describes the type of machine on which +.B bash +is executing. +The default is system-dependent. +.TP +.B LINENO +Each time this parameter is referenced, the shell substitutes +a decimal number representing the current sequential line number +(starting with 1) within a script or function. When not in a +script or function, the value substituted is not guaranteed to +be meaningful. +If +.SM +.B LINENO +is unset, it loses its special properties, even if it is +subsequently reset. +.TP +.B MACHTYPE +Automatically set to a string that fully describes the system +type on which +.B bash +is executing, in the standard GNU \fIcpu-company-system\fP format. +The default is system-dependent. +.TP +.B OLDPWD +The previous working directory as set by the +.B cd +command. +.TP +.B OPTARG +The value of the last option argument processed by the +.B getopts +builtin command (see +.SM +.B SHELL BUILTIN COMMANDS +below). +.TP +.B OPTIND +The index of the next argument to be processed by the +.B getopts +builtin command (see +.SM +.B SHELL BUILTIN COMMANDS +below). +.TP +.B OSTYPE +Automatically set to a string that +describes the operating system on which +.B bash +is executing. +The default is system-dependent. +.TP +.B PIPESTATUS +An array variable (see +.B Arrays +below) containing a list of exit status values from the processes +in the most-recently-executed foreground pipeline (which may +contain only a single command). +.TP +.B PPID +The process ID of the shell's parent. This variable is readonly. +.TP +.B PWD +The current working directory as set by the +.B cd +command. +.TP +.B RANDOM +Each time this parameter is referenced, a random integer between +0 and 32767 is +generated. The sequence of random numbers may be initialized by assigning +a value to +.SM +.BR RANDOM . +If +.SM +.B RANDOM +is unset, it loses its special properties, even if it is +subsequently reset. +.TP +.B REPLY +Set to the line of input read by the +.B read +builtin command when no arguments are supplied. +.TP +.B SECONDS +Each time this parameter is +referenced, the number of seconds since shell invocation is returned. If a +value is assigned to +.SM +.BR SECONDS , +the value returned upon subsequent +references is +the number of seconds since the assignment plus the value assigned. +If +.SM +.B SECONDS +is unset, it loses its special properties, even if it is +subsequently reset. +.TP +.B SHELLOPTS +A colon-separated list of enabled shell options. Each word in +the list is a valid argument for the +.B \-o +option to the +.B set +builtin command (see +.SM +.B "SHELL BUILTIN COMMANDS" +below). The options appearing in +.SM +.B SHELLOPTS +are those reported as +.I on +by \fBset \-o\fP. +If this variable is in the environment when +.B bash +starts up, each shell option in the list will be enabled before +reading any startup files. +This variable is read-only. +.TP +.B SHLVL +Incremented by one each time an instance of +.B bash +is started. +.TP +.B UID +Expands to the user ID of the current user, initialized at shell startup. +This variable is readonly. +.PD +.PP +The following variables are used by the shell. In some cases, +.B bash +assigns a default value to a variable; these cases are noted +below. +.PP +.PD 0 +.TP +.B BASH_ENV +If this parameter is set when \fBbash\fP is executing a shell script, +its value is interpreted as a filename containing commands to +initialize the shell, as in +.IR ~/.bashrc . +The value of +.SM +.B BASH_ENV +is subjected to parameter expansion, command substitution, and arithmetic +expansion before being interpreted as a file name. +.SM +.B PATH +is not used to search for the resultant file name. +.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 +.if t \f(CW".:~:/usr"\fP. +.if n ".:~:/usr". +.TP +.B COLUMNS +Used by the \fBselect\fP builtin command to determine the terminal width +when printing selection lists. Automatically set upon receipt of a SIGWINCH. +.TP +.B COMPREPLY +An array variable from which \fBbash\fP reads the possible completions +generated by a shell function invoked by the programmable completion +facility (see \fBProgrammable Completion\fP below). +.TP +.B EMACS +If \fBbash\fP finds this variable in the environment when the shell starts +with value +.if t \f(CWt\fP, +.if n "t", +it assumes that the shell is running in an emacs shell buffer and disables +line editing. +.TP +.B FCEDIT +The default editor for the +.B fc +builtin command. +.TP +.B FIGNORE +A colon-separated list of suffixes to ignore when performing +filename completion (see +.SM +.B READLINE +below). +A filename whose suffix matches one of the entries in +.SM +.B FIGNORE +is excluded from the list of matched filenames. +A sample value is +.if t \f(CW".o:~"\fP. +.if n ".o:~". +.TP +.B GLOBIGNORE +A colon-separated list of patterns defining the set of filenames to +be ignored by pathname expansion. +If a filename matched by a pathname expansion pattern also matches one +of the patterns in +.SM +.BR GLOBIGNORE , +it is removed from the list of matches. +.TP +.B HISTCONTROL +A colon-separated list of values controlling how commands are saved on +the history list. +If the list of values includes +.IR ignorespace , +lines which begin with a +.B space +character are not saved in the history list. +A value of +.I ignoredups +causes lines matching the previous history entry to not be saved. +A value of +.I ignoreboth +is shorthand for \fIignorespace\fP and \fIignoredups\fP. +A value of +.IR erasedups +causes all previous lines matching the current line to be removed from +the history list before that line is saved. +Any value not in the above list is ignored. +If \fBHISTCONTROL\fP is unset, or does not include a valid value, +all lines read by the shell parser are saved on the history list, +subject to the value of +.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 HISTFILE +The name of the file in which command history is saved (see +.SM +.B HISTORY +below). The default value is \fI~/.bash_history\fP. If unset, the +command history is not saved when an interactive shell exits. +.TP +.B HISTFILESIZE +The maximum number of lines contained in the history file. When this +variable is assigned a value, the history file is truncated, if +necessary, to contain no more than that number of lines. The default +value is 500. The history file is also truncated to this size after +writing it when an interactive shell exits. +.TP +.B HISTIGNORE +A colon-separated list of patterns used to decide which command lines +should be saved on the history list. Each pattern is anchored at the +beginning of the line and must match the complete line (no implicit +`\fB*\fP' is appended). Each pattern is tested against the line +after the checks specified by +.B HISTCONTROL +are applied. +In addition to the normal shell pattern matching characters, `\fB&\fP' +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 HISTSIZE +The number of commands to remember in the command history (see +.SM +.B HISTORY +below). The default value is 500. +.TP +.B HOME +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 HOSTFILE +Contains the name of a file in the same format as +.FN /etc/hosts +that should be read when the shell needs to complete a +hostname. +The list of possible hostname completions may be changed while the +shell is running; +the next time hostname completion is attempted after the +value is changed, +.B bash +adds the contents of the new file to the existing list. +If +.SM +.B HOSTFILE +is set, but has no value, \fBbash\fP attempts to read +.FN /etc/hosts +to obtain the list of possible hostname completions. +When +.SM +.B HOSTFILE +is unset, the hostname list is cleared. +.TP +.B IFS +The +.I Internal Field Separator +that is used +for word splitting after expansion and to +split lines into words with the +.B read +builtin command. The default value is +``''. +.TP +.B IGNOREEOF +Controls the +action of an interactive shell on receipt of an +.SM +.B EOF +character as the sole input. If set, the value is the number of +consecutive +.SM +.B EOF +characters which must be +typed as the first characters on an input line before +.B bash +exits. If the variable exists but does not have a numeric value, or +has no value, the default value is 10. If it does not exist, +.SM +.B EOF +signifies the end of input to the shell. +.TP +.B INPUTRC +The filename for the +.B readline +startup file, overriding the default of +.FN ~/.inputrc +(see +.SM +.B READLINE +below). +.TP +.B LANG +Used to determine the locale category for any category not specifically +selected with a variable starting with \fBLC_\fP. +.TP +.B LC_ALL +This variable overrides the value of \fBLANG\fP and any other +\fBLC_\fP variable specifying a locale category. +.TP +.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 +This variable determines the locale used to translate double-quoted +strings preceded by a \fB$\fP. +.TP +.B LC_NUMERIC +This variable determines the locale category used for number formatting. +.TP +.B LINES +Used by the \fBselect\fP builtin command to determine the column length +for printing selection lists. Automatically set upon receipt of a SIGWINCH. +.TP +.B MAIL +If this parameter is set to a file name and the +.SM +.B MAILPATH +variable is not set, +.B bash +informs the user of the arrival of mail in the specified file. +.TP +.B MAILCHECK +Specifies how +often (in seconds) +.B bash +checks for mail. The default is 60 seconds. When it is time to check +for mail, the shell does so before displaying the primary prompt. +If this variable is unset, or set to a value that is not a number +greater than or equal to zero, the shell disables mail checking. +.TP +.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 +.PP +\fBMAILPATH\fP='/var/mail/bfox?"You have mail":~/shell\-mail?"$_ has mail!"' +.PP +.B Bash +supplies a default value for this variable, but the location of the user +mail files that it uses is system dependent (e.g., /var/mail/\fB$USER\fP). +.RE +.TP +.B OPTERR +If set to the value 1, +.B bash +displays error messages generated by the +.B getopts +builtin command (see +.SM +.B SHELL BUILTIN COMMANDS +below). +.SM +.B OPTERR +is initialized to 1 each time the shell is invoked or a shell +script is executed. +.TP +.B PATH +The search path for commands. It +is a colon-separated list of directories in which +the shell looks for commands (see +.SM +.B COMMAND EXECUTION +below). +A zero-length (null) directory name in the value of \fBPATH\fP indicates the +current directory. +A null directory name may appear as two adjacent colons, or as an initial +or trailing colon. +The default path is system-dependent, +and is set by the administrator who installs +.BR bash . +A common value is +.if t \f(CW/usr/gnu/bin:/usr/local/bin:/usr/ucb:/bin:/usr/bin:.\fP. +.if n ``/usr/gnu/bin:/usr/local/bin:/usr/ucb:/bin:/usr/bin:.''. +.TP +.B POSIXLY_CORRECT +If this variable is in the environment when \fBbash\fP starts, the shell +enters \fIposix mode\fP before reading the startup files, as if the +.B \-\-posix +invocation option had been supplied. If it is set while the shell is +running, \fBbash\fP enables \fIposix mode\fP, as if the command +.if t \f(CWset -o posix\fP +.if n \fIset -o posix\fP +had been executed. +.TP +.B PROMPT_COMMAND +If set, the value is executed as a command prior to issuing each primary +prompt. +.TP +.B PS1 +The value of this parameter is expanded (see +.SM +.B PROMPTING +below) and used as the primary prompt string. The default value is +``\fB\es\-\ev\e$ \fP''. +.TP +.B PS2 +The value of this parameter is expanded as with +.B PS1 +and used as the secondary prompt string. The default is +``\fB> \fP''. +.TP +.B PS3 +The value of this parameter is used as the prompt for the +.B select +command (see +.SM +.B SHELL GRAMMAR +above). +.TP +.B PS4 +The value of this parameter is expanded as with +.B PS1 +and the value is printed before each command +.B bash +displays during an execution trace. The first character of +.SM +.B PS4 +is replicated multiple times, as necessary, to indicate multiple +levels of indirection. The default is ``\fB+ \fP''. +.TP +.B TIMEFORMAT +The value of this parameter is used as a format string specifying +how the timing information for pipelines prefixed with the +.B time +reserved word should be displayed. +The \fB%\fP 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. +.sp .5 +.RS +.PD 0 +.TP 10 +.B %% +A literal \fB%\fP. +.TP +.B %[\fIp\fP][l]R +The elapsed time in seconds. +.TP +.B %[\fIp\fP][l]U +The number of CPU seconds spent in user mode. +.TP +.B %[\fIp\fP][l]S +The number of CPU seconds spent in system mode. +.TP +.B %P +The CPU percentage, computed as (%U + %S) / %R. +.PD +.RE +.IP +The optional \fIp\fP is a digit specifying the \fIprecision\fP, +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 \fIp\fP greater than 3 are changed to 3. +If \fIp\fP is not specified, the value 3 is used. +.IP +The optional \fBl\fP specifies a longer format, including +minutes, of the form \fIMM\fPm\fISS\fP.\fIFF\fPs. +The value of \fIp\fP determines whether or not the fraction is +included. +.IP +If this variable is not set, \fBbash\fP acts as if it had the +value \fB$'\enreal\et%3lR\enuser\et%3lU\ensys\t%3lS'\fP. +If the value is null, no timing information is displayed. +A trailing newline is added when the format string is displayed. +.TP +.B TMOUT +If set to a value greater than zero, \fBTMOUT\fP is treated as the +default timeout for the \fBread\fP builtin. +The \fBselect\fP command terminates if input does not arrive +after \fBTMOUT\fP seconds when input is coming from a terminal. +In an interactive shell, the value is interpreted as the +number of seconds to wait for input after issuing the primary prompt. +.B Bash +terminates after waiting for that number of seconds if input does +not arrive. +.TP +.B auto_resume +This variable controls how the shell interacts with the user and +job control. If this variable is set, single word simple +commands without redirections are treated as candidates for resumption +of an existing stopped job. There is no ambiguity allowed; if there is +more than one job beginning with the string typed, the job most recently +accessed is selected. The +.I name +of a stopped job, in this context, is the command line used to +start it. +If set to the value +.IR exact , +the string supplied must match the name of a stopped job exactly; +if set to +.IR substring , +the string supplied needs to match a substring of the name of a +stopped job. The +.I substring +value provides functionality analogous to the +.B %? +job identifier (see +.SM +.B JOB CONTROL +below). If set to any other value, the supplied string must +be a prefix of a stopped job's name; this provides functionality +analogous to the +.B % +job identifier. +.TP +.B histchars +The two or three characters which control history expansion +and tokenization (see +.SM +.B HISTORY EXPANSION +below). The first character is the \fIhistory expansion\fP character, +the character which signals the start of a history +expansion, normally `\fB!\fP'. +The second character is the \fIquick substitution\fP +character, which is used as shorthand for re-running the previous +command entered, substituting one string for another in the command. +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 +remaining words on the line. It does not necessarily cause the shell +parser to treat the rest of the line as a comment. +.PD +.SS Arrays +.B Bash +provides one-dimensional array variables. Any variable may be used as +an array; the +.B declare +builtin will explicitly declare an array. There is no maximum +limit on the size of an array, nor any requirement that members +be indexed or assigned contiguously. Arrays are indexed using +integers and are zero-based. +.PP +An array is created automatically if any variable is assigned to using +the syntax \fIname\fP[\fIsubscript\fP]=\fIvalue\fP. The +.I subscript +is treated as an arithmetic expression that must evaluate to a number +greater than or equal to zero. To explicitly declare an array, use +.B declare \-a \fIname\fP +(see +.SM +.B SHELL BUILTIN COMMANDS +below). +.B declare \-a \fIname\fP[\fIsubscript\fP] +is also accepted; the \fIsubscript\fP is ignored. Attributes may be +specified for an array variable using the +.B declare +and +.B readonly +builtins. Each attribute applies to all members of an array. +.PP +Arrays are assigned to using compound assignments of the form +\fIname\fP=\fB(\fPvalue\fI1\fP ... value\fIn\fP\fB)\fP, where each +\fIvalue\fP is of the form [\fIsubscript\fP]=\fIstring\fP. Only +\fIstring\fP is required. If +the optional brackets and subscript are supplied, that index is assigned to; +otherwise the index of the element assigned is the last index assigned +to by the statement plus one. Indexing starts at zero. +This syntax is also accepted by the +.B declare +builtin. Individual array elements may be assigned to using the +\fIname\fP[\fIsubscript\fP]=\fIvalue\fP syntax introduced above. +.PP +Any element of an array may be referenced using +${\fIname\fP[\fIsubscript\fP]}. The braces are required to avoid +conflicts with pathname expansion. If +\fIsubscript\fP is \fB@\fP or \fB*\fP, the word expands to +all members of \fIname\fP. These subscripts differ only when the +word appears within double quotes. If the word is double-quoted, +${\fIname\fP[*]} expands to a single +word with the value of each array member separated by the first +character of the +.SM +.B IFS +special variable, and ${\fIname\fP[@]} expands each element of +\fIname\fP to a separate word. When there are no array members, +${\fIname\fP[@]} expands to nothing. This is analogous to the expansion +of the special parameters \fB*\fP and \fB@\fP (see +.B Special Parameters +above). ${#\fIname\fP[\fIsubscript\fP]} expands to the length of +${\fIname\fP[\fIsubscript\fP]}. If \fIsubscript\fP is \fB*\fP or +\fB@\fP, the expansion is the number of elements in the array. +Referencing an array variable without a subscript is equivalent to +referencing element zero. +.PP +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 +\fBunset\fP \fIname\fP[\fIsubscript\fP], where +\fIsubscript\fP is \fB*\fP or \fB@\fP, removes the entire array. +.PP +The +.BR declare , +.BR local , +and +.B readonly +builtins each accept a +.B \-a +option to specify an array. The +.B read +builtin accepts a +.B \-a +option to assign a list of words read from the standard input +to an array. The +.B set +and +.B declare +builtins display array values in a way that allows them to be +reused as assignments. +.SH EXPANSION +Expansion is performed on the command line after it has been split into +words. There are seven kinds of expansion performed: +.IR "brace expansion" , +.IR "tilde expansion" , +.IR "parameter and variable expansion" , +.IR "command substitution" , +.IR "arithmetic expansion" , +.IR "word splitting" , +and +.IR "pathname expansion" . +.PP +The order of expansions is: brace expansion, tilde expansion, +parameter, variable and arithmetic expansion and +command substitution +(done in a left-to-right fashion), word splitting, and pathname +expansion. +.PP +On systems that can support it, there is an additional expansion +available: \fIprocess substitution\fP. +.PP +Only brace expansion, word splitting, and pathname expansion +can change the number of words of the expansion; other expansions +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 +.BR PARAMETERS ). +.SS Brace Expansion +.PP +.I "Brace expansion" +is a mechanism by which arbitrary strings +may be generated. This mechanism is similar to +\fIpathname expansion\fP, but the filenames generated +need not exist. Patterns to be brace expanded take +the form of an optional +.IR preamble , +followed by either a series of comma-separated strings or +a sequence expression 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 +Brace expansions may be nested. The results of each expanded +string are not sorted; left to right order is preserved. +For example, a\fB{\fPd,c,b\fB}\fPe expands into `ade ace abe'. +.PP +A sequence expression takes the form \fB{\fP\fIx\fP\fB..\fP\fIy\fP\fB}\fP, +where \fIx\fP and \fIy\fP are either integers or single characters. +When integers are supplied, the expression expands to each number between +\fIx\fP and \fIy\fP, inclusive. +When characters are supplied, the expression expands to each character +lexicographically between \fIx\fP and \fIy\fP, inclusive. Note that +both \fIx\fP and \fIy\fP must be of the same type. +.PP +Brace expansion is performed before any other expansions, +and any characters special to other expansions are preserved +in the result. It is strictly textual. +.B Bash +does not apply any syntactic interpretation to the context of the +expansion or the text between the braces. +.PP +A correctly-formed brace expansion must contain unquoted opening +and closing braces, and at least one unquoted comma or a valid +sequence expression. +Any incorrectly formed brace expansion is left unchanged. +A \fB{\fP or \fB,\fP may be quoted with a backslash to prevent its +being considered part of a brace expression. +To avoid conflicts with parameter expansion, the string \fB${\fP +is not considered eligible for brace expansion. +.PP +This construct is typically used as shorthand when the common +prefix of the strings to be generated is longer than in the +above example: +.RS +.PP +mkdir /usr/local/src/bash/{old,new,dist,bugs} +.RE +or +.RS +chown root /usr/{ucb/{ex,edit},lib/{ex?.?*,how_ex}} +.RE +.PP +Brace expansion introduces a slight incompatibility with +historical versions of +.BR sh . +.B sh +does not treat opening or closing braces specially when they +appear as part of a word, and preserves them in the output. +.B Bash +removes braces from words as a consequence of brace +expansion. For example, a word entered to +.B sh +as \fIfile{1,2}\fP +appears identically in the output. The same word is +output as +.I file1 file2 +after expansion by +.BR bash . +If strict compatibility with +.B sh +is desired, start +.B bash +with the +.B +B +option or disable brace expansion with the +.B +B +option to the +.B set +command (see +.SM +.B SHELL BUILTIN COMMANDS +below). +.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 . +If +.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 , +.SM +.BR MAILPATH , +and +.SM +.BR CDPATH , +and the shell assigns the expanded value. +.SS Parameter Expansion +.PP +The `\fB$\fP' character introduces parameter expansion, +command substitution, or arithmetic expansion. The parameter name +or symbol to be expanded may be enclosed in braces, which +are optional but serve to protect the variable to be expanded from +characters immediately following it which could be +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 +${\fIparameter\fP} +The value of \fIparameter\fP is substituted. The braces are required +when +.I parameter +is a positional parameter with more than one digit, +or when +.I parameter +is followed by a character which is not to be +interpreted as part of its name. +.PD +.PP +If the first character of \fIparameter\fP is an exclamation point, +a level of variable indirection is introduced. +\fBBash\fP uses the value of the variable formed from the rest of +\fIparameter\fP as the name of the variable; this variable is then +expanded and that value is used in the rest of the substitution, rather +than the value of \fIparameter\fP itself. +This is known as \fIindirect expansion\fP. +The exceptions to this are the expansions of ${!\fIprefix\fP*} and +${\fB!\fP\fIname\fP[\fI@\fP]} described below. +The exclamation point must immediately follow the left brace in order to +introduce indirection. +.PP +In each of the cases below, \fIword\fP is subject to tilde expansion, +parameter expansion, command substitution, and arithmetic expansion. +When not performing substring expansion, \fBbash\fP tests for a parameter +that is unset or null; omitting the colon results in a test only for a +parameter that is unset. +.PP +.PD 0 +.TP +${\fIparameter\fP\fB:\-\fP\fIword\fP} +\fBUse Default Values\fP. If +.I parameter +is unset or null, the expansion of +.I word +is substituted. Otherwise, the value of +.I parameter +is substituted. +.TP +${\fIparameter\fP\fB:=\fP\fIword\fP} +\fBAssign Default Values\fP. +If +.I parameter +is unset or null, the expansion of +.I word +is assigned to +.IR parameter . +The value of +.I parameter +is then substituted. Positional parameters and special parameters may +not be assigned to in this way. +.TP +${\fIparameter\fP\fB:?\fP\fIword\fP} +\fBDisplay Error if Null or Unset\fP. +If +.I parameter +is null or unset, the expansion of \fIword\fP (or a message to that effect +if +.I word +is not present) is written to the standard error and the shell, if it +is not interactive, exits. Otherwise, the value of \fIparameter\fP is +substituted. +.TP +${\fIparameter\fP\fB:+\fP\fIword\fP} +\fBUse Alternate Value\fP. +If +.I parameter +is null or unset, nothing is substituted, otherwise the expansion of +.I word +is substituted. +.TP +${\fIparameter\fP\fB:\fP\fIoffset\fP} +.PD 0 +.TP +${\fIparameter\fP\fB:\fP\fIoffset\fP\fB:\fP\fIlength\fP} +.PD +\fBSubstring Expansion.\fP +Expands to up to \fIlength\fP characters of \fIparameter\fP +starting at the character specified by \fIoffset\fP. +If \fIlength\fP is omitted, expands to the substring of +\fIparameter\fP starting at the character specified by \fIoffset\fP. +\fIlength\fP and \fIoffset\fP are arithmetic expressions (see +.SM +.B +ARITHMETIC EVALUATION +below). +\fIlength\fP must evaluate to a number greater than or equal to zero. +If \fIoffset\fP evaluates to a number less than zero, the value +is used as an offset from the end of the value of \fIparameter\fP. +If \fIparameter\fP is \fB@\fP, the result is \fIlength\fP positional +parameters beginning at \fIoffset\fP. +If \fIparameter\fP is an array name indexed by @ or *, +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\fIprefix\fP\fB*\fP} +.PD 0 +.TP +${\fB!\fP\fIprefix\fP\fB@\fP} +.PD +Expands to the names of variables whose names begin with \fIprefix\fP, +separated by the first character of the +.SM +.B IFS +special variable. +.TP +${\fB!\fP\fIname\fP[\fI@\fP]} +.PD 0 +.TP +${\fB!\fP\fIname\fP[\fI*\fP]} +.PD +If \fIname\fP is an array variable, expands to the list of array indices +(keys) assigned in \fIname\fP. +If \fIname\fP is not an array, expands to 0 if \fIname\fP is set and null +otherwise. +When \fI@\fP is used and the expansion appears within double quotes, each +key expands to a separate word. +.TP +${\fB#\fP\fIparameter\fP} +The length in characters of the value of \fIparameter\fP is substituted. +If +.I parameter +is +.B * +or +.BR @ , +the value substituted is the number of positional parameters. +If +.I parameter +is an array name subscripted by +.B * +or +.BR @ , +the value substituted is the number of elements in the array. +.TP +${\fIparameter\fP\fB#\fP\fIword\fP} +.PD 0 +.TP +${\fIparameter\fP\fB##\fP\fIword\fP} +.PD +The +.I word +is expanded to produce a pattern just as in pathname +expansion. If the pattern matches the beginning of +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 +longest matching pattern (the ``\fB##\fP'' case) deleted. +If +.I parameter +is +.B @ +or +.BR * , +the pattern removal operation is applied to each positional +parameter in turn, and the expansion is the resultant list. +If +.I parameter +is an array variable subscripted with +.B @ +or +.BR * , +the pattern removal operation is applied to each member of the +array in turn, and the expansion is the resultant list. +.TP +${\fIparameter\fP\fB%\fP\fIword\fP} +.PD 0 +.TP +${\fIparameter\fP\fB%%\fP\fIword\fP} +.PD +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 +longest matching pattern (the ``\fB%%\fP'' case) deleted. +If +.I parameter +is +.B @ +or +.BR * , +the pattern removal operation is applied to each positional +parameter in turn, and the expansion is the resultant list. +If +.I parameter +is an array variable subscripted with +.B @ +or +.BR * , +the pattern removal operation is applied to each member of the +array in turn, and the expansion is the resultant list. +.TP +${\fIparameter\fP\fB/\fP\fIpattern\fP\fB/\fP\fIstring\fP} +.PD 0 +.TP +${\fIparameter\fP\fB//\fP\fIpattern\fP\fB/\fP\fIstring\fP} +.PD +The \fIpattern\fP is expanded to produce a pattern just as in +pathname expansion. +\fIParameter\fP is expanded and the longest match of \fIpattern\fP +against its value is replaced with \fIstring\fP. +In the first form, only the first match is replaced. +The second form causes all matches of \fIpattern\fP to be +replaced with \fIstring\fP. +If \fIpattern\fP begins with \fB#\fP, it must match at the beginning +of the expanded value of \fIparameter\fP. +If \fIpattern\fP begins with \fB%\fP, it must match at the end +of the expanded value of \fIparameter\fP. +If \fIstring\fP is null, matches of \fIpattern\fP are deleted +and the \fB/\fP following \fIpattern\fP may be omitted. +If +.I parameter +is +.B @ +or +.BR * , +the substitution operation is applied to each positional +parameter in turn, and the expansion is the resultant list. +If +.I parameter +is an array variable subscripted with +.B @ +or +.BR * , +the substitution operation is applied to each member of the +array in turn, and the expansion is the resultant list. +.SS Command Substitution +.PP +\fICommand substitution\fP allows the output of a command to replace +the command name. There are two forms: +.PP +.RS +.PP +\fB$(\fP\fIcommand\fP\|\fB)\fP +.RE +or +.RS +\fB`\fP\fIcommand\fP\fB`\fP +.RE +.PP +.B Bash +performs the expansion by executing \fIcommand\fP 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 \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, +backslash retains its literal meaning except when followed by +.BR $ , +.BR ` , +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 +If the substitution appears within double quotes, word splitting and +pathname expansion are not performed on the results. +.SS Arithmetic Expansion +.PP +Arithmetic expansion allows the evaluation of an arithmetic expression +and the substitution of the result. The format for arithmetic expansion is: +.RS +.PP +\fB$((\fP\fIexpression\fP\fB))\fP +.RE +.PP +The +.I 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, string +expansion, command substitution, and quote removal. +Arithmetic expansions may be nested. +.PP +The evaluation is performed according to the rules listed below under +.SM +.BR "ARITHMETIC EVALUATION" . +If +.I expression +is invalid, +.B bash +prints a message indicating failure and no substitution occurs. +.SS Process Substitution +.PP +\fIProcess substitution\fP is supported on systems that support named +pipes (\fIFIFOs\fP) or the \fB/dev/fd\fP method of naming open files. +It takes the form of +\fB<(\fP\fIlist\^\fP\fB)\fP +or +\fB>(\fP\fIlist\^\fP\fB)\fP. +The process \fIlist\fP is run with its input or output connected to a +\fIFIFO\fP or some file in \fB/dev/fd\fP. The name of this file is +passed as an argument to the current command as the result of the +expansion. If the \fB>(\fP\fIlist\^\fP\fB)\fP form is used, writing to +the file will provide input for \fIlist\fP. If the +\fB<(\fP\fIlist\^\fP\fB)\fP form is used, the file passed as an +argument should be read to obtain the output of \fIlist\fP. +.PP +When available, process substitution is performed +simultaneously with parameter and variable expansion, +command substitution, +and arithmetic expansion. +.SS Word Splitting +.PP +The shell scans the results of +parameter expansion, +command substitution, +and +arithmetic expansion +that did not occur within double quotes for +.IR "word splitting" . +.PP +The shell treats each character of +.SM +.B IFS +as a delimiter, and splits the results of the other +expansions into words on these characters. If +.SM +.B IFS +is unset, or its +value is exactly +.BR , +the default, then +any sequence of +.SM +.B IFS +characters serves to delimit words. If +.SM +.B IFS +has a value other than the default, then sequences of +the whitespace characters +.B space +and +.B tab +are ignored at the beginning and end of the +word, as long as the whitespace character is in the +value of +.SM +.BR IFS +(an +.SM +.B IFS +whitespace character). +Any character in +.SM +.B IFS +that is not +.SM +.B IFS +whitespace, along with any adjacent +.SM +.B IFS +whitespace characters, delimits a field. +A sequence of +.SM +.B IFS +whitespace characters is also treated as a delimiter. +If the value of +.SM +.B IFS +is null, no word splitting occurs. +.PP +Explicit null arguments (\^\f3"\^"\fP or \^\f3'\^'\fP\^) are retained. +Unquoted implicit null arguments, resulting from the expansion of +parameters that have no values, are removed. +If a parameter with no value is expanded within double quotes, a +null argument results and is retained. +.PP +Note that if no expansion occurs, no splitting +is performed. +.SS Pathname Expansion +.PP +After word splitting, +unless the +.B \-f +option has been set, +.B bash +scans each word for the characters +.BR * , +.BR ? , +and +.BR [ . +If one of these characters appears, then the word is +regarded as a +.IR 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 +.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 +.B ``.'' +at the start of a name or immediately following a slash +must be matched explicitly, unless the shell option +.B dotglob +is set. +When matching a pathname, the slash character must always be +matched explicitly. +In other cases, the +.B ``.'' +character is not treated specially. +See the description of +.B shopt +below under +.SM +.B SHELL BUILTIN COMMANDS +for a description of the +.BR nocaseglob , +.BR nullglob , +and +.B dotglob +shell options. +.PP +The +.SM +.B GLOBIGNORE +shell variable may be used to restrict the set of file names matching a +.IR pattern . +If +.SM +.B GLOBIGNORE +is set, each matching file name that also matches one of the patterns in +.SM +.B GLOBIGNORE +is removed from the list of matches. +The file names +.B ``.'' +and +.B ``..'' +are always ignored when +.SM +.B GLOBIGNORE +is set and not null. However, setting +.SM +.B GLOBIGNORE +to a non-null value has the effect of enabling the +.B dotglob +shell option, so all other file names beginning with a +.B ``.'' +will match. +To get the old behavior of ignoring file names beginning with a +.BR ``.'' , +make +.B ``.*'' +one of the patterns in +.SM +.BR GLOBIGNORE . +The +.B dotglob +option is disabled when +.SM +.B GLOBIGNORE +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. A backslash escapes the following character; the +escaping backslash is discarded when matching. +The special pattern characters must be quoted if +they are to be matched literally. +.PP +The special pattern characters have the following meanings: +.PP +.PD 0 +.TP +.B * +Matches any string, including the null string. +.TP +.B ? +Matches any single character. +.TP +.B [...] +Matches any one of the enclosed characters. A pair of characters +separated by a hyphen denotes a +\fIrange expression\fP; +any character that sorts between those two characters, inclusive, +using the current locale's collating sequence and character set, +is matched. If the first character following the +.B [ +is a +.B ! +or a +.B ^ +then any character not enclosed is matched. +The sorting order of characters in range expressions is determined by +the current locale and the value of the \fBLC_COLLATE\fP shell variable, +if set. +A +.B \- +may be matched by including it as the first or last character +in the set. +A +.B ] +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 word xdigit +.if t alnum alpha ascii blank cntrl digit graph lower print punct space upper word xdigit +.br +A character class matches any character belonging to that class. +The \fBword\fP character class matches letters, digits, and the character _. +.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 +.PP +After the preceding expansions, all unquoted occurrences of the +characters +.BR \e , +.BR ' , +and \^\f3"\fP\^ that did not result from one of the above +expansions are removed. +.SH REDIRECTION +Before a command is executed, its input and output +may be +.I redirected +using a special notation interpreted by the shell. +Redirection may also be used to open and close files for the +current shell execution environment. The following redirection +operators may precede or appear anywhere within a +.I simple command +or may follow a +.IR command . +Redirections are processed in the order they appear, from +left to right. +.PP +In the following descriptions, if the file descriptor number is +omitted, and the first character of the redirection operator is +.BR < , +the redirection refers to the standard input (file descriptor +0). If the first character of the redirection operator is +.BR > , +the redirection refers to the standard output (file descriptor +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, pathname expansion, and word splitting. +If it expands to more than one word, +.B bash +reports an error. +.PP +Note that the order of redirections is significant. For example, +the command +.RS +.PP +ls \fB>\fP dirlist 2\fB>&\fP1 +.RE +.PP +directs both standard output and standard error to the file +.IR dirlist , +while the command +.RS +.PP +ls 2\fB>&\fP1 \fB>\fP dirlist +.RE +.PP +directs only the standard output to file +.IR dirlist , +because the standard error was duplicated as standard output +before the standard output was redirected to +.IR dirlist . +.PP +\fBBash\fP handles several filenames specially when they are used in +redirections, as described in the following table: +.RS +.PP +.PD 0 +.TP +.B /dev/fd/\fIfd\fP +If \fIfd\fP is a valid integer, file descriptor \fIfd\fP is duplicated. +.TP +.B /dev/stdin +File descriptor 0 is duplicated. +.TP +.B /dev/stdout +File descriptor 1 is duplicated. +.TP +.B /dev/stderr +File descriptor 2 is duplicated. +.TP +.B /dev/tcp/\fIhost\fP/\fIport\fP +If \fIhost\fP is a valid hostname or Internet address, and \fIport\fP +is an integer port number or service name, \fBbash\fP attempts to open +a TCP connection to the corresponding socket. +.TP +.B /dev/udp/\fIhost\fP/\fIport\fP +If \fIhost\fP is a valid hostname or Internet address, and \fIport\fP +is an integer port number or service name, \fBbash\fP attempts to open +a UDP connection to the corresponding socket. +.PD +.RE +.PP +A failure to open or create a file causes the redirection to fail. +.SS Redirecting Input +.PP +Redirection of input causes the file whose name results from +the expansion of +.I word +to be opened for reading on file descriptor +.IR n , +or the standard input (file descriptor 0) if +.I n +is not specified. +.PP +The general format for redirecting input is: +.RS +.PP +[\fIn\fP]\fB<\fP\fIword\fP +.RE +.SS Redirecting Output +.PP +Redirection of output causes the file whose name results from +the expansion of +.I word +to be opened for writing on file descriptor +.IR n , +or the standard output (file descriptor 1) if +.I n +is not specified. If the file does not exist it is created; +if it does exist it is truncated to zero size. +.PP +The general format for redirecting output is: +.RS +.PP +[\fIn\fP]\fB>\fP\fIword\fP +.RE +.PP +If the redirection operator is +.BR > , +and the +.B noclobber +option to the +.B set +builtin has been enabled, the redirection will fail if the file +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 +.PP +Redirection of output in this fashion +causes the file whose name results from +the expansion of +.I word +to be opened for appending on file descriptor +.IR n , +or the standard output (file descriptor 1) if +.I n +is not specified. If the file does not exist it is created. +.PP +The general format for appending output is: +.RS +.PP +[\fIn\fP]\fB>>\fP\fIword\fP +.RE +.PP +.SS Redirecting Standard Output and Standard Error +.PP +.B Bash +allows both the +standard output (file descriptor 1) and +the standard error output (file descriptor 2) +to be redirected to the file whose name is the +expansion of +.I word +with this construct. +.PP +There are two formats for redirecting standard output and +standard error: +.RS +.PP +\fB&>\fP\fIword\fP +.RE +and +.RS +\fB>&\fP\fIword\fP +.RE +.PP +Of the two forms, the first is preferred. +This is semantically equivalent to +.RS +.PP +\fB>\fP\fIword\fP 2\fB>&\fP1 +.RE +.SS Here Documents +.PP +This type of redirection instructs the shell to read input from the +current source until a line containing only +.I word +(with no trailing blanks) +is seen. All of +the lines read up to that point are then used as the standard +input for a command. +.PP +The format of here-documents is: +.RS +.PP +.nf +\fB<<\fP[\fB\-\fP]\fIword\fP + \fIhere-document\fP +\fIdelimiter\fP +.fi +.RE +.PP +No parameter expansion, command substitution, arithmetic expansion, +or pathname expansion is performed on +.IR word . +If any characters in +.I word +are quoted, the +.I delimiter +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 +case, the character sequence +.B \e +is ignored, and +.B \e +must be used to quote the characters +.BR \e , +.BR $ , +and +.BR ` . +.PP +If the redirection operator is +.BR <<\- , +then all leading tab characters are stripped from input lines and the +line containing +.IR delimiter . +This allows +here-documents within shell scripts to be indented in a +natural fashion. +.SS "Here Strings" +A variant of here documents, the format is: +.RS +.PP +.nf +\fB<<<\fP\fIword\fP +.fi +.RE +.PP +The \fIword\fP is expanded and supplied to the command on its standard +input. +.SS "Duplicating File Descriptors" +.PP +The redirection operator +.RS +.PP +[\fIn\fP]\fB<&\fP\fIword\fP +.RE +.PP +is used to duplicate input file descriptors. +If +.I word +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 +.BR \- , +file descriptor +.I n +is closed. If +.I n +is not specified, the standard input (file descriptor 0) is used. +.PP +The operator +.RS +.PP +[\fIn\fP]\fB>&\fP\fIword\fP +.RE +.PP +is used similarly to duplicate output file descriptors. If +.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 +error are redirected as described previously. +.SS "Moving File Descriptors" +.PP +The redirection operator +.RS +.PP +[\fIn\fP]\fB<&\fP\fIdigit\fP\fB\-\fP +.RE +.PP +moves the file descriptor \fIdigit\fP to file descriptor +.IR n , +or the standard input (file descriptor 0) if \fIn\fP is not specified. +\fIdigit\fP is closed after being duplicated to \fIn\fP. +.PP +Similarly, the redirection operator +.RS +.PP +[\fIn\fP]\fB>&\fP\fIdigit\fP\fB\-\fP +.RE +.PP +moves the file descriptor \fIdigit\fP to file descriptor +.IR n , +or the standard output (file descriptor 1) if \fIn\fP is not specified. +.SS "Opening File Descriptors for Reading and Writing" +.PP +The redirection operator +.RS +.PP +[\fIn\fP]\fB<>\fP\fIword\fP +.RE +.PP +causes the file whose name is the expansion of +.I word +to be opened for both reading and writing on file descriptor +.IR n , +or on file descriptor 0 if +.I n +is not specified. If the file does not exist, it is created. +.SH ALIASES +\fIAliases\fP 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 +.B alias +and +.B unalias +builtin commands (see +.SM +.B SHELL BUILTIN COMMANDS +below). +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 the +.I metacharacters +listed above, with the exception that the alias name may not +contain \fI=\fP. 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 +.B ls +to +.BR "ls \-F" , +for instance, and +.B bash +does not try to recursively expand the replacement text. +If the last character of the alias value is a +.IR blank , +then the next command +word following the alias is also checked for alias expansion. +.PP +Aliases are created and listed with the +.B alias +command, and removed with the +.B unalias +command. +.PP +There is no mechanism for using arguments in the replacement text. +If arguments are needed, a shell function should be used (see +.SM +.B FUNCTIONS +below). +.PP +Aliases are not expanded when the shell is not interactive, unless +the +.B expand_aliases +shell option is set using +.B shopt +(see the description of +.B shopt +under +.SM +\fBSHELL BUILTIN COMMANDS\fP +below). +.PP +The rules concerning the definition and use of aliases are +somewhat confusing. +.B 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 +.B alias +in compound commands. +.PP +For almost every purpose, aliases are superseded by +shell functions. +.SH FUNCTIONS +A shell function, defined as described above under +.SM +.BR "SHELL GRAMMAR" , +stores a series of commands for later execution. +When the name of a shell function is used as a simple command name, +the list of commands associated with that function name is executed. +Functions are executed in the context of the +current shell; no new process is created to interpret +them (contrast this with the execution of a shell script). +When a function is executed, the arguments to the +function become the positional parameters +during its execution. +The special parameter +.B # +is updated to reflect the change. Positional parameter 0 +is unchanged. +The first element of the +.SM +.B FUNCNAME +variable is set to the name of the function while the function +is executing. +All other aspects of the shell execution +environment are identical between a function and its caller +with the exception that the +.SM +.B DEBUG +trap (see the description of the +.B trap +builtin under +.SM +.B SHELL BUILTIN COMMANDS +below) is not inherited unless the function has been given the +\fBtrace\fP attribute (see the description of the +.SM +.B declare +builtin below) or the +\fB\-o functrace\fP shell option has been enabled with +the \fBset\fP builtin +(in which case all functions inherit the \fBDEBUG\fP trap). +.PP +Variables local to the function may be declared with the +.B local +builtin command. Ordinarily, variables and their values +are shared between the function and its caller. +.PP +If the builtin command +.B return +is executed in a function, the function completes and +execution resumes with the next command after the function +call. +Any command associated with the \fBRETURN\fP trap is executed +before execution resumes. +When a function completes, the values of the +positional parameters and the special parameter +.B # +are restored to the values they had prior to the function's +execution. +.PP +Function names and definitions may be listed with the +.B \-f +option to the +.B declare +or +.B typeset +builtin commands. The +.B \-F +option to +.B declare +or +.B typeset +will list the function names only +(and optionally the source file and line number, if the \fBextdebug\fP +shell option is enabled). +Functions may be exported so that subshells +automatically have them defined with the +.B \-f +option to the +.B export +builtin. +Note that shell functions and variables with the same name may result +in multiple identically-named entries in the environment passed to the +shell's children. +Care should be taken in cases where this may cause a problem. +.PP +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 and \fBdeclare\fP builtin +commands and \fBArithmetic Expansion\fP). +Evaluation is done in fixed-width integers with no check for overflow, +though division by 0 is trapped and flagged as an error. +The operators and their precedence, associativity, and values +are the same as in the C language. +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 \fIid\fP++ \fIid\fP\-\- +variable post-increment and post-decrement +.TP +.B ++\fIid\fP \-\-\fIid\fP +variable pre-increment and pre-decrement +.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 operator +.TP +.B = *= /= %= += \-= <<= >>= &= ^= |= +assignment +.TP +.B \fIexpr1\fP , \fIexpr2\fP +comma +.PD +.PP +Shell variables are allowed as operands; parameter expansion is +performed before the expression is evaluated. +Within an expression, shell variables may also be referenced by name +without using the parameter expansion syntax. +A shell variable that is null or unset evaluates to 0 when referenced +by name without using the parameter expansion syntax. +The value of a variable is evaluated as an arithmetic expression +when it is referenced, or when a variable which has been given the +\fIinteger\fP attribute using \fBdeclare -i\fP is assigned a value. +A null value evaluates to 0. +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 +\fI/dev/fd/n\fP, then file descriptor \fIn\fP is checked. +If the \fIfile\fP argument to one of the primaries is one of +\fI/dev/stdin\fP, \fI/dev/stdout\fP, or \fI/dev/stderr\fP, file +descriptor 0, 1, or 2, respectively, 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 \-h \fIfile\fP +True if \fIfile\fP exists and is a symbolic link. +.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, +or if \fIfile1\fP exists and \fPfile2\fP does not. +.TP +\fIfile1\fP \-\fBot\fP \fIfile2\fP +True if \fIfile1\fP is older than \fIfile2\fP, or if \fIfile2\fP exists +and \fIfile1\fP does not. +.TP +\fIfile1\fP \fB\-ef\fP \fIfile2\fP +True if \fIfile1\fP and \fIfile2\fP refer to 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 for strict POSIX compliance. +.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 +simple command and an optional list of arguments, the following +actions are taken. +.PP +If the command name contains no slashes, the shell attempts to +locate it. If there exists a shell function by that name, that +function is invoked as described above in +.SM +.BR FUNCTIONS . +If the name does not match a function, the shell searches for +it in the list of shell builtins. If a match is found, that +builtin is invoked. +.PP +If the name is neither a shell function nor a builtin, +and contains no slashes, +.B bash +searches each element of the +.SM +.B PATH +for a directory containing an executable file by that name. +.B Bash +uses a hash table to remember the full pathnames of executable +files (see +.B hash +under +.SM +.B "SHELL BUILTIN COMMANDS" +below). +A full search of the directories in +.SM +.B 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. +.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. +.PP +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 \fIshell script\fP, a file +containing shell commands. A subshell is spawned to execute +it. This subshell reinitializes itself, so +that the effect is as if a new shell had been invoked +to handle the script, with the exception that the locations of +commands remembered by the parent (see +.B hash +below under +.SM +\fBSHELL BUILTIN COMMANDS\fP) +are retained by the child. +.PP +If the program is a file beginning with +.BR #! , +the remainder of the first line specifies an interpreter +for the program. The shell executes the +specified interpreter on operating systems that do not +handle this executable format themselves. The arguments to the +interpreter consist of a single optional argument following the +interpreter name on the first line of the program, followed +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 and functions 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. +.PP +If a command is followed by a \fB&\fP and job control is not active, the +default standard input for the command is the empty file \fI/dev/null\fP. +Otherwise, the invoked command inherits the file descriptors of the calling +shell as modified by redirections. +.SH ENVIRONMENT +When a program is invoked it is given an array of strings +called the +.IR environment . +This is a list of +\fIname\fP\-\fIvalue\fP pairs, of the form +.IR "name\fR=\fPvalue" . +.PP +The shell provides several ways to manipulate the environment. +On invocation, the shell scans its own environment and +creates a parameter for each name found, automatically marking +it for +.I export +to child processes. Executed commands inherit the environment. +The +.B export +and +.B declare \-x +commands allow parameters and functions to be added to and +deleted from the environment. If the value of a parameter +in the environment is modified, the new value becomes part +of the environment, 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 +.B unset +command, plus any additions via the +.B export +and +.B declare \-x +commands. +.PP +The environment for any +.I simple command +or function may be augmented temporarily by prefixing it with +parameter assignments, as described above in +.SM +.BR PARAMETERS . +These assignment statements affect only the environment seen +by that command. +.PP +If the +.B \-k +option is set (see the +.B set +builtin command below), then +.I all +parameter assignments are placed in the environment for a command, +not just those that precede the command name. +.PP +When +.B bash +invokes an external command, the variable +.B _ +is set to the full file name of the command and passed to that +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. +When a command terminates on a fatal signal \fIN\fP, \fBbash\fP uses +the value of 128+\fIN\fP as the exit status. +.PP +If a command is not found, the child process created to +execute it returns a status of 127. If a command is found +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 +while they execute. +All builtins return an exit status of 2 to indicate incorrect usage. +.PP +\fBBash\fP itself returns the exit status of the last command +executed, unless a syntax error occurs, in which case it exits +with a non-zero value. See also the \fBexit\fP builtin +command below. +.SH SIGNALS +When \fBbash\fP is interactive, in the absence of any traps, it ignores +.SM +.B SIGTERM +(so that \fBkill 0\fP does not kill an interactive shell), +and +.SM +.B SIGINT +is caught and handled (so that the \fBwait\fP builtin is interruptible). +In all cases, \fBbash\fP ignores +.SM +.BR SIGQUIT . +If job control is in effect, +.B bash +ignores +.SM +.BR SIGTTIN , +.SM +.BR SIGTTOU , +and +.SM +.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 +.B SIGINT +and +.SM +.B SIGQUIT +as well. +Commands run as a result of command substitution ignore the +keyboard-generated job control signals +.SM +.BR SIGTTIN , +.SM +.BR SIGTTOU , +and +.SM +.BR SIGTSTP . +.PP +The shell exits by default upon receipt of a +.SM +.BR SIGHUP . +Before exiting, an interactive shell resends the +.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 +builtin (see +.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 +refers to the ability to selectively stop (\fIsuspend\fP) +the execution of processes and continue (\fIresume\fP) +their execution at a later point. A user typically employs +this facility via an interactive interface supplied jointly +by the system's terminal driver and +.BR bash . +.PP +The shell associates a +.I job +with each pipeline. It keeps a table of currently executing +jobs, which may be listed with the +.B jobs +command. When +.B bash +starts a job asynchronously (in the +.IR background ), +it prints a line that looks like: +.RS +.PP +[1] 25647 +.RE +.PP +indicating that this job is job number 1 and that the process ID +of the last process in the pipeline associated with this job is 25647. +All of the processes in a single pipeline are members of the same job. +.B Bash +uses the +.I job +abstraction as the basis for job control. +.PP +To facilitate the implementation of the user interface to job +control, the operating system maintains the notion of a \fIcurrent terminal +process group ID\fP. Members of this process group (processes whose +process group ID is equal to the current terminal process group ID) +receive keyboard-generated signals such as +.SM +.BR SIGINT . +These processes are said to be in the +.IR foreground . +.I Background +processes are those whose process group ID differs from the terminal's; +such processes are immune to keyboard-generated signals. +Only foreground processes are allowed to read from or write to the +terminal. Background processes which attempt to read from (write to) the +terminal are sent a +.SM +.B SIGTTIN (SIGTTOU) +signal by the terminal driver, +which, unless caught, suspends the process. +.PP +If the operating system on which +.B bash +is running supports +job control, +.B bash +contains facilities to use it. +Typing the +.I suspend +character (typically +.BR ^Z , +Control-Z) while a process is running +causes that process to be stopped and returns control to +.BR bash . +Typing the +.I "delayed suspend" +character (typically +.BR ^Y , +Control-Y) causes the process to be stopped when it +attempts to read input from the terminal, and control to +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 +.B fg +command to continue it in the foreground, or +the +.B kill +command to kill it. A \fB^Z\fP takes effect immediately, +and has the additional side effect of causing pending output +and typeahead to be discarded. +.PP +There are a number of ways to refer to a job in the shell. +The character +.B % +introduces a job name. Job number +.I n +may be referred to as +.BR %n . +A job may also be referred to using a prefix of the name used to +start it, or using a substring that appears in its command line. +For example, +.B %ce +refers to a stopped +.B ce +job. If a prefix matches more than one job, +.B bash +reports an error. Using +.BR %?ce , +on the other hand, refers to any job containing the string +.B ce +in its command line. If the substring matches more than one job, +.B bash +reports an error. The symbols +.B %% +and +.B %+ +refer to the shell's notion of the +.IR "current job" , +which is the last job stopped while it was in +the foreground or started in the background. +The +.I "previous job" +may be referenced using +.BR %\- . +In output pertaining to jobs (e.g., the output of the +.B jobs +command), the current job is always flagged with a +.BR + , +and the previous job with a +.BR \- . +.PP +Simply naming a job can be used to bring it into the +foreground: +.B %1 +is a synonym for +\fB``fg %1''\fP, +bringing job 1 from the background into the foreground. +Similarly, +.B ``%1 &'' +resumes job 1 in the background, equivalent to +\fB``bg %1''\fP. +.PP +The shell learns immediately whenever a job changes state. +Normally, +.B 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 +.B \-b +option to the +.B set +builtin command +is enabled, +.B bash +reports such changes immediately. +Any trap on +.SM +.B SIGCHLD +is executed for each child that exits. +.PP +If an attempt to exit +.B bash +is made while jobs are stopped, the shell prints a warning message. The +.B jobs +command may then be used to inspect their status. +If a second attempt to exit is made without an intervening command, +the shell does not print another warning, and the stopped +jobs are terminated. +.SH PROMPTING +When executing interactively, +.B bash +displays the primary prompt +.SM +.B PS1 +when it is ready to read a command, and the secondary prompt +.SM +.B PS2 +when it needs more input to complete a command. +.B Bash +allows these prompt strings to be customized by inserting a number of +backslash-escaped special characters that are decoded as follows: +.RS +.PD 0 +.TP +.B \ea +an ASCII bell character (07) +.TP +.B \ed +the date in "Weekday Month Date" format (e.g., "Tue May 26") +.TP +.B \eD{\fIformat\fP} +the \fIformat\fP is passed to \fIstrftime\fP(3) and the result is inserted +into the prompt string; an empty \fIformat\fP results in a locale-specific +time representation. The braces are required +.TP +.B \ee +an ASCII escape character (033) +.TP +.B \eh +the hostname up to the first `.' +.TP +.B \eH +the hostname +.TP +.B \ej +the number of jobs currently managed by the shell +.TP +.B \el +the basename of the shell's terminal device name +.TP +.B \en +newline +.TP +.B \er +carriage return +.TP +.B \es +the name of the shell, the basename of +.B $0 +(the portion following the final slash) +.TP +.B \et +the current time in 24-hour HH:MM:SS format +.TP +.B \eT +the current time in 12-hour HH:MM:SS format +.TP +.B \e@ +the current time in 12-hour am/pm format +.TP +.B \eA +the current time in 24-hour HH:MM format +.TP +.B \eu +the username of the current user +.TP +.B \ev +the version of \fBbash\fP (e.g., 2.00) +.TP +.B \eV +the release of \fBbash\fP, version + patchelvel (e.g., 2.00.0) +.TP +.B \ew +the current working directory +.TP +.B \eW +the basename of the current working directory +.TP +.B \e! +the history number of this command +.TP +.B \e# +the command number of this command +.TP +.B \e$ +if the effective UID is 0, a +.BR # , +otherwise a +.B $ +.TP +.B \e\fInnn\fP +the character corresponding to the octal number \fInnn\fP +.TP +.B \e\e +a backslash +.TP +.B \e[ +begin a sequence of non-printing characters, which could be used to +embed a terminal control sequence into the prompt +.TP +.B \e] +end a sequence of non-printing characters +.PD +.RE +.PP +The command number and the history number are usually different: +the history number of a command is its position in the history +list, which may include commands restored from the history file +(see +.SM +.B HISTORY +below), while the command number is the position in the sequence +of commands executed during the current shell session. +After the string is decoded, it is expanded via +parameter expansion, command substitution, arithmetic +expansion, and quote removal, subject to the value of the +.B promptvars +shell option (see the description of the +.B shopt +command under +.SM +.B "SHELL BUILTIN COMMANDS" +below). +.SH READLINE +This is the library that handles reading input when using an interactive +shell, unless the +.B \-\-noediting +option is given at shell invocation. +By default, the line editing commands are similar to those of emacs. +A vi-style line editing interface is also available. +To turn off line editing after the shell is running, use the +.B +o emacs +or +.B +o vi +options to the +.B set +builtin (see +.SM +.B SHELL BUILTIN COMMANDS +below). +.SS "Readline Notation" +.PP +In this section, the emacs-style notation is used to denote +keystrokes. Control keys are denoted by C\-\fIkey\fR, e.g., C\-n +means Control\-N. Similarly, +.I meta +keys are denoted by M\-\fIkey\fR, so M\-x means Meta\-X. (On keyboards +without a +.I meta +key, M\-\fIx\fP means ESC \fIx\fP, i.e., press the Escape key +then the +.I x +key. This makes ESC the \fImeta prefix\fP. +The combination M\-C\-\fIx\fP means ESC\-Control\-\fIx\fP, +or press the Escape key +then hold the Control key while pressing the +.I x +key.) +.PP +Readline commands may be given numeric +.IR arguments , +which normally act as a repeat count. +Sometimes, however, it is the sign of the argument that is significant. +Passing a negative argument to a command that acts in the forward +direction (e.g., \fBkill\-line\fP) causes that command to act in a +backward direction. +Commands whose behavior with arguments deviates from this are noted +below. +.PP +When a command is described as \fIkilling\fP text, the text +deleted is saved for possible future retrieval +(\fIyanking\fP). The killed text is saved in a +\fIkill ring\fP. Consecutive kills cause the text to be +accumulated into one unit, which can be yanked all at once. +Commands which do not kill text separate the chunks of text +on the kill ring. +.SS "Readline Initialization" +.PP +Readline is customized by putting commands in an initialization +file (the \fIinputrc\fP file). +The name of this file is taken from the value of the +.SM +.B INPUTRC +variable. If that variable is unset, the default is +.IR ~/.inputrc . +When a program which uses the readline library starts up, the +initialization file is read, and the key bindings and variables +are set. +There are only a few basic constructs allowed in the +readline initialization file. +Blank lines are ignored. +Lines beginning with a \fB#\fP are comments. +Lines beginning with a \fB$\fP indicate conditional constructs. +Other lines denote key bindings and variable settings. +.PP +The default key-bindings may be changed with an +.I inputrc +file. +Other programs that use this library may add their own commands +and bindings. +.PP +For example, placing +.RS +.PP +M\-Control\-u: universal\-argument +.RE +or +.RS +C\-Meta\-u: universal\-argument +.RE +into the +.I inputrc +would make M\-C\-u execute the readline command +.IR universal\-argument . +.PP +The following symbolic character names are recognized: +.IR RUBOUT , +.IR DEL , +.IR ESC , +.IR LFD , +.IR NEWLINE , +.IR RET , +.IR RETURN , +.IR SPC , +.IR SPACE , +and +.IR TAB . +.PP +In addition to command names, readline allows keys to be bound +to a string that is inserted when the key is pressed (a \fImacro\fP). +.SS "Readline Key Bindings" +.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 +it should be bound. The name may be specified in one of two ways: +as a symbolic key name, possibly with \fIMeta\-\fP or \fIControl\-\fP +prefixes, or as a key sequence. +.PP +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: +.sp +.RS +Control-u: universal\-argument +.br +Meta-Rubout: backward-kill-word +.br +Control-o: "> output" +.RE +.LP +In the above example, +.I C\-u +is bound to the function +.BR universal\-argument , +.I M\-DEL +is bound to the function +.BR backward\-kill\-word , +and +.I C\-o +is bound to run the macro +expressed on the right hand side (that is, to insert the text +.if t \f(CW> output\fP +.if n ``> output'' +into the line). +.PP +In the second form, \fB"keyseq"\fP:\^\fIfunction\-name\fP or \fImacro\fP, +.B keyseq +differs from +.B keyname +above in that strings denoting +an entire key sequence may be specified by placing the sequence +within double quotes. Some GNU Emacs style key escapes can be +used, as in the following example, but the symbolic character names +are not recognized. +.sp +.RS +"\eC\-u": universal\-argument +.br +"\eC\-x\eC\-r": re\-read\-init\-file +.br +"\ee[11~": "Function Key 1" +.RE +.PP +In this example, +.I C\-u +is again bound to the function +.BR universal\-argument . +.I "C\-x C\-r" +is bound to the function +.BR re\-read\-init\-file , +and +.I "ESC [ 1 1 ~" +is bound to insert the text +.if t \f(CWFunction Key 1\fP. +.if n ``Function Key 1''. +.PP +The full set of GNU Emacs style escape sequences is +.RS +.PD 0 +.TP +.B \eC\- +control prefix +.TP +.B \eM\- +meta prefix +.TP +.B \ee +an escape character +.TP +.B \e\e +backslash +.TP +.B \e" +literal " +.TP +.B \e' +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 eight-bit character whose value is the octal value \fInnn\fP +(one to three digits) +.TP +.B \ex\fIHH\fP +the eight-bit character whose value is the hexadecimal value \fIHH\fP +(one or two hex 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 +allows the current readline key bindings to be displayed or modified +with the +.B bind +builtin command. The editing mode may be switched during interactive +use by using the +.B \-o +option to the +.B set +builtin command (see +.SM +.B SHELL BUILTIN COMMANDS +below). +.SS "Readline Variables" +.PP +Readline has variables that can be used to further customize its +behavior. A variable may be set in the +.I inputrc +file with a statement of the form +.RS +.PP +\fBset\fP \fIvariable\-name\fP \fIvalue\fP +.RE +.PP +Except where noted, readline variables can take the values +.B On +or +.BR Off . +The variables and their default values are: +.PP +.PD 0 +.TP +.B bell\-style (audible) +Controls what happens when readline wants to ring the terminal bell. +If set to \fBnone\fP, readline never rings the bell. If set to +\fBvisible\fP, readline uses a visible bell if one is available. +If set to \fBaudible\fP, readline attempts to ring the terminal's bell. +.TP +.B comment\-begin (``#'') +The string that is inserted when the readline +.B insert\-comment +command is executed. +This command is bound to +.B M\-# +in emacs mode and to +.B # +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 +the number of possible completions +generated by the \fBpossible\-completions\fP command. +It may be set to any integer value greater than or equal to +zero. If the number of possible completions is greater than +or equal to the value of this variable, the user is asked whether +or not he wishes to view them; otherwise they are simply listed +on the terminal. +.TP +.B convert\-meta (On) +If set to \fBOn\fP, readline will convert characters with the +eighth bit set to an ASCII key sequence +by stripping the eighth bit and prefixing an +escape character (in effect, using escape as the \fImeta prefix\fP). +.TP +.B disable\-completion (Off) +If set to \fBOn\fP, readline will inhibit word completion. Completion +characters will be inserted into the line as if they had been +mapped to \fBself-insert\fP. +.TP +.B editing\-mode (emacs) +Controls whether readline begins with a set of key bindings similar +to \fIemacs\fP or \fIvi\fP. +.B editing\-mode +can be set to either +.B emacs +or +.BR vi . +.TP +.B enable\-keypad (Off) +When set to \fBOn\fP, readline will try to enable the application +keypad when it is called. Some systems need this to enable the +arrow keys. +.TP +.B expand\-tilde (Off) +If set to \fBon\fP, tilde expansion is performed when readline +attempts word completion. +.TP +.B history-preserve-point +If set to \fBon\fP, the history code attempts to place point at the +same location on each history line retrived with \fBprevious-history\fP +or \fBnext-history\fP. +.TP +.B horizontal\-scroll\-mode (Off) +When set to \fBOn\fP, makes readline use a single line for display, +scrolling the input horizontally on a single screen line when it +becomes longer than the screen width rather than wrapping to a new line. +.TP +.B input\-meta (Off) +If set to \fBOn\fP, readline will enable eight-bit input (that is, +it will not strip the high bit from the characters it reads), +regardless of what the terminal claims it can support. The name +.B meta\-flag +is a synonym for this variable. +.TP +.B isearch\-terminators (``C\-[C\-J'') +The string of characters that should terminate an incremental +search without subsequently executing the character as a command. +If this variable has not been given a value, the characters +\fIESC\fP and \fIC\-J\fP will terminate an incremental search. +.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 +.IR vi\-insert . +\fIvi\fP is equivalent to \fIvi\-command\fP; \fIemacs\fP is +equivalent to \fIemacs\-standard\fP. The default value is +.IR emacs ; +the value of +.B editing\-mode +also affects the default keymap. +.TP +.B mark\-directories (On) +If set to \fBOn\fP, completed directory names have a slash +appended. +.TP +.B mark\-modified\-lines (Off) +If set to \fBOn\fP, history lines that have been modified are displayed +with a preceding asterisk (\fB*\fP). +.TP +.B mark\-symlinked\-directories (Off) +If set to \fBOn\fP, completed names which are symbolic links to directories +have a slash appended (subject to the value of +\fBmark\-directories\fP). +.TP +.B match\-hidden\-files (On) +This variable, when set to \fBOn\fP, causes readline to match files whose +names begin with a `.' (hidden files) when performing filename +completion, unless the leading `.' is +supplied by the user in the filename to be completed. +.TP +.B output\-meta (Off) +If set to \fBOn\fP, readline will display characters with the +eighth bit set directly rather than as a meta-prefixed escape +sequence. +.TP +.B page\-completions (On) +If set to \fBOn\fP, readline uses an internal \fImore\fP-like pager +to display a screenful of possible completions at a time. +.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 +set to +.BR on , +words which have more than one possible completion cause the +matches to be listed immediately instead of ringing the bell. +.TP +.B visible\-stats (Off) +If set to \fBOn\fP, a character denoting a file's type as reported +by \fIstat\fP(2) is appended to the filename when listing possible +completions. +.PD +.SS "Readline Conditional Constructs" +.PP +Readline implements a facility similar in spirit to the conditional +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 +.B $if +construct allows bindings to be made based on the +editing mode, the terminal being used, or the application using +readline. The text of the test extends to the end of the line; +no characters are required to isolate it. +.RS +.IP \fBmode\fP +The \fBmode=\fP form of the \fB$if\fP directive is used to test +whether readline is in emacs or vi mode. +This may be used in conjunction +with the \fBset keymap\fP command, for instance, to set bindings in +the \fIemacs\-standard\fP and \fIemacs\-ctlx\fP keymaps only if +readline is starting out in emacs mode. +.IP \fBterm\fP +The \fBterm=\fP form may be used to include terminal-specific +key bindings, perhaps to bind the key sequences output by the +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 +to match both +.I sun +and +.IR sun\-cmd , +for instance. +.IP \fBapplication\fP +The \fBapplication\fP construct is used to include +application-specific settings. Each program using the readline +library sets the \fIapplication name\fP, and an initialization +file can test for a particular value. +This could be used to bind key sequences to functions useful for +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 +\fB$if\fP Bash +# Quote the current or previous word +"\eC\-xq": "\eeb\e"\eef\e"" +\fB$endif\fP +.fi +.RE +.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 +Readline provides commands for searching through the command history +(see +.SM +.B HISTORY +below) for lines containing a specified string. +There are two search modes: +.I incremental +and +.IR non-incremental . +.PP +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 characters present in the value of the \fBisearch-terminators\fP +variable are used to terminate an incremental search. +If that variable has not been assigned a value the Escape and +Control-J characters will terminate an incremental 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. +.PP +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 \fInewline\fP will terminate the search and accept +the line, thereby executing the command from the history list. +.PP +Readline remembers the last incremental search string. If two +Control-Rs are typed without any intervening characters defining a +new search string, any remembered search string is used. +.PP +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 +The following is a list of the names of the commands and the default +key sequences to which they are bound. +Command names without an accompanying key sequence are unbound by default. +In the following descriptions, \fIpoint\fP refers to the current cursor +position, and \fImark\fP refers to a cursor position saved by the +\fBset\-mark\fP command. +The text between the point and mark is referred to as the \fIregion\fP. +.SS Commands for Moving +.PP +.PD 0 +.TP +.B beginning\-of\-line (C\-a) +Move to the start of the current line. +.TP +.B end\-of\-line (C\-e) +Move to the end of the line. +.TP +.B forward\-char (C\-f) +Move forward a character. +.TP +.B backward\-char (C\-b) +Move back a character. +.TP +.B forward\-word (M\-f) +Move forward to the end of the next word. Words are composed of +alphanumeric characters (letters and digits). +.TP +.B backward\-word (M\-b) +Move back to the start of the current or previous word. Words are +composed of alphanumeric characters (letters and digits). +.TP +.B clear\-screen (C\-l) +Clear the screen leaving the current line at the top of the screen. +With an argument, refresh the current line without clearing the +screen. +.TP +.B redraw\-current\-line +Refresh the current line. +.PD +.SS Commands for Manipulating the History +.PP +.PD 0 +.TP +.B accept\-line (Newline, Return) +Accept the line regardless of where the cursor is. If this line is +non-empty, add it to the history list according to the state of the +.SM +.B HISTCONTROL +variable. If the line is a modified history +line, then restore the history line to its original state. +.TP +.B previous\-history (C\-p) +Fetch the previous command from the history list, moving back in +the list. +.TP +.B next\-history (C\-n) +Fetch the next command from the history list, moving forward in the +list. +.TP +.B beginning\-of\-history (M\-<) +Move to the first line in the history. +.TP +.B end\-of\-history (M\->) +Move to the end of the input history, i.e., the line currently being +entered. +.TP +.B reverse\-search\-history (C\-r) +Search backward starting at the current line and moving `up' through +the history as necessary. This is an incremental search. +.TP +.B forward\-search\-history (C\-s) +Search forward starting at the current line and moving `down' through +the history as necessary. This is an incremental search. +.TP +.B non\-incremental\-reverse\-search\-history (M\-p) +Search backward through the history starting at the current line +using a non-incremental search for a string supplied by the user. +.TP +.B non\-incremental\-forward\-search\-history (M\-n) +Search forward through the history using a non-incremental search for +a string supplied by the user. +.TP +.B history\-search\-forward +Search forward through the history for the string of characters +between the start of the current line and the point. +This is a non-incremental search. +.TP +.B history\-search\-backward +Search backward through the history for the string of characters +between the start of the current line and the point. +This is a non-incremental search. +.TP +.B yank\-nth\-arg (M\-C\-y) +Insert the first argument to the previous command (usually +the second word on the previous line) at point. +With an argument +.IR n , +insert the \fIn\fPth word from the previous command (the words +in the previous command begin with word 0). A negative argument +inserts the \fIn\fPth word from the end of the previous command. +.TP +.B +yank\-last\-arg (M\-.\^, M\-_\^) +Insert the last argument to the previous command (the last word of +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 +.SM +.B HISTORY EXPANSION +below for a description of history expansion. +.TP +.B history\-expand\-line (M\-^) +Perform history expansion on the current line. +See +.SM +.B HISTORY EXPANSION +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. +See +.SM +.B ALIASES +above for a description of alias expansion. +.TP +.B history\-and\-alias\-expand\-line +Perform history and alias expansion on the current line. +.TP +.B insert\-last\-argument (M\-.\^, M\-_\^) +A synonym for \fByank\-last\-arg\fP. +.TP +.B operate\-and\-get\-next (C\-o) +Accept the current line for execution and fetch the next line +relative to the current line from the history for editing. Any +argument is ignored. +.TP +.B edit\-and\-execute\-command (C\-xC\-e) +Invoke an editor on the current command line, and execute the result as shell +commands. +\fBBash\fP attempts to invoke +.SM +.BR $FCEDIT , +.SM +.BR $EDITOR , +and \fIemacs\fP as the editor, in that order. +.PD +.SS Commands for Changing Text +.PP +.PD 0 +.TP +.B delete\-char (C\-d) +Delete the character at point. 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 +.BR EOF . +.TP +.B backward\-delete\-char (Rubout) +Delete the character behind the cursor. When given a numeric argument, +save the deleted text on the kill ring. +.TP +.B forward\-backward\-delete\-char +Delete the character under the cursor, unless the cursor is at the +end of the line, in which case the character behind the cursor is +deleted. +.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 +.B tab\-insert (C\-v TAB) +Insert a tab character. +.TP +.B self\-insert (a,\ b,\ A,\ 1,\ !,\ ...) +Insert the character typed. +.TP +.B transpose\-chars (C\-t) +Drag the character before point forward over the character at point, +moving point forward as well. +If point is at the end of the line, then this transposes +the two characters before point. +Negative arguments have no effect. +.TP +.B transpose\-words (M\-t) +Drag the word before point past the word after point, +moving point over that word as well. +If point is at the end of the line, this transposes +the last two words on the line. +.TP +.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. +.TP +.B overwrite\-mode +Toggle overwrite mode. With an explicit positive numeric argument, +switches to overwrite mode. With an explicit non-positive numeric +argument, switches to insert mode. This command affects only +\fBemacs\fP mode; \fBvi\fP mode does overwrite differently. +Each call to \fIreadline()\fP starts in insert mode. +In overwrite mode, characters bound to \fBself\-insert\fP replace +the text at point rather than pushing the text to the right. +Characters bound to \fBbackward\-delete\-char\fP replace the character +before point with a space. By default, this command is unbound. +.PD +.SS Killing and Yanking +.PP +.PD 0 +.TP +.B kill\-line (C\-k) +Kill the text from point to the end of the line. +.TP +.B backward\-kill\-line (C\-x Rubout) +Kill backward to the beginning of the line. +.TP +.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 +Kill all characters on the current line, no matter where point is. +.TP +.B kill\-word (M\-d) +Kill from point to the end of the current word, or if between +words, to the end of the next word. +Word boundaries are the same as those used by \fBforward\-word\fP. +.TP +.B backward\-kill\-word (M\-Rubout) +Kill the word behind point. +Word boundaries are the same as those used by \fBbackward\-word\fP. +.TP +.B unix\-word\-rubout (C\-w) +Kill the word behind point, using white space as a word boundary. +The killed text is saved on the kill-ring. +.TP +.B delete\-horizontal\-space (M\-\e) +Delete all spaces and tabs around point. +.TP +.B kill\-region +Kill the text in the current region. +.TP +.B copy\-region\-as\-kill +Copy the text in the region to the kill buffer. +.TP +.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) +Yank the top of the kill ring into the buffer at point. +.TP +.B yank\-pop (M\-y) +Rotate the kill ring, and yank the new top. Only works following +.B yank +or +.BR yank\-pop . +.PD +.SS Numeric Arguments +.PP +.PD 0 +.TP +.B digit\-argument (M\-0, M\-1, ..., M\-\-) +Add this digit to the argument already accumulating, or start a new +argument. M\-\- starts a negative argument. +.TP +.B universal\-argument +This is another way to specify an argument. +If this command is followed by one or more digits, optionally with a +leading minus sign, those digits define the argument. +If the command is followed by digits, executing +.B universal\-argument +again ends the numeric argument, but is otherwise ignored. +As a special case, if this command is immediately followed by a +character that is neither a digit or minus sign, the argument count +for the next command is multiplied by four. +The argument count is initially one, so executing this function the +first time makes the argument count four, a second time makes the +argument count sixteen, and so on. +.PD +.SS Completing +.PP +.PD 0 +.TP +.B complete (TAB) +Attempt to perform completion on the text before point. +.B Bash +attempts completion treating the text as a variable (if the +text begins with \fB$\fP), username (if the text begins with +\fB~\fP), hostname (if the text begins with \fB@\fP), or +command (including aliases and functions) in turn. If none +of these produces a match, filename completion is attempted. +.TP +.B possible\-completions (M\-?) +List the possible completions of the text before point. +.TP +.B insert\-completions (M\-*) +Insert all completions of the text before point +that would have been generated by +\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 +(subject to the setting of \fBbell\-style\fP) +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 delete\-char\-or\-list +Deletes the character under the cursor if not at the beginning or +end of the line (like \fBdelete\-char\fP). +If at the end of the line, behaves identically to +\fBpossible\-completions\fP. +This command is unbound by default. +.TP +.B complete\-filename (M\-/) +Attempt filename completion on the text before point. +.TP +.B possible\-filename\-completions (C\-x /) +List the possible completions of the text before point, +treating it as a filename. +.TP +.B complete\-username (M\-~) +Attempt completion on the text before point, treating +it as a username. +.TP +.B possible\-username\-completions (C\-x ~) +List the possible completions of the text before point, +treating it as a username. +.TP +.B complete\-variable (M\-$) +Attempt completion on the text before point, treating +it as a shell variable. +.TP +.B possible\-variable\-completions (C\-x $) +List the possible completions of the text before point, +treating it as a shell variable. +.TP +.B complete\-hostname (M\-@) +Attempt completion on the text before point, treating +it as a hostname. +.TP +.B possible\-hostname\-completions (C\-x @) +List the possible completions of the text before point, +treating it as a hostname. +.TP +.B complete\-command (M\-!) +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. +.TP +.B possible\-command\-completions (C\-x !) +List the possible completions of the text before point, +treating it as a command name. +.TP +.B dynamic\-complete\-history (M\-TAB) +Attempt completion on the text before point, comparing +the text against lines from the history list for possible +completion matches. +.TP +.B complete\-into\-braces (M\-{) +Perform filename completion and insert the list of possible completions +enclosed within braces so the list is available to the shell (see +.B Brace Expansion +above). +.PD +.SS Keyboard Macros +.PP +.PD 0 +.TP +.B start\-kbd\-macro (C\-x (\^) +Begin saving the characters typed into the current keyboard macro. +.TP +.B end\-kbd\-macro (C\-x )\^) +Stop saving the characters typed into the current keyboard macro +and store the definition. +.TP +.B call\-last\-kbd\-macro (C\-x e) +Re-execute the last keyboard macro defined, by making the characters +in the macro appear as if typed at the keyboard. +.PD +.SS Miscellaneous +.PP +.PD 0 +.TP +.B re\-read\-init\-file (C\-x C\-r) +Read in the contents of the \fIinputrc\fP file, and incorporate +any bindings or variable assignments found there. +.TP +.B abort (C\-g) +Abort the current editing command and +ring the terminal's bell (subject to the setting of +.BR bell\-style ). +.TP +.B do\-uppercase\-version (M\-a, M\-b, M\-\fIx\fP, ...) +If the metafied character \fIx\fP is lowercase, run the command +that is bound to the corresponding uppercase character. +.TP +.B prefix\-meta (ESC) +Metafy the next character typed. +.SM +.B ESC +.B f +is equivalent to +.BR Meta\-f . +.TP +.B undo (C\-_, C\-x C\-u) +Incremental undo, separately remembered for each line. +.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. +.TP +.B tilde\-expand (M\-&) +Perform tilde expansion on the current word. +.TP +.B set\-mark (C\-@, M\-) +Set the mark to the point. If a +numeric argument is supplied, the mark is set to that position. +.TP +.B exchange\-point\-and\-mark (C\-x C\-x) +Swap the point with the mark. The current cursor position is set to +the saved position, and the old cursor position is saved as the mark. +.TP +.B character\-search (C\-]) +A character is read and point is moved to the next occurrence of that +character. A negative count searches for previous occurrences. +.TP +.B character\-search\-backward (M\-C\-]) +A character is read and point is moved to the previous occurrence of that +character. A negative count searches for subsequent occurrences. +.TP +.B insert\-comment (M\-#) +Without a numeric argument, the value of the readline +.B comment\-begin +variable is inserted at the beginning of the current line. +If a numeric argument is supplied, this command acts as a toggle: if +the characters at the beginning of the line do not match the value +of \fBcomment\-begin\fP, the value is inserted, otherwise +the characters in \fBcomment-begin\fP are deleted from the beginning of +the line. +In either case, the line is accepted as if a newline had been typed. +The default value of +\fBcomment\-begin\fP causes this command to make the current line +a shell comment. +If a numeric argument causes the comment character to be removed, the line +will be executed by the shell. +.TP +.B glob\-complete\-word (M\-g) +The word before point is treated as a pattern for pathname expansion, +with an asterisk implicitly appended. This pattern is used to +generate a list of matching file names for possible completions. +.TP +.B glob\-expand\-word (C\-x *) +The word before point is treated as a pattern for pathname expansion, +and the list of matching file names is inserted, replacing the word. +If a numeric argument is supplied, an asterisk is appended before +pathname expansion. +.TP +.B glob\-list\-expansions (C\-x g) +The list of expansions that would have been generated by +.B glob\-expand\-word +is displayed, and the line is redrawn. +If a numeric argument is supplied, an asterisk is appended before +pathname expansion. +.TP +.B 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 \fIinputrc\fP file. +.TP +.B dump\-variables +Print all of the settable readline 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 \fIinputrc\fP file. +.TP +.B 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 \fIinputrc\fP file. +.TP +.B display\-shell\-version (C\-x C\-v) +Display version information about the current instance of +.BR bash . +.PD +.SS Programmable Completion +.PP +When word completion is attempted for an argument to a command for +which a completion specification (a \fIcompspec\fP) has been defined +using the \fBcomplete\fP builtin (see +.SM +.B "SHELL BUILTIN COMMANDS" +below), the programmable completion facilities are invoked. +.PP +First, the command name is identified. +If a compspec has been defined for that command, the +compspec is used to generate the list of possible completions for the word. +If the command word is a full pathname, a compspec for the full +pathname is searched for first. +If no compspec is found for the full pathname, an attempt is made to +find a compspec for the portion following the final slash. +.PP +Once a compspec has been found, it is used to generate the list of +matching words. +If a compspec is not found, the default \fBbash\fP completion as +described above under \fBCompleting\fP is performed. +.PP +First, the actions specified by the compspec are used. +Only matches which are prefixed by the word being completed are +returned. +When the +.B \-f +or +.B \-d +option is used for filename or directory name completion, the shell +variable +.SM +.B FIGNORE +is used to filter the matches. +.PP +Any completions specified by a filename expansion pattern to the +\fB\-G\fP option are generated next. +The words generated by the pattern need not match the word +being completed. +The +.SM +.B GLOBIGNORE +shell variable is not used to filter the matches, but the +.SM +.B FIGNORE +variable is used. +.PP +Next, the string specified as the argument to the \fB\-W\fP option +is considered. +The string is first split using the characters in the +.SM +.B IFS +special variable as delimiters. +Shell quoting is honored. +Each word is then expanded using +brace expansion, tilde expansion, parameter and variable expansion, +command substitution, arithmetic expansion, and pathname expansion, +as described above under +.SM +.BR EXPANSION . +The results are split using the rules described above under +\fBWord Splitting\fP. +The results of the expansion are prefix-matched against the word being +completed, and the matching words become the possible completions. +.PP +After these matches have been generated, any shell function or command +specified with the \fB\-F\fP and \fB\-C\fP options is invoked. +When the command or function is invoked, the +.SM +.B COMP_LINE +and +.SM +.B COMP_POINT +variables are assigned values as described above under +\fBShell Variables\fP. +If a shell function is being invoked, the +.SM +.B COMP_WORDS +and +.SM +.B COMP_CWORD +variables are also set. +When the function or command is invoked, the first argument is the +name of the command whose arguments are being completed, the +second argument is the word being completed, and the third argument +is the word preceding the word being completed on the current command line. +No filtering of the generated completions against the word being completed +is performed; the function or command has complete freedom in generating +the matches. +.PP +Any function specified with \fB\-F\fP is invoked first. +The function may use any of the shell facilities, including the +\fBcompgen\fP builtin described below, to generate the matches. +It must put the possible completions in the +.SM +.B COMPREPLY +array variable. +.PP +Next, any command specified with the \fB\-C\fP option is invoked +in an environment equivalent to command substitution. +It should print a list of completions, one per line, to the +standard output. +Backslash may be used to escape a newline, if necessary. +.PP +After all of the possible completions are generated, any filter +specified with the \fB\-X\fP option is applied to the list. +The filter is a pattern as used for pathname expansion; a \fB&\fP +in the pattern is replaced with the text of the word being completed. +A literal \fB&\fP may be escaped with a backslash; the backslash +is removed before attempting a match. +Any completion that matches the pattern will be removed from the list. +A leading \fB!\fP negates the pattern; in this case any completion +not matching the pattern will be removed. +.PP +Finally, any prefix and suffix specified with the \fB\-P\fP and \fB\-S\fP +options are added to each member of the completion list, and the result is +returned to the readline completion code as the list of possible +completions. +.PP +If the previously-applied actions do not generate any matches, and the +\fB\-o dirnames\fP option was supplied to \fBcomplete\fP when the +compspec was defined, directory name completion is attempted. +.PP +By default, if a compspec is found, whatever it generates is returned +to the completion code as the full set of possible completions. +The default \fBbash\fP completions are not attempted, and the readline +default of filename completion is disabled. +If the \fB-o default\fP option was supplied to \fBcomplete\fP when the +compspec was defined, readline's default completion will be performed +if the compspec generates no matches. +.PP +When a compspec indicates that directory name completion is desired, +the programmable completion functions force readline to append a slash +to completed names which are symbolic links to directories, subject to +the value of the \fBmark\-directories\fP readline variable, regardless +of the setting of the \fBmark-symlinked\-directories\fP readline variable. +.SH HISTORY +When the +.B \-o history +option to the +.B set +builtin is enabled, the shell provides access to the +\fIcommand history\fP, +the list of commands previously typed. +The value of the \fBHISTSIZE\fP variable is used as the +number of commands to save in a history list. +The text of the last +.SM +.B HISTSIZE +commands (default 500) is saved. The shell +stores each command in the history list prior to parameter and +variable expansion (see +.SM +.B EXPANSION +above) but after history expansion is performed, subject to the +values of the shell variables +.SM +.B HISTIGNORE +and +.SM +.BR HISTCONTROL . +.PP +On startup, the history is initialized from the file named by +the variable +.SM +.B HISTFILE +(default \fI~/.bash_history\fP). +The file named by the value of +.SM +.B HISTFILE +is truncated, if necessary, to contain no more than +the number of lines specified by the value of +.SM +.BR HISTFILESIZE . +When an interactive shell exits, the last +.SM +.B $HISTSIZE +lines are copied from the history list to +.SM +.BR $HISTFILE . +If the +.B histappend +shell option is enabled +(see the description of +.B shopt +under +.SM +.B "SHELL BUILTIN COMMANDS" +below), the lines are appended to the history file, +otherwise the history file is overwritten. +If +.SM +.B HISTFILE +is unset, or if the history file is unwritable, the history is +not saved. After saving the history, the history file is truncated +to contain no more than +.SM +.B HISTFILESIZE +lines. If +.SM +.B HISTFILESIZE +is not set, no truncation is performed. +.PP +The builtin command +.B fc +(see +.SM +.B SHELL BUILTIN COMMANDS +below) may be used to list or edit and re-execute a portion of +the history list. +The +.B history +builtin may be used to display or modify the history list and +manipulate the history file. +When using command-line editing, search commands +are available in each editing mode that provide access to the +history list. +.PP +The shell allows control over which commands are saved on the history +list. The +.SM +.B HISTCONTROL +and +.SM +.B HISTIGNORE +variables may be set to cause the shell to save only a subset of the +commands entered. +The +.B cmdhist +shell option, if enabled, causes the shell to attempt to save each +line of a multi-line command in the same history entry, adding +semicolons where necessary to preserve syntactic correctness. +The +.B lithist +shell option causes the shell to save the command with embedded newlines +instead of semicolons. See the description of the +.B shopt +builtin below under +.SM +.B "SHELL BUILTIN COMMANDS" +for information on setting and unsetting shell options. +.SH "HISTORY EXPANSION" +.PP +The shell supports a history expansion feature that +is similar to the history expansion in +.BR csh. +This section describes what syntax features are available. This +feature is enabled by default for interactive shells, and can be +disabled using the +.B \+H +option to the +.B set +builtin command (see +.SM +.B SHELL BUILTIN COMMANDS +below). Non-interactive shells do not perform history expansion +by default. +.PP +History expansions introduce words from the history list into +the input stream, making it easy to repeat commands, insert the +arguments to a previous command into the current input line, or +fix errors in previous commands quickly. +.PP +History expansion is performed immediately after a complete line +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. +Only backslash (\^\fB\e\fP\^) and single quotes can quote +the history expansion character. +.PP +Several shell options settable with the +.B shopt +builtin may be used to tailor the behavior of history expansion. +If the +.B histverify +shell option is enabled (see the description of the +.B shopt +builtin), and +.B readline +is being used, history substitutions are not immediately passed to +the shell parser. +Instead, the expanded line is reloaded into the +.B readline +editing buffer for further modification. +If +.B readline +is being used, and the +.B histreedit +shell option is enabled, a failed history substitution will be reloaded +into the +.B readline +editing buffer for correction. +The +.B \-p +option to the +.B history +builtin command may be used to see what a history expansion will +do before using it. +The +.B \-s +option to the +.B 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. +.PP +The shell allows control of the various characters used by the +history expansion mechanism (see the description of +.B histchars +above under +.BR "Shell Variables" ). +.SS Event Designators +.PP +An event designator is a reference to a command line entry in the +history list. +.PP +.PD 0 +.TP +.B ! +Start a history substitution, except when followed by a +.BR blank , +newline, = or ( (when the \fBextglob\fP shell option is enabled using +the \fBshopt\fP builtin). +.TP +.B !\fIn\fR +Refer to command line +.IR n . +.TP +.B !\-\fIn\fR +Refer to the current command line minus +.IR n . +.TP +.B !! +Refer to the previous command. This is a synonym for `!\-1'. +.TP +.B !\fIstring\fR +Refer to the most recent command starting with +.IR string . +.TP +.B !?\fIstring\fR\fB[?]\fR +Refer to the most recent command containing +.IR string . +The trailing \fB?\fP may be omitted if +.I string +is followed immediately by a newline. +.TP +.B \d\s+2^\s-2\u\fIstring1\fP\d\s+2^\s-2\u\fIstring2\fP\d\s+2^\s-2\u +Quick substitution. Repeat the last command, replacing +.I string1 +with +.IR string2 . +Equivalent to +``!!:s/\fIstring1\fP/\fIstring2\fP/'' +(see \fBModifiers\fP below). +.TP +.B !# +The entire command line typed so far. +.PD +.SS Word Designators +.PP +Word designators are used to select desired words from the event. +A +.B : +separates the event specification from the word designator. +It may be omitted if the word designator begins with a +.BR ^ , +.BR $ , +.BR * , +.BR \- , +or +.BR % . +Words are numbered from the beginning of the line, +with the first word being denoted by 0 (zero). +Words are inserted into the current line separated by single spaces. +.PP +.PD 0 +.TP +.B 0 (zero) +The zeroth word. For the shell, this is the command +word. +.TP +.I n +The \fIn\fRth word. +.TP +.B ^ +The first argument. That is, word 1. +.TP +.B $ +The last argument. +.TP +.B % +The word matched by the most recent `?\fIstring\fR?' search. +.TP +.I x\fB\-\fPy +A range of words; `\-\fIy\fR' abbreviates `0\-\fIy\fR'. +.TP +.B * +All of the words but the zeroth. This is a synonym +for `\fI1\-$\fP'. It is not an error to use +.B * +if there is just one +word in the event; the empty string is returned in that case. +.TP +.B x* +Abbreviates \fIx\-$\fP. +.TP +.B x\- +Abbreviates \fIx\-$\fP like \fBx*\fP, but omits the last word. +.PD +.PP +If a word designator is supplied without an event specification, the +previous command is used as the event. +.SS Modifiers +.PP +After the optional word designator, there may appear a sequence of +one or more of the following modifiers, each preceded by a `:'. +.PP +.PD 0 +.PP +.TP +.B h +Remove a trailing file name component, leaving only the head. +.TP +.B t +Remove all leading file name components, leaving the tail. +.TP +.B r +Remove a trailing suffix of the form \fI.xxx\fP, leaving the +basename. +.TP +.B e +Remove all but the trailing suffix. +.TP +.B p +Print the new command but do not execute it. +.TP +.B q +Quote the substituted words, escaping further substitutions. +.TP +.B x +Quote the substituted words as with +.BR q , +but break into words at +.B blanks +and newlines. +.TP +.B s/\fIold\fP/\fInew\fP/ +Substitute +.I new +for the first occurrence of +.I old +in the event line. Any delimiter can be used in place of /. The +final delimiter is optional if it is the last character of the +event line. The delimiter may be quoted in +.I old +and +.I new +with a single backslash. If & appears in +.IR new , +it is replaced by +.IR old . +A single backslash will quote the &. If +.I old +is null, it is set to the last +.I old +substituted, or, if no previous history substitutions took place, +the last +.I string +in a +.B !?\fIstring\fR\fB[?]\fR +search. +.TP +.B & +Repeat the previous substitution. +.TP +.B g +Cause changes to be applied over the entire event line. This is +used in conjunction with `\fB:s\fP' (e.g., `\fB:gs/\fIold\fP/\fInew\fP/\fR') +or `\fB:&\fP'. If used with +`\fB:s\fP', any delimiter can be used +in place of /, and the final delimiter is optional +if it is the last character of the event line. +An \fBa\fP may be used as a synonym for \fBg\fP. +.TP +.B G +Apply the following `\fBs\fP' modifier once to each word in the event line. +.PD +.SH "SHELL BUILTIN COMMANDS" +.\" start of bash_builtins +.zZ +.PP +Unless otherwise noted, each builtin command documented in this +section as accepting options preceded by +.B \- +accepts +.B \-\- +to signify the end of the options. +.sp .5 +.PD 0 +.TP +\fB:\fP [\fIarguments\fP] +.PD +No effect; the command does nothing beyond expanding +.I arguments +and performing any specified +redirections. A zero exit code is returned. +.TP +\fB .\| \fP \fIfilename\fP [\fIarguments\fP] +.PD 0 +.TP +\fBsource\fP \fIfilename\fP [\fIarguments\fP] +.PD +Read and execute commands from +.I filename +in the current +shell environment and return the exit status of the last command +executed from +.IR filename . +If +.I filename +does not contain a slash, file names in +.SM +.B PATH +are used to find the directory containing +.IR filename . +The file searched for in +.SM +.B PATH +need not be executable. +When \fBbash\fP is not in \fIposix mode\fP, the current directory is +searched if no file is found in +.SM +.BR PATH . +If the +.B sourcepath +option to the +.B shopt +builtin command is turned off, the +.SM +.B PATH +is not searched. +If any \fIarguments\fP are supplied, they become the positional +parameters when \fIfilename\fP is executed. Otherwise the positional +parameters are unchanged. +The return status is the status of the last command exited within +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] ...] +\fBAlias\fP with no arguments or with the +.B \-p +option prints the list of aliases in the form +\fBalias\fP \fIname\fP=\fIvalue\fP on standard output. +When arguments are supplied, an alias is defined for +each \fIname\fP whose \fIvalue\fP is given. +A trailing space in \fIvalue\fP causes the next word to be +checked for alias substitution when the alias is expanded. +For each \fIname\fP in the argument list for which no \fIvalue\fP +is supplied, the name and value of the alias is printed. +\fBAlias\fP returns true unless a \fIname\fP is given for which +no alias has been defined. +.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 +\fIcurrent job\fP is used. +.B bg +.I jobspec +returns 0 unless run when job control is disabled or, when run with +job control enabled, if \fIjobspec\fP was not found or started without +job control. +.TP +\fBbind\fP [\fB\-m\fP \fIkeymap\fP] [\fB\-lpsvPSV\fP] +.PD 0 +.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 +.TP +\fBbind\fP [\fB\-m\fP \fIkeymap\fP] \fB\-x\fP \fIkeyseq\fP:\fIshell\-command\fP +.TP +\fBbind\fP [\fB\-m\fP \fIkeymap\fP] \fIkeyseq\fP:\fIfunction\-name\fP +.TP +\fBbind\fP \fIreadline\-command\fP +.PD +Display current +.B readline +key and function bindings, bind a key sequence to a +.B readline +function or macro, or set a +.B readline +variable. +Each non-option argument is a command as it would appear in +.IR .inputrc , +but each binding or command must be passed as a separate argument; +e.g., '"\eC\-x\eC\-r": re\-read\-init\-file'. +Options, if supplied, have the following meanings: +.RS +.PD 0 +.TP +.B \-m \fIkeymap\fP +Use +.I keymap +as the keymap to be affected by the subsequent bindings. +Acceptable +.I keymap +names are +\fIemacs, emacs\-standard, emacs\-meta, emacs\-ctlx, vi, +vi\-move, vi\-command\fP, and +.IR vi\-insert . +\fIvi\fP is equivalent to \fIvi\-command\fP; \fIemacs\fP is +equivalent to \fIemacs\-standard\fP. +.TP +.B \-l +List the names of all \fBreadline\fP functions. +.TP +.B \-p +Display \fBreadline\fP function names and bindings in such a way +that they can be re-read. +.TP +.B \-P +List current \fBreadline\fP function names and bindings. +.TP +.B \-v +Display \fBreadline\fP variable names and values in such a way that they +can be re-read. +.TP +.B \-V +List current \fBreadline\fP variable names and values. +.TP +.B \-s +Display \fBreadline\fP key sequences bound to macros and the strings +they output in such a way that they can be re-read. +.TP +.B \-S +Display \fBreadline\fP key sequences bound to macros and the strings +they output. +.TP +.B \-f \fIfilename\fP +Read key bindings from \fIfilename\fP. +.TP +.B \-q \fIfunction\fP +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. +.TP +.B \-x \fIkeyseq\fP:\fIshell\-command\fP +Cause \fIshell\-command\fP to be executed whenever \fIkeyseq\fP is +entered. +.PD +.PP +The return value is 0 unless an unrecognized option is given or an +error occurred. +.RE +.TP +\fBbreak\fP [\fIn\fP] +Exit from within a +.BR for , +.BR while , +.BR until , +or +.B select +loop. If \fIn\fP is specified, break \fIn\fP levels. +.I n +must be \(>= 1. If +.I n +is greater than the number of enclosing loops, all enclosing loops +are exited. The return value is 0 unless the shell is not executing +a loop when +.B break +is executed. +.TP +\fBbuiltin\fP \fIshell\-builtin\fP [\fIarguments\fP] +Execute the specified shell builtin, passing it +.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. +.TP +\fBcd\fP [\fB\-L|-P\fP] [\fIdir\fP] +Change the current directory to \fIdir\fP. The variable +.SM +.B HOME +is the +default +.IR dir . +The variable +.SM +.B CDPATH +defines the search path for the directory containing +.IR dir . +Alternative directory names in +.SM +.B CDPATH +are separated by a colon (:). A null directory name in +.SM +.B CDPATH +is the same as the current directory, i.e., ``\fB.\fP''. If +.I dir +begins with a slash (/), +then +.SM +.B CDPATH +is not used. The +.B \-P +option says to use the physical directory structure instead of +following symbolic links (see also the +.B \-P +option to the +.B set +builtin command); the +.B \-L +option forces symbolic links to be followed. An argument of +.B \- +is equivalent to +.SM +.BR $OLDPWD . +The return value is true if the directory was successfully changed; +false otherwise. +.TP +\fBcaller\fP [\fIexpr\fP] +Returns the context of any active subroutine call (a shell function or +a script executed with the \fB.\fP or \fBsource\fP builtins. +Without \fIexpr\fP, \fBcaller\fP displays the line number and source +filename of the current subroutine call. +If a non-negative integer is supplied as \fIexpr\fP, \fBcaller\fP +displays the line number, subroutine name, and source file corresponding +to that position in the current execution call stack. This extra +information may be used, for example, to print a stack trace. The +current frame is frame 0. +The return value is 0 unless the shell is not executing a subroutine +call or \fIexpr\fP does not correspond to a valid position in the +call stack. +.TP +\fBcommand\fP [\fB\-pVv\fP] \fIcommand\fP [\fIarg\fP ...] +Run +.I command +with +.I args +suppressing the normal shell function lookup. Only builtin +commands or commands found in the +.SM +.B PATH +are executed. If the +.B \-p +option is given, the search for +.I command +is performed using a default value for +.B PATH +that is guaranteed to find all of the standard utilities. +If either the +.B \-V +or +.B \-v +option is supplied, a description of +.I command +is printed. The +.B \-v +option causes a single word indicating the command or file name +used to invoke +.I command +to be displayed; the +.B \-V +option produces a more verbose description. +If the +.B \-V +or +.B \-v +option is supplied, the exit status is 0 if +.I command +was found, and 1 if not. If neither option is supplied and +an error occurred or +.I command +cannot be found, the exit status is 127. Otherwise, the exit status of the +.B command +builtin is the exit status of +.IR command . +.TP +\fBcompgen\fP [\fIoption\fP] [\fIword\fP] +Generate possible completion matches for \fIword\fP according to +the \fIoption\fPs, which may be any option accepted by the +.B complete +builtin with the exception of \fB\-p\fP and \fB\-r\fP, and write +the matches to the standard output. +When using the \fB\-F\fP or \fB\-C\fP options, the various shell variables +set by the programmable completion facilities, while available, will not +have useful values. +.sp 1 +The matches will be generated in the same way as if the programmable +completion code had generated them directly from a completion specification +with the same flags. +If \fIword\fP is specified, only those completions matching \fIword\fP +will be displayed. +.sp 1 +The return value is true unless an invalid option is supplied, or no +matches were generated. +.TP +\fBcomplete\fP [\fB\-abcdefgjksuv\fP] [\fB\-o\fP \fIcomp-option\fP] [\fB\-A\fP \fIaction\fP] [\fB\-G\fP \fIglobpat\fP] [\fB\-W\fP \fIwordlist\fP] [\fB\-P\fP \fIprefix\fP] [\fB\-S\fP \fIsuffix\fP] +.br +[\fB\-X\fP \fIfilterpat\fP] [\fB\-F\fP \fIfunction\fP] [\fB\-C\fP \fIcommand\fP] \fIname\fP [\fIname ...\fP] +.PD 0 +.TP +\fBcomplete\fP \fB\-pr\fP [\fIname\fP ...] +.PD +Specify how arguments to each \fIname\fP should be completed. +If the \fB\-p\fP option is supplied, or if no options are supplied, +existing completion specifications are printed in a way that allows +them to be reused as input. +The \fB\-r\fP option removes a completion specification for +each \fIname\fP, or, if no \fIname\fPs are supplied, all +completion specifications. +.sp 1 +The process of applying these completion specifications when word completion +is attempted is described above under \fBProgrammable Completion\fP. +.sp 1 +Other options, if specified, have the following meanings. +The arguments to the \fB\-G\fP, \fB\-W\fP, and \fB\-X\fP options +(and, if necessary, the \fB\-P\fP and \fB\-S\fP options) +should be quoted to protect them from expansion before the +.B complete +builtin is invoked. +.RS +.PD 0 +.TP 8 +\fB\-o\fP \fIcomp-option\fP +The \fIcomp-option\fP controls several aspects of the compspec's behavior +beyond the simple generation of completions. +\fIcomp-option\fP may be one of: +.RS +.TP 8 +.B default +Use readline's default filename completion if the compspec generates +no matches. +.TP 8 +.B dirnames +Perform directory name completion if the compspec generates no matches. +.TP 8 +.B filenames +Tell readline that the compspec generates filenames, so it can perform any +filename\-specific processing (like adding a slash to directory names or +suppressing trailing spaces). Intended to be used with shell functions. +.TP 8 +.B nospace +Tell readline not to append a space (the default) to words completed at +the end of the line. +.RE +.TP 8 +\fB\-A\fP \fIaction\fP +The \fIaction\fP may be one of the following to generate a list of possible +completions: +.RS +.TP 8 +.B alias +Alias names. May also be specified as \fB\-a\fP. +.TP 8 +.B arrayvar +Array variable names. +.TP 8 +.B binding +\fBReadline\fP key binding names. +.TP 8 +.B builtin +Names of shell builtin commands. May also be specified as \fB\-b\fP. +.TP 8 +.B command +Command names. May also be specified as \fB\-c\fP. +.TP 8 +.B directory +Directory names. May also be specified as \fB\-d\fP. +.TP 8 +.B disabled +Names of disabled shell builtins. +.TP 8 +.B enabled +Names of enabled shell builtins. +.TP 8 +.B export +Names of exported shell variables. May also be specified as \fB\-e\fP. +.TP 8 +.B file +File names. May also be specified as \fB\-f\fP. +.TP 8 +.B function +Names of shell functions. +.TP 8 +.B group +Group names. May also be specified as \fB\-g\fP. +.TP 8 +.B helptopic +Help topics as accepted by the \fBhelp\fP builtin. +.TP 8 +.B hostname +Hostnames, as taken from the file specified by the +.SM +.B HOSTFILE +shell variable. +.TP 8 +.B job +Job names, if job control is active. May also be specified as \fB\-j\fP. +.TP 8 +.B keyword +Shell reserved words. May also be specified as \fB\-k\fP. +.TP 8 +.B running +Names of running jobs, if job control is active. +.TP 8 +.B service +Service names. May also be specified as \fB\-s\fP. +.TP 8 +.B setopt +Valid arguments for the \fB\-o\fP option to the \fBset\fP builtin. +.TP 8 +.B shopt +Shell option names as accepted by the \fBshopt\fP builtin. +.TP 8 +.B signal +Signal names. +.TP 8 +.B stopped +Names of stopped jobs, if job control is active. +.TP 8 +.B user +User names. May also be specified as \fB\-u\fP. +.TP 8 +.B variable +Names of all shell variables. May also be specified as \fB\-v\fP. +.RE +.TP 8 +\fB\-G\fP \fIglobpat\fP +The filename expansion pattern \fIglobpat\fP is expanded to generate +the possible completions. +.TP 8 +\fB\-W\fP \fIwordlist\fP +The \fIwordlist\fP is split using the characters in the +.SM +.B IFS +special variable as delimiters, and each resultant word is expanded. +The possible completions are the members of the resultant list which +match the word being completed. +.TP 8 +\fB\-C\fP \fIcommand\fP +\fIcommand\fP is executed in a subshell environment, and its output is +used as the possible completions. +.TP 8 +\fB\-F\fP \fIfunction\fP +The shell function \fIfunction\fP is executed in the current shell +environment. +When it finishes, the possible completions are retrieved from the value +of the +.SM +.B COMPREPLY +array variable. +.TP 8 +\fB\-X\fP \fIfilterpat\fP +\fIfilterpat\fP is a pattern as used for filename expansion. +It is applied to the list of possible completions generated by the +preceding options and arguments, and each completion matching +\fIfilterpat\fP is removed from the list. +A leading \fB!\fP in \fIfilterpat\fP negates the pattern; in this +case, any completion not matching \fIfilterpat\fP is removed. +.TP 8 +\fB\-P\fP \fIprefix\fP +\fIprefix\fP is added at the beginning of each possible completion +after all other options have been applied. +.TP 8 +\fB\-S\fP \fIsuffix\fP +\fIsuffix\fP is appended to each possible completion +after all other options have been applied. +.PD +.PP +The return value is true unless an invalid option is supplied, an option +other than \fB\-p\fP or \fB\-r\fP is supplied without a \fIname\fP +argument, an attempt is made to remove a completion specification for +a \fIname\fP for which no specification exists, or +an error occurs adding a completion specification. +.RE +.TP +\fBcontinue\fP [\fIn\fP] +Resume the next iteration of the enclosing +.BR for , +.BR while , +.BR until , +or +.B select +loop. +If +.I n +is specified, resume at the \fIn\fPth enclosing loop. +.I n +must be \(>= 1. If +.I n +is greater than the number of enclosing loops, the last enclosing loop +(the ``top-level'' loop) is resumed. The return value is 0 unless the +shell is not executing a loop when +.B continue +is executed. +.TP +\fBdeclare\fP [\fB\-afFirtx\fP] [\fB\-p\fP] [\fIname\fP[=\fIvalue\fP] ...] +.PD 0 +.TP +\fBtypeset\fP [\fB\-afFirtx\fP] [\fB\-p\fP] [\fIname\fP[=\fIvalue\fP] ...] +.PD +Declare variables and/or give them attributes. +If no \fIname\fPs are given then display the values of variables. +The +.B \-p +option will display the attributes and values of each +.IR name . +When +.B \-p +is used, additional options are ignored. +The +.B \-F +option inhibits the display of function definitions; only the +function name and attributes are printed. +If the \fBextdebug\fP shell option is enabled using \fBshopt\fP, +the source file name and line number where the function is defined +are displayed as well. The +.B \-F +option implies +.BR \-f . +The following options can +be used to restrict output to variables with the specified attribute or +to give variables attributes: +.RS +.PD 0 +.TP +.B \-a +Each \fIname\fP is an array variable (see +.B Arrays +above). +.TP +.B \-f +Use function names only. +.TP +.B \-i +The variable is treated as an integer; arithmetic evaluation (see +.SM +.B "ARITHMETIC EVALUATION" ") " +is performed when the variable is assigned a value. +.TP +.B \-r +Make \fIname\fPs readonly. These names cannot then be assigned values +by subsequent assignment statements or unset. +.TP +.B \-t +Give each \fIname\fP the \fItrace\fP attribute. +Traced functions inherit the \fBDEBUG\fP trap from the calling shell. +The trace attribute has no special meaning for variables. +.TP +.B \-x +Mark \fIname\fPs for export to subsequent commands via the environment. +.PD +.PP +Using `+' instead of `\-' +turns off the attribute instead, with the exception that \fB+a\fP +may not be used to destroy an array variable. When used in a function, +makes each +\fIname\fP local, as with the +.B local +command. +If a variable name is followed by =\fIvalue\fP, the value of +the variable is set to \fIvalue\fP. +The return value is 0 unless an invalid option is encountered, +an attempt is made to define a function using +.if n ``\-f foo=bar'', +.if t \f(CW\-f foo=bar\fP, +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 (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, +or an attempt is made to display a non-existent function with \fB\-f\fP. +.RE +.TP +.B dirs [\fB\-clpv\fP] [+\fIn\fP] [\-\fIn\fP] +Without options, displays the list of currently remembered directories. +The default display is on a single line with directory names separated +by spaces. +Directories are added to the list with the +.B pushd +command; the +.B popd +command removes entries from the list. +.RS +.PD 0 +.TP +\fB+\fP\fIn\fP +Displays the \fIn\fPth entry counting from the left of the list +shown by +.B dirs +when invoked without options, starting with zero. +.TP +\fB\-\fP\fIn\fP +Displays the \fIn\fPth entry counting from the right of the list +shown by +.B dirs +when invoked without options, starting with zero. +.TP +.B \-c +Clears the directory stack by deleting all of the entries. +.TP +.B \-l +Produces a longer listing; the default listing format uses a +tilde to denote the home directory. +.TP +.B \-p +Print the directory stack with one entry per line. +.TP +.B \-v +Print the directory stack with one entry per line, +prefixing each entry with its index in the stack. +.PD +.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 +is not sent to the job if the shell receives a +.SM +.BR SIGHUP . +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. +.TP +\fBecho\fP [\fB\-neE\fP] [\fIarg\fP ...] +Output the \fIarg\fPs, separated by spaces, followed by a newline. +The return status is always 0. +If \fB\-n\fP is specified, the trailing newline is +suppressed. If the \fB\-e\fP option is given, interpretation of +the following backslash-escaped characters is enabled. The +.B \-E +option disables the interpretation of these escape characters, +even on systems where they are interpreted by default. +The \fBxpg_echo\fP shell option may be used to +dynamically determine whether or not \fBecho\fP expands these +escape characters by default. +.B echo +does not interpret +.B \-\- +to mean the end of options. +.B echo +interprets the following escape sequences: +.RS +.PD 0 +.TP +.B \ea +alert (bell) +.TP +.B \eb +backspace +.TP +.B \ec +suppress trailing newline +.TP +.B \ee +an escape character +.TP +.B \ef +form feed +.TP +.B \en +new line +.TP +.B \er +carriage return +.TP +.B \et +horizontal tab +.TP +.B \ev +vertical tab +.TP +.B \e\e +backslash +.TP +.B \e0\fInnn\fP +the eight-bit character whose value is the octal value \fInnn\fP +(zero to three octal digits) +.TP +.B \e\fInnn\fP +the eight-bit character whose value is the octal value \fInnn\fP +(one to three octal digits) +.TP +.B \ex\fIHH\fP +the eight-bit character whose value is the hexadecimal value \fIHH\fP +(one or two hex 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 without 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, +\fInames\fP are enabled. For example, to use the +.B test +binary found via the +.SM +.B PATH +instead of the shell builtin version, run +.if t \f(CWenable -n test\fP. +.if n ``enable -n test''. +The +.B \-f +option means to load the new builtin command +.I name +from shared object +.IR filename , +on systems that support dynamic loading. The +.B \-d +option will delete a builtin previously loaded with +.BR \-f . +If no \fIname\fP arguments are given, or if the +.B \-p +option is supplied, a list of shell builtins is printed. +With no other option arguments, the list consists of all enabled +shell builtins. +If \fB\-n\fP is supplied, only disabled builtins are printed. +If \fB\-a\fP is supplied, the list printed includes all builtins, with an +indication of whether or not each is enabled. +If \fB\-s\fP is supplied, the output is restricted to the POSIX +\fIspecial\fP builtins. +The return value is 0 unless a +.I name +is not a shell builtin or there is an error loading a new builtin +from a shared object. +.TP +\fBeval\fP [\fIarg\fP ...] +The \fIarg\fPs are read and concatenated together into a single +command. This command is then read and executed by the shell, and +its exit status is returned as the value of +.BR eval . +If there are no +.IR args , +or only null arguments, +.B eval +returns 0. +.TP +\fBexec\fP [\fB\-cl\fP] [\fB\-a\fP \fIname\fP] [\fIcommand\fP [\fIarguments\fP]] +If +.I command +is specified, it replaces the shell. +No new process is created. The +.I arguments +become the arguments to \fIcommand\fP. +If the +.B \-l +option is supplied, +the shell places a dash at the beginning of the zeroth arg passed to +.IR command . +This is what +.IR login (1) +does. The +.B \-c +option causes +.I command +to be executed with an empty environment. If +.B \-a +is supplied, the shell passes +.I name +as the zeroth argument to the executed command. If +.I command +cannot be executed for some reason, a non-interactive shell exits, +unless the shell option +.B execfail +is enabled, in which case it returns failure. +An interactive shell returns failure if the file cannot be executed. +If +.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] +Cause the shell to exit +with a status of \fIn\fP. If +.I n +is omitted, the exit status +is that of the last command executed. +A trap on +.SM +.B EXIT +is executed before the shell terminates. +.TP +\fBexport\fP [\fB\-fn\fP\^] [\fIname\fP[=\fIword\fP]] ... +.PD 0 +.TP +.B export \-p +.PD +The supplied +.I names +are marked for automatic export to the environment of +subsequently executed commands. If the +.B \-f +option is given, +the +.I names +refer to functions. +If no +.I names +are given, or if the +.B \-p +option is supplied, a list +of all names that are exported in this shell is printed. +The +.B \-n +option causes the export property to be removed from the +named variables. +If a variable name is followed by =\fIword\fP, the value of +the variable is set to \fIword\fP. +.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 +.I name +that is not a function. +.TP +\fBfc\fP [\fB\-e\fP \fIename\fP] [\fB\-nlr\fP] [\fIfirst\fP] [\fIlast\fP] +.PD 0 +.TP +\fBfc\fP \fB\-s\fP [\fIpat\fP=\fIrep\fP] [\fIcmd\fP] +.PD +Fix Command. In the first form, a range of commands from +.I first +to +.I last +is selected from the history list. +.I First +and +.I last +may be specified as a string (to locate the last 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 +.I last +is not specified it is set to +the current command for listing (so that +.if n ``fc \-l \-10'' +.if t \f(CWfc \-l \-10\fP +prints the last 10 commands) and to +.I first +otherwise. +If +.I first +is not specified it is set to the previous +command for editing and \-16 for listing. +.sp 1 +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 +.I ename +is invoked +on a file containing those commands. If +.I ename +is not given, the +value of the +.SM +.B FCEDIT +variable is used, and +the value of +.SM +.B EDITOR +if +.SM +.B FCEDIT +is not set. If neither variable is set, +.FN vi +is used. When editing is complete, the edited commands are +echoed and executed. +.sp 1 +In the second form, \fIcommand\fP is re-executed after each instance +of \fIpat\fP is replaced by \fIrep\fP. +A useful alias to use with this is +.if n ``r="fc -s"'', +.if t \f(CWr='fc \-s'\fP, +so that typing +.if n ``r cc'' +.if t \f(CWr cc\fP +runs the last command beginning with +.if n ``cc'' +.if t \f(CWcc\fP +and typing +.if n ``r'' +.if t \f(CWr\fP +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 +or +.I last +specify history lines out of range. +If the +.B \-e +option is supplied, the return value is the value of the last +command executed or failure if an error occurs with the temporary +file of commands. If the second form is used, the return status +is that of the command re-executed, unless +.I cmd +does not specify a valid history line, in which case +.B fc +returns failure. +.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. +The return value is that of the command placed into the foreground, +or failure if run when job control is disabled or, when run with +job control enabled, if +.I jobspec +does not specify a valid job or +.I jobspec +specifies a job that was started without job control. +.TP +\fBgetopts\fP \fIoptstring\fP \fIname\fP [\fIargs\fP] +.B getopts +is used by shell procedures to parse positional parameters. +.I optstring +contains the option characters to be recognized; if a character +is followed by a colon, the option is expected to have an +argument, which should be separated from it by white space. +The colon and question mark characters may not be used as +option characters. +Each time it is invoked, +.B getopts +places the next option in the shell variable +.IR name , +initializing +.I name +if it does not exist, +and the index of the next argument to be processed into the +variable +.SM +.BR OPTIND . +.SM +.B OPTIND +is initialized to 1 each time the shell or a shell script +is invoked. When an option requires an argument, +.B getopts +places that argument into the variable +.SM +.BR OPTARG . +The shell does not reset +.SM +.B OPTIND +automatically; it must be manually reset between multiple +calls to +.B getopts +within the same shell invocation if a new set of parameters +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 +.I optstring +is a colon, +.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 +.I name +and, if not silent, +prints an error message and unsets +.SM +.BR OPTARG . +If +.B getopts +is silent, +the option character found is placed in +.SM +.B OPTARG +and no diagnostic message is printed. +.sp 1 +If a required argument is not found, and +.B getopts +is not silent, +a question mark (\^\fB?\fP\^) is placed in +.IR name , +.SM +.B OPTARG +is unset, and a diagnostic message is printed. +If +.B getopts +is silent, then a colon (\^\fB:\fP\^) is placed in +.I name +and +.SM +.B OPTARG +is set to the option character found. +.sp 1 +.B getopts +returns true if an option, specified or unspecified, is found. +It returns false if the end of options is encountered or an +error occurs. +.TP +\fBhash\fP [\fB\-lr\fP] [\fB\-p\fP \fIfilename\fP] [\fB\-dt\fP] [\fIname\fP] +For each +.IR name , +the full file name of the command is determined by searching +the directories in +.B $PATH +and remembered. +If the +.B \-p +option is supplied, no path search is performed, and +.I filename +is used as the full file name of the command. +The +.B \-r +option causes the shell to forget all +remembered locations. +The +.B \-d +option causes the shell to forget the remembered location of each \fIname\fP. +If the +.B \-t +option is supplied, the full pathname to which each \fIname\fP corresponds +is printed. If multiple \fIname\fP arguments are supplied with \fB\-t\fP, +the \fIname\fP is printed before the hashed full pathname. +The +.B \-l +option causes output to be displayed in a format that may be reused as input. +If no arguments are given, or if only \fB\-l\fP is supplied, +information about remembered commands is printed. +The return status is true unless a +.I name +is not found or an invalid option is supplied. +.TP +\fBhelp\fP [\fB\-s\fP] [\fIpattern\fP] +Display helpful information about builtin commands. If +.I pattern +is specified, +.B help +gives detailed help on all commands matching +.IR pattern ; +otherwise help for all the builtins and shell control structures +is printed. +The \fB\-s\fP option restricts the information displayed to a short +usage synopsis. +The return status is 0 unless no command matches +.IR pattern . +.TP +\fBhistory [\fIn\fP] +.PD 0 +.TP +\fBhistory\fP \fB\-c\fP +.TP +\fBhistory \-d\fP \fIoffset\fP +.TP +\fBhistory\fP \fB\-anrw\fP [\fIfilename\fP] +.TP +\fBhistory\fP \fB\-p\fP \fIarg\fP [\fIarg ...\fP] +.TP +\fBhistory\fP \fB\-s\fP \fIarg\fP [\fIarg ...\fP] +.PD +With no options, display the command +history list with line numbers. Lines listed +with a +.B * +have been modified. An argument of +.I n +lists only the last +.I n +lines. If \fIfilename\fP is supplied, it is used as the +name of the history file; if not, the value of +.SM +.B HISTFILE +is used. Options, if supplied, have the following meanings: +.RS +.PD 0 +.TP +.B \-c +Clear the history list by deleting all the entries. +.TP +\fB\-d\fP \fIoffset\fP +Delete the history entry at position \fIoffset\fP. +.TP +.B \-a +Append the ``new'' history lines (history lines entered since the +beginning of the current \fBbash\fP session) to the history file. +.TP +.B \-n +Read the history lines not already read from the history +file into the current history list. These are lines +appended to the history file since the beginning of the +current \fBbash\fP session. +.TP +.B \-r +Read the contents of the history file +and use them as the current history. +.TP +.B \-w +Write the current history to the history file, overwriting the +history file's contents. +.TP +.B \-p +Perform history substitution on the following \fIargs\fP and display +the result on the standard output. +Does not store the results in the history list. +Each \fIarg\fP must be quoted to disable normal history expansion. +.TP +.B \-s +Store the +.I args +in the history list as a single entry. The last command in the +history list is removed before the +.I args +are added. +.PD +.PP +The return value is 0 unless an invalid option is encountered, an +error occurs while reading or writing the history file, an invalid +\fIoffset\fP is supplied as an argument to \fB\-d\fP, or the +history expansion supplied as an argument to \fB\-p\fP fails. +.RE +.TP +\fBjobs\fP [\fB\-lnprs\fP] [ \fIjobspec\fP ... ] +.PD 0 +.TP +\fBjobs\fP \fB\-x\fP \fIcommand\fP [ \fIargs\fP ... ] +.PD +The first form lists the active jobs. The options have the following +meanings: +.RS +.PD 0 +.TP +.B \-l +List process IDs +in addition to the normal information. +.TP +.B \-p +List only the process ID of the job's process group +leader. +.TP +.B \-n +Display information only about jobs that have changed status since +the user was last notified of their status. +.TP +.B \-r +Restrict output to running jobs. +.TP +.B \-s +Restrict output to stopped jobs. +.PD +.PP +If +.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. +.PP +If the +.B \-x +option is supplied, +.B jobs +replaces any +.I jobspec +found in +.I command +or +.I args +with the corresponding process group ID, and executes +.I command +passing it +.IR args , +returning its exit status. +.RE +.TP +\fBkill\fP [\fB\-s\fP \fIsigspec\fP | \fB\-n\fP \fIsignum\fP | \fB\-\fP\fIsigspec\fP] [\fIpid\fP | \fIjobspec\fP] ... +.PD 0 +.TP +\fBkill\fP \fB\-l\fP [\fIsigspec\fP | \fIexit_status\fP] +.PD +Send the signal named by +.I sigspec +or +.I signum +to the processes named by +.I pid +or +.IR jobspec . +.I sigspec +is either a signal name such as +.SM +.B SIGKILL +or a signal number; +.I signum +is a signal number. If +.I sigspec +is a signal name, the name may be +given with or without the +.SM +.B SIG +prefix. +If +.I sigspec +is not present, then +.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 ...] +Each +.I arg +is an arithmetic expression to be evaluated (see +.SM +.BR "ARITHMETIC EVALUATION" ). +If the last +.I arg +evaluates to 0, +.B let +returns 1; 0 is returned otherwise. +.TP +\fBlocal\fP [\fIoption\fP] [\fIname\fP[=\fIvalue\fP] ...] +For each argument, a local variable named +.I name +is created, and assigned +.IR value . +The \fIoption\fP can be any of the options accepted by \fBdeclare\fP. +When +.B local +is used within a function, it causes the variable +.I name +to have a visible scope restricted to that function and its children. +With no operands, +.B local +writes a list of local variables to the standard output. It is +an error to use +.B local +when not within a function. The return status is 0 unless +.B local +is used outside a function, an invalid +.I name +is supplied, or +\fIname\fP is a readonly variable. +.TP +.B logout +Exit a login shell. +.TP +\fBpopd\fP [\-\fBn\fP] [+\fIn\fP] [\-\fIn\fP] +Removes entries from the directory stack. With no arguments, +removes the top directory from the stack, and performs a +.B cd +to the new top directory. +Arguments, if supplied, have the following meanings: +.RS +.PD 0 +.TP +\fB+\fP\fIn\fP +Removes the \fIn\fPth entry counting from the left of the list +shown by +.BR dirs , +starting with zero. For example: +.if n ``popd +0'' +.if t \f(CWpopd +0\fP +removes the first directory, +.if n ``popd +1'' +.if t \f(CWpopd +1\fP +the second. +.TP +\fB\-\fP\fIn\fP +Removes the \fIn\fPth entry counting from the right of the list +shown by +.BR dirs , +starting with zero. For example: +.if n ``popd -0'' +.if t \f(CWpopd -0\fP +removes the last directory, +.if n ``popd -1'' +.if t \f(CWpopd -1\fP +the next to last. +.TP +.B \-n +Suppresses the normal change of directory when removing directories +from the stack, so that only the stack is manipulated. +.PD +.PP +If the +.B popd +command is successful, a +.B dirs +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, \fB%b\fP causes +\fBprintf\fP to expand backslash escape sequences in the corresponding +\fIargument\fP, and \fB%q\fP 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. The return value is zero on success, +non-zero on failure. +.TP +\fBpushd\fP [\fB\-n\fP] [\fIdir\fP] +.PD 0 +.TP +\fBpushd\fP [\fB\-n\fP] [+\fIn\fP] [\-\fIn\fP] +.PD +Adds a directory to the top of the directory stack, or rotates +the stack, making the new top of the stack the current working +directory. With no arguments, exchanges the top two directories +and returns 0, unless the directory stack is empty. +Arguments, if supplied, have the following meanings: +.RS +.PD 0 +.TP +\fB+\fP\fIn\fP +Rotates the stack so that the \fIn\fPth directory +(counting from the left of the list shown by +.BR dirs , +starting with zero) +is at the top. +.TP +\fB\-\fP\fIn\fP +Rotates the stack so that the \fIn\fPth directory +(counting from the right of the list shown by +.BR dirs , +starting with zero) is at the top. +.TP +.B \-n +Suppresses the normal change of directory when adding directories +to the stack, so that only the stack is manipulated. +.TP +.I dir +Adds +.I dir +to the directory stack at the top, making it the +new current working directory. +.PD +.PP +If the +.B pushd +command is successful, a +.B dirs +is performed as well. +If the first form is used, +.B pushd +returns 0 unless the cd to +.I dir +fails. With the second form, +.B pushd +returns 0 unless the directory stack is empty, +a non-existent directory stack element is specified, +or the directory change to the specified new current directory +fails. +.RE +.TP +\fBpwd\fP [\fB\-LP\fP] +Print the absolute pathname of the current working directory. +The pathname printed contains no symbolic links if the +.B \-P +option is supplied or the +.B \-o physical +option to the +.B set +builtin command is enabled. +If the +.B \-L +option is used, the pathname printed may contain symbolic links. +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\-ers\fP] [\fB\-u\fP \fIfd\fP] [\fB\-t\fP \fItimeout\fP] [\fB\-a\fP \fIaname\fP] [\fB\-p\fP \fIprompt\fP] [\fB\-n\fP \fInchars\fP] [\fB\-d\fP \fIdelim\fP] [\fIname\fP ...] +One line is read from the standard input, or from the file descriptor +\fIfd\fP supplied as an argument to the \fB\-u\fP option, and the first word +is assigned to the first +.IR name , +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 input stream than names, +the remaining names are assigned empty values. +The characters in +.SM +.B IFS +are used to split the line into words. +The backslash character (\fB\e\fP) may be used to remove any special +meaning for the next character read and for line continuation. +Options, if supplied, have the following meanings: +.RS +.PD 0 +.TP +.B \-a \fIaname\fP +The words are assigned to sequential indices +of the array variable +.IR aname , +starting at 0. +.I aname +is unset before any new values are assigned. +Other \fIname\fP arguments are ignored. +.TP +.B \-d \fIdelim\fP +The first character of \fIdelim\fP is used to terminate the input line, +rather than newline. +.TP +.B \-e +If the standard input +is coming from a terminal, +.B readline +(see +.SM +.B READLINE +above) is used to obtain the line. +.TP +.B \-n \fInchars\fP +\fBread\fP returns after reading \fInchars\fP characters rather than +waiting for a complete line of input. +.TP +.B \-p \fIprompt\fP +Display \fIprompt\fP on standard error, without a +trailing newline, before attempting to read any input. The prompt +is displayed only if input is coming from a terminal. +.TP +.B \-r +Backslash does not act as an escape character. +The backslash is considered to be part of the line. +In particular, a backslash-newline pair may not be used as a line +continuation. +.TP +.B \-s +Silent mode. If input is coming from a terminal, characters are +not echoed. +.TP +.B \-t \fItimeout\fP +Cause \fBread\fP to time out and return failure if a complete line of +input is not read within \fItimeout\fP seconds. +This option has no effect if \fBread\fP is not reading input from the +terminal or a pipe. +.TP +.B \-u \fIfd\FP +Read input from file descriptor \fIfd\fP. +.PD +.PP +If no +.I names +are supplied, the line read is assigned to the variable +.SM +.BR REPLY . +The return code is zero, unless end-of-file is encountered, \fBread\fP +times out, or an invalid file descriptor is supplied as the argument to +\fB\-u\fP. +.RE +.TP +\fBreadonly\fP [\fB\-apf\fP] [\fIname\fP[=\fIword\fP] ...] +.PD +The given +\fInames\fP are marked readonly; the values of these +.I names +may not be changed by subsequent assignment. +If the +.B \-f +option is supplied, the functions corresponding to the +\fInames\fP are so +marked. +The +.B \-a +option restricts the variables to arrays. +If no +.I name +arguments are given, or if the +.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 that +may be reused as input. +If a variable name is followed by =\fIword\fP, the value of +the variable is set to \fIword\fP. +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 +.I name +that is not a function. +.TP +\fBreturn\fP [\fIn\fP] +Causes a function to exit with the return value specified by +.IR n . +If +.I n +is omitted, the return status is that of the last command +executed in the function body. If used outside a function, +but during execution of a script by the +.B . +(\fBsource\fP) command, it causes the shell to stop executing +that script and return either +.I n +or the exit status of the last command executed within the +script as the exit status of the script. If used outside a +function and not during execution of a script by \fB.\fP\^, +the return status is false. +Any command associated with the \fBRETURN\fP trap is executed +before execution resumes after the function or script. +.TP +\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 +as values for the positional parameters and are assigned, in order, to +.BR $1 , +.BR $2 , +.B ... +.BR $\fIn\fP . +Options, if specified, have the following meanings: +.RS +.PD 0 +.TP 8 +.B \-a +Automatically mark variables and functions which are modified or created +for export to the environment of subsequent commands. +.TP 8 +.B \-b +Report the status of terminated background jobs +immediately, rather than before the next primary prompt. This is +effective only when job control is enabled. +.TP 8 +.B \-e +Exit immediately if a \fIsimple command\fP (see +.SM +.B SHELL GRAMMAR +above) exits with a non-zero status. +The shell does not exit if the +command that fails is part of the command list immediately following a +.B while +or +.B until +keyword, +part of the test in an +.I if +statement, part of a +.B && +or +.B \(bv\(bv +list, or if the command's return value is +being inverted via +.BR ! . +A trap on \fBERR\fP, if set, is executed before the shell exits. +.TP 8 +.B \-f +Disable pathname expansion. +.TP 8 +.B \-h +Remember the location of commands as they are looked up for execution. +This is enabled by default. +.TP 8 +.B \-k +All arguments in the form of assignment statements +are placed in the environment for a command, not just +those that precede the command name. +.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 +.SM +.B JOB CONTROL +above). Background processes run in a separate process +group and a line containing their exit status is printed +upon their completion. +.TP 8 +.B \-n +Read commands but do not execute them. This may be used to +check a shell script for syntax errors. This is ignored by +interactive shells. +.TP 8 +.B \-o \fIoption\-name\fP +The \fIoption\-name\fP can be one of the following: +.RS +.TP 8 +.B allexport +Same as +.BR \-a . +.TP 8 +.B braceexpand +Same as +.BR \-B . +.TP 8 +.B emacs +Use an emacs-style command line editing interface. This is enabled +by default when the shell is interactive, unless the shell is started +with the +.B \-\-noediting +option. +.TP 8 +.B errtrace +Same as +.BR \-E . +.TP 8 +.B functrace +Same as +.BR \-T . +.TP 8 +.B errexit +Same as +.BR \-e . +.TP 8 +.B hashall +Same as +.BR \-h . +.TP 8 +.B histexpand +Same as +.BR \-H . +.TP 8 +.B history +Enable command history, as described above under +.SM +.BR HISTORY . +This option is on by default in interactive shells. +.TP 8 +.B ignoreeof +The effect is as if the shell command +.if t \f(CWIGNOREEOF=10\fP +.if n ``IGNOREEOF=10'' +had been executed +(see +.B Shell Variables +above). +.TP 8 +.B keyword +Same as +.BR \-k . +.TP 8 +.B monitor +Same as +.BR \-m . +.TP 8 +.B noclobber +Same as +.BR \-C . +.TP 8 +.B noexec +Same as +.BR \-n . +.TP 8 +.B noglob +Same as +.BR \-f . +.B nolog +Currently ignored. +.TP 8 +.B notify +Same as +.BR \-b . +.TP 8 +.B nounset +Same as +.BR \-u . +.TP 8 +.B onecmd +Same as +.BR \-t . +.TP 8 +.B physical +Same as +.BR \-P . +.TP 8 +.B posix +Change the behavior of +.B bash +where the default operation differs +from the POSIX 1003.2 standard to match the standard (\fIposix mode\fP). +.TP 8 +.B privileged +Same as +.BR \-p . +.TP 8 +.B verbose +Same as +.BR \-v . +.TP 8 +.B vi +Use a vi-style command line editing interface. +.TP 8 +.B xtrace +Same as +.BR \-x . +.sp .5 +.PP +If +.B \-o +is supplied with no \fIoption\-name\fP, the values of the current options are +printed. +If +.B +o +is supplied with no \fIoption\-name\fP, a series of +.B set +commands to recreate the current option settings is displayed on +the standard output. +.RE +.TP 8 +.B \-p +Turn on +.I privileged +mode. In this mode, the +.SM +.B $ENV +and +.SM +.B $BASH_ENV +files are not processed, shell functions are not inherited from the +environment, and the +.SM +.B SHELLOPTS +variable, if it appears in the environment, is ignored. +If the shell is started with the effective user (group) id not equal to the +real user (group) id, and the \fB\-p\fP option is not supplied, these actions +are taken and the effective user id is set to the real user id. +If the \fB\-p\fP option is supplied at startup, the effective user id is +not reset. +Turning this option off causes the effective user +and group ids to be set to the real user and group ids. +.TP 8 +.B \-t +Exit after reading and executing one command. +.TP 8 +.B \-u +Treat unset variables as an error when performing +parameter expansion. If expansion is attempted on an +unset variable, the shell prints an error message, and, +if not interactive, exits with a non-zero status. +.TP 8 +.B \-v +Print shell input lines as they are read. +.TP 8 +.B \-x +After expanding each \fIsimple command\fP, +\fBfor\fP command, \fBcase\fP command, \fBselect\fP command, or +arithmetic \fBfor\fP command, display the expanded value of +.SM +.BR PS4 , +followed by the command and its expanded arguments +or associated word list. +.TP 8 +.B \-B +The shell performs brace expansion (see +.B Brace Expansion +above). This is on by default. +.TP 8 +.B \-C +If set, +.B bash +does not overwrite an existing file with the +.BR > , +.BR >& , +and +.B <> +redirection operators. This may be overridden when +creating output files by using the redirection operator +.B >| +instead of +.BR > . +.TP 8 +.B \-E +If set, any trap on \fBERR\fP is inherited by shell functions, command +substitutions, and commands executed in a subshell environment. +The \fBERR\fP trap is normally not inherited in such cases. +.TP 8 +.B \-H +Enable +.B ! +style history substitution. This option is on by +default when the shell is interactive. +.TP 8 +.B \-P +If set, the shell does not follow symbolic links when executing +commands such as +.B cd +that change the current working directory. It uses the +physical directory structure instead. By default, +.B bash +follows the logical chain of directories when performing commands +which change the current directory. +.TP 8 +.B \-T +If set, any trap on \fBDEBUG\fP is inherited by shell functions, command +substitutions, and commands executed in a subshell environment. +The \fBDEBUG\fP trap is normally not inherited in such cases. +.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 +.BR \- . +.TP 8 +.B \- +Signal the end of options, cause all remaining \fIarg\fPs to be +assigned to the positional parameters. The +.B \-x +and +.B \-v +options are turned off. +If there are no \fIarg\fPs, +the positional parameters remain unchanged. +.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 +\fBshift\fP [\fIn\fP] +The positional parameters from \fIn\fP+1 ... are renamed to +.B $1 +.B .... +Parameters represented by the numbers \fB$#\fP +down to \fB$#\fP\-\fIn\fP+1 are unset. +.I n +must be a non-negative number less than or equal to \fB$#\fP. +If +.I n +is 0, no parameters are changed. +If +.I n +is not given, it is assumed to be 1. +If +.I n +is greater than \fB$#\fP, the positional parameters are not changed. +The return status is greater than zero if +.I n +is greater than +.B $# +or less than zero; otherwise 0. +.TP +\fBshopt\fP [\fB\-pqsu\fP] [\fB\-o\fP] [\fIoptname\fP ...] +Toggle the values of variables controlling optional shell behavior. +With no options, or with the +.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 +.TP +.B \-s +Enable (set) each \fIoptname\fP. +.TP +.B \-u +Disable (unset) each \fIoptname\fP. +.TP +.B \-q +Suppresses normal output (quiet mode); the return status indicates +whether the \fIoptname\fP is set or unset. +If multiple \fIoptname\fP arguments are given with +.BR \-q , +the return status is zero if all \fIoptnames\fP are enabled; non-zero +otherwise. +.TP +.B \-o +Restricts the values of \fIoptname\fP to be those defined for the +.B \-o +option to the +.B set +builtin. +.PD +.PP +If either +.B \-s +or +.B \-u +is used with no \fIoptname\fP arguments, the display is limited to +those options which are set or unset, respectively. +Unless otherwise noted, the \fBshopt\fP options are disabled (unset) +by default. +.PP +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 +The list of \fBshopt\fP options is: +.if t .sp .5v +.if n .sp 1v +.PD 0 +.TP 8 +.B cdable_vars +If set, an argument to the +.B cd +builtin command that +is not a directory is assumed to be the name of a variable whose +value is the directory to change to. +.TP 8 +.B cdspell +If set, minor errors in the spelling of a directory component in a +.B cd +command will be corrected. +The errors checked for are transposed characters, +a missing character, and one character too many. +If a correction is found, the corrected file name is printed, +and the command proceeds. +This option is only used by interactive shells. +.TP 8 +.B checkhash +If set, \fBbash\fP checks that a command found in the hash +table exists before trying to execute it. If a hashed command no +longer exists, a normal path search is performed. +.TP 8 +.B checkwinsize +If set, \fBbash\fP checks the window size after each command +and, if necessary, updates the values of +.SM +.B LINES +and +.SM +.BR COLUMNS . +.TP 8 +.B cmdhist +If set, +.B bash +attempts to save all lines of a multiple-line +command in the same history entry. This allows +easy re-editing of multi-line commands. +.TP 8 +.B dotglob +If set, +.B bash +includes filenames beginning with a `.' in the results of pathname +expansion. +.TP 8 +.B execfail +If set, a non-interactive shell will not exit if +it cannot execute the file specified as an argument to the +.B exec +builtin command. An interactive shell does not exit if +.B exec +fails. +.TP 8 +.B expand_aliases +If set, aliases are expanded as described above under +.SM +.BR ALIASES . +This option is enabled by default for interactive shells. +.TP 8 +.B extdebug +If set, behavior intended for use by debuggers is enabled: +.RS +.TP +.B 1. +The \fB\-F\fP option to the \fBdeclare\fP builtin displays the source +file name and line number corresponding to each function name supplied +as an argument. +.TP +.B 2. +If the command run by the \fBDEBUG\fP trap returns a non-zero value, the +next command is skipped and not executed. +.TP +.B 3. +If the command run by the \fBDEBUG\fP trap returns a value of 2, and the +shell is executing in a subroutine (a shell function or a shell script +executed by the \fB.\fP or \fBsource\fP builtins), a call to +\fBreturn\fP is simulated. +.RE +.TP 8 +.B extglob +If set, the extended pattern matching features described above under +\fBPathname Expansion\fP are enabled. +.TP 8 +.B extquote +If set, \fB$\fP'\fIstring\fP' and \fB$\fP"\fIstring\fP" quoting is +performed within \fB${\fP\fIparameter\fP\fB}\fP expansions +enclosed in double quotes. This option is enabled by default. +.TP 8 +.B histappend +If set, the history list is appended to the file named by the value +of the +.B HISTFILE +variable when the shell exits, rather than overwriting the file. +.TP 8 +.B histreedit +If set, and +.B readline +is being used, a user is given the opportunity to re-edit a +failed history substitution. +.TP 8 +.B histverify +If set, and +.B readline +is being used, the results of history substitution are not immediately +passed to the shell parser. Instead, the resulting line is loaded into +the \fBreadline\fP editing buffer, allowing further modification. +.TP 8 +.B hostcomplete +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 +.SM +.B READLINE +above). +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 +.B # +to cause that word and all remaining characters on that +line to be ignored in an interactive shell (see +.SM +.B COMMENTS +above). This option is enabled by default. +.TP 8 +.B lithist +If set, and the +.B cmdhist +option is enabled, multi-line commands are saved to the history with +embedded newlines rather than using semicolon separators where possible. +.TP 8 +.B login_shell +The shell sets this option if it is started as a login shell (see +.SM +.B "INVOCATION" +above). +The value may not be changed. +.TP 8 +.B mailwarn +If set, and a file that \fBbash\fP is checking for mail has been +accessed since the last time it was checked, the message ``The mail in +\fImailfile\fP has been read'' is displayed. +.TP 8 +.B no_empty_cmd_completion +If set, and +.B readline +is being used, +.B bash +will not attempt to search the \fBPATH\fP for possible completions when +completion is attempted on an empty line. +.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, +.B bash +allows patterns which match no +files (see +.B Pathname Expansion +above) +to expand to a null string, rather than themselves. +.TP 8 +.B progcomp +If set, the programmable completion facilities (see +\fBProgrammable Completion\fP above) are enabled. +This option is enabled by default. +.TP 8 +.B promptvars +If set, prompt strings undergo variable and parameter expansion after +being expanded as described in +.SM +.B PROMPTING +above. This option is enabled by default. +.TP 8 +.B restricted_shell +The shell sets this option if it is started in restricted mode (see +.SM +.B "RESTRICTED SHELL" +below). +The value may not be changed. +This is not reset when the startup files are executed, allowing +the startup files to discover whether or not a shell is restricted. +.TP 8 +.B shift_verbose +If set, the +.B shift +builtin prints an error message when the shift count exceeds the +number of positional parameters. +.TP 8 +.B sourcepath +If set, the +\fBsource\fP (\fB.\fP) builtin uses the value of +.SM +.B PATH +to find the directory containing the file supplied as an argument. +This option is enabled by default. +.TP 8 +.B xpg_echo +If set, the \fBecho\fP builtin expands backslash-escape sequences +by default. +.RE +.TP +\fBsuspend\fP [\fB\-f\fP] +Suspend the execution of this shell until it receives a +.SM +.B SIGCONT +signal. The +.B \-f +option says not to complain if this is +a login shell; just suspend anyway. The return status is 0 unless +the shell is a login shell and +.B \-f +is not supplied, or if job control is not enabled. +.TP +\fBtest\fP \fIexpr\fP +.PD 0 +.TP +\fB[\fP \fIexpr\fP \fB]\fP +Return a status of 0 or 1 depending on +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 +.I expr +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. +.TP +\fIexpr1\fP \-\fBo\fP \fIexpr2\fP +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 +Print the accumulated user and system times for the shell and +for processes run from the shell. The return status is 0. +.TP +\fBtrap\fP [\fB\-lp\fP] [\fIarg\fP] [\fIsigspec\fP ...] +The command +.I arg +is to be read and executed when the shell receives +signal(s) +.IR sigspec . +If +.I arg +is absent or +.BR \- , +all specified signals are +reset to their original values (the values they had +upon entrance to the shell). +If +.I arg +is the null string the signal specified by each +.I sigspec +is ignored by the shell and by the commands it invokes. +If +.I arg +is not present and +.B \-p +has been supplied, then the trap commands associated with each +.I sigspec +are displayed. +If no arguments are supplied or if only +.B \-p +is given, +.B trap +prints the list of commands associated with each signal number. +The +.B \-l +option causes the shell to print a list of signal names and +their corresponding numbers. +Each +.I sigspec +is either +a signal name defined in <\fIsignal.h\fP>, or a signal number. +If a +.I sigspec +is +.SM +.B EXIT +(0) the command +.I arg +is executed on exit from the shell. +If a +.I sigspec +is +.SM +.BR DEBUG , +the command +.I arg +is executed before every \fIsimple command\fP, \fIfor\fP command, +\fIcase\fP command, \fIselect\fP command, every arithmetic \fIfor\fP +command, and before the first command executes in a shell function (see +.SM +.B SHELL GRAMMAR +above). +Refer to the description of the \fBextglob\fP option to the +\fBshopt\fP builtin for details of its effect on the \fBDEBUG\fP trap. +If a +.I sigspec +is +.SM +.BR ERR , +the command +.I arg +is executed whenever a simple command has a non\-zero exit status. +The +.SM +.B ERR +trap is not executed if the failed +command is part of the command list immediately following a +.B while +or +.B until +keyword, +part of the test in an +.I if +statement, part of a +.B && +or +.B \(bv\(bv +list, or if the command's return value is +being inverted via +.BR ! . +If a +.I sigspec +is +.SM +.BR RETURN , +the command +.I arg +is executed each time a shell function or a script executed with the +\fB.\fP or \fBsource\fP builtins finishes executing. +Signals ignored upon entry to the shell cannot be trapped or reset. +Trapped signals are reset to their original values in a child +process when it is created. +The return status is false if any +.I sigspec +is invalid; otherwise +.B trap +returns true. +.TP +\fBtype\fP [\fB\-aftpP\fP] \fIname\fP [\fIname\fP ...] +With no options, +indicate how each +.I name +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 +.IR alias , +.IR keyword , +.IR function , +.IR builtin , +or +.I file +if +.I name +is an alias, shell reserved word, function, builtin, or disk file, +respectively. +If the +.I name +is not found, then nothing is printed, and an exit status of false +is returned. +If the +.B \-p +option is used, +.B type +either returns the name of the disk file +that would be executed if +.I name +were specified as a command name, +or nothing if +.if t \f(CWtype -t name\fP +.if n ``type -t name'' +would not return +.IR file . +The +.B \-P +option forces a +.SM +.B PATH +search for each \fIname\fP, even if +.if t \f(CWtype -t name\fP +.if n ``type -t name'' +would not return +.IR file . +If a command is hashed, +.B \-p +and +.B \-P +print the hashed value, not necessarily the file that appears +first in +.SM +.BR PATH . +If the +.B \-a +option is used, +.B type +prints all of the places that contain +an executable named +.IR name . +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 . +The +.B \-f +option suppresses shell function lookup, as with the \fBcommand\fP builtin. +.B type +returns true if any of the arguments are found, false if +none are found. +.TP +\fBulimit\fP [\fB\-SHacdflmnpstuv\fP [\fIlimit\fP]] +Provides control over the resources available to the shell and to +processes started by it, on systems that allow such control. +The \fB\-H\fP and \fB\-S\fP options specify that the hard or soft limit is +set for the given resource. A hard limit cannot be increased once it +is set; a soft limit may be increased up to the value of the hard limit. +If neither \fB\-H\fP nor \fB\-S\fP is specified, both the soft and hard +limits are set. +The value of +.I limit +can be a number in the unit specified for the resource +or one of the special values +.BR hard , +.BR soft , +or +.BR unlimited , +which stand for the current hard limit, the current soft limit, and +no limit, respectively. +If +.I limit +is omitted, the current value of the soft limit of the resource is +printed, unless the \fB\-H\fP option is given. When more than one +resource is specified, the limit name and unit are printed before the value. +Other options are interpreted as follows: +.RS +.PD 0 +.TP +.B \-a +All current limits are reported +.TP +.B \-c +The maximum size of core files created +.TP +.B \-d +The maximum size of a process's data segment +.TP +.B \-f +The maximum size of files created by the shell +.TP +.B \-l +The maximum size that may be locked into memory +.TP +.B \-m +The maximum resident set size +.TP +.B \-n +The maximum number of open file descriptors (most systems do not +allow this value to be set) +.TP +.B \-p +The pipe size in 512-byte blocks (this may not be set) +.TP +.B \-s +The maximum stack size +.TP +.B \-t +The maximum amount of cpu time in seconds +.TP +.B \-u +The maximum number of processes available to a single user +.TP +.B \-v +The maximum amount of virtual memory available to the shell +.PD +.PP +If +.I limit +is given, it is the new value of the specified resource (the +.B \-a +option is display only). +If no option is given, then +.B \-f +is assumed. Values are in 1024-byte increments, except for +.BR \-t , +which is in seconds, +.BR \-p , +which is in units of 512-byte blocks, +and +.B \-n +and +.BR \-u , +which are unscaled values. +The return status is 0 unless an invalid option or argument is supplied, +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 . +If +.I mode +begins with a digit, it +is interpreted as an octal number; otherwise +it is interpreted as a symbolic mode mask similar +to that accepted by +.IR chmod (1). +If +.I mode +is omitted, the current value of the mask is printed. +The +.B \-S +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. +.TP +\fBunalias\fP [\-\fBa\fP] [\fIname\fP ...] +Remove each \fIname\fP from the list of defined aliases. If +.B \-a +is supplied, all alias definitions are removed. The return +value is true unless a supplied +.I name +is not a defined alias. +.TP +\fBunset\fP [\-\fBfv\fP] [\fIname\fP ...] +For each +.IR name , +remove the corresponding variable or function. +If no options are supplied, or the +.B \-v +option is given, each +.I name +refers to a shell variable. +Read-only variables may not be unset. +If +.B \-f +is specifed, +each +.I name +refers to a shell function, and the function definition +is removed. +Each unset variable or function is removed from the environment +passed to subsequent commands. +If any of +.SM +.BR RANDOM , +.SM +.BR SECONDS , +.SM +.BR LINENO , +.SM +.BR HISTCMD , +.SM +.BR FUNCNAME , +.SM +.BR GROUPS , +or +.SM +.B DIRSTACK +are unset, they lose their special properties, even if they are +subsequently reset. The exit status is true unless a +.I name +is readonly. +.TP +\fBwait\fP [\fIn\fP] +Wait for the specified process and return its termination +status. +.I n +may be a process +ID or a job specification; if a job spec is given, all processes +in that job's pipeline are waited for. If +.I n +is not given, all currently active child processes +are waited for, and the return status is zero. If +.I n +specifies a non-existent process or job, the return status is +127. Otherwise, the return status is the exit status of the last +process or job waited for. +.\" bash_builtins +.if \n(zZ=1 .ig zZ +.SH "RESTRICTED SHELL" +.\" rbash.1 +.zY +.PP +If +.B bash +is started with the name +.BR rbash , +or the +.B \-r +option is supplied at invocation, +the shell becomes restricted. +A restricted shell is used to +set up an environment more controlled than the standard shell. +It behaves identically to +.B bash +with the exception that the following are disallowed or not performed: +.IP \(bu +changing directories with \fBcd\fP +.IP \(bu +setting or unsetting the values of +.BR SHELL , +.BR PATH , +.BR ENV , +or +.B BASH_ENV +.IP \(bu +specifying command names containing +.B / +.IP \(bu +specifying a file name containing a +.B / +as an argument to the +.B . +builtin command +.IP \(bu +Specifying a filename containing a slash as an argument to the +.B \-p +option to the +.B hash +builtin command +.IP \(bu +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 +using the +.B exec +builtin command to replace the shell with another command +.IP \(bu +adding or deleting builtin commands with the +.B \-f +and +.B \-d +options to the +.B enable +builtin command +.IP \(bu +Using the \fBenable\fP builtin command to enable disabled shell builtins +.IP \(bu +specifying the +.B \-p +option to the +.B command +builtin command +.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. +.PP +When a command that is found to be a shell script is executed (see +.SM +.B "COMMAND EXECUTION" +above), +.B rbash +turns off any restrictions in the shell spawned to execute the +script. +.\" end of rbash.1 +.if \n(zY=1 .ig zY +.SH "SEE ALSO" +.PD 0 +.TP +\fIBash Reference Manual\fP, Brian Fox and Chet Ramey +.TP +\fIThe Gnu Readline Library\fP, Brian Fox and Chet Ramey +.TP +\fIThe Gnu History Library\fP, Brian Fox and Chet Ramey +.TP +\fIPortable Operating System Interface (POSIX) Part 2: Shell and Utilities\fP, IEEE +.TP +\fIsh\fP(1), \fIksh\fP(1), \fIcsh\fP(1) +.TP +\fIemacs\fP(1), \fIvi\fP(1) +.TP +\fIreadline\fP(3) +.PD +.SH FILES +.PD 0 +.TP +.FN /bin/bash +The \fBbash\fP executable +.TP +.FN /etc/profile +The systemwide initialization file, executed for login shells +.TP +.FN ~/.bash_profile +The personal initialization file, executed for login shells +.TP +.FN ~/.bashrc +The individual per-interactive-shell startup file +.TP +.FN ~/.bash_logout +The individual login shell cleanup file, executed when a login shell exits +.TP +.FN ~/.inputrc +Individual \fIreadline\fP initialization file +.PD +.SH AUTHORS +Brian Fox, Free Software Foundation +.br +bfox@gnu.org +.PP +Chet Ramey, Case Western Reserve University +.br +chet@po.CWRU.Edu +.SH BUG REPORTS +If you find a bug in +.B bash, +you should report it. But first, you should +make sure that it really is a bug, and that it appears in the latest +version of +.BR bash . +The latest version is always available from +\fIftp://ftp.gnu.org/pub/bash/\fP. +.PP +Once you have determined that a bug actually exists, use the +.I 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 \fIbug-bash@gnu.org\fP or posted to the Usenet +newsgroup +.BR gnu.bash.bug . +.PP +ALL bug reports should include: +.PP +.PD 0 +.TP 20 +The version number of \fBbash\fR +.TP +The hardware and operating system +.TP +The compiler used to compile +.TP +A description of the bug behaviour +.TP +A short script or `recipe' which exercises the bug +.PD +.PP +.I bashbug +inserts the first three items automatically into the template +it provides for filing a bug report. +.PP +Comments and bug reports concerning +this manual page should be directed to +.IR chet@po.CWRU.Edu . +.SH BUGS +.PP +It's too big and too slow. +.PP +There are some subtle differences between +.B bash +and traditional versions of +.BR sh , +mostly because of the +.SM +.B POSIX +specification. +.PP +Aliases are confusing in some uses. +.PP +Shell builtin commands and functions are not stoppable/restartable. +.PP +Compound commands and command sequences of the form `a ; b ; c' +are not handled gracefully when process suspension is attempted. +When a process is stopped, the shell immediately executes the next +command in the sequence. +It suffices to place the sequence of commands between +parentheses to force it into a subshell, which may be stopped as +a unit. +.PP +Commands inside of \fB$(\fP...\fB)\fP command substitution are not +parsed until substitution is attempted. This will delay error +reporting until some time after the command is entered. +.PP +Array variables may not (yet) be exported. +.zZ +.zY diff --git a/doc/bash.html b/doc/bash.html index 2cfb6547..c19bc7be 100644 --- a/doc/bash.html +++ b/doc/bash.html @@ -642,7 +642,6 @@ command: -  

SHELL GRAMMAR

@@ -5411,7 +5410,7 @@ the version of bash (e.g., 2.00)
\V
-the release of bash, version + patchelvel (e.g., 2.00.0) +the release of bash, version + patch level (e.g., 2.00.0)
\w
@@ -11355,6 +11354,6 @@ Array variables may not (yet) be exported.
This document was created by man2html from bash.1.
-Time: 29 June 2004 10:37:49 EDT +Time: 19 July 2004 16:04:22 EDT diff --git a/doc/bash.pdf b/doc/bash.pdf index 0d7436b5..9a671a1a 100644 Binary files a/doc/bash.pdf and b/doc/bash.pdf differ diff --git a/doc/bash.ps b/doc/bash.ps index 2c086e6e..f2686220 100644 --- a/doc/bash.ps +++ b/doc/bash.ps @@ -1,6 +1,6 @@ %!PS-Adobe-3.0 %%Creator: groff version 1.18.1 -%%CreationDate: Tue Jun 29 10:37:28 2004 +%%CreationDate: Mon Jul 19 16:03:47 2004 %%DocumentNeededResources: font Times-Roman %%+ font Times-Bold %%+ font Times-Italic @@ -3625,15 +3625,16 @@ F1(\\@)144 156 Q F0(the current time in 12-hour am/pm format)23.92 E F1 144 180 Q F0(the username of the current user)27.66 E F1(\\v)144 192 Q F0(the v)28.22 E(ersion of)-.15 E F1(bash)2.5 E F0(\(e.g., 2.00\))2.5 E F1(\\V)144 204 Q F0(the release of)26 E F1(bash)2.5 E F0 2.5(,v)C -(ersion + patchelv)-2.65 E(el \(e.g., 2.00.0\))-.15 E F1(\\w)144 216 Q -F0(the current w)26 E(orking directory)-.1 E 2.5(,w)-.65 G(ith)-2.5 E F1 -($HOME)2.5 E F0(abbre)2.5 E(viated with a tilde)-.25 E F1(\\W)144 228 Q -F0(the basename of the current w)23.22 E(orking directory)-.1 E 2.5(,w) --.65 G(ith)-2.5 E F1($HOME)2.5 E F0(abbre)2.5 E(viated with a tilde)-.25 -E F1(\\!)144 240 Q F0(the history number of this command)29.89 E F1(\\#) -144 252 Q F0(the command number of this command)28.22 E F1(\\$)144 264 Q -F0(if the ef)28.22 E(fecti)-.25 E .3 -.15(ve U)-.25 H(ID is 0, a).15 E -F1(#)2.5 E F0 2.5(,o)C(therwise a)-2.5 E F1($)2.5 E(\\)144 276 Q/F2 10 +(ersion + patch le)-2.65 E -.15(ve)-.25 G 2.5(l\().15 G(e.g., 2.00.0\)) +-2.5 E F1(\\w)144 216 Q F0(the current w)26 E(orking directory)-.1 E 2.5 +(,w)-.65 G(ith)-2.5 E F1($HOME)2.5 E F0(abbre)2.5 E(viated with a tilde) +-.25 E F1(\\W)144 228 Q F0(the basename of the current w)23.22 E +(orking directory)-.1 E 2.5(,w)-.65 G(ith)-2.5 E F1($HOME)2.5 E F0 +(abbre)2.5 E(viated with a tilde)-.25 E F1(\\!)144 240 Q F0 +(the history number of this command)29.89 E F1(\\#)144 252 Q F0 +(the command number of this command)28.22 E F1(\\$)144 264 Q F0 +(if the ef)28.22 E(fecti)-.25 E .3 -.15(ve U)-.25 H(ID is 0, a).15 E F1 +(#)2.5 E F0 2.5(,o)C(therwise a)-2.5 E F1($)2.5 E(\\)144 276 Q/F2 10 /Times-Italic@0 SF(nnn)A F0 (the character corresponding to the octal number)18.22 E F2(nnn)2.5 E F1 (\\\\)144 288 Q F0 2.5(ab)30.44 G(ackslash)-2.5 E F1(\\[)144 300 Q F0 diff --git a/doc/bashref.dvi b/doc/bashref.dvi index 333e9c48..f8894897 100644 Binary files a/doc/bashref.dvi and b/doc/bashref.dvi differ diff --git a/doc/bashref.html b/doc/bashref.html index e71130a3..0189bd46 100644 --- a/doc/bashref.html +++ b/doc/bashref.html @@ -1,6 +1,6 @@ - + + +
- +
digit-argument (M-0, M-1, ... M--) -
+
Add this digit to the argument already accumulating, or start a new argument. M-- starts a negative argument.

- +

universal-argument () -
+
This is another way to specify an argument. If this command is followed by one or more digits, optionally with a leading minus sign, those digits define the argument. @@ -1662,30 +1670,30 @@ By default, this is not bound to a key.

- +
complete (TAB) -
+
Attempt to perform completion on the text before point. The actual completion performed is application-specific. The default is filename completion.

- +

possible-completions (M-?) -
+
List the possible completions of the text before point.

- +

insert-completions (M-*) -
+
Insert all completions of the text before point that would have 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 @@ -1700,9 +1708,9 @@ This command is intended to be bound to TAB, but is unbound by default.

- +

delete-char-or-list () -
+
Deletes the character under the cursor if not at the beginning or end of the line (like delete-char). If at the end of the line, behaves identically to @@ -1731,22 +1739,22 @@ This command is unbound by default.
- +
start-kbd-macro (C-x () -
+
Begin saving the characters typed into the current keyboard macro.

- +

end-kbd-macro (C-x )) -
+
Stop saving the characters typed into the current keyboard macro and save the definition.

- +

call-last-kbd-macro (C-x e) -
+
Re-execute the last keyboard macro defined, by making the characters in the macro appear as if typed at the keyboard.

@@ -1772,87 +1780,87 @@ in the macro appear as if typed at the keyboard.

- +
re-read-init-file (C-x C-r) -
+
Read in the contents of the inputrc file, and incorporate any bindings or variable assignments found there.

- +

abort (C-g) -
+
Abort the current editing command and ring the terminal's bell (subject to the setting of bell-style).

- +

do-uppercase-version (M-a, M-b, M-x, ...) -
+
If the metafied character x is lowercase, run the command that is bound to the corresponding uppercase character.

- +

prefix-meta (ESC) -
+
Metafy the next character typed. This is for keyboards without a meta key. Typing `ESC f' is equivalent to typing M-f.

- +

undo (C-_ or C-x C-u) -
+
Incremental undo, separately remembered for each line.

- +

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-~) -
+
Perform tilde expansion on the current word.

- +

set-mark (C-@) -
+
Set the mark to the point. If a numeric argument is supplied, the mark is set to that position.

- +

exchange-point-and-mark (C-x C-x) -
+
Swap the point with the mark. The current cursor position is set to the saved position, and the old cursor position is saved as the mark.

- +

character-search (C-]) -
+
A character is read and point is moved to the next occurrence of that character. A negative count searches for previous occurrences.

- +

character-search-backward (M-C-]) -
+
A character is read and point is moved to the previous occurrence of that character. A negative count searches for subsequent occurrences.

- +

insert-comment (M-#) -
+
Without a numeric argument, the value of the comment-begin variable is inserted at the beginning of the current line. If a numeric argument is supplied, this command acts as a toggle: if @@ -1863,43 +1871,43 @@ the line. In either case, the line is accepted as if a newline had been typed.

- +

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 file. This command is unbound by default.

- +

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 output. 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.

- +

emacs-editing-mode (C-e) -
+
When in vi command mode, this causes a switch to emacs editing mode.

- +

vi-editing-mode (M-C-j) -
+
When in emacs editing mode, this causes a switch to vi editing mode.

@@ -1950,7 +1958,7 @@ in the consitency of user interface across discrete programs that need to provide a command line interface.

-Copyright (C) 1988-2002 Free Software Foundation, Inc. +Copyright (C) 1988-2004 Free Software Foundation, Inc.

Permission is granted to make and distribute verbatim copies of @@ -2034,8 +2042,8 @@ the simplest way possible, perhaps to replace calls in your code to gets() or fgets().

- - + +

The function readline() prints a prompt prompt @@ -2349,7 +2357,7 @@ and a non-zero value if some error occurs. These variables are available to function writers.

- +

Variable: char * rl_line_buffer
This is the line gathered so far. You are welcome to modify the @@ -2359,7 +2367,7 @@ the memory allocated to rl_line_buffer.

- +

Variable: int rl_point
The offset of the current cursor position in rl_line_buffer @@ -2367,7 +2375,7 @@ the memory allocated to rl_line_buffer.

- +

Variable: int rl_end
The number of characters present in rl_line_buffer. When @@ -2376,7 +2384,7 @@ the memory allocated to rl_line_buffer.

- +

Variable: int rl_mark
The mark (saved position) in the current line. If set, the mark @@ -2384,7 +2392,7 @@ and point define a region.

- +

Variable: int rl_done
Setting this to a non-zero value causes Readline to return the current @@ -2392,7 +2400,7 @@ line immediately.

- +

Variable: int rl_num_chars_to_read
Setting this to a positive value before calling readline() causes @@ -2401,7 +2409,7 @@ than reading up to a character bound to accept-line.

- +

Variable: int rl_pending_input
Setting this to a value makes it the next keystroke read. This is a @@ -2409,7 +2417,7 @@ way to stuff a single character into the input stream.

- +

Variable: int rl_dispatching
Set to a non-zero value if a function is being called from a key binding; @@ -2418,7 +2426,7 @@ they were called directly or by Readline's dispatching mechanism.

- +

Variable: int rl_erase_empty_line
Setting this to a non-zero value causes Readline to completely erase @@ -2428,7 +2436,7 @@ the beginning of the newly-blank line.

- +

Variable: char * rl_prompt
The prompt Readline uses. This is set from the argument to @@ -2438,7 +2446,7 @@ be used to modify the prompt string after calling readline().

- +

Variable: int rl_already_prompted
If an application wishes to display the prompt itself, rather than have @@ -2451,14 +2459,14 @@ never sets it.

- +

Variable: const char * rl_library_version
The version number of this revision of the library.

- +

Variable: int rl_readline_version
An integer encoding the current version of the library. The encoding is @@ -2469,7 +2477,7 @@ value 0x0402.

- +

Variable: int rl_gnu_readline_p
Always set to 1, denoting that this is GNU readline rather than some @@ -2477,7 +2485,7 @@ emulation.

- +

Variable: const char * rl_terminal_name
The terminal type, used for initialization. If not set by the application, @@ -2486,7 +2494,7 @@ the first time it is called.

- +

Variable: const char * rl_readline_name
This variable is set to a unique name by each application using Readline. @@ -2495,7 +2503,7 @@ The value allows conditional parsing of the inputrc file

- +

Variable: FILE * rl_instream
The stdio stream from which Readline reads input. @@ -2503,7 +2511,7 @@ If NULL, Readline defaults to stdin.

- +

Variable: FILE * rl_outstream
The stdio stream to which Readline performs output. @@ -2511,7 +2519,7 @@ If NULL, Readline defaults to stdout.

- +

Variable: rl_command_func_t * rl_last_func
The address of the last command function Readline executed. May be used to @@ -2520,7 +2528,7 @@ example.

- +

Variable: rl_hook_func_t * rl_startup_hook
If non-zero, this is the address of a function to call just @@ -2528,7 +2536,7 @@ before readline prints the first prompt.

- +

Variable: rl_hook_func_t * rl_pre_input_hook
If non-zero, this is the address of a function to call after @@ -2537,7 +2545,7 @@ starts reading input characters.

- +

Variable: rl_hook_func_t * rl_event_hook
If non-zero, this is the address of a function to call periodically @@ -2547,7 +2555,7 @@ is no keyboard input.

- +

Variable: rl_getc_func_t * rl_getc_function
If non-zero, Readline will call indirectly through this pointer @@ -2557,7 +2565,7 @@ to get a character from the input stream. By default, it is set to

- +

Variable: rl_voidfunc_t * rl_redisplay_function
If non-zero, Readline will call indirectly through this pointer @@ -2567,7 +2575,7 @@ redisplay function (see section 2.4.6 Redisplay

- +

Variable: rl_vintfunc_t * rl_prep_term_function
If non-zero, Readline will call indirectly through this pointer @@ -2578,7 +2586,7 @@ By default, this is set to rl_prep_terminal

- +

Variable: rl_voidfunc_t * rl_deprep_term_function
If non-zero, Readline will call indirectly through this pointer @@ -2589,7 +2597,7 @@ By default, this is set to rl_deprep_terminal

- +

Variable: Keymap rl_executing_keymap
This variable is set to the keymap (see section 2.4.2 Selecting a Keymap) in which the @@ -2597,7 +2605,7 @@ currently executing readline function was found.

- +

Variable: Keymap rl_binding_keymap
This variable is set to the keymap (see section 2.4.2 Selecting a Keymap) in which the @@ -2605,14 +2613,14 @@ last key binding occurred.

- +

Variable: char * rl_executing_macro
This variable is set to the text of any currently-executing macro.

- +

Variable: int rl_readline_state
A variable with bit values that encapsulate the current Readline state. @@ -2668,7 +2676,7 @@ and is about to return the line to the caller.

- +

Variable: int rl_explicit_arg
Set to a non-zero value if an explicit numeric argument was specified by @@ -2676,7 +2684,7 @@ the user. Only valid in a bindable command function.

- +

Variable: int rl_numeric_arg
Set to the value of any numeric argument explicitly specified by the user @@ -2685,7 +2693,7 @@ command function.

- +

Variable: int rl_editing_mode
Set to a value denoting Readline's current editing mode. A value of @@ -2763,7 +2771,7 @@ programmer, should bind the functions you write to descriptive names as well. Readline provides a function for doing that:

- +

Function: int rl_add_defun (const char *name, rl_command_func_t *function, int key)
Add name to the list of named functions. Make function be @@ -2803,7 +2811,7 @@ get run. You can make your own keymaps, copy existing keymaps, and tell Readline which keymap to use.

- +

Function: Keymap rl_make_bare_keymap (void)
Returns a new, empty keymap. The space for the keymap is allocated with @@ -2812,14 +2820,14 @@ Readline which keymap to use.

- +

Function: Keymap rl_copy_keymap (Keymap map)
Return a new keymap which is a copy of map.

- +

Function: Keymap rl_make_keymap (void)
Return a new keymap with the printing characters bound to rl_insert, @@ -2828,7 +2836,7 @@ the Meta digits bound to produce numeric arguments.

- +

Function: void rl_discard_keymap (Keymap keymap)
Free the storage associated with keymap. @@ -2839,21 +2847,21 @@ Readline has several internal keymaps. These functions allow you to change which keymap is active.

- +

Function: Keymap rl_get_keymap (void)
Returns the currently active keymap.

- +

Function: void rl_set_keymap (Keymap keymap)
Makes keymap the currently active keymap.

- +

Function: Keymap rl_get_keymap_by_name (const char *name)
Return the keymap matching name. name is one which would @@ -2861,7 +2869,7 @@ be supplied in a set keymap inputrc line (see section +
Function: char * rl_get_keymap_name (Keymap keymap)
Return the name matching keymap. name is one which would @@ -2906,7 +2914,7 @@ initialization function assigned to the rl_startup_hook variable These functions manage key bindings.

- +

Function: int rl_bind_key (int key, rl_command_func_t *function)
Binds key to function in the currently active keymap. @@ -2914,7 +2922,7 @@ Returns non-zero in the case of an invalid key.

- +

Function: int rl_bind_key_in_map (int key, rl_command_func_t *function, Keymap map)
Bind key to function in map. @@ -2922,7 +2930,7 @@ Returns non-zero in the case of an invalid key.

- +

Function: int rl_bind_key_if_unbound (int key, rl_command_func_t *function)
Binds key to function if it is not already bound in the @@ -2932,7 +2940,7 @@ already bound.

- +

Function: int rl_bind_key_if_unbound_in_map (int key, rl_command_func_t *function, Keymap map)
Binds key to function if it is not already bound in map. @@ -2941,7 +2949,7 @@ already bound.

- +

Function: int rl_unbind_key (int key)
Bind key to the null function in the currently active keymap. @@ -2949,7 +2957,7 @@ Returns non-zero in case of error.

- +

Function: int rl_unbind_key_in_map (int key, Keymap map)
Bind key to the null function in map. @@ -2957,21 +2965,21 @@ Returns non-zero in case of error.

- +

Function: int rl_unbind_function_in_map (rl_command_func_t *function, Keymap map)
Unbind all keys that execute function in map.

- +

Function: int rl_unbind_command_in_map (const char *command, Keymap map)
Unbind all keys that are bound to command in map.

- +

Function: int rl_bind_keyseq (const char *keyseq, rl_command_func_t *function)
Bind the key sequence represented by the string keyseq to the function @@ -2981,7 +2989,7 @@ The return value is non-zero if keyseq is invalid.

- +

Function: int rl_bind_keyseq_in_map (const char *keyseq, rl_command_func_t *function, Keymap map)
Bind the key sequence represented by the string keyseq to the function @@ -2991,14 +2999,14 @@ The return value is non-zero if keyseq is invalid.

- +

Function: int rl_set_key (const char *keyseq, rl_command_func_t *function, Keymap map)
Equivalent to rl_bind_keyseq_in_map.

- +

Function: int rl_bind_keyseq_if_unbound (const char *keyseq, rl_command_func_t *function)
Binds keyseq to function if it is not already bound in the @@ -3008,7 +3016,7 @@ already bound.

- +

Function: int rl_bind_keyseq_if_unbound_in_map (const char *keyseq, rl_command_func_t *function, Keymap map)
Binds keyseq to function if it is not already bound in map. @@ -3017,7 +3025,7 @@ already bound.

- +

Function: int rl_generic_bind (int type, const char *keyseq, char *data, Keymap map)
Bind the key sequence represented by the string keyseq to the arbitrary @@ -3028,7 +3036,7 @@ necessary. The initial keymap in which to do bindings is map.

- +

Function: int rl_parse_and_bind (char *line)
Parse line as if it had been read from the inputrc file and @@ -3037,7 +3045,7 @@ perform any key bindings and variable assignments found

- +

Function: int rl_read_init_file (const char *filename)
Read keybindings and variable assignments from filename @@ -3068,14 +3076,14 @@ and the functions invoked by a particular key sequence. You may also associate a new function name with an arbitrary function.

- +

Function: rl_command_func_t * rl_named_function (const char *name)
Return the function with name name.

- +

Function: rl_command_func_t * rl_function_of_keyseq (const char *keyseq, Keymap map, int *type)
Return the function invoked by keyseq in keymap map. @@ -3085,7 +3093,7 @@ it points to (one of ISFUNC, ISKMAP, or ISMACR

- +

Function: char ** rl_invoking_keyseqs (rl_command_func_t *function)
Return an array of strings representing the key sequences used to @@ -3093,7 +3101,7 @@ invoke function in the current keymap.

- +

Function: char ** rl_invoking_keyseqs_in_map (rl_command_func_t *function, Keymap map)
Return an array of strings representing the key sequences used to @@ -3101,7 +3109,7 @@ invoke function in the keymap map.

- +

Function: void rl_function_dumper (int readable)
Print the readline function names and the key sequences currently @@ -3111,14 +3119,14 @@ the list is formatted in such a way that it can be made part of an

- +

Function: void rl_list_funmap_names (void)
Print the names of all bindable Readline functions to rl_outstream.

- +

Function: const char ** rl_funmap_names (void)
Return a NULL terminated array of known function names. The array is @@ -3127,7 +3135,7 @@ should free() the array when you are done, but not the pointers.

- +

Function: int rl_add_funmap_entry (const char *name, rl_command_func_t *function)
Add name to the list of bindable Readline command names, and make @@ -3182,7 +3190,7 @@ tells what to undo, not how to undo it. UNDO_BEGIN and rl_end_undo_group().

- +

Function: int rl_begin_undo_group (void)
Begins saving undo information in a group construct. The undo @@ -3192,7 +3200,7 @@ information usually comes from calls to rl_insert_text() and

- +

Function: int rl_end_undo_group (void)
Closes the current undo group started with rl_begin_undo_group @@ -3201,7 +3209,7 @@ for each call to rl_begin_undo_group().

- +

Function: void rl_add_undo (enum undo_code what, int start, int end, char *text)
Remember how to undo an event (according to what). The affected @@ -3209,14 +3217,14 @@ text runs from start to end, and encompasses text

- +

Function: void rl_free_undo_list (void)
Free the existing undo list.

- +

Function: int rl_do_undo (void)
Undo the first thing on the undo list. Returns 0 if there was @@ -3230,7 +3238,7 @@ once, just before you modify the text. You must supply the indices of the text range that you are going to modify.

- +

Function: int rl_modifying (int start, int end)
Tell Readline to save the text between start and end as a @@ -3257,7 +3265,7 @@ that text.

- +

Function: void rl_redisplay (void)
Change what's displayed on the screen to reflect the current contents @@ -3265,7 +3273,7 @@ of rl_line_buffer.

- +

Function: int rl_forced_update_display (void)
Force the line to be updated and redisplayed, whether or not @@ -3273,7 +3281,7 @@ Readline thinks the screen display is correct.

- +

Function: int rl_on_new_line (void)
Tell the update functions that we have moved onto a new (empty) line, @@ -3281,7 +3289,7 @@ usually after ouputting a newline.

- +

Function: int rl_on_new_line_with_prompt (void)
Tell the update functions that we have moved onto a new line, with @@ -3293,7 +3301,7 @@ It should be used after setting rl_already_prompted.

- +

Function: int rl_reset_line_state (void)
Reset the display state to a clean state and redisplay the current line @@ -3301,14 +3309,14 @@ starting on a new line.

- +

Function: int rl_crlf (void)
Move the cursor to the start of the next screen line.

- +

Function: int rl_show_char (int c)
Display character c on rl_outstream. @@ -3319,7 +3327,7 @@ redisplay.

- +

Function: int rl_message (const char *, ...)
The arguments are a format string as would be supplied to printf, @@ -3330,14 +3338,14 @@ is also used to display numeric arguments and search strings.

- +

Function: int rl_clear_message (void)
Clear the message in the echo area.

- +

Function: void rl_save_prompt (void)
Save the local Readline prompt display state in preparation for @@ -3345,7 +3353,7 @@ displaying a new message in the message area with rl_message().

- +

Function: void rl_restore_prompt (void)
Restore the local Readline prompt display state saved by the most @@ -3353,7 +3361,7 @@ recent call to rl_save_prompt.

- +

Function: int rl_expand_prompt (char *prompt)
Expand any special character sequences in prompt and set up the @@ -3363,10 +3371,15 @@ expand the primary prompt if the rl_on_new_line_with_prompt() function or rl_already_prompted variable is used. It returns the number of visible characters on the last line of the (possibly multi-line) prompt. +Applications may indicate that the prompt contains characters that take +up no physical screen space when displayed by bracketing a sequence of +such characters with the special markers RL_PROMPT_START_IGNORE +and RL_PROMPT_END_IGNORE (declared in `readline.h'. This may +be used to embed terminal-specific escape sequences in prompts.

- +

Function: int rl_set_prompt (const char *prompt)
Make Readline use prompt for subsequent redisplay. This calls @@ -3393,7 +3406,7 @@ to the result.

- +

Function: int rl_insert_text (const char *text)
Insert text into the line at the current cursor position. @@ -3401,7 +3414,7 @@ Returns the number of characters inserted.

- +

Function: int rl_delete_text (int start, int end)
Delete the text between start and end in the current line. @@ -3409,7 +3422,7 @@ Returns the number of characters deleted.

- +

Function: char * rl_copy_text (int start, int end)
Return a copy of the text between start and end in @@ -3417,7 +3430,7 @@ the current line.

- +

Function: int rl_kill_text (int start, int end)
Copy the text between start and end in the current line @@ -3429,7 +3442,7 @@ not a kill, a new kill ring slot is used.

- +

Function: int rl_push_macro_input (char *macro)
Cause macro to be inserted into the line, as if it had been invoked @@ -3456,7 +3469,7 @@ by a key bound to a macro. Not especially useful; use

- +

Function: int rl_read_key (void)
Return the next character available from Readline's current input stream. @@ -3468,7 +3481,7 @@ the rl_event_hook variable.

- +

Function: int rl_getc (FILE *stream)
Return the next character available from stream, which is assumed to @@ -3476,7 +3489,7 @@ be the keyboard.

- +

Function: int rl_stuff_char (int c)
Insert c into the Readline input stream. It will be "read" @@ -3487,7 +3500,7 @@ before Readline attempts to read characters from the terminal with

- +

Function: int rl_execute_next (int c)
Make c be the next command to be executed when rl_read_key() @@ -3495,7 +3508,7 @@ is called. This sets rl_pending_input.

- +

Function: int rl_clear_pending_input (void)
Unset rl_pending_input, effectively negating the effect of any @@ -3504,7 +3517,7 @@ pending input has not already been read with rl_read_key().

- +

Function: int rl_set_keyboard_input_timeout (int u)
While waiting for keyboard input in rl_read_key(), Readline will @@ -3532,7 +3545,7 @@ one-tenth of a second. Returns the old timeout value.

- +

Function: void rl_prep_terminal (int meta_flag)
Modify the terminal settings for Readline's use, so readline() @@ -3542,7 +3555,7 @@ read eight-bit input.

- +

Function: void rl_deprep_terminal (void)
Undo the effects of rl_prep_terminal(), leaving the terminal in @@ -3551,7 +3564,7 @@ the state in which it was before the most recent call to

- +

Function: void rl_tty_set_default_bindings (Keymap kmap)
Read the operating system's terminal editing characters (as would be @@ -3560,7 +3573,7 @@ The bindings are performed in kmap.

- +

Function: void rl_tty_unset_default_bindings (Keymap kmap)
Reset the bindings manipulated by rl_tty_set_default_bindings so @@ -3569,7 +3582,7 @@ The bindings are performed in kmap.

- +

Function: int rl_reset_terminal (const char *terminal_name)
Reinitialize Readline's idea of the terminal settings using @@ -3597,7 +3610,7 @@ environment variable is used.

- +

Function: void rl_replace_line (const char *text, int clear_undo)
Replace the contents of rl_line_buffer with text. @@ -3607,7 +3620,7 @@ current line is cleared.

- +

Function: int rl_extend_line_buffer (int len)
Ensure that rl_line_buffer has enough space to hold len @@ -3615,7 +3628,7 @@ characters, possibly reallocating it if necessary.

- +

Function: int rl_initialize (void)
Initialize or re-initialize Readline's internal state. @@ -3624,21 +3637,21 @@ reading any input.

- +

Function: int rl_ding (void)
Ring the terminal bell, obeying the setting of bell-style.

- +

Function: int rl_alphabetic (int c)
Return 1 if c is an alphabetic character.

- +

Function: void rl_display_match_list (char **matches, int len, int max)
A convenience function for displaying a list of strings in @@ -3655,28 +3668,28 @@ The following are implemented as macros, defined in chardefs.h. Applications should refrain from using them.

- +

Function: int _rl_uppercase_p (int c)
Return 1 if c is an uppercase alphabetic character.

- +

Function: int _rl_lowercase_p (int c)
Return 1 if c is a lowercase alphabetic character.

- +

Function: int _rl_digit_p (int c)
Return 1 if c is a numeric character.

- +

Function: int _rl_to_upper (int c)
If c is a lowercase alphabetic character, return the corresponding @@ -3684,7 +3697,7 @@ uppercase character.

- +

Function: int _rl_to_lower (int c)
If c is an uppercase alphabetic character, return the corresponding @@ -3692,7 +3705,7 @@ lowercase character.

- +

Function: int _rl_digit_value (int c)
If c is a number, return the value it represents. @@ -3717,7 +3730,7 @@ lowercase character.

- +

Function: int rl_macro_bind (const char *keyseq, const char *macro, Keymap map)
Bind the key sequence keyseq to invoke the macro macro. @@ -3727,7 +3740,7 @@ use rl_generic_bind() instead.

- +

Function: void rl_macro_dumper (int readable)
Print the key sequences bound to macros and their values, using @@ -3737,7 +3750,7 @@ that it can be made part of an inputrc file and re-read.

- +

Function: int rl_variable_bind (const char *variable, const char *value)
Make the Readline variable variable have value. @@ -3747,7 +3760,7 @@ file (see section 1.3.1 Readline Init File Syntax<

- +

Function: void rl_variable_dumper (int readable)
Print the readline variable names and their current values @@ -3757,7 +3770,7 @@ that it can be made part of an inputrc file and re-read.

- +

Function: int rl_set_paren_blink_timeout (int u)
Set the time interval (in microseconds) that Readline waits when showing @@ -3765,7 +3778,7 @@ a balancing character when blink-matching-paren has been enabled.

- +

Function: char * rl_get_termcap (const char *cap)
Retrieve the string value of the termcap capability cap. @@ -3803,7 +3816,7 @@ also be invoked as a `callback' function from an event loop. There are functions available to make this easy.

- +

Function: void rl_callback_handler_install (const char *prompt, rl_vcpfunc_t *lhandler)
Set up the terminal for readline I/O and display the initial @@ -3813,7 +3826,7 @@ The function takes the text of the line as an argument.

- +

Function: void rl_callback_read_char (void)
Whenever an application determines that keyboard input is available, it @@ -3832,7 +3845,7 @@ the terminal settings are modified for Readline's use again.

- +

Function: void rl_callback_handler_remove (void)
Restore the terminal to its initial state and remove the line handler. @@ -3990,7 +4003,7 @@ values of these variables only when calling readline(), not in a signal handler, so Readline's internal signal state is not corrupted.

- +

Variable: int rl_catch_signals
If this variable is non-zero, Readline will install signal handlers for @@ -4002,7 +4015,7 @@ The default value of rl_catch_signals is 1.

- +

Variable: int rl_catch_sigwinch
If this variable is non-zero, Readline will install a signal handler for @@ -4020,7 +4033,7 @@ Readline provides convenience functions to do the necessary terminal and internal state cleanup upon receipt of a signal.

- +

Function: void rl_cleanup_after_signal (void)
This function will reset the state of the terminal to what it was before @@ -4030,7 +4043,7 @@ all signals, depending on the values of rl_catch_signals and

- +

Function: void rl_free_line_state (void)
This will free any partial state associated with the current input line @@ -4042,7 +4055,7 @@ current input line.

- +

Function: void rl_reset_after_signal (void)
This will reinitialize the terminal and reinstall any Readline signal @@ -4057,14 +4070,14 @@ Readline to update its idea of the terminal size when a SIGWINCH is received.

- +

Function: void rl_resize_terminal (void)
Update Readline's internal screen size by reading values from the kernel.

- +

Function: void rl_set_screen_size (int rows, int cols)
Set Readline's idea of the terminal size to rows rows and @@ -4077,7 +4090,7 @@ is still interested in the screen dimensions, Readline's idea of the screen size may be queried.

- +

Function: void rl_get_screen_size (int *rows, int *cols)
Return Readline's idea of the terminal's size in the @@ -4088,7 +4101,7 @@ variables pointed to by the arguments. The following functions install and remove Readline's signal handlers.

- +

Function: int rl_set_signals (void)
Install Readline's signal handler for SIGINT, SIGQUIT, @@ -4098,7 +4111,7 @@ The following functions install and remove Readline's signal handlers.

- +

Function: int rl_clear_signals (void)
Remove all of the Readline signal handlers installed by @@ -4211,7 +4224,7 @@ Such a generator function is referred to as an

- +

Function: int rl_complete (int ignore, int invoking_key)
Complete the word at or before point. You have supplied the function @@ -4220,7 +4233,7 @@ that does the initial simple matching selection algorithm (see

- +

Variable: rl_compentry_func_t * rl_completion_entry_function
This is a pointer to the generator function for @@ -4256,7 +4269,7 @@ Here is the complete list of callable completion functions present in Readline.

- +

Function: int rl_complete_internal (int what_to_do)
Complete the word at or before point. what_to_do says what to do @@ -4270,7 +4283,7 @@ a common prefix.

- +

Function: int rl_complete (int ignore, int invoking_key)
Complete the word at or before point. You have supplied the function @@ -4282,7 +4295,7 @@ argument depending on invoking_key.

- +

Function: int rl_possible_completions (int count, int invoking_key)
List the possible completions. See description of rl_complete @@ -4291,7 +4304,7 @@ argument depending on invoking_key.

- +

Function: int rl_insert_completions (int count, int invoking_key)
Insert the list of possible completions into the line, deleting the @@ -4300,7 +4313,7 @@ This calls rl_complete_internal() with an argument of `*'

- +

Function: int rl_completion_mode (rl_command_func_t *cfunc)
Returns the apppriate value to pass to rl_complete_internal() @@ -4312,7 +4325,7 @@ the same interface as rl_complete().

- +

Function: char ** rl_completion_matches (const char *text, rl_compentry_func_t *entry_func)
Returns an array of strings which is a list of completions for @@ -4330,7 +4343,7 @@ when there are no more matches.

- +

Function: char * rl_filename_completion_function (const char *text, int state)
A generator function for filename completion in the general case. @@ -4341,7 +4354,7 @@ Readline functions).

- +

Function: char * rl_username_completion_function (const char *text, int state)
A completion generator for usernames. text contains a partial @@ -4369,7 +4382,7 @@ for subsequent calls.

- +

Variable: rl_compentry_func_t * rl_completion_entry_function
A pointer to the generator function for rl_completion_matches(). @@ -4378,7 +4391,7 @@ the default filename completer.

- +

Variable: rl_completion_func_t * rl_attempted_completion_function
A pointer to an alternative function to create matches. @@ -4395,7 +4408,7 @@ completion even if this function returns no matches.

- +

Variable: rl_quote_func_t * rl_filename_quoting_function
A pointer to a function that will quote a filename in an @@ -4412,7 +4425,7 @@ to reset this character.

- +

Variable: rl_dequote_func_t * rl_filename_dequoting_function
A pointer to a function that will remove application-specific quoting @@ -4425,7 +4438,7 @@ that delimits the filename (usually `'' or `"'). If

- +

Variable: rl_linebuf_func_t * rl_char_is_quoted_p
A pointer to a function to call that determines whether or not a specific @@ -4438,7 +4451,7 @@ used to break words for the completer.

- +

Variable: rl_compignore_func_t * rl_ignore_some_completions_function
This function, if defined, is called by the completer when real filename @@ -4451,7 +4464,7 @@ from the array must be freed.

- +

Variable: rl_icppfunc_t * rl_directory_completion_hook
This function, if defined, is allowed to modify the directory portion @@ -4467,7 +4480,7 @@ It could be used to expand symbolic links or shell variables in pathnames.

- +

Variable: rl_compdisp_func_t * rl_completion_display_matches_hook
If non-zero, then this is the address of a function to call when @@ -4484,7 +4497,7 @@ function may be called from this hook.

- +

Variable: const char * rl_basic_word_break_characters
The basic list of characters that signal a break between words for the @@ -4494,14 +4507,14 @@ which break words for completion in Bash:

- +

Variable: const char * rl_basic_quote_characters
A list of quote characters which can cause a word break.

- +

Variable: const char * rl_completer_word_break_characters
The list of characters that signal a break between words for @@ -4510,7 +4523,19 @@ which break words for completion in Bash:

- + +

+
Variable: rl_cpvfunc_t * rl_completion_word_break_hook +
If non-zero, this is the address of a function to call when Readline is +deciding where to separate words for word completion. It should return +a character string like rl_completer_word_break_characters to be +used to perform the current completion. The function may choose to set +rl_completer_word_break_characters itself. If the function +returns NULL, rl_completer_word_break_characters is used. +
+

+ +

Variable: const char * rl_completer_quote_characters
A list of characters which can be used to quote a substring of the line. @@ -4520,7 +4545,7 @@ unless they also appear within this list.

- +

Variable: const char * rl_filename_quote_characters
A list of characters that cause a filename to be quoted by the completer @@ -4528,7 +4553,7 @@ when they appear in a completed filename. The default is the null string.

- +

Variable: const char * rl_special_prefixes
The list of characters that are word break characters, but should be @@ -4539,7 +4564,7 @@ shell variables and hostnames.

- +

Variable: int rl_completion_query_items
Up to this many items will be displayed in response to a @@ -4548,7 +4573,7 @@ she wants to see them all. The default value is 100.

- +

Variable: int rl_completion_append_character
When a single completion alternative matches at the end of the command @@ -4561,17 +4586,47 @@ an application-specific command line syntax specification.

- +

Variable: int rl_completion_suppress_append
If non-zero, rl_completion_append_character is not appended to -matches at the end of the command line, as described above. It is -set to 0 before any application-specific completion function is called, -and may only be changed within such a function. +matches at the end of the command line, as described above. +It is set to 0 before any application-specific completion function +is called, and may only be changed within such a function.

- + +

+
Variable: int rl_completion_quote_character +
When Readline is completing quoted text, as delimited by one of the +characters in rl_completer_quote_characters, it sets this variable +to the quoting character found. +This is set before any application-specific completion function is called. +
+

+ + +

+
Variable: int rl_completion_suppress_quote +
If non-zero, Readline does not append a matching quote character when +performing completion on a quoted string. +It is set to 0 before any application-specific completion function +is called, and may only be changed within such a function. +
+

+ + +

+
Variable: int rl_completion_found_quote +
When Readline is completing quoted text, it sets this variable +to a non-zero value if the word being completed contains or is delimited +by any quoting characters, including backslashes. +This is set before any application-specific completion function is called. +
+

+ +

Variable: int rl_completion_mark_symlink_dirs
If non-zero, a slash will be appended to completed filenames that are @@ -4586,7 +4641,7 @@ function modifies the value, the user's preferences are honored.

- +

Variable: int rl_ignore_completion_duplicates
If non-zero, then duplicates in the matches are removed. @@ -4594,7 +4649,7 @@ The default is 1.

- +

Variable: int rl_filename_completion_desired
Non-zero means that the results of the matches are to be treated as @@ -4608,7 +4663,7 @@ characters in rl_filename_quote_characters and

- +

Variable: int rl_filename_quoting_desired
Non-zero means that the results of the matches are to be quoted using @@ -4622,7 +4677,7 @@ by rl_filename_quoting_function.

- +

Variable: int rl_attempted_completion_over
If an application-specific completion function assigned to @@ -4633,7 +4688,7 @@ It should be set only by an application's completion function.

- +

Variable: int rl_completion_type
Set to a character describing the type of completion Readline is currently @@ -4645,7 +4700,7 @@ the same interface as rl_complete().

- +

Variable: int rl_inhibit_completion
If this variable is non-zero, completion is inhibited. The completion @@ -5156,7 +5211,7 @@ valid_argument (caller, arg)

- +

Version 1.2, November 2002
@@ -5726,7 +5781,7 @@ to permit their use in free software. editing command lines1.2.1 Readline Bare Essentials
F -FDL, GNU Free Documentation LicenseA.1 GNU Free Documentation License +FDL, GNU Free Documentation LicenseA.1 GNU Free Documentation License
I initialization file, readline1.3 Readline Init File @@ -5740,7 +5795,7 @@ to permit their use in free software. notation, readline1.2.1 Readline Bare Essentials
R -readline, function2.1 Basic Behavior +readline, function2.1 Basic Behavior
V variables, readline1.3.1 Readline Init File Syntax @@ -5834,16 +5889,16 @@ to permit their use in free software. Index Entry Section
_ -_rl_digit_p2.4.10 Utility Functions -_rl_digit_value2.4.10 Utility Functions -_rl_lowercase_p2.4.10 Utility Functions -_rl_to_lower2.4.10 Utility Functions -_rl_to_upper2.4.10 Utility Functions -_rl_uppercase_p2.4.10 Utility Functions +_rl_digit_p2.4.10 Utility Functions +_rl_digit_value2.4.10 Utility Functions +_rl_lowercase_p2.4.10 Utility Functions +_rl_to_lower2.4.10 Utility Functions +_rl_to_upper2.4.10 Utility Functions +_rl_uppercase_p2.4.10 Utility Functions
A -abort (C-g)1.4.8 Some Miscellaneous Commands -abort (C-g)1.4.8 Some Miscellaneous Commands +abort (C-g)1.4.8 Some Miscellaneous Commands +abort (C-g)1.4.8 Some Miscellaneous Commands accept-line (Newline or Return)1.4.2 Commands For Manipulating The History accept-line (Newline or Return)1.4.2 Commands For Manipulating The History
@@ -5865,62 +5920,62 @@ to permit their use in free software. bell-style1.3.1 Readline Init File Syntax
C -call-last-kbd-macro (C-x e)1.4.7 Keyboard Macros -call-last-kbd-macro (C-x e)1.4.7 Keyboard Macros +call-last-kbd-macro (C-x e)1.4.7 Keyboard Macros +call-last-kbd-macro (C-x e)1.4.7 Keyboard Macros capitalize-word (M-c)1.4.3 Commands For Changing Text capitalize-word (M-c)1.4.3 Commands For Changing Text -character-search (C-])1.4.8 Some Miscellaneous Commands -character-search (C-])1.4.8 Some Miscellaneous Commands -character-search-backward (M-C-])1.4.8 Some Miscellaneous Commands -character-search-backward (M-C-])1.4.8 Some Miscellaneous Commands +character-search (C-])1.4.8 Some Miscellaneous Commands +character-search (C-])1.4.8 Some Miscellaneous Commands +character-search-backward (M-C-])1.4.8 Some Miscellaneous Commands +character-search-backward (M-C-])1.4.8 Some Miscellaneous Commands clear-screen (C-l)1.4.1 Commands For Moving clear-screen (C-l)1.4.1 Commands For Moving comment-begin1.3.1 Readline Init File Syntax -complete (TAB)1.4.6 Letting Readline Type For You -complete (TAB)1.4.6 Letting Readline Type For You +complete (TAB)1.4.6 Letting Readline Type For You +complete (TAB)1.4.6 Letting Readline Type For You completion-query-items1.3.1 Readline Init File Syntax convert-meta1.3.1 Readline Init File Syntax -copy-backward-word ()1.4.4 Killing And Yanking -copy-backward-word ()1.4.4 Killing And Yanking -copy-forward-word ()1.4.4 Killing And Yanking -copy-forward-word ()1.4.4 Killing And Yanking -copy-region-as-kill ()1.4.4 Killing And Yanking -copy-region-as-kill ()1.4.4 Killing And Yanking +copy-backward-word ()1.4.4 Killing And Yanking +copy-backward-word ()1.4.4 Killing And Yanking +copy-forward-word ()1.4.4 Killing And Yanking +copy-forward-word ()1.4.4 Killing And Yanking +copy-region-as-kill ()1.4.4 Killing And Yanking +copy-region-as-kill ()1.4.4 Killing And Yanking
D delete-char (C-d)1.4.3 Commands For Changing Text delete-char (C-d)1.4.3 Commands For Changing Text -delete-char-or-list ()1.4.6 Letting Readline Type For You -delete-char-or-list ()1.4.6 Letting Readline Type For You -delete-horizontal-space ()1.4.4 Killing And Yanking -delete-horizontal-space ()1.4.4 Killing And Yanking -digit-argument (M-0, M-1, <small>...</small> M--)1.4.5 Specifying Numeric Arguments -digit-argument (M-0, M-1, <small>...</small> M--)1.4.5 Specifying Numeric Arguments +delete-char-or-list ()1.4.6 Letting Readline Type For You +delete-char-or-list ()1.4.6 Letting Readline Type For You +delete-horizontal-space ()1.4.4 Killing And Yanking +delete-horizontal-space ()1.4.4 Killing And Yanking +digit-argument (M-0, M-1, <small>...</small> M--)1.4.5 Specifying Numeric Arguments +digit-argument (M-0, M-1, <small>...</small> M--)1.4.5 Specifying Numeric Arguments disable-completion1.3.1 Readline Init File Syntax -do-uppercase-version (M-a, M-b, M-x, <small>...</small>)1.4.8 Some Miscellaneous Commands -do-uppercase-version (M-a, M-b, M-x, <small>...</small>)1.4.8 Some Miscellaneous Commands +do-uppercase-version (M-a, M-b, M-x, <small>...</small>)1.4.8 Some Miscellaneous Commands +do-uppercase-version (M-a, M-b, M-x, <small>...</small>)1.4.8 Some Miscellaneous Commands downcase-word (M-l)1.4.3 Commands For Changing Text downcase-word (M-l)1.4.3 Commands For Changing Text -dump-functions ()1.4.8 Some Miscellaneous Commands -dump-functions ()1.4.8 Some Miscellaneous Commands -dump-macros ()1.4.8 Some Miscellaneous Commands -dump-macros ()1.4.8 Some Miscellaneous Commands -dump-variables ()1.4.8 Some Miscellaneous Commands -dump-variables ()1.4.8 Some Miscellaneous Commands +dump-functions ()1.4.8 Some Miscellaneous Commands +dump-functions ()1.4.8 Some Miscellaneous Commands +dump-macros ()1.4.8 Some Miscellaneous Commands +dump-macros ()1.4.8 Some Miscellaneous Commands +dump-variables ()1.4.8 Some Miscellaneous Commands +dump-variables ()1.4.8 Some Miscellaneous Commands
E editing-mode1.3.1 Readline Init File Syntax -emacs-editing-mode (C-e)1.4.8 Some Miscellaneous Commands -emacs-editing-mode (C-e)1.4.8 Some Miscellaneous Commands +emacs-editing-mode (C-e)1.4.8 Some Miscellaneous Commands +emacs-editing-mode (C-e)1.4.8 Some Miscellaneous Commands enable-keypad1.3.1 Readline Init File Syntax -end-kbd-macro (C-x ))1.4.7 Keyboard Macros -end-kbd-macro (C-x ))1.4.7 Keyboard Macros +end-kbd-macro (C-x ))1.4.7 Keyboard Macros +end-kbd-macro (C-x ))1.4.7 Keyboard Macros end-of-history (M-&#62;)1.4.2 Commands For Manipulating The History end-of-history (M-&#62;)1.4.2 Commands For Manipulating The History end-of-line (C-e)1.4.1 Commands For Moving end-of-line (C-e)1.4.1 Commands For Moving -exchange-point-and-mark (C-x C-x)1.4.8 Some Miscellaneous Commands -exchange-point-and-mark (C-x C-x)1.4.8 Some Miscellaneous Commands +exchange-point-and-mark (C-x C-x)1.4.8 Some Miscellaneous Commands +exchange-point-and-mark (C-x C-x)1.4.8 Some Miscellaneous Commands expand-tilde1.3.1 Readline Init File Syntax
F @@ -5943,18 +5998,18 @@ to permit their use in free software.
I input-meta1.3.1 Readline Init File Syntax -insert-comment (M-#)1.4.8 Some Miscellaneous Commands -insert-comment (M-#)1.4.8 Some Miscellaneous Commands -insert-completions (M-*)1.4.6 Letting Readline Type For You -insert-completions (M-*)1.4.6 Letting Readline Type For You +insert-comment (M-#)1.4.8 Some Miscellaneous Commands +insert-comment (M-#)1.4.8 Some Miscellaneous Commands +insert-completions (M-*)1.4.6 Letting Readline Type For You +insert-completions (M-*)1.4.6 Letting Readline Type For You isearch-terminators1.3.1 Readline Init File Syntax
K keymap1.3.1 Readline Init File Syntax kill-line (C-k)1.4.4 Killing And Yanking kill-line (C-k)1.4.4 Killing And Yanking -kill-region ()1.4.4 Killing And Yanking -kill-region ()1.4.4 Killing And Yanking +kill-region ()1.4.4 Killing And Yanking +kill-region ()1.4.4 Killing And Yanking kill-whole-line ()1.4.4 Killing And Yanking kill-whole-line ()1.4.4 Killing And Yanking kill-word (M-d)1.4.4 Killing And Yanking @@ -5964,8 +6019,8 @@ to permit their use in free software. mark-modified-lines1.3.1 Readline Init File Syntax mark-symlinked-directories1.3.1 Readline Init File Syntax match-hidden-files1.3.1 Readline Init File Syntax -menu-complete ()1.4.6 Letting Readline Type For You -menu-complete ()1.4.6 Letting Readline Type For You +menu-complete ()1.4.6 Letting Readline Type For You +menu-complete ()1.4.6 Letting Readline Type For You meta-flag1.3.1 Readline Init File Syntax
N @@ -5983,10 +6038,10 @@ to permit their use in free software.
P page-completions1.3.1 Readline Init File Syntax -possible-completions (M-?)1.4.6 Letting Readline Type For You -possible-completions (M-?)1.4.6 Letting Readline Type For You -prefix-meta (ESC)1.4.8 Some Miscellaneous Commands -prefix-meta (ESC)1.4.8 Some Miscellaneous Commands +possible-completions (M-?)1.4.6 Letting Readline Type For You +possible-completions (M-?)1.4.6 Letting Readline Type For You +prefix-meta (ESC)1.4.8 Some Miscellaneous Commands +prefix-meta (ESC)1.4.8 Some Miscellaneous Commands previous-history (C-p)1.4.2 Commands For Manipulating The History previous-history (C-p)1.4.2 Commands For Manipulating The History
@@ -5995,201 +6050,207 @@ to permit their use in free software. quoted-insert (C-q or C-v)1.4.3 Commands For Changing Text
R -re-read-init-file (C-x C-r)1.4.8 Some Miscellaneous Commands -re-read-init-file (C-x C-r)1.4.8 Some Miscellaneous Commands -readline2.1 Basic Behavior +re-read-init-file (C-x C-r)1.4.8 Some Miscellaneous Commands +re-read-init-file (C-x C-r)1.4.8 Some Miscellaneous Commands +readline2.1 Basic Behavior redraw-current-line ()1.4.1 Commands For Moving redraw-current-line ()1.4.1 Commands For Moving reverse-search-history (C-r)1.4.2 Commands For Manipulating The History reverse-search-history (C-r)1.4.2 Commands For Manipulating The History -revert-line (M-r)1.4.8 Some Miscellaneous Commands -revert-line (M-r)1.4.8 Some Miscellaneous Commands -rl_add_defun2.4.1 Naming a Function -rl_add_funmap_entry2.4.4 Associating Function Names and Bindings -rl_add_undo2.4.5 Allowing Undoing -rl_alphabetic2.4.10 Utility Functions -rl_already_prompted2.3 Readline Variables -rl_attempted_completion_function2.6.3 Completion Variables -rl_attempted_completion_over2.6.3 Completion Variables -rl_basic_quote_characters2.6.3 Completion Variables -rl_basic_word_break_characters2.6.3 Completion Variables -rl_begin_undo_group2.4.5 Allowing Undoing -rl_bind_key2.4.3 Binding Keys -rl_bind_key_if_unbound2.4.3 Binding Keys -rl_bind_key_if_unbound_in_map2.4.3 Binding Keys -rl_bind_key_in_map2.4.3 Binding Keys -rl_bind_keyseq2.4.3 Binding Keys -rl_bind_keyseq_if_unbound2.4.3 Binding Keys -rl_bind_keyseq_if_unbound_in_map2.4.3 Binding Keys -rl_bind_keyseq_in_map2.4.3 Binding Keys -rl_binding_keymap2.3 Readline Variables -rl_callback_handler_install2.4.12 Alternate Interface -rl_callback_handler_remove2.4.12 Alternate Interface -rl_callback_read_char2.4.12 Alternate Interface -rl_catch_signals2.5 Readline Signal Handling -rl_catch_sigwinch2.5 Readline Signal Handling -rl_char_is_quoted_p2.6.3 Completion Variables -rl_cleanup_after_signal2.5 Readline Signal Handling -rl_clear_message2.4.6 Redisplay -rl_clear_pending_input2.4.8 Character Input -rl_clear_signals2.5 Readline Signal Handling -rl_complete2.6.1 How Completing Works -rl_complete2.6.2 Completion Functions -rl_complete_internal2.6.2 Completion Functions -rl_completer_quote_characters2.6.3 Completion Variables -rl_completer_word_break_characters2.6.3 Completion Variables -rl_completion_append_character2.6.3 Completion Variables -rl_completion_display_matches_hook2.6.3 Completion Variables -rl_completion_entry_function2.6.1 How Completing Works -rl_completion_entry_function2.6.3 Completion Variables -rl_completion_mark_symlink_dirs2.6.3 Completion Variables -rl_completion_matches2.6.2 Completion Functions -rl_completion_mode2.6.2 Completion Functions -rl_completion_query_items2.6.3 Completion Variables -rl_completion_suppress_append2.6.3 Completion Variables -rl_completion_type2.6.3 Completion Variables -rl_copy_keymap2.4.2 Selecting a Keymap -rl_copy_text2.4.7 Modifying Text -rl_crlf2.4.6 Redisplay -rl_delete_text2.4.7 Modifying Text -rl_deprep_term_function2.3 Readline Variables -rl_deprep_terminal2.4.9 Terminal Management -rl_ding2.4.10 Utility Functions -rl_directory_completion_hook2.6.3 Completion Variables -rl_discard_keymap2.4.2 Selecting a Keymap -rl_dispatching2.3 Readline Variables -rl_display_match_list2.4.10 Utility Functions -rl_do_undo2.4.5 Allowing Undoing -rl_done2.3 Readline Variables -rl_editing_mode2.3 Readline Variables -rl_end2.3 Readline Variables -rl_end_undo_group2.4.5 Allowing Undoing -rl_erase_empty_line2.3 Readline Variables -rl_event_hook2.3 Readline Variables -rl_execute_next2.4.8 Character Input -rl_executing_keymap2.3 Readline Variables -rl_executing_macro2.3 Readline Variables -rl_expand_prompt2.4.6 Redisplay -rl_explicit_arg2.3 Readline Variables -rl_extend_line_buffer2.4.10 Utility Functions -rl_filename_completion_desired2.6.3 Completion Variables -rl_filename_completion_function2.6.2 Completion Functions -rl_filename_dequoting_function2.6.3 Completion Variables -rl_filename_quote_characters2.6.3 Completion Variables -rl_filename_quoting_desired2.6.3 Completion Variables -rl_filename_quoting_function2.6.3 Completion Variables -rl_forced_update_display2.4.6 Redisplay -rl_free_line_state2.5 Readline Signal Handling -rl_free_undo_list2.4.5 Allowing Undoing -rl_function_dumper2.4.4 Associating Function Names and Bindings -rl_function_of_keyseq2.4.4 Associating Function Names and Bindings -rl_funmap_names2.4.4 Associating Function Names and Bindings -rl_generic_bind2.4.3 Binding Keys -rl_get_keymap2.4.2 Selecting a Keymap -rl_get_keymap_by_name2.4.2 Selecting a Keymap -rl_get_keymap_name2.4.2 Selecting a Keymap -rl_get_screen_size2.5 Readline Signal Handling -rl_get_termcap2.4.11 Miscellaneous Functions -rl_getc2.4.8 Character Input -rl_getc_function2.3 Readline Variables -rl_gnu_readline_p2.3 Readline Variables -rl_ignore_completion_duplicates2.6.3 Completion Variables -rl_ignore_some_completions_function2.6.3 Completion Variables -rl_inhibit_completion2.6.3 Completion Variables -rl_initialize2.4.10 Utility Functions -rl_insert_completions2.6.2 Completion Functions -rl_insert_text2.4.7 Modifying Text -rl_instream2.3 Readline Variables -rl_invoking_keyseqs2.4.4 Associating Function Names and Bindings -rl_invoking_keyseqs_in_map2.4.4 Associating Function Names and Bindings -rl_kill_text2.4.7 Modifying Text -rl_last_func2.3 Readline Variables -rl_library_version2.3 Readline Variables -rl_line_buffer2.3 Readline Variables -rl_list_funmap_names2.4.4 Associating Function Names and Bindings -rl_macro_bind2.4.11 Miscellaneous Functions -rl_macro_dumper2.4.11 Miscellaneous Functions -rl_make_bare_keymap2.4.2 Selecting a Keymap -rl_make_keymap2.4.2 Selecting a Keymap -rl_mark2.3 Readline Variables -rl_message2.4.6 Redisplay -rl_modifying2.4.5 Allowing Undoing -rl_named_function2.4.4 Associating Function Names and Bindings -rl_num_chars_to_read2.3 Readline Variables -rl_numeric_arg2.3 Readline Variables -rl_on_new_line2.4.6 Redisplay -rl_on_new_line_with_prompt2.4.6 Redisplay -rl_outstream2.3 Readline Variables -rl_parse_and_bind2.4.3 Binding Keys -rl_pending_input2.3 Readline Variables -rl_point2.3 Readline Variables -rl_possible_completions2.6.2 Completion Functions -rl_pre_input_hook2.3 Readline Variables -rl_prep_term_function2.3 Readline Variables -rl_prep_terminal2.4.9 Terminal Management -rl_prompt2.3 Readline Variables -rl_push_macro_input2.4.7 Modifying Text -rl_read_init_file2.4.3 Binding Keys -rl_read_key2.4.8 Character Input -rl_readline_name2.3 Readline Variables -rl_readline_state2.3 Readline Variables -rl_readline_version2.3 Readline Variables -rl_redisplay2.4.6 Redisplay -rl_redisplay_function2.3 Readline Variables -rl_replace_line2.4.10 Utility Functions -rl_reset_after_signal2.5 Readline Signal Handling -rl_reset_line_state2.4.6 Redisplay -rl_reset_terminal2.4.9 Terminal Management -rl_resize_terminal2.5 Readline Signal Handling -rl_restore_prompt2.4.6 Redisplay -rl_save_prompt2.4.6 Redisplay -rl_set_key2.4.3 Binding Keys -rl_set_keyboard_input_timeout2.4.8 Character Input -rl_set_keymap2.4.2 Selecting a Keymap -rl_set_paren_blink_timeout2.4.11 Miscellaneous Functions -rl_set_prompt2.4.6 Redisplay -rl_set_screen_size2.5 Readline Signal Handling -rl_set_signals2.5 Readline Signal Handling -rl_show_char2.4.6 Redisplay -rl_special_prefixes2.6.3 Completion Variables -rl_startup_hook2.3 Readline Variables -rl_stuff_char2.4.8 Character Input -rl_terminal_name2.3 Readline Variables -rl_tty_set_default_bindings2.4.9 Terminal Management -rl_tty_unset_default_bindings2.4.9 Terminal Management -rl_unbind_command_in_map2.4.3 Binding Keys -rl_unbind_function_in_map2.4.3 Binding Keys -rl_unbind_key2.4.3 Binding Keys -rl_unbind_key_in_map2.4.3 Binding Keys -rl_username_completion_function2.6.2 Completion Functions -rl_variable_bind2.4.11 Miscellaneous Functions -rl_variable_dumper2.4.11 Miscellaneous Functions +revert-line (M-r)1.4.8 Some Miscellaneous Commands +revert-line (M-r)1.4.8 Some Miscellaneous Commands +rl_add_defun2.4.1 Naming a Function +rl_add_funmap_entry2.4.4 Associating Function Names and Bindings +rl_add_undo2.4.5 Allowing Undoing +rl_alphabetic2.4.10 Utility Functions +rl_already_prompted2.3 Readline Variables +rl_attempted_completion_function2.6.3 Completion Variables +rl_attempted_completion_over2.6.3 Completion Variables +rl_basic_quote_characters2.6.3 Completion Variables +rl_basic_word_break_characters2.6.3 Completion Variables +rl_begin_undo_group2.4.5 Allowing Undoing +rl_bind_key2.4.3 Binding Keys +rl_bind_key_if_unbound2.4.3 Binding Keys +rl_bind_key_if_unbound_in_map2.4.3 Binding Keys +rl_bind_key_in_map2.4.3 Binding Keys +rl_bind_keyseq2.4.3 Binding Keys +rl_bind_keyseq_if_unbound2.4.3 Binding Keys +rl_bind_keyseq_if_unbound_in_map2.4.3 Binding Keys +rl_bind_keyseq_in_map2.4.3 Binding Keys +rl_binding_keymap2.3 Readline Variables +rl_callback_handler_install2.4.12 Alternate Interface +rl_callback_handler_remove2.4.12 Alternate Interface +rl_callback_read_char2.4.12 Alternate Interface +rl_catch_signals2.5 Readline Signal Handling +rl_catch_sigwinch2.5 Readline Signal Handling +rl_char_is_quoted_p2.6.3 Completion Variables +rl_cleanup_after_signal2.5 Readline Signal Handling +rl_clear_message2.4.6 Redisplay +rl_clear_pending_input2.4.8 Character Input +rl_clear_signals2.5 Readline Signal Handling +rl_complete2.6.1 How Completing Works +rl_complete2.6.2 Completion Functions +rl_complete_internal2.6.2 Completion Functions +rl_completer_quote_characters2.6.3 Completion Variables +rl_completer_word_break_characters2.6.3 Completion Variables +rl_completion_append_character2.6.3 Completion Variables +rl_completion_display_matches_hook2.6.3 Completion Variables +rl_completion_entry_function2.6.1 How Completing Works +rl_completion_entry_function2.6.3 Completion Variables +rl_completion_found_quote2.6.3 Completion Variables +rl_completion_mark_symlink_dirs2.6.3 Completion Variables +rl_completion_matches2.6.2 Completion Functions +rl_completion_mode2.6.2 Completion Functions +rl_completion_query_items2.6.3 Completion Variables +rl_completion_quote_character2.6.3 Completion Variables +rl_completion_suppress_append2.6.3 Completion Variables +rl_completion_suppress_quote2.6.3 Completion Variables +rl_completion_type2.6.3 Completion Variables +rl_completion_word_break_hook2.6.3 Completion Variables +rl_copy_keymap2.4.2 Selecting a Keymap +rl_copy_text2.4.7 Modifying Text +rl_crlf2.4.6 Redisplay +rl_delete_text2.4.7 Modifying Text +rl_deprep_term_function2.3 Readline Variables +rl_deprep_terminal2.4.9 Terminal Management +rl_ding2.4.10 Utility Functions +rl_directory_completion_hook2.6.3 Completion Variables +rl_discard_keymap2.4.2 Selecting a Keymap +rl_dispatching2.3 Readline Variables +rl_display_match_list2.4.10 Utility Functions +rl_do_undo2.4.5 Allowing Undoing +rl_done2.3 Readline Variables +rl_editing_mode2.3 Readline Variables +rl_end2.3 Readline Variables +rl_end_undo_group2.4.5 Allowing Undoing +rl_erase_empty_line2.3 Readline Variables +rl_event_hook2.3 Readline Variables +rl_execute_next2.4.8 Character Input +rl_executing_keymap2.3 Readline Variables +rl_executing_macro2.3 Readline Variables +rl_expand_prompt2.4.6 Redisplay +rl_explicit_arg2.3 Readline Variables +rl_extend_line_buffer2.4.10 Utility Functions +rl_filename_completion_desired2.6.3 Completion Variables +rl_filename_completion_function2.6.2 Completion Functions +rl_filename_dequoting_function2.6.3 Completion Variables +rl_filename_quote_characters2.6.3 Completion Variables +rl_filename_quoting_desired2.6.3 Completion Variables +rl_filename_quoting_function2.6.3 Completion Variables +rl_forced_update_display2.4.6 Redisplay +rl_free_line_state2.5 Readline Signal Handling +rl_free_undo_list2.4.5 Allowing Undoing +rl_function_dumper2.4.4 Associating Function Names and Bindings +rl_function_of_keyseq2.4.4 Associating Function Names and Bindings +rl_funmap_names2.4.4 Associating Function Names and Bindings +rl_generic_bind2.4.3 Binding Keys +rl_get_keymap2.4.2 Selecting a Keymap +rl_get_keymap_by_name2.4.2 Selecting a Keymap +rl_get_keymap_name2.4.2 Selecting a Keymap +rl_get_screen_size2.5 Readline Signal Handling +rl_get_termcap2.4.11 Miscellaneous Functions +rl_getc2.4.8 Character Input +rl_getc_function2.3 Readline Variables +rl_gnu_readline_p2.3 Readline Variables +rl_ignore_completion_duplicates2.6.3 Completion Variables +rl_ignore_some_completions_function2.6.3 Completion Variables +rl_inhibit_completion2.6.3 Completion Variables +rl_initialize2.4.10 Utility Functions +rl_insert_completions2.6.2 Completion Functions +rl_insert_text2.4.7 Modifying Text +rl_instream2.3 Readline Variables +rl_invoking_keyseqs2.4.4 Associating Function Names and Bindings +rl_invoking_keyseqs_in_map2.4.4 Associating Function Names and Bindings +rl_kill_text2.4.7 Modifying Text +rl_last_func2.3 Readline Variables +rl_library_version2.3 Readline Variables +rl_line_buffer2.3 Readline Variables +rl_list_funmap_names2.4.4 Associating Function Names and Bindings +rl_macro_bind2.4.11 Miscellaneous Functions +rl_macro_dumper2.4.11 Miscellaneous Functions +rl_make_bare_keymap2.4.2 Selecting a Keymap +rl_make_keymap2.4.2 Selecting a Keymap +rl_mark2.3 Readline Variables +rl_message2.4.6 Redisplay +rl_modifying2.4.5 Allowing Undoing +rl_named_function2.4.4 Associating Function Names and Bindings +rl_num_chars_to_read2.3 Readline Variables +rl_numeric_arg2.3 Readline Variables +rl_on_new_line2.4.6 Redisplay +rl_on_new_line_with_prompt2.4.6 Redisplay +rl_outstream2.3 Readline Variables +rl_parse_and_bind2.4.3 Binding Keys +rl_pending_input2.3 Readline Variables +rl_point2.3 Readline Variables +rl_possible_completions2.6.2 Completion Functions +rl_pre_input_hook2.3 Readline Variables +rl_prep_term_function2.3 Readline Variables +rl_prep_terminal2.4.9 Terminal Management +rl_prompt2.3 Readline Variables +rl_push_macro_input2.4.7 Modifying Text +rl_read_init_file2.4.3 Binding Keys +rl_read_key2.4.8 Character Input +rl_readline_name2.3 Readline Variables +rl_readline_state2.3 Readline Variables +rl_readline_version2.3 Readline Variables +rl_redisplay2.4.6 Redisplay +rl_redisplay_function2.3 Readline Variables +rl_replace_line2.4.10 Utility Functions +rl_reset_after_signal2.5 Readline Signal Handling +rl_reset_line_state2.4.6 Redisplay +rl_reset_terminal2.4.9 Terminal Management +rl_resize_terminal2.5 Readline Signal Handling +rl_restore_prompt2.4.6 Redisplay +rl_save_prompt2.4.6 Redisplay +rl_set_key2.4.3 Binding Keys +rl_set_keyboard_input_timeout2.4.8 Character Input +rl_set_keymap2.4.2 Selecting a Keymap +rl_set_paren_blink_timeout2.4.11 Miscellaneous Functions +rl_set_prompt2.4.6 Redisplay +rl_set_screen_size2.5 Readline Signal Handling +rl_set_signals2.5 Readline Signal Handling +rl_show_char2.4.6 Redisplay +rl_special_prefixes2.6.3 Completion Variables +rl_startup_hook2.3 Readline Variables +rl_stuff_char2.4.8 Character Input +rl_terminal_name2.3 Readline Variables +rl_tty_set_default_bindings2.4.9 Terminal Management +rl_tty_unset_default_bindings2.4.9 Terminal Management +rl_unbind_command_in_map2.4.3 Binding Keys +rl_unbind_function_in_map2.4.3 Binding Keys +rl_unbind_key2.4.3 Binding Keys +rl_unbind_key_in_map2.4.3 Binding Keys +rl_username_completion_function2.6.2 Completion Functions +rl_variable_bind2.4.11 Miscellaneous Functions +rl_variable_dumper2.4.11 Miscellaneous Functions
S self-insert (a, b, A, 1, !, <small>...</small>)1.4.3 Commands For Changing Text self-insert (a, b, A, 1, !, <small>...</small>)1.4.3 Commands For Changing Text -set-mark (C-@)1.4.8 Some Miscellaneous Commands -set-mark (C-@)1.4.8 Some Miscellaneous Commands +set-mark (C-@)1.4.8 Some Miscellaneous Commands +set-mark (C-@)1.4.8 Some Miscellaneous Commands show-all-if-ambiguous1.3.1 Readline Init File Syntax show-all-if-unmodified1.3.1 Readline Init File Syntax -start-kbd-macro (C-x ()1.4.7 Keyboard Macros -start-kbd-macro (C-x ()1.4.7 Keyboard Macros +start-kbd-macro (C-x ()1.4.7 Keyboard Macros +start-kbd-macro (C-x ()1.4.7 Keyboard Macros
T tab-insert (M-TAB)1.4.3 Commands For Changing Text tab-insert (M-TAB)1.4.3 Commands For Changing Text -tilde-expand (M-~)1.4.8 Some Miscellaneous Commands -tilde-expand (M-~)1.4.8 Some Miscellaneous Commands +tilde-expand (M-~)1.4.8 Some Miscellaneous Commands +tilde-expand (M-~)1.4.8 Some Miscellaneous Commands transpose-chars (C-t)1.4.3 Commands For Changing Text transpose-chars (C-t)1.4.3 Commands For Changing Text transpose-words (M-t)1.4.3 Commands For Changing Text transpose-words (M-t)1.4.3 Commands For Changing Text
U -undo (C-_ or C-x C-u)1.4.8 Some Miscellaneous Commands -undo (C-_ or C-x C-u)1.4.8 Some Miscellaneous Commands -universal-argument ()1.4.5 Specifying Numeric Arguments -universal-argument ()1.4.5 Specifying Numeric Arguments +undo (C-_ or C-x C-u)1.4.8 Some Miscellaneous Commands +undo (C-_ or C-x C-u)1.4.8 Some Miscellaneous Commands +universal-argument ()1.4.5 Specifying Numeric Arguments +universal-argument ()1.4.5 Specifying Numeric Arguments +unix-filename-rubout ()1.4.4 Killing And Yanking +unix-filename-rubout ()1.4.4 Killing And Yanking unix-line-discard (C-u)1.4.4 Killing And Yanking unix-line-discard (C-u)1.4.4 Killing And Yanking unix-word-rubout (C-w)1.4.4 Killing And Yanking @@ -6198,19 +6259,19 @@ to permit their use in free software. upcase-word (M-u)1.4.3 Commands For Changing Text
V -vi-editing-mode (M-C-j)1.4.8 Some Miscellaneous Commands -vi-editing-mode (M-C-j)1.4.8 Some Miscellaneous Commands +vi-editing-mode (M-C-j)1.4.8 Some Miscellaneous Commands +vi-editing-mode (M-C-j)1.4.8 Some Miscellaneous Commands visible-stats1.3.1 Readline Init File Syntax
Y -yank (C-y)1.4.4 Killing And Yanking -yank (C-y)1.4.4 Killing And Yanking +yank (C-y)1.4.4 Killing And Yanking +yank (C-y)1.4.4 Killing And Yanking yank-last-arg (M-. or M-_)1.4.2 Commands For Manipulating The History yank-last-arg (M-. or M-_)1.4.2 Commands For Manipulating The History yank-nth-arg (M-C-y)1.4.2 Commands For Manipulating The History yank-nth-arg (M-C-y)1.4.2 Commands For Manipulating The History -yank-pop (M-y)1.4.4 Killing And Yanking -yank-pop (M-y)1.4.4 Killing And Yanking +yank-pop (M-y)1.4.4 Killing And Yanking +yank-pop (M-y)1.4.4 Killing And Yanking

Jump to:   _   @@ -6425,7 +6486,7 @@ to permit their use in free software. [ ? ]

About this document

-This document was generated by Chet Ramey on September, 22 2003 +This document was generated by Chet Ramey on July, 27 2004 using texi2html

@@ -6587,7 +6648,7 @@ the following structure:
This document was generated -by Chet Ramey on September, 22 2003 +by Chet Ramey on July, 27 2004 using texi2html diff --git a/lib/readline/doc/readline.info b/lib/readline/doc/readline.info index 264ebdfb..4f7b4ae7 100644 --- a/lib/readline/doc/readline.info +++ b/lib/readline/doc/readline.info @@ -1,12 +1,11 @@ This is readline.info, produced by makeinfo version 4.5 from ./rlman.texi. -This manual describes the GNU Readline Library (version 5.0, 19 -September 2003), a library which aids in the consistency of user -interface across discrete programs which provide a command line -interface. +This manual describes the GNU Readline Library (version 5.0, 28 January +2004), a library which aids in the consistency of user interface across +discrete programs which provide a command line interface. - Copyright (C) 1988-2003 Free Software Foundation, Inc. + Copyright (C) 1988-2004 Free Software Foundation, Inc. Permission is granted to make and distribute verbatim copies of this manual provided the copyright notice and this permission notice are @@ -1040,6 +1039,11 @@ Killing And Yanking Kill the word behind point, using white space as a word boundary. The killed text is saved on the kill-ring. +`unix-filename-rubout ()' + Kill the word behind point, using white space and the slash + character as the word boundaries. The killed text is saved on the + kill-ring. + `delete-horizontal-space ()' Delete all spaces and tabs around point. By default, this is unbound. @@ -1261,7 +1265,7 @@ the standard `vi' movement keys, move to previous history lines with aiding in the consitency of user interface across discrete programs that need to provide a command line interface. - Copyright (C) 1988-2002 Free Software Foundation, Inc. + Copyright (C) 1988-2004 Free Software Foundation, Inc. Permission is granted to make and distribute verbatim copies of this manual provided the copyright notice and this permission notice pare @@ -2141,7 +2145,12 @@ Redisplay primary prompt if the `rl_on_new_line_with_prompt()' function or `rl_already_prompted' variable is used. It returns the number of visible characters on the last line of the (possibly multi-line) - prompt. + prompt. Applications may indicate that the prompt contains + characters that take up no physical screen space when displayed by + bracketing a sequence of such characters with the special markers + `RL_PROMPT_START_IGNORE' and `RL_PROMPT_END_IGNORE' (declared in + `readline.h'. This may be used to embed terminal-specific escape + sequences in prompts. - Function: int rl_set_prompt (const char *prompt) Make Readline use PROMPT for subsequent redisplay. This calls @@ -2836,6 +2845,15 @@ Completion Variables `rl_complete_internal()'. The default list is the value of `rl_basic_word_break_characters'. + - Variable: rl_cpvfunc_t * rl_completion_word_break_hook + If non-zero, this is the address of a function to call when + Readline is deciding where to separate words for word completion. + It should return a character string like + `rl_completer_word_break_characters' to be used to perform the + current completion. The function may choose to set + `rl_completer_word_break_characters' itself. If the function + returns `NULL', `rl_completer_word_break_characters' is used. + - Variable: const char * rl_completer_quote_characters A list of characters which can be used to quote a substring of the line. Completion occurs on the entire substring, and within the @@ -2875,6 +2893,25 @@ Completion Variables set to 0 before any application-specific completion function is called, and may only be changed within such a function. + - Variable: int rl_completion_quote_character + When Readline is completing quoted text, as delimited by one of the + characters in RL_COMPLETER_QUOTE_CHARACTERS, it sets this variable + to the quoting character found. This is set before any + application-specific completion function is called. + + - Variable: int rl_completion_suppress_quote + If non-zero, Readline does not append a matching quote character + when performing completion on a quoted string. It is set to 0 + before any application-specific completion function is called, and + may only be changed within such a function. + + - Variable: int rl_completion_found_quote + When Readline is completing quoted text, it sets this variable to + a non-zero value if the word being completed contains or is + delimited by any quoting characters, including backslashes. This + is set before any application-specific completion function is + called. + - Variable: int rl_completion_mark_symlink_dirs If non-zero, a slash will be appended to completed filenames that are symbolic links to directory names, subject to the value of the @@ -3958,21 +3995,25 @@ Function and Variable Index * rl_clear_message: Redisplay. * rl_clear_pending_input: Character Input. * rl_clear_signals: Readline Signal Handling. -* rl_complete <1>: Completion Functions. -* rl_complete: How Completing Works. +* rl_complete <1>: How Completing Works. +* rl_complete: Completion Functions. * rl_complete_internal: Completion Functions. * rl_completer_quote_characters: Completion Variables. * rl_completer_word_break_characters: Completion Variables. * rl_completion_append_character: Completion Variables. * rl_completion_display_matches_hook: Completion Variables. -* rl_completion_entry_function <1>: How Completing Works. -* rl_completion_entry_function: Completion Variables. +* rl_completion_entry_function <1>: Completion Variables. +* rl_completion_entry_function: How Completing Works. +* rl_completion_found_quote: Completion Variables. * rl_completion_mark_symlink_dirs: Completion Variables. * rl_completion_matches: Completion Functions. * rl_completion_mode: Completion Functions. * rl_completion_query_items: Completion Variables. +* rl_completion_quote_character: Completion Variables. * rl_completion_suppress_append: Completion Variables. +* rl_completion_suppress_quote: Completion Variables. * rl_completion_type: Completion Variables. +* rl_completion_word_break_hook: Completion Variables. * rl_copy_keymap: Keymaps. * rl_copy_text: Modifying Text. * rl_crlf: Redisplay. @@ -4098,6 +4139,7 @@ Function and Variable Index * transpose-words (M-t): Commands For Text. * undo (C-_ or C-x C-u): Miscellaneous Commands. * universal-argument (): Numeric Arguments. +* unix-filename-rubout (): Commands For Killing. * unix-line-discard (C-u): Commands For Killing. * unix-word-rubout (C-w): Commands For Killing. * upcase-word (M-u): Commands For Text. @@ -4110,58 +4152,58 @@ Function and Variable Index  Tag Table: -Node: Top1298 -Node: Command Line Editing1939 -Node: Introduction and Notation2590 -Node: Readline Interaction4208 -Node: Readline Bare Essentials5395 -Node: Readline Movement Commands7176 -Node: Readline Killing Commands8133 -Node: Readline Arguments10043 -Node: Searching11079 -Node: Readline Init File13222 -Node: Readline Init File Syntax14283 -Node: Conditional Init Constructs25646 -Node: Sample Init File28171 -Node: Bindable Readline Commands31355 -Node: Commands For Moving32405 -Node: Commands For History33255 -Node: Commands For Text36114 -Node: Commands For Killing38829 -Node: Numeric Arguments40780 -Node: Commands For Completion41908 -Node: Keyboard Macros43441 -Node: Miscellaneous Commands44001 -Node: Readline vi Mode47351 -Node: Programming with GNU Readline49169 -Node: Basic Behavior50143 -Node: Custom Functions53573 -Node: Readline Typedefs55051 -Node: Function Writing56681 -Node: Readline Variables57889 -Node: Readline Convenience Functions67312 -Node: Function Naming68294 -Node: Keymaps69546 -Node: Binding Keys71302 -Node: Associating Function Names and Bindings75824 -Node: Allowing Undoing78069 -Node: Redisplay80604 -Node: Modifying Text83675 -Node: Character Input84904 -Node: Terminal Management86684 -Node: Utility Functions88103 -Node: Miscellaneous Functions90442 -Node: Alternate Interface92506 -Node: A Readline Example94651 -Node: Readline Signal Handling96588 -Node: Custom Completers102191 -Node: How Completing Works102906 -Node: Completion Functions106209 -Node: Completion Variables109764 -Node: A Short Completion Example120386 -Node: Copying This Manual132939 -Node: GNU Free Documentation License133179 -Node: Concept Index155573 -Node: Function and Variable Index156522 +Node: Top1296 +Node: Command Line Editing1937 +Node: Introduction and Notation2588 +Node: Readline Interaction4206 +Node: Readline Bare Essentials5393 +Node: Readline Movement Commands7174 +Node: Readline Killing Commands8131 +Node: Readline Arguments10041 +Node: Searching11077 +Node: Readline Init File13220 +Node: Readline Init File Syntax14281 +Node: Conditional Init Constructs25644 +Node: Sample Init File28169 +Node: Bindable Readline Commands31353 +Node: Commands For Moving32403 +Node: Commands For History33253 +Node: Commands For Text36112 +Node: Commands For Killing38827 +Node: Numeric Arguments40958 +Node: Commands For Completion42086 +Node: Keyboard Macros43619 +Node: Miscellaneous Commands44179 +Node: Readline vi Mode47529 +Node: Programming with GNU Readline49347 +Node: Basic Behavior50321 +Node: Custom Functions53751 +Node: Readline Typedefs55229 +Node: Function Writing56859 +Node: Readline Variables58067 +Node: Readline Convenience Functions67490 +Node: Function Naming68472 +Node: Keymaps69724 +Node: Binding Keys71480 +Node: Associating Function Names and Bindings76002 +Node: Allowing Undoing78247 +Node: Redisplay80782 +Node: Modifying Text84216 +Node: Character Input85445 +Node: Terminal Management87225 +Node: Utility Functions88644 +Node: Miscellaneous Functions90983 +Node: Alternate Interface93047 +Node: A Readline Example95192 +Node: Readline Signal Handling97129 +Node: Custom Completers102732 +Node: How Completing Works103447 +Node: Completion Functions106750 +Node: Completion Variables110305 +Node: A Short Completion Example122375 +Node: Copying This Manual134928 +Node: GNU Free Documentation License135168 +Node: Concept Index157562 +Node: Function and Variable Index158511  End Tag Table diff --git a/lib/readline/doc/readline.ps b/lib/readline/doc/readline.ps index d3718386..a6b031ac 100644 --- a/lib/readline/doc/readline.ps +++ b/lib/readline/doc/readline.ps @@ -1,14 +1,14 @@ %!PS-Adobe-2.0 %%Creator: dvips(k) 5.86 Copyright 1999 Radical Eye Software %%Title: readline.dvi -%%Pages: 72 +%%Pages: 74 %%PageOrder: Ascend %%BoundingBox: 0 0 596 842 %%EndComments %DVIPSWebPage: (www.radicaleye.com) %DVIPSCommandLine: dvips -D 300 -o readline.ps readline.dvi %DVIPSParameters: dpi=300, compressed -%DVIPSSource: TeX output 2003.09.22:0904 +%DVIPSSource: TeX output 2004.07.27:0931 %%BeginProcSet: texc.pro %! /TeXDict 300 dict def TeXDict begin/N{def}def/B{bind def}N/S{exch}N/X{S @@ -797,8 +797,8 @@ FC000F006C6C131E6C6C5BEC803890387FC078013F5B90381FE1E090380FF3C0ECFF806D 306C1560A26C15C06CEC01806C6CEB0300D800E0130E0178133C90381F01F0903807FFC0 D900FEC7FC272B7DA02E>13 D E %EndDVIPSBitmapFont -%DVIPSBitmapFont: Fr cmbx12 14.4 53 -/Fr 53 122 df<123C127FEAFF80A213C0A3127F123E1200A2EA0180A3EA0300A2120612 +%DVIPSBitmapFont: Fr cmbx12 14.4 54 +/Fr 54 122 df<123C127FEAFF80A213C0A3127F123E1200A2EA0180A3EA0300A2120612 0E5A5A12100A157B8813>44 D<121C127FA2EAFF80A3EA7F00A2121C09097B8813>46 D<130E131E137EEA07FE12FFA212F81200B3ABB512FEA317277BA622>49 DII65 DI<91387FE003903907FFFC07011FEBFF0F90397FF00F -9F9039FF0001FFD801FC7F4848147F4848143F4848141F485A160F485A1607127FA290C9 -FC5AA97E7F1607123FA26C7E160E6C7E6C6C141C6C6C143C6C6C14786CB4EB01F090397F -F007C0011FB512800107EBFE009038007FF028297CA831>IIII<91387FE0 -03903907FFFC07011FEBFF0F90397FF00F9F9039FF0001FFD801FC7F4848804848804848 -80485A82485A82127FA290CAFC5AA892B512F87E7F03001300123FA26C7EA26C7E6C7E6C -7E6C7E6CB45B90387FF007011FB5129F0107EBFE0F9039007FF0032D297CA835>I -II75 DII -III< -ECFFC0010F13FC90383FC0FF9039FE001FC048486D7ED803F0EB03F000078148486D7E48 -486D7EA24848147FA2007F1680A290C8123FA24816C0AA6C16806D147FA2003F1600A26C -6C14FE143E3A0FE07F81FC00079038C1C1F83A03F18063F0D801F9EB67E0D800FFEB3FC0 -90263FC07FC7FC90380FFFFC01004913C0EC003C811601ED1F8316FF6F1380A21700816F -5A6F5A6F5A2A357CA833>II<9038FF80600003EBF0E0 -000F13F8381F80FD383F001F003E1307481303A200FC1301A214007EA26C140013C0EA7F -FCEBFFE06C13F86C13FE80000714806C14C0C6FC010F13E0EB007FEC1FF0140F140700E0 -1303A46C14E0A26C13076C14C0B4EB0F80EBE03F39E3FFFE0000E15B38C01FF01C297CA8 -25>I<007FB71280A39039807F807FD87C00140F00781507A20070150300F016C0A24815 -01A5C791C7FCB3A490B612C0A32A287EA72F>IIII89 +>I<1238123E003FB512F0A34814E015C0158015003870000EA25C485B5C5CC6485AA249 +5A130791C7FC5B5B131E133EA2137E137CA213FCA41201A76C5A13701C297CA822>I65 DI<91387FE003903907FFFC07011FEBFF0F90397FF00F9F9039 +FF0001FFD801FC7F4848147F4848143F4848141F485A160F485A1607127FA290C9FC5AA9 +7E7F1607123FA26C7E160E6C7E6C6C141C6C6C143C6C6C14786CB4EB01F090397FF007C0 +011FB512800107EBFE009038007FF028297CA831>IIII<91387FE0039039 +07FFFC07011FEBFF0F90397FF00F9F9039FF0001FFD801FC7F484880484880484880485A +82485A82127FA290CAFC5AA892B512F87E7F03001300123FA26C7EA26C7E6C7E6C7E6C7E +6CB45B90387FF007011FB5129F0107EBFE0F9039007FF0032D297CA835>III75 DIIIIIII<9038FF80600003EBF0E0000F13 +F8381F80FD383F001F003E1307481303A200FC1301A214007EA26C140013C0EA7FFCEBFF +E06C13F86C13FE80000714806C14C0C6FC010F13E0EB007FEC1FF0140F140700E01303A4 +6C14E0A26C13076C14C0B4EB0F80EBE03F39E3FFFE0000E15B38C01FF01C297CA825>I< +007FB71280A39039807F807FD87C00140F00781507A20070150300F016C0A2481501A5C7 +91C7FCB3A490B612C0A32A287EA72F>IIII89 D<3803FF80000F13F0381F01FC383F80FE147F801580EA1F00C7FCA4EB3FFF3801FC3FEA 0FE0EA1F80EA3F00127E5AA4145F007E13DF393F839FFC381FFE0F3803FC031E1B7E9A21 >97 D) -195 367 y(#include)g()195 411 y(#include)g()195 455 y(#include)g()195 -498 y(#include)g()195 585 y(#include)g()195 629 y(#include)g()195 716 y(extern)g(char)h(*xmalloc)f(\(\);)195 -803 y(/*)i(The)f(names)g(of)h(functions)d(that)i(actually)f(do)h(the)h -(manipulat)o(ion)o(.)d(*/)195 847 y(int)i(com_list)f(__P\(\(char)f -(*\)\);)195 890 y(int)i(com_view)f(__P\(\(char)f(*\)\);)195 -934 y(int)i(com_rename)e(__P\(\(char)g(*\)\);)195 978 -y(int)i(com_stat)f(__P\(\(char)f(*\)\);)195 1021 y(int)i(com_pwd)f -(__P\(\(char)f(*\)\);)195 1065 y(int)i(com_delete)e(__P\(\(char)g -(*\)\);)195 1108 y(int)i(com_help)f(__P\(\(char)f(*\)\);)195 -1152 y(int)i(com_cd)g(__P\(\(char)e(*\)\);)195 1196 y(int)i(com_quit)f -(__P\(\(char)f(*\)\);)195 1283 y(/*)j(A)g(structure)d(which)i(contains) -e(information)g(on)j(the)f(commands)f(this)h(program)254 -1326 y(can)g(understand)o(.)f(*/)195 1413 y(typedef)g(struct)g({)234 -1457 y(char)h(*name;)g(/*)g(User)g(printable)f(name)h(of)h(the)f -(function.)e(*/)234 1501 y(rl_icpfunc)o(_t)g(*func;)h(/*)i(Function)e -(to)i(call)f(to)h(do)f(the)h(job.)f(*/)234 1544 y(char)g(*doc;)g(/*)h -(Documenta)o(tio)o(n)d(for)j(this)f(function.)36 b(*/)195 -1588 y(})19 b(COMMAND;)195 1675 y(COMMAND)e(commands[)o(])g(=)i({)234 -1719 y({)g("cd",)f(com_cd,)f("Change)g(to)i(directory)d(DIR")i(},)234 -1762 y({)h("delete",)e(com_dele)o(te,)f("Delete)h(FILE")h(},)234 -1806 y({)h("help",)e(com_help,)f("Display)h(this)h(text")g(},)234 -1849 y({)h("?",)g(com_help)o(,)e("Synonym)f(for)j(`help'")e(},)234 -1893 y({)i("list",)e(com_list,)f("List)i(files)g(in)h(DIR")f(},)234 +(Readline)843 b(47)1685 149 y([V)l(ariable])-1799 b Fg(int)20 +b Ff(rl)p 216 149 18 3 v 25 w(inhibit)p 404 149 V 28 +w(completion)195 204 y Ft(If)14 b(this)h(v)m(ariable)g(is)g(non-zero,)f +(completion)i(is)e(inhibited.)22 b(The)15 b(completion)g(c)o(haracter)e +(will)j(b)q(e)195 259 y(inserted)g(as)f(an)o(y)g(other)g(b)q(ound)h(to) +e Fs(self-insert)p Ft(.)75 371 y Fh(2.6.4)30 b(A)21 b(Short)f +(Completion)g(Example)137 493 y Ft(Here)11 b(is)f(a)g(small)h +(application)h(demonstrating)e(the)g(use)h(of)e(the)i(GNU)f(Readline)h +(library)l(.)19 b(It)11 b(is)f(called)75 548 y Fs(fileman)p +Ft(,)17 b(and)h(the)g(source)g(co)q(de)g(resides)h(in)f(`)p +Fs(examples/fileman.c)p Ft('.)25 b(This)18 b(sample)g(application)75 +603 y(pro)o(vides)c(completion)g(of)e(command)h(names,)g(line)i +(editing)g(features,)d(and)i(access)f(to)f(the)h(history)h(list.)p +eop +%%Page: 48 52 +48 51 bop 75 -58 a Ft(48)1299 b(GNU)15 b(Readline)h(Library)195 +149 y Fd(/*)j(fileman.c)d(--)j(A)g(tiny)f(applicatio)o(n)e(which)i +(demonstrat)o(es)e(how)j(to)f(use)h(the)254 193 y(GNU)f(Readline)f +(library.)36 b(This)18 b(applicatio)o(n)e(interactive)o(ly)g(allows)h +(users)254 237 y(to)i(manipulat)o(e)d(files)i(and)h(their)e(modes.)h +(*/)195 324 y(#include)f()195 367 y(#include)g()195 411 y(#include)g()195 +455 y(#include)g()195 498 y(#include)g()195 585 y(#include)g()195 +629 y(#include)g()195 +716 y(extern)g(char)h(*xmalloc)f(\(\);)195 803 y(/*)i(The)f(names)g(of) +h(functions)d(that)i(actually)f(do)h(the)h(manipulat)o(ion)o(.)d(*/)195 +847 y(int)i(com_list)f(__P\(\(char)f(*\)\);)195 890 y(int)i(com_view)f +(__P\(\(char)f(*\)\);)195 934 y(int)i(com_rename)e(__P\(\(char)g +(*\)\);)195 978 y(int)i(com_stat)f(__P\(\(char)f(*\)\);)195 +1021 y(int)i(com_pwd)f(__P\(\(char)f(*\)\);)195 1065 +y(int)i(com_delete)e(__P\(\(char)g(*\)\);)195 1108 y(int)i(com_help)f +(__P\(\(char)f(*\)\);)195 1152 y(int)i(com_cd)g(__P\(\(char)e(*\)\);) +195 1196 y(int)i(com_quit)f(__P\(\(char)f(*\)\);)195 +1283 y(/*)j(A)g(structure)d(which)i(contains)e(information)g(on)j(the)f +(commands)f(this)h(program)254 1326 y(can)g(understand)o(.)f(*/)195 +1413 y(typedef)g(struct)g({)234 1457 y(char)h(*name;)g(/*)g(User)g +(printable)f(name)h(of)h(the)f(function.)e(*/)234 1501 +y(rl_icpfunc)o(_t)g(*func;)h(/*)i(Function)e(to)i(call)f(to)h(do)f(the) +h(job.)f(*/)234 1544 y(char)g(*doc;)g(/*)h(Documenta)o(tio)o(n)d(for)j +(this)f(function.)36 b(*/)195 1588 y(})19 b(COMMAND;)195 +1675 y(COMMAND)e(commands[)o(])g(=)i({)234 1719 y({)g("cd",)f(com_cd,)f +("Change)g(to)i(directory)d(DIR")i(},)234 1762 y({)h("delete",)e +(com_dele)o(te,)f("Delete)h(FILE")h(},)234 1806 y({)h("help",)e +(com_help,)f("Display)h(this)h(text")g(},)234 1849 y({)h("?",)g +(com_help)o(,)e("Synonym)f(for)j(`help'")e(},)234 1893 +y({)i("list",)e(com_list,)f("List)i(files)g(in)h(DIR")f(},)234 1936 y({)h("ls",)f(com_list,)e("Synonym)h(for)h(`list'")f(},)234 1980 y({)i("pwd",)f(com_pwd,)e("Print)i(the)g(current)f(working)g (directory)o(")g(},)234 2024 y({)i("quit",)e(com_quit,)f("Quit)i(using) @@ -4507,37 +4565,38 @@ y(/*)j(The)f(name)g(of)h(this)f(program,)f(as)i(taken)e(from)h (argv[0].)f(*/)195 2547 y(char)h(*progname;)195 2634 y(/*)h(When)f(non-zero,)e(this)i(means)g(the)g(user)g(is)h(done)f (using)g(this)g(program.)f(*/)p eop -%%Page: 48 52 -48 51 bop 75 -58 a Ft(48)1299 b(GNU)15 b(Readline)h(Library)195 -149 y Fd(int)i(done;)195 237 y(char)g(*)195 280 y(dupstr)f(\(s\))293 -324 y(int)i(s;)195 367 y({)234 411 y(char)f(*r;)234 498 -y(r)h(=)h(xmalloc)d(\(strlen)f(\(s\))j(+)g(1\);)234 542 -y(strcpy)f(\(r,)g(s\);)234 585 y(return)g(\(r\);)195 -629 y(})195 716 y(main)g(\(argc,)f(argv\))293 760 y(int)i(argc;)293 -803 y(char)f(**argv;)195 847 y({)234 890 y(char)g(*line,)g(*s;)234 -978 y(progname)f(=)i(argv[0];)234 1065 y(initialize)o(_re)o(ad)o(lin)o -(e)d(\(\);)j(/*)g(Bind)f(our)g(completer.)e(*/)234 1152 -y(/*)j(Loop)f(reading)f(and)h(executing)f(lines)g(until)h(the)g(user)h -(quits.)e(*/)234 1196 y(for)i(\()g(;)g(done)f(==)h(0;)g(\))273 -1239 y({)313 1283 y(line)f(=)h(readline)d(\("FileMan:)g("\);)313 -1370 y(if)j(\(!line\))352 1413 y(break;)313 1501 y(/*)g(Remove)e -(leading)g(and)h(trailing)f(whitespac)o(e)f(from)j(the)f(line.)372 -1544 y(Then,)f(if)i(there)f(is)h(anything)d(left,)i(add)g(it)h(to)g -(the)f(history)f(list)372 1588 y(and)h(execute)f(it.)h(*/)313 -1631 y(s)h(=)g(stripwhite)d(\(line\);)313 1719 y(if)j(\(*s\))352 -1762 y({)391 1806 y(add_histor)o(y)d(\(s\);)391 1849 -y(execute_li)o(ne)g(\(s\);)352 1893 y(})313 1980 y(free)i(\(line\);)273 -2024 y(})234 2067 y(exit)g(\(0\);)195 2111 y(})195 2198 -y(/*)h(Execute)e(a)i(command)e(line.)h(*/)195 2242 y(int)195 -2285 y(execute_li)o(ne)e(\(line\))293 2329 y(char)i(*line;)195 -2372 y({)234 2416 y(register)f(int)h(i;)234 2460 y(COMMAND)f(*command;) -234 2503 y(char)h(*word;)234 2590 y(/*)h(Isolate)e(the)h(command)f -(word.)h(*/)234 2634 y(i)h(=)h(0;)p eop %%Page: 49 53 49 52 bop 75 -58 a Ft(Chapter)15 b(2:)k(Programming)c(with)g(GNU)g -(Readline)843 b(49)234 149 y Fd(while)18 b(\(line[i])e(&&)j(whitespace) -d(\(line[i]\)\))273 193 y(i++;)234 237 y(word)i(=)i(line)e(+)h(i;)234 -324 y(while)f(\(line[i])e(&&)j(!whitespac)o(e)e(\(line[i]\))o(\))273 +(Readline)843 b(49)195 149 y Fd(int)18 b(done;)195 237 +y(char)g(*)195 280 y(dupstr)f(\(s\))293 324 y(int)i(s;)195 +367 y({)234 411 y(char)f(*r;)234 498 y(r)h(=)h(xmalloc)d(\(strlen)f +(\(s\))j(+)g(1\);)234 542 y(strcpy)f(\(r,)g(s\);)234 +585 y(return)g(\(r\);)195 629 y(})195 716 y(main)g(\(argc,)f(argv\))293 +760 y(int)i(argc;)293 803 y(char)f(**argv;)195 847 y({)234 +890 y(char)g(*line,)g(*s;)234 978 y(progname)f(=)i(argv[0];)234 +1065 y(initialize)o(_re)o(ad)o(lin)o(e)d(\(\);)j(/*)g(Bind)f(our)g +(completer.)e(*/)234 1152 y(/*)j(Loop)f(reading)f(and)h(executing)f +(lines)g(until)h(the)g(user)h(quits.)e(*/)234 1196 y(for)i(\()g(;)g +(done)f(==)h(0;)g(\))273 1239 y({)313 1283 y(line)f(=)h(readline)d +(\("FileMan:)g("\);)313 1370 y(if)j(\(!line\))352 1413 +y(break;)313 1501 y(/*)g(Remove)e(leading)g(and)h(trailing)f(whitespac) +o(e)f(from)j(the)f(line.)372 1544 y(Then,)f(if)i(there)f(is)h(anything) +d(left,)i(add)g(it)h(to)g(the)f(history)f(list)372 1588 +y(and)h(execute)f(it.)h(*/)313 1631 y(s)h(=)g(stripwhite)d(\(line\);) +313 1719 y(if)j(\(*s\))352 1762 y({)391 1806 y(add_histor)o(y)d(\(s\);) +391 1849 y(execute_li)o(ne)g(\(s\);)352 1893 y(})313 +1980 y(free)i(\(line\);)273 2024 y(})234 2067 y(exit)g(\(0\);)195 +2111 y(})195 2198 y(/*)h(Execute)e(a)i(command)e(line.)h(*/)195 +2242 y(int)195 2285 y(execute_li)o(ne)e(\(line\))293 +2329 y(char)i(*line;)195 2372 y({)234 2416 y(register)f(int)h(i;)234 +2460 y(COMMAND)f(*command;)234 2503 y(char)h(*word;)234 +2590 y(/*)h(Isolate)e(the)h(command)f(word.)h(*/)234 +2634 y(i)h(=)h(0;)p eop +%%Page: 50 54 +50 53 bop 75 -58 a Ft(50)1299 b(GNU)15 b(Readline)h(Library)234 +149 y Fd(while)i(\(line[i])e(&&)j(whitespace)d(\(line[i]\)\))273 +193 y(i++;)234 237 y(word)i(=)i(line)e(+)h(i;)234 324 +y(while)f(\(line[i])e(&&)j(!whitespac)o(e)e(\(line[i]\))o(\))273 367 y(i++;)234 455 y(if)i(\(line[i]\))273 498 y(line[i++])e(=)i('\\0';) 234 585 y(command)e(=)i(find_comma)o(nd)d(\(word\);)234 672 y(if)j(\(!command\))273 716 y({)313 760 y(fprintf)e(\(stderr,)f @@ -4565,43 +4624,44 @@ y(char)i(*string;)195 2242 y({)234 2285 y(register)f(char)h(*s,)g(*t;) 273 2416 y(;)234 2503 y(if)h(\(*s)g(==)f(0\))273 2547 y(return)g(\(s\);)234 2634 y(t)h(=)h(s)f(+)g(strlen)e(\(s\))i(-)g(1;)p eop -%%Page: 50 54 -50 53 bop 75 -58 a Ft(50)1299 b(GNU)15 b(Readline)h(Library)234 -149 y Fd(while)i(\(t)h(>)g(s)g(&&)g(whitespace)d(\(*t\)\))273 -193 y(t--;)234 237 y(*++t)i(=)i('\\0';)234 324 y(return)e(s;)195 -367 y(})195 455 y(/*)h(*********)o(***)o(**)o(***)o(**)o(***)o(***)o -(**)o(***)o(**)o(***)o(***)o(**)o(***)o(**)o(***)o(***)o(**)o(***)o(**) -o(***)o(***)d(*/)195 498 y(/*)1294 b(*/)195 542 y(/*)352 -b(Interface)16 b(to)j(Readline)e(Completio)o(n)311 b(*/)195 -585 y(/*)1294 b(*/)195 629 y(/*)19 b(*********)o(***)o(**)o(***)o(**)o -(***)o(***)o(**)o(***)o(**)o(***)o(***)o(**)o(***)o(**)o(***)o(***)o -(**)o(***)o(**)o(***)o(***)d(*/)195 716 y(char)i(*command_g)o(en)o(era) -o(to)o(r)f(__P\(\(cons)o(t)f(char)j(*,)f(int\)\);)195 -760 y(char)g(**fileman_)o(co)o(mpl)o(et)o(ion)e(__P\(\(cons)o(t)h(char) -h(*,)h(int,)f(int\)\);)195 847 y(/*)h(Tell)f(the)g(GNU)h(Readline)d -(library)h(how)i(to)g(complete)o(.)36 b(We)19 b(want)f(to)h(try)g(to) -254 890 y(complete)d(on)j(command)e(names)h(if)h(this)f(is)h(the)f -(first)g(word)g(in)h(the)f(line,)g(or)254 934 y(on)h(filenames)d(if)j -(not.)f(*/)195 978 y(initialize)o(_r)o(ead)o(li)o(ne)e(\(\))195 -1021 y({)234 1065 y(/*)j(Allow)f(condition)o(al)e(parsing)h(of)i(the)f -(~/.inputrc)e(file.)i(*/)234 1108 y(rl_readlin)o(e_n)o(am)o(e)f(=)i -("FileMan")o(;)234 1196 y(/*)g(Tell)f(the)h(complete)o(r)e(that)h(we)h -(want)f(a)h(crack)f(first.)f(*/)234 1239 y(rl_attempt)o(ed_)o(co)o(mpl) -o(et)o(ion)o(_fu)o(nc)o(tio)o(n)f(=)k(fileman_c)o(om)o(ple)o(tio)o(n;) -195 1283 y(})195 1370 y(/*)f(Attempt)e(to)i(complete)d(on)j(the)f -(contents)f(of)i(TEXT.)37 b(START)18 b(and)g(END)254 -1413 y(bound)g(the)g(region)f(of)i(rl_line_bu)o(ff)o(er)d(that)i -(contains)f(the)h(word)g(to)254 1457 y(complete.)36 b(TEXT)18 -b(is)g(the)h(word)f(to)h(complete.)36 b(We)18 b(can)h(use)f(the)h -(entire)254 1501 y(contents)d(of)j(rl_line_bu)o(ffe)o(r)d(in)j(case)f -(we)h(want)f(to)h(do)g(some)f(simple)254 1544 y(parsing.)36 -b(Returnthe)16 b(array)i(of)h(matches,)d(or)j(NULL)f(if)h(there)f -(aren't)f(any.)h(*/)195 1588 y(char)g(**)195 1631 y(fileman_co)o(mp)o -(let)o(io)o(n)f(\(text,)g(start,)g(end\))293 1675 y(const)h(char)g -(*text;)293 1719 y(int)h(start,)e(end;)195 1762 y({)234 -1806 y(char)h(**matches;)234 1893 y(matches)f(=)i(\(char)f(**\)NULL;) -234 1980 y(/*)h(If)g(this)f(word)g(is)h(at)g(the)f(start)g(of)h(the)f -(line,)g(then)g(it)h(is)g(a)g(command)293 2024 y(to)g(complete.)36 +%%Page: 51 55 +51 54 bop 75 -58 a Ft(Chapter)15 b(2:)k(Programming)c(with)g(GNU)g +(Readline)843 b(51)234 149 y Fd(while)18 b(\(t)h(>)g(s)g(&&)g +(whitespace)d(\(*t\)\))273 193 y(t--;)234 237 y(*++t)i(=)i('\\0';)234 +324 y(return)e(s;)195 367 y(})195 455 y(/*)h(*********)o(***)o(**)o +(***)o(**)o(***)o(***)o(**)o(***)o(**)o(***)o(***)o(**)o(***)o(**)o +(***)o(***)o(**)o(***)o(**)o(***)o(***)d(*/)195 498 y(/*)1294 +b(*/)195 542 y(/*)352 b(Interface)16 b(to)j(Readline)e(Completio)o(n) +311 b(*/)195 585 y(/*)1294 b(*/)195 629 y(/*)19 b(*********)o(***)o(**) +o(***)o(**)o(***)o(***)o(**)o(***)o(**)o(***)o(***)o(**)o(***)o(**)o +(***)o(***)o(**)o(***)o(**)o(***)o(***)d(*/)195 716 y(char)i +(*command_g)o(en)o(era)o(to)o(r)f(__P\(\(cons)o(t)f(char)j(*,)f +(int\)\);)195 760 y(char)g(**fileman_)o(co)o(mpl)o(et)o(ion)e +(__P\(\(cons)o(t)h(char)h(*,)h(int,)f(int\)\);)195 847 +y(/*)h(Tell)f(the)g(GNU)h(Readline)d(library)h(how)i(to)g(complete)o(.) +36 b(We)19 b(want)f(to)h(try)g(to)254 890 y(complete)d(on)j(command)e +(names)h(if)h(this)f(is)h(the)f(first)g(word)g(in)h(the)f(line,)g(or) +254 934 y(on)h(filenames)d(if)j(not.)f(*/)195 978 y(initialize)o(_r)o +(ead)o(li)o(ne)e(\(\))195 1021 y({)234 1065 y(/*)j(Allow)f(condition)o +(al)e(parsing)h(of)i(the)f(~/.inputrc)e(file.)i(*/)234 +1108 y(rl_readlin)o(e_n)o(am)o(e)f(=)i("FileMan")o(;)234 +1196 y(/*)g(Tell)f(the)h(complete)o(r)e(that)h(we)h(want)f(a)h(crack)f +(first.)f(*/)234 1239 y(rl_attempt)o(ed_)o(co)o(mpl)o(et)o(ion)o(_fu)o +(nc)o(tio)o(n)f(=)k(fileman_c)o(om)o(ple)o(tio)o(n;)195 +1283 y(})195 1370 y(/*)f(Attempt)e(to)i(complete)d(on)j(the)f(contents) +f(of)i(TEXT.)37 b(START)18 b(and)g(END)254 1413 y(bound)g(the)g(region) +f(of)i(rl_line_bu)o(ff)o(er)d(that)i(contains)f(the)h(word)g(to)254 +1457 y(complete.)36 b(TEXT)18 b(is)g(the)h(word)f(to)h(complete.)36 +b(We)18 b(can)h(use)f(the)h(entire)254 1501 y(contents)d(of)j +(rl_line_bu)o(ffe)o(r)d(in)j(case)f(we)h(want)f(to)h(do)g(some)f +(simple)254 1544 y(parsing.)36 b(Returnthe)16 b(array)i(of)h(matches,)d +(or)j(NULL)f(if)h(there)f(aren't)f(any.)h(*/)195 1588 +y(char)g(**)195 1631 y(fileman_co)o(mp)o(let)o(io)o(n)f(\(text,)g +(start,)g(end\))293 1675 y(const)h(char)g(*text;)293 +1719 y(int)h(start,)e(end;)195 1762 y({)234 1806 y(char)h(**matches;) +234 1893 y(matches)f(=)i(\(char)f(**\)NULL;)234 1980 +y(/*)h(If)g(this)f(word)g(is)h(at)g(the)f(start)g(of)h(the)f(line,)g +(then)g(it)h(is)g(a)g(command)293 2024 y(to)g(complete.)36 b(Otherwise)16 b(it)j(is)f(the)h(name)f(of)h(a)g(file)f(in)h(the)f (current)293 2067 y(directory.)e(*/)234 2111 y(if)j(\(start)e(==)i(0\)) 273 2154 y(matches)e(=)j(rl_compl)o(eti)o(on_)o(ma)o(tch)o(es)c @@ -4614,14 +4674,14 @@ b(lets)g(us)254 2416 y(know)g(whether)f(to)i(start)e(from)h(scratch;)f 2503 y(char)g(*)195 2547 y(command_ge)o(ne)o(rat)o(or)e(\(text,)h (state\))293 2590 y(const)h(char)g(*text;)293 2634 y(int)h(state;)p eop -%%Page: 51 55 -51 54 bop 75 -58 a Ft(Chapter)15 b(2:)k(Programming)c(with)g(GNU)g -(Readline)843 b(51)195 149 y Fd({)234 193 y(static)18 -b(int)g(list_inde)o(x,)e(len;)234 237 y(char)i(*name;)234 -324 y(/*)h(If)g(this)f(is)h(a)g(new)f(word)h(to)f(complete,)f(initiali) -o(ze)f(now.)38 b(This)293 367 y(includes)17 b(saving)g(the)h(length)g -(of)g(TEXT)h(for)f(efficiency)o(,)e(and)293 411 y(initializi)o(ng)g -(the)i(index)g(variable)f(to)i(0.)f(*/)234 455 y(if)h(\(!state\))273 +%%Page: 52 56 +52 55 bop 75 -58 a Ft(52)1299 b(GNU)15 b(Readline)h(Library)195 +149 y Fd({)234 193 y(static)i(int)g(list_inde)o(x,)e(len;)234 +237 y(char)i(*name;)234 324 y(/*)h(If)g(this)f(is)h(a)g(new)f(word)h +(to)f(complete,)f(initiali)o(ze)f(now.)38 b(This)293 +367 y(includes)17 b(saving)g(the)h(length)g(of)g(TEXT)h(for)f +(efficiency)o(,)e(and)293 411 y(initializi)o(ng)g(the)i(index)g +(variable)f(to)i(0.)f(*/)234 455 y(if)h(\(!state\))273 498 y({)313 542 y(list_inde)o(x)d(=)k(0;)313 585 y(len)e(=)h(strlen)f (\(text\);)273 629 y(})234 716 y(/*)h(Return)e(the)i(next)f(name)g (which)g(partially)e(matches)h(from)h(the)293 760 y(command)f(list.)h @@ -4650,17 +4710,17 @@ b(This)18 b(is)h(for)g(the)f(LIST,)g(VIEW)g(and)g(RENAME)254 (arg\)\))273 2416 y(return)h(1;)234 2503 y(sprintf)f(\(syscom,)g("more) g(\045s",)h(arg\);)234 2547 y(return)g(\(system)e(\(syscom\)\);)195 2590 y(})p eop -%%Page: 52 56 -52 55 bop 75 -58 a Ft(52)1299 b(GNU)15 b(Readline)h(Library)195 -149 y Fd(com_rename)g(\(arg\))293 193 y(char)i(*arg;)195 -237 y({)234 280 y(too_danger)o(ous)e(\("rename")o(\);)234 -324 y(return)i(\(1\);)195 367 y(})195 455 y(com_stat)f(\(arg\))293 -498 y(char)h(*arg;)195 542 y({)234 585 y(struct)g(stat)g(finfo;)234 -672 y(if)h(\(!valid_ar)o(gu)o(men)o(t)d(\("stat",)h(arg\)\))273 -716 y(return)h(\(1\);)234 803 y(if)h(\(stat)f(\(arg,)f(&finfo\))g(==)i -(-1\))273 847 y({)313 890 y(perror)e(\(arg\);)313 934 -y(return)g(\(1\);)273 978 y(})234 1065 y(printf)h(\("Statis)o(tic)o(s)e -(for)j(`\045s':\\n",)d(arg\);)234 1152 y(printf)i(\("\045s)g(has)g +%%Page: 53 57 +53 56 bop 75 -58 a Ft(Chapter)15 b(2:)k(Programming)c(with)g(GNU)g +(Readline)843 b(53)195 149 y Fd(com_rename)16 b(\(arg\))293 +193 y(char)i(*arg;)195 237 y({)234 280 y(too_danger)o(ous)e(\("rename") +o(\);)234 324 y(return)i(\(1\);)195 367 y(})195 455 y(com_stat)f +(\(arg\))293 498 y(char)h(*arg;)195 542 y({)234 585 y(struct)g(stat)g +(finfo;)234 672 y(if)h(\(!valid_ar)o(gu)o(men)o(t)d(\("stat",)h +(arg\)\))273 716 y(return)h(\(1\);)234 803 y(if)h(\(stat)f(\(arg,)f +(&finfo\))g(==)i(-1\))273 847 y({)313 890 y(perror)e(\(arg\);)313 +934 y(return)g(\(1\);)273 978 y(})234 1065 y(printf)h(\("Statis)o(tic)o +(s)e(for)j(`\045s':\\n",)d(arg\);)234 1152 y(printf)i(\("\045s)g(has)g (\045d)h(link\045s,)e(and)h(is)h(\045d)g(byte\045s)e(in)i(length.\\n")o (,)d(arg,)391 1196 y(finfo.st_n)o(li)o(nk,)391 1239 y(\(finfo.st_)o(nl) o(ink)g(==)j(1\))g(?)g("")g(:)g("s",)391 1283 y(finfo.st_s)o(iz)o(e,) @@ -4683,17 +4743,16 @@ y(})195 1936 y(/*)h(Print)f(out)g(help)g(for)g(ARG,)h(or)f(for)h(all)f 2460 y(printf)e(\("\045s\\t\\t\045s.)o(\\n)o(",)f(commands[i)o(].n)o (am)o(e,)g(commands[i)o(].d)o(oc\))o(;)391 2503 y(printed++;)352 2547 y(})273 2590 y(})p eop -%%Page: 53 57 -53 56 bop 75 -58 a Ft(Chapter)15 b(2:)k(Programming)c(with)g(GNU)g -(Readline)843 b(53)234 149 y Fd(if)19 b(\(!printed\))273 -193 y({)313 237 y(printf)e(\("No)h(commands)f(match)g(`\045s'.)38 -b(Possibil)o(tie)o(s)17 b(are:\\n",)f(arg\);)313 324 -y(for)i(\(i)h(=)g(0;)g(commands[i)o(].)o(nam)o(e;)d(i++\))352 -367 y({)391 411 y(/*)j(Print)f(in)g(six)h(columns.)d(*/)391 -455 y(if)j(\(printed)d(==)j(6\))430 498 y({)470 542 y(printed)d(=)k(0;) -470 585 y(printf)d(\("\\n"\);)430 629 y(})391 716 y(printf)g -(\("\045s\\t",)g(commands[)o(i].)o(nam)o(e\))o(;)391 -760 y(printed++;)352 803 y(})313 890 y(if)i(\(printed)o(\))352 +%%Page: 54 58 +54 57 bop 75 -58 a Ft(54)1299 b(GNU)15 b(Readline)h(Library)234 +149 y Fd(if)j(\(!printed\))273 193 y({)313 237 y(printf)e(\("No)h +(commands)f(match)g(`\045s'.)38 b(Possibil)o(tie)o(s)17 +b(are:\\n",)f(arg\);)313 324 y(for)i(\(i)h(=)g(0;)g(commands[i)o(].)o +(nam)o(e;)d(i++\))352 367 y({)391 411 y(/*)j(Print)f(in)g(six)h +(columns.)d(*/)391 455 y(if)j(\(printed)d(==)j(6\))430 +498 y({)470 542 y(printed)d(=)k(0;)470 585 y(printf)d(\("\\n"\);)430 +629 y(})391 716 y(printf)g(\("\045s\\t",)g(commands[)o(i].)o(nam)o(e\)) +o(;)391 760 y(printed++;)352 803 y(})313 890 y(if)i(\(printed)o(\))352 934 y(printf)e(\("\\n"\);)273 978 y(})234 1021 y(return)h(\(0\);)195 1065 y(})195 1152 y(/*)h(Change)e(to)i(the)f(directory)f(ARG.)h(*/)195 1196 y(com_cd)f(\(arg\))293 1239 y(char)h(*arg;)195 1283 @@ -4711,14 +4770,15 @@ y({)234 1326 y(if)h(\(chdir)e(\(arg\))h(==)h(-1\))273 y(})195 2503 y(/*)h(The)f(user)g(wishes)g(to)g(quit)h(using)e(this)h (program.)36 b(Just)19 b(set)f(DONE)254 2547 y(non-zero.)e(*/)195 2590 y(com_quit)h(\(arg\))293 2634 y(char)h(*arg;)p eop -%%Page: 54 58 -54 57 bop 75 -58 a Ft(54)1299 b(GNU)15 b(Readline)h(Library)195 -149 y Fd({)234 193 y(done)i(=)i(1;)234 237 y(return)e(\(0\);)195 -280 y(})195 367 y(/*)h(Function)d(which)i(tells)g(you)g(that)g(you)h -(can't)e(do)i(this.)f(*/)195 411 y(too_danger)o(ou)o(s)f(\(caller\))293 -455 y(char)h(*caller;)195 498 y({)234 542 y(fprintf)f(\(stderr,)411 -585 y("\045s:)h(Too)g(dangerous)e(for)j(me)g(to)g(distribu)o(te.)o -(\\n")411 629 y(caller\);)234 672 y(fprintf)e(\(stderr,)g("Write)g(it)i +%%Page: 55 59 +55 58 bop 75 -58 a Ft(Chapter)15 b(2:)k(Programming)c(with)g(GNU)g +(Readline)843 b(55)195 149 y Fd({)234 193 y(done)18 b(=)i(1;)234 +237 y(return)e(\(0\);)195 280 y(})195 367 y(/*)h(Function)d(which)i +(tells)g(you)g(that)g(you)h(can't)e(do)i(this.)f(*/)195 +411 y(too_danger)o(ou)o(s)f(\(caller\))293 455 y(char)h(*caller;)195 +498 y({)234 542 y(fprintf)f(\(stderr,)411 585 y("\045s:)h(Too)g +(dangerous)e(for)j(me)g(to)g(distribu)o(te.)o(\\n")411 +629 y(caller\);)234 672 y(fprintf)e(\(stderr,)g("Write)g(it)i (yourself.)o(\\n")o(\);)195 716 y(})195 803 y(/*)g(Return)e(non-zero)g (if)h(ARG)h(is)g(a)g(valid)f(argument)e(for)j(CALLER,)254 847 y(else)f(print)g(an)g(error)g(message)f(and)h(return)g(zero.)f(*/) @@ -4728,9 +4788,12 @@ h(!*arg\))273 1108 y({)313 1152 y(fprintf)e(\(stderr,)f("\045s:)i (Argument)f(required.)o(\\n)o(",)f(caller\);)313 1196 y(return)h(\(0\);)273 1239 y(})234 1326 y(return)h(\(1\);)195 1370 y(})p eop -%%Page: 55 59 -55 58 bop 75 -58 a Ft(App)q(endix)17 b(A:)e(Cop)o(ying)g(This)h(Man)o -(ual)1053 b(55)75 149 y Fp(App)r(endix)25 b(A)20 b(Cop)n(ying)26 +%%Page: 56 60 +56 59 bop 75 -58 a Ft(56)1299 b(GNU)15 b(Readline)h(Library)p +eop +%%Page: 57 61 +57 60 bop 75 -58 a Ft(App)q(endix)17 b(A:)e(Cop)o(ying)g(This)h(Man)o +(ual)1053 b(57)75 149 y Fp(App)r(endix)25 b(A)20 b(Cop)n(ying)26 b(This)g(Man)n(ual)75 345 y Fr(A.1)33 b(GNU)21 b(F)-6 b(ree)23 b(Do)r(cumen)n(tation)g(License)698 455 y Ft(V)l(ersion)16 b(1.2,)e(No)o(v)o(em)o(b)q(er)h(2002)195 526 y(Cop)o(yrigh)o(t)421 @@ -4802,8 +4865,8 @@ h(ma)o(y)e(not)h(explain)h(an)o(y)f(mathematics.\))18 b(The)165 2670 y(relationship)d(could)g(b)q(e)f(a)g(matter)e(of)i (historical)g(connection)h(with)f(the)g(sub)s(ject)f(or)h(with)g (related)p eop -%%Page: 56 60 -56 59 bop 75 -58 a Ft(56)1299 b(GNU)15 b(Readline)h(Library)165 +%%Page: 58 62 +58 61 bop 75 -58 a Ft(58)1299 b(GNU)15 b(Readline)h(Library)165 149 y(matters,)h(or)g(of)g(legal,)i(commercial,)g(philosophical,)i (ethical)e(or)e(p)q(olitical)j(p)q(osition)f(regarding)165 204 y(them.)165 275 y(The)13 b(\\In)o(v)m(arian)o(t)g(Sections")g(are)g @@ -4893,9 +4956,9 @@ k(are)d(considered)j(to)165 2560 y(b)q(e)g(included)j(b)o(y)d d(ha)o(v)o(e)h(is)h(v)o(oid)g(and)g(has)f(no)165 2670 y(e\013ect)d(on)g(the)g(meaning)h(of)f(this)h(License.)p eop -%%Page: 57 61 -57 60 bop 75 -58 a Ft(App)q(endix)17 b(A:)e(Cop)o(ying)g(This)h(Man)o -(ual)1053 b(57)100 149 y(2.)29 b(VERBA)l(TIM)15 b(COPYING)165 +%%Page: 59 63 +59 62 bop 75 -58 a Ft(App)q(endix)17 b(A:)e(Cop)o(ying)g(This)h(Man)o +(ual)1053 b(59)100 149 y(2.)29 b(VERBA)l(TIM)15 b(COPYING)165 222 y(Y)l(ou)k(ma)o(y)g(cop)o(y)f(and)i(distribute)g(the)f(Do)q(cumen)o (t)g(in)h(an)o(y)f(medium,)h(either)g(commercially)g(or)165 277 y(noncommercially)l(,)k(pro)o(vided)e(that)f(this)h(License,)i(the) @@ -4977,8 +5040,8 @@ q(cumen)o(t.)100 2378 y(4.)29 b(MODIFICA)l(TIONS)165 (er)h(p)q(ossesses)h(a)e(cop)o(y)h(of)165 2670 y(it.)j(In)c(addition,)g (y)o(ou)f(m)o(ust)f(do)h(these)h(things)g(in)g(the)f(Mo)q(di\014ed)h(V) l(ersion:)p eop -%%Page: 58 62 -58 61 bop 75 -58 a Ft(58)1299 b(GNU)15 b(Readline)h(Library)178 +%%Page: 60 64 +60 63 bop 75 -58 a Ft(60)1299 b(GNU)15 b(Readline)h(Library)178 149 y(A.)30 b(Use)17 b(in)g(the)f(Title)h(P)o(age)f(\(and)g(on)h(the)f (co)o(v)o(ers,)g(if)g(an)o(y\))g(a)g(title)h(distinct)h(from)d(that)h (of)g(the)255 204 y(Do)q(cumen)o(t,)h(and)g(from)f(those)h(of)f @@ -5057,9 +5120,9 @@ h(Section.)177 2540 y(O.)30 b(Preserv)o(e)15 b(an)o(y)g(W)l(arran)o(t)o (that)d(qualify)165 2670 y(as)e(Secondary)g(Sections)h(and)f(con)o (tain)g(no)g(material)g(copied)h(from)e(the)h(Do)q(cumen)o(t,)g(y)o(ou) f(ma)o(y)h(at)p eop -%%Page: 59 63 -59 62 bop 75 -58 a Ft(App)q(endix)17 b(A:)e(Cop)o(ying)g(This)h(Man)o -(ual)1053 b(59)165 149 y(y)o(our)16 b(option)g(designate)h(some)f(or)f +%%Page: 61 65 +61 64 bop 75 -58 a Ft(App)q(endix)17 b(A:)e(Cop)o(ying)g(This)h(Man)o +(ual)1053 b(61)165 149 y(y)o(our)16 b(option)g(designate)h(some)f(or)f (all)i(of)f(these)h(sections)f(as)g(in)o(v)m(arian)o(t.)24 b(T)l(o)15 b(do)i(this,)f(add)g(their)165 204 y(titles)i(to)f(the)h (list)h(of)e(In)o(v)m(arian)o(t)h(Sections)h(in)f(the)g(Mo)q(di\014ed)h @@ -5142,8 +5205,8 @@ g(in)g(all)165 2440 y(other)c(resp)q(ects.)165 2506 y(Y)l(ou)h(ma)o(y)f 2615 y(do)q(cumen)o(t,)g(and)f(follo)o(w)g(this)h(License)h(in)f(all)h (other)d(resp)q(ects)i(regarding)g(v)o(erbatim)f(cop)o(ying)g(of)165 2670 y(that)e(do)q(cumen)o(t.)p eop -%%Page: 60 64 -60 63 bop 75 -58 a Ft(60)1299 b(GNU)15 b(Readline)h(Library)100 +%%Page: 62 66 +62 65 bop 75 -58 a Ft(62)1299 b(GNU)15 b(Readline)h(Library)100 149 y(7.)29 b(A)o(GGREGA)l(TION)14 b(WITH)i(INDEPENDENT)e(W)o(ORKS)165 214 y(A)g(compilation)h(of)f(the)g(Do)q(cumen)o(t)g(or)f(its)i(deriv)m (ativ)o(es)g(with)f(other)g(separate)f(and)i(indep)q(enden)o(t)165 @@ -5227,9 +5290,9 @@ b(If)17 b(the)g(Do)q(cumen)o(t)f(do)q(es)g(not)g(sp)q(ecify)i(a)e(v)o (ma)o(y)f(c)o(ho)q(ose)i(an)o(y)e(v)o(ersion)i(ev)o(er)f(published)j (\(not)c(as)h(a)g(draft\))f(b)o(y)i(the)f(F)l(ree)165 2660 y(Soft)o(w)o(are)d(F)l(oundation.)p eop -%%Page: 61 65 -61 64 bop 75 -58 a Ft(App)q(endix)17 b(A:)e(Cop)o(ying)g(This)h(Man)o -(ual)1053 b(61)75 149 y Fh(A.1.1)30 b(ADDENDUM:)22 b(Ho)n(w)f(to)f(use) +%%Page: 63 67 +63 66 bop 75 -58 a Ft(App)q(endix)17 b(A:)e(Cop)o(ying)g(This)h(Man)o +(ual)1053 b(63)75 149 y Fh(A.1.1)30 b(ADDENDUM:)22 b(Ho)n(w)f(to)f(use) h(this)f(License)h(for)f(y)n(our)h(do)r(cumen)n(ts)137 271 y Ft(T)l(o)14 b(use)g(this)g(License)h(in)g(a)e(do)q(cumen)o(t)h(y) o(ou)f(ha)o(v)o(e)h(written,)f(include)j(a)d(cop)o(y)h(of)f(the)h @@ -5262,11 +5325,11 @@ Fc(list)h(their)g(titles)p Fd(,)f(with)273 860 y(the)i(Front-Cov)o(er)d (license,)k(suc)o(h)e(as)g(the)f(GNU)75 1196 y(General)16 b(Public)h(License,)f(to)f(p)q(ermit)h(their)f(use)h(in)g(free)f(soft)o (w)o(are.)p eop -%%Page: 62 66 -62 65 bop 75 -58 a Ft(62)1299 b(GNU)15 b(Readline)h(Library)p +%%Page: 64 68 +64 67 bop 75 -58 a Ft(64)1299 b(GNU)15 b(Readline)h(Library)p eop -%%Page: 63 67 -63 66 bop 75 -58 a Ft(Concept)15 b(Index)1466 b(63)75 +%%Page: 65 69 +65 68 bop 75 -58 a Ft(Concept)15 b(Index)1466 b(65)75 149 y Fp(Concept)27 b(Index)75 319 y Fr(A)75 380 y Fb(application)q (-sp)q(eci)q(\014c)16 b(completion)f(functions)5 b Fa(.)j(.)e(.)g(.)g (.)g(.)h(.)17 b Fb(41)75 511 y Fr(C)75 571 y Fb(command)d(editing)e @@ -5276,7 +5339,7 @@ Fb(1)75 703 y Fr(E)75 763 y Fb(editing)15 b(command)f(lines)f Fa(.)6 b(.)h(.)f(.)g(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.)h(.)f(.)g(.) g(.)g(.)g(.)h(.)f(.)g(.)g(.)24 b Fb(1)75 895 y Fr(F)75 955 y Fb(FDL,)13 b(GNU)f(F)m(ree)h(Do)q(cumen)o(tation)j(License)6 -b Fa(.)h(.)f(.)g(.)g(.)g(.)h(.)18 b Fb(55)75 1086 y Fr(I)75 +b Fa(.)h(.)f(.)g(.)g(.)g(.)h(.)18 b Fb(57)75 1086 y Fr(I)75 1147 y Fb(initiali)q(zati)q(on)e(\014le,)e(readline)t Fa(.)8 b(.)e(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.)h(.) f(.)g(.)g(.)g(.)g(.)17 b Fb(4)75 1192 y(in)o(teraction,)e(readline)5 @@ -5301,12 +5364,12 @@ Fb(5)1012 1131 y Fr(Y)1012 1192 y Fb(y)o(anking)e(text)t Fa(.)7 b(.)f(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.) g(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.)h(.)f(.)g(.)17 b Fb(2)p eop -%%Page: 64 68 -64 67 bop 75 -58 a Ft(64)1299 b(GNU)15 b(Readline)h(Library)p +%%Page: 66 70 +66 69 bop 75 -58 a Ft(66)1299 b(GNU)15 b(Readline)h(Library)p eop -%%Page: 65 69 -65 68 bop 75 -58 a Ft(F)l(unction)16 b(and)f(V)l(ariable)i(Index)1187 -b(65)75 149 y Fp(F)-7 b(unction)26 b(and)h(V)-7 b(ariable)26 +%%Page: 67 71 +67 70 bop 75 -58 a Ft(F)l(unction)16 b(and)f(V)l(ariable)i(Index)1187 +b(67)75 149 y Fp(F)-7 b(unction)26 b(and)h(V)-7 b(ariable)26 b(Index)p 80 305 21 3 v 75 366 a Fd(_rl_digit_)o(p)7 b Fa(.)f(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.)h(.) f(.)g(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)23 @@ -5491,8 +5554,8 @@ b Fb(14)1012 2626 y Fd(non-increme)o(nt)o(al-)o(re)o(ver)o(se)o(-se)o (.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.)g(.)h(.) f(.)g(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.)h (.)20 b Fb(14)p eop -%%Page: 66 70 -66 69 bop 75 -58 a Ft(66)1299 b(GNU)15 b(Readline)h(Library)75 +%%Page: 68 72 +68 71 bop 75 -58 a Ft(68)1299 b(GNU)15 b(Readline)h(Library)75 149 y Fr(O)75 209 y Fb(output-meta)5 b Fa(.)i(.)f(.)h(.)f(.)g(.)g(.)g (.)g(.)h(.)f(.)g(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.)g(.)h(.)f(.)g(.) g(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.)18 b Fb(7)75 253 @@ -5604,352 +5667,363 @@ b Fb(45)75 2670 y Fd(rl_complet)o(io)o(n_d)o(is)o(pla)o(y_m)o(at)o(che) o(s_)o(hoo)o(k)9 b Fa(.)d(.)g(.)g(.)g(.)g(.)h(.)24 b Fb(44)1012 149 y Fd(rl_completi)o(on)o(_en)o(tr)o(y_f)o(un)o(cti)o(on)s Fa(.)s(.)6 b(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.)g(.)17 b Fb(42,)c(43)1012 -194 y Fd(rl_completi)o(on)o(_ma)o(rk)o(_sy)o(ml)o(ink)o(_di)o(rs)t -Fa(.)s(.)7 b(.)f(.)g(.)g(.)g(.)g(.)h(.)f(.)g(.)18 b Fb(45)1012 -238 y Fd(rl_completi)o(on)o(_ma)o(tc)o(hes)8 b Fa(.)f(.)f(.)g(.)g(.)g -(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.)h(.)25 -b Fb(42)1012 282 y Fd(rl_completi)o(on)o(_mo)o(de)t Fa(.)t(.)6 -b(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.)h(.)f -(.)g(.)g(.)g(.)g(.)g(.)19 b Fb(42)1012 326 y Fd(rl_completi)o(on)o(_qu) -o(er)o(y_i)o(te)o(ms)9 b Fa(.)s(.)d(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.)h(.)f -(.)g(.)g(.)g(.)g(.)g(.)23 b Fb(45)1012 371 y Fd(rl_completi)o(on)o(_su) -o(pp)o(res)o(s_)o(app)o(end)5 b Fa(.)t(.)h(.)g(.)g(.)g(.)g(.)h(.)f(.)g -(.)g(.)g(.)g(.)20 b Fb(45)1012 415 y Fd(rl_completi)o(on)o(_ty)o(pe)t +194 y Fd(rl_completi)o(on)o(_fo)o(un)o(d_q)o(uo)o(te)c +Fa(.)s(.)d(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.)g(.)23 +b Fb(46)1012 238 y Fd(rl_completi)o(on)o(_ma)o(rk)o(_sy)o(ml)o(ink)o +(_di)o(rs)t Fa(.)s(.)7 b(.)f(.)g(.)g(.)g(.)g(.)h(.)f(.)g(.)18 +b Fb(46)1012 282 y Fd(rl_completi)o(on)o(_ma)o(tc)o(hes)8 +b Fa(.)f(.)f(.)g(.)g(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.)h(.)f(.)g(.) +g(.)g(.)g(.)h(.)25 b Fb(42)1012 326 y Fd(rl_completi)o(on)o(_mo)o(de)t Fa(.)t(.)6 b(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.) -g(.)h(.)f(.)g(.)g(.)g(.)g(.)g(.)19 b Fb(46)1012 459 y -Fd(rl_copy_key)o(ma)o(p)8 b Fa(.)s(.)e(.)h(.)f(.)g(.)g(.)g(.)g(.)h(.)f -(.)g(.)g(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.) -h(.)21 b Fb(28)1012 503 y Fd(rl_copy_tex)o(t)6 b Fa(.)g(.)h(.)f(.)g(.)g -(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.)h(.)f(.)g(.) -g(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)23 b Fb(34)1012 547 y -Fd(rl_crlf)t Fa(.)t(.)6 b(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.)h(.)f(.)g -(.)g(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.)h(.) -f(.)g(.)g(.)g(.)g(.)h(.)17 b Fb(33)1012 592 y Fd(rl_delete_t)o(ex)o(t)8 +g(.)h(.)f(.)g(.)g(.)g(.)g(.)g(.)19 b Fb(42)1012 371 y +Fd(rl_completi)o(on)o(_qu)o(er)o(y_i)o(te)o(ms)9 b Fa(.)s(.)d(.)g(.)h +(.)f(.)g(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.)g(.)23 +b Fb(45)1012 415 y Fd(rl_completi)o(on)o(_qu)o(ot)o(e_c)o(ha)o(rac)o +(ter)5 b Fa(.)t(.)h(.)g(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.)20 +b Fb(45)1012 459 y Fd(rl_completi)o(on)o(_su)o(pp)o(res)o(s_)o(app)o +(end)5 b Fa(.)t(.)h(.)g(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.)20 +b Fb(45)1012 503 y Fd(rl_completi)o(on)o(_su)o(pp)o(res)o(s_)o(quo)o +(te)7 b Fa(.)s(.)f(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.)g(.)h(.)20 +b Fb(46)1012 547 y Fd(rl_completi)o(on)o(_ty)o(pe)t Fa(.)t(.)6 +b(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.)h(.)f +(.)g(.)g(.)g(.)g(.)g(.)19 b Fb(46)1012 592 y Fd(rl_completi)o(on)o(_wo) +o(rd)o(_br)o(ea)o(k_h)o(ook)5 b Fa(.)t(.)h(.)g(.)g(.)g(.)g(.)h(.)f(.)g +(.)g(.)g(.)g(.)20 b Fb(45)1012 636 y Fd(rl_copy_key)o(ma)o(p)8 +b Fa(.)s(.)e(.)h(.)f(.)g(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.)g(.)h(.) +f(.)g(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.)h(.)21 b +Fb(28)1012 680 y Fd(rl_copy_tex)o(t)6 b Fa(.)g(.)h(.)f(.)g(.)g(.)g(.)g +(.)h(.)f(.)g(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.) +g(.)g(.)h(.)f(.)g(.)g(.)23 b Fb(34)1012 724 y Fd(rl_crlf)t +Fa(.)t(.)6 b(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.) +g(.)h(.)f(.)g(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g +(.)g(.)h(.)17 b Fb(33)1012 769 y Fd(rl_delete_t)o(ex)o(t)8 b Fa(.)s(.)e(.)h(.)f(.)g(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.)g(.)h(.) f(.)g(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.)h(.)21 b -Fb(34)1012 636 y Fd(rl_deprep_t)o(er)o(m_f)o(un)o(cti)o(on)7 +Fb(34)1012 813 y Fd(rl_deprep_t)o(er)o(m_f)o(un)o(cti)o(on)7 b Fa(.)f(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.)h(.)f(.) -g(.)g(.)24 b Fb(26)1012 680 y Fd(rl_deprep_t)o(er)o(min)o(al)t +g(.)g(.)24 b Fb(26)1012 857 y Fd(rl_deprep_t)o(er)o(min)o(al)t Fa(.)t(.)6 b(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.) -g(.)h(.)f(.)g(.)g(.)g(.)g(.)g(.)19 b Fb(35)1012 724 y +g(.)h(.)f(.)g(.)g(.)g(.)g(.)g(.)19 b Fb(35)1012 901 y Fd(rl_ding)t Fa(.)t(.)6 b(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.)h(.)f(.)g (.)g(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.)h(.) -f(.)g(.)g(.)g(.)g(.)h(.)17 b Fb(36)1012 769 y Fd(rl_director)o(y_)o +f(.)g(.)g(.)g(.)g(.)h(.)17 b Fb(36)1012 945 y Fd(rl_director)o(y_)o (com)o(pl)o(eti)o(on)o(_ho)o(ok)7 b Fa(.)s(.)f(.)g(.)g(.)g(.)h(.)f(.)g -(.)g(.)g(.)g(.)g(.)h(.)20 b Fb(44)1012 813 y Fd(rl_discard_)o(ke)o(yma) +(.)g(.)g(.)g(.)g(.)h(.)20 b Fb(44)1012 990 y Fd(rl_discard_)o(ke)o(yma) o(p)6 b Fa(.)s(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.)g(.)h(.)f(.)g(.)g (.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.)h(.)f(.)19 b Fb(29)1012 -857 y Fd(rl_dispatch)o(in)o(g)8 b Fa(.)s(.)e(.)h(.)f(.)g(.)g(.)g(.)g(.) -h(.)f(.)g(.)g(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g -(.)g(.)h(.)21 b Fb(24)1012 901 y Fd(rl_display_)o(ma)o(tch)o(_l)o(ist)8 -b Fa(.)f(.)f(.)g(.)g(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.)h(.)f(.)g(.) -g(.)g(.)g(.)h(.)25 b Fb(36)1012 945 y Fd(rl_do_undo)8 +1034 y Fd(rl_dispatch)o(in)o(g)8 b Fa(.)s(.)e(.)h(.)f(.)g(.)g(.)g(.)g +(.)h(.)f(.)g(.)g(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.) +g(.)g(.)h(.)21 b Fb(24)1012 1078 y Fd(rl_display_)o(ma)o(tch)o(_l)o +(ist)8 b Fa(.)f(.)f(.)g(.)g(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.)h(.)f +(.)g(.)g(.)g(.)g(.)h(.)25 b Fb(36)1012 1122 y Fd(rl_do_undo)8 b Fa(.)e(.)g(.)g(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.) g(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.)g(.)h(.)24 -b Fb(32)1012 990 y Fd(rl_done)t Fa(.)t(.)6 b(.)g(.)g(.)h(.)f(.)g(.)g(.) -g(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.)h(.)f(.)g -(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.)h(.)17 b Fb(24)1012 -1034 y Fd(rl_editing_)o(mo)o(de)7 b Fa(.)s(.)f(.)g(.)h(.)f(.)g(.)g(.)g +b Fb(32)1012 1167 y Fd(rl_done)t Fa(.)t(.)6 b(.)g(.)g(.)h(.)f(.)g(.)g +(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.)h(.)f(.) +g(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.)h(.)17 b Fb(24)1012 +1211 y Fd(rl_editing_)o(mo)o(de)7 b Fa(.)s(.)f(.)g(.)h(.)f(.)g(.)g(.)g (.)g(.)h(.)f(.)g(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.)g(.)h(.)f(.)g(.) -g(.)g(.)21 b Fb(28)1012 1078 y Fd(rl_end)5 b Fa(.)t(.)h(.)g(.)h(.)f(.)g +g(.)g(.)21 b Fb(28)1012 1255 y Fd(rl_end)5 b Fa(.)t(.)h(.)g(.)h(.)f(.)g (.)g(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.)h(.) f(.)g(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.)h(.)f(.)g(.)18 -b Fb(24)1012 1122 y Fd(rl_end_undo)o(_g)o(rou)o(p)6 b +b Fb(24)1012 1299 y Fd(rl_end_undo)o(_g)o(rou)o(p)6 b Fa(.)s(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)g -(.)h(.)f(.)g(.)g(.)g(.)g(.)h(.)f(.)19 b Fb(32)1012 1167 +(.)h(.)f(.)g(.)g(.)g(.)g(.)h(.)f(.)19 b Fb(32)1012 1343 y Fd(rl_erase_em)o(pt)o(y_l)o(in)o(e)t Fa(.)t(.)6 b(.)g(.)g(.)g(.)g(.)h (.)f(.)g(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)18 -b Fb(24)1012 1211 y Fd(rl_event_ho)o(ok)8 b Fa(.)s(.)e(.)h(.)f(.)g(.)g +b Fb(24)1012 1388 y Fd(rl_event_ho)o(ok)8 b Fa(.)s(.)e(.)h(.)f(.)g(.)g (.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.)h(.)f(.)g(.) -g(.)g(.)g(.)h(.)f(.)g(.)22 b Fb(26)1012 1255 y Fd(rl_execute_)o(ne)o +g(.)g(.)g(.)h(.)f(.)g(.)22 b Fb(26)1012 1432 y Fd(rl_execute_)o(ne)o (xt)7 b Fa(.)s(.)f(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)g (.)h(.)f(.)g(.)g(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)21 -b Fb(34)1012 1299 y Fd(rl_executin)o(g_)o(key)o(ma)o(p)t +b Fb(35)1012 1476 y Fd(rl_executin)o(g_)o(key)o(ma)o(p)t Fa(.)t(.)6 b(.)g(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.) -g(.)g(.)h(.)f(.)g(.)g(.)g(.)18 b Fb(26)1012 1343 y Fd(rl_executin)o(g_) +g(.)g(.)h(.)f(.)g(.)g(.)g(.)18 b Fb(26)1012 1520 y Fd(rl_executin)o(g_) o(mac)o(ro)t Fa(.)t(.)6 b(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.)h(.)f (.)g(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.)g(.)19 b Fb(26)1012 -1388 y Fd(rl_expand_p)o(ro)o(mpt)6 b Fa(.)s(.)g(.)g(.)g(.)h(.)f(.)g(.)g +1564 y Fd(rl_expand_p)o(ro)o(mpt)6 b Fa(.)s(.)g(.)g(.)g(.)h(.)f(.)g(.)g (.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.)h(.)f(.)g(.) -g(.)20 b Fb(33)1012 1432 y Fd(rl_explicit)o(_a)o(rg)7 +g(.)20 b Fb(33)1012 1609 y Fd(rl_explicit)o(_a)o(rg)7 b Fa(.)s(.)f(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.)h(.) f(.)g(.)g(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)21 b Fb(27)1012 -1476 y Fd(rl_extend_l)o(in)o(e_b)o(uf)o(fer)8 b Fa(.)f(.)f(.)g(.)g(.)g +1653 y Fd(rl_extend_l)o(in)o(e_b)o(uf)o(fer)8 b Fa(.)f(.)f(.)g(.)g(.)g (.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.)h(.)25 -b Fb(35)1012 1520 y Fd(rl_filename)o(_c)o(omp)o(le)o(tio)o(n_)o(des)o +b Fb(35)1012 1697 y Fd(rl_filename)o(_c)o(omp)o(le)o(tio)o(n_)o(des)o (ire)o(d)5 b Fa(.)s(.)i(.)f(.)g(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)19 -b Fb(46)1012 1564 y Fd(rl_filename)o(_c)o(omp)o(le)o(tio)o(n_)o(fun)o +b Fb(46)1012 1741 y Fd(rl_filename)o(_c)o(omp)o(le)o(tio)o(n_)o(fun)o (cti)o(on)t Fa(.)s(.)7 b(.)f(.)g(.)g(.)g(.)g(.)h(.)f(.)g(.)18 -b Fb(43)1012 1609 y Fd(rl_filename)o(_d)o(equ)o(ot)o(ing)o(_f)o(unc)o +b Fb(43)1012 1786 y Fd(rl_filename)o(_d)o(equ)o(ot)o(ing)o(_f)o(unc)o (tio)o(n)5 b Fa(.)s(.)i(.)f(.)g(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)19 -b Fb(43)1012 1653 y Fd(rl_filename)o(_q)o(uot)o(e_)o(cha)o(ra)o(cte)o +b Fb(43)1012 1830 y Fd(rl_filename)o(_q)o(uot)o(e_)o(cha)o(ra)o(cte)o (rs)7 b Fa(.)s(.)f(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.)g(.)h(.)20 -b Fb(45)1012 1697 y Fd(rl_filename)o(_q)o(uot)o(in)o(g_d)o(es)o(ire)o +b Fb(45)1012 1874 y Fd(rl_filename)o(_q)o(uot)o(in)o(g_d)o(es)o(ire)o (d)8 b Fa(.)s(.)e(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.)h(.)f(.)g(.)21 -b Fb(46)1012 1741 y Fd(rl_filename)o(_q)o(uot)o(in)o(g_f)o(un)o(cti)o +b Fb(46)1012 1918 y Fd(rl_filename)o(_q)o(uot)o(in)o(g_f)o(un)o(cti)o (on)7 b Fa(.)s(.)f(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.)g(.)h(.)20 -b Fb(43)1012 1786 y Fd(rl_forced_u)o(pd)o(ate)o(_d)o(isp)o(la)o(y)7 +b Fb(43)1012 1962 y Fd(rl_forced_u)o(pd)o(ate)o(_d)o(isp)o(la)o(y)7 b Fa(.)f(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.)h(.) -f(.)23 b Fb(33)1012 1830 y Fd(rl_free_lin)o(e_)o(sta)o(te)t +f(.)23 b Fb(33)1012 2007 y Fd(rl_free_lin)o(e_)o(sta)o(te)t Fa(.)t(.)6 b(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.) -g(.)h(.)f(.)g(.)g(.)g(.)g(.)g(.)19 b Fb(40)1012 1874 +g(.)h(.)f(.)g(.)g(.)g(.)g(.)g(.)19 b Fb(40)1012 2051 y Fd(rl_free_und)o(o_)o(lis)o(t)6 b Fa(.)s(.)g(.)g(.)g(.)h(.)f(.)g(.)g (.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.)h(.)f(.) -19 b Fb(32)1012 1918 y Fd(rl_function)o(_d)o(ump)o(er)t +19 b Fb(32)1012 2095 y Fd(rl_function)o(_d)o(ump)o(er)t Fa(.)t(.)6 b(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.) -g(.)h(.)f(.)g(.)g(.)g(.)g(.)g(.)19 b Fb(31)1012 1962 +g(.)h(.)f(.)g(.)g(.)g(.)g(.)g(.)19 b Fb(31)1012 2139 y Fd(rl_function)o(_o)o(f_k)o(ey)o(seq)8 b Fa(.)f(.)f(.)g(.)g(.)g(.)g (.)g(.)h(.)f(.)g(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.)h(.)25 -b Fb(31)1012 2007 y Fd(rl_funmap_n)o(am)o(es)7 b Fa(.)s(.)f(.)g(.)h(.)f +b Fb(31)1012 2184 y Fd(rl_funmap_n)o(am)o(es)7 b Fa(.)s(.)f(.)g(.)h(.)f (.)g(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.)g(.) -h(.)f(.)g(.)g(.)g(.)21 b Fb(31)1012 2051 y Fd(rl_generic_)o(bi)o(nd)7 +h(.)f(.)g(.)g(.)g(.)21 b Fb(31)1012 2228 y Fd(rl_generic_)o(bi)o(nd)7 b Fa(.)s(.)f(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.)h(.) f(.)g(.)g(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)21 b Fb(30)1012 -2095 y Fd(rl_get_keym)o(ap)8 b Fa(.)s(.)e(.)h(.)f(.)g(.)g(.)g(.)g(.)h +2272 y Fd(rl_get_keym)o(ap)8 b Fa(.)s(.)e(.)h(.)f(.)g(.)g(.)g(.)g(.)h (.)f(.)g(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.) -h(.)f(.)g(.)22 b Fb(29)1012 2139 y Fd(rl_get_keym)o(ap)o(_by)o(_n)o +h(.)f(.)g(.)22 b Fb(29)1012 2316 y Fd(rl_get_keym)o(ap)o(_by)o(_n)o (ame)8 b Fa(.)f(.)f(.)g(.)g(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.)h(.)f -(.)g(.)g(.)g(.)g(.)h(.)25 b Fb(29)1012 2184 y Fd(rl_get_keym)o(ap)o +(.)g(.)g(.)g(.)g(.)h(.)25 b Fb(29)1012 2360 y Fd(rl_get_keym)o(ap)o (_na)o(me)t Fa(.)t(.)6 b(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.)h(.)f(.) g(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.)g(.)19 b Fb(29)1012 -2228 y Fd(rl_get_scre)o(en)o(_si)o(ze)t Fa(.)t(.)6 b(.)g(.)g(.)g(.)h(.) +2405 y Fd(rl_get_scre)o(en)o(_si)o(ze)t Fa(.)t(.)6 b(.)g(.)g(.)g(.)h(.) f(.)g(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.)g -(.)19 b Fb(40)1012 2272 y Fd(rl_get_term)o(ca)o(p)8 b +(.)19 b Fb(40)1012 2449 y Fd(rl_get_term)o(ca)o(p)8 b Fa(.)s(.)e(.)h(.)f(.)g(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.)g(.)h(.)f (.)g(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.)h(.)21 b Fb(37)1012 -2316 y Fd(rl_getc)t Fa(.)t(.)6 b(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.)h(.) +2493 y Fd(rl_getc)t Fa(.)t(.)6 b(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.)h(.) f(.)g(.)g(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)g -(.)h(.)f(.)g(.)g(.)g(.)g(.)h(.)17 b Fb(34)1012 2360 y +(.)h(.)f(.)g(.)g(.)g(.)g(.)h(.)17 b Fb(34)1012 2537 y Fd(rl_getc_fun)o(ct)o(ion)6 b Fa(.)s(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.) g(.)h(.)f(.)g(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)20 -b Fb(26)1012 2405 y Fd(rl_gnu_read)o(li)o(ne_)o(p)6 b +b Fb(26)1012 2582 y Fd(rl_gnu_read)o(li)o(ne_)o(p)6 b Fa(.)s(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)g -(.)h(.)f(.)g(.)g(.)g(.)g(.)h(.)f(.)19 b Fb(25)1012 2449 +(.)h(.)f(.)g(.)g(.)g(.)g(.)h(.)f(.)19 b Fb(25)1012 2626 y Fd(rl_ignore_c)o(om)o(ple)o(ti)o(on_)o(du)o(pli)o(cat)o(es)t -Fa(.)s(.)7 b(.)f(.)g(.)g(.)g(.)g(.)h(.)f(.)g(.)18 b Fb(45)1012 -2493 y Fd(rl_ignore_s)o(om)o(e_c)o(om)o(ple)o(ti)o(ons)o(_fu)o(nc)o -(tio)o(n)8 b Fa(.)e(.)g(.)g(.)g(.)h(.)24 b Fb(44)1012 -2537 y Fd(rl_inhibit_)o(co)o(mpl)o(et)o(ion)8 b Fa(.)f(.)f(.)g(.)g(.)g -(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.)h(.)25 -b Fb(46)1012 2582 y Fd(rl_initiali)o(ze)8 b Fa(.)s(.)e(.)h(.)f(.)g(.)g -(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.)h(.)f(.)g(.) -g(.)g(.)g(.)h(.)f(.)g(.)22 b Fb(35)1012 2626 y Fd(rl_insert_c)o(om)o -(ple)o(ti)o(ons)8 b Fa(.)f(.)f(.)g(.)g(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g -(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.)h(.)25 b Fb(42)1012 2670 -y Fd(rl_insert_t)o(ex)o(t)8 b Fa(.)s(.)e(.)h(.)f(.)g(.)g(.)g(.)g(.)h(.) -f(.)g(.)g(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)g -(.)h(.)21 b Fb(34)p eop -%%Page: 67 71 -67 70 bop 75 -58 a Ft(F)l(unction)16 b(and)f(V)l(ariable)i(Index)1187 -b(67)75 149 y Fd(rl_instrea)o(m)7 b Fa(.)f(.)g(.)g(.)h(.)f(.)g(.)g(.)g +Fa(.)s(.)7 b(.)f(.)g(.)g(.)g(.)g(.)h(.)f(.)g(.)18 b Fb(46)1012 +2670 y Fd(rl_ignore_s)o(om)o(e_c)o(om)o(ple)o(ti)o(ons)o(_fu)o(nc)o +(tio)o(n)8 b Fa(.)e(.)g(.)g(.)g(.)h(.)24 b Fb(44)p eop +%%Page: 69 73 +69 72 bop 75 -58 a Ft(F)l(unction)16 b(and)f(V)l(ariable)i(Index)1187 +b(69)75 149 y Fd(rl_inhibit)o(_c)o(omp)o(le)o(tio)o(n)9 +b Fa(.)d(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.)h(.) +f(.)g(.)g(.)g(.)25 b Fb(47)75 193 y Fd(rl_initial)o(iz)o(e)9 +b Fa(.)s(.)d(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.) +h(.)f(.)g(.)g(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.)22 +b Fb(36)75 237 y Fd(rl_insert_)o(co)o(mpl)o(et)o(ion)o(s)9 +b Fa(.)d(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.)h(.) +f(.)g(.)g(.)g(.)25 b Fb(42)75 280 y Fd(rl_insert_)o(te)o(xt)8 +b Fa(.)s(.)e(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.) +g(.)h(.)f(.)g(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)21 b +Fb(34)75 324 y Fd(rl_instrea)o(m)7 b Fa(.)f(.)g(.)g(.)h(.)f(.)g(.)g(.)g (.)g(.)h(.)f(.)g(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.) -g(.)g(.)h(.)f(.)g(.)g(.)23 b Fb(25)75 194 y Fd(rl_invokin)o(g_)o(key)o +g(.)g(.)h(.)f(.)g(.)g(.)23 b Fb(25)75 368 y Fd(rl_invokin)o(g_)o(key)o (se)o(qs)t Fa(.)s(.)6 b(.)h(.)f(.)g(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)g (.)h(.)f(.)g(.)g(.)g(.)g(.)g(.)h(.)f(.)17 b Fb(31)75 -238 y Fd(rl_invokin)o(g_)o(key)o(se)o(qs_)o(in_)o(ma)o(p)8 +411 y Fd(rl_invokin)o(g_)o(key)o(se)o(qs_)o(in_)o(ma)o(p)8 b Fa(.)t(.)e(.)g(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.)g(.)h(.)f(.)21 -b Fb(31)75 282 y Fd(rl_kill_te)o(xt)6 b Fa(.)g(.)g(.)g(.)h(.)f(.)g(.)g +b Fb(31)75 455 y Fd(rl_kill_te)o(xt)6 b Fa(.)g(.)g(.)g(.)h(.)f(.)g(.)g (.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.)h(.)f(.) -g(.)g(.)g(.)g(.)h(.)f(.)22 b Fb(34)75 326 y Fd(rl_last_fu)o(nc)6 +g(.)g(.)g(.)g(.)h(.)f(.)22 b Fb(34)75 499 y Fd(rl_last_fu)o(nc)6 b Fa(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.)g(.) h(.)f(.)g(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.)h(.)f(.)22 -b Fb(25)75 371 y Fd(rl_library)o(_v)o(ers)o(io)o(n)5 +b Fb(25)75 542 y Fd(rl_library)o(_v)o(ers)o(io)o(n)5 b Fa(.)s(.)i(.)f(.)g(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.)g(.)h(.)f(.) -g(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)18 b Fb(25)75 415 y Fd(rl_line_bu)o(ff) +g(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)18 b Fb(25)75 586 y Fd(rl_line_bu)o(ff) o(er)8 b Fa(.)s(.)e(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.)h(.)f(.)g(.)g (.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)21 -b Fb(24)75 459 y Fd(rl_list_fu)o(nm)o(ap_)o(na)o(mes)s +b Fb(24)75 629 y Fd(rl_list_fu)o(nm)o(ap_)o(na)o(mes)s Fa(.)s(.)6 b(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.)h(.) -f(.)g(.)g(.)g(.)g(.)h(.)16 b Fb(31)75 503 y Fd(rl_macro_b)o(in)o(d)9 +f(.)g(.)g(.)g(.)g(.)h(.)16 b Fb(31)75 673 y Fd(rl_macro_b)o(in)o(d)9 b Fa(.)s(.)d(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.) h(.)f(.)g(.)g(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.)22 -b Fb(36)75 548 y Fd(rl_macro_d)o(um)o(per)6 b Fa(.)t(.)g(.)g(.)g(.)g(.) +b Fb(36)75 717 y Fd(rl_macro_d)o(um)o(per)6 b Fa(.)t(.)g(.)g(.)g(.)g(.) h(.)f(.)g(.)g(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g -(.)g(.)h(.)f(.)g(.)20 b Fb(36)75 592 y Fd(rl_make_ba)o(re)o(_ke)o(ym)o +(.)g(.)h(.)f(.)g(.)20 b Fb(36)75 760 y Fd(rl_make_ba)o(re)o(_ke)o(ym)o (ap)t Fa(.)s(.)6 b(.)h(.)f(.)g(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.)h -(.)f(.)g(.)g(.)g(.)g(.)g(.)h(.)f(.)17 b Fb(28)75 636 +(.)f(.)g(.)g(.)g(.)g(.)g(.)h(.)f(.)17 b Fb(28)75 804 y Fd(rl_make_ke)o(ym)o(ap)8 b Fa(.)s(.)e(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.) g(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.)h(.)f(.)g(.)g -(.)g(.)21 b Fb(28)75 680 y Fd(rl_mark)t Fa(.)t(.)6 b(.)g(.)g(.)g(.)g(.) +(.)g(.)21 b Fb(28)75 848 y Fd(rl_mark)t Fa(.)t(.)6 b(.)g(.)g(.)g(.)g(.) h(.)f(.)g(.)g(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g (.)g(.)h(.)f(.)g(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)17 -b Fb(24)75 725 y Fd(rl_message)7 b Fa(.)f(.)g(.)h(.)f(.)g(.)g(.)g(.)g +b Fb(24)75 891 y Fd(rl_message)7 b Fa(.)f(.)g(.)h(.)f(.)g(.)g(.)g(.)g (.)h(.)f(.)g(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.) -g(.)g(.)h(.)f(.)g(.)g(.)g(.)24 b Fb(33)75 769 y Fd(rl_modifyi)o(ng)6 +g(.)g(.)h(.)f(.)g(.)g(.)g(.)24 b Fb(33)75 935 y Fd(rl_modifyi)o(ng)6 b Fa(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.)g(.) h(.)f(.)g(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.)h(.)f(.)22 -b Fb(32)75 813 y Fd(rl_named_f)o(un)o(cti)o(on)5 b Fa(.)s(.)i(.)f(.)g +b Fb(32)75 979 y Fd(rl_named_f)o(un)o(cti)o(on)5 b Fa(.)s(.)i(.)f(.)g (.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.)h(.)f(.) -g(.)g(.)g(.)g(.)19 b Fb(31)75 858 y Fd(rl_num_cha)o(rs)o(_to)o(_r)o +g(.)g(.)g(.)g(.)19 b Fb(31)75 1022 y Fd(rl_num_cha)o(rs)o(_to)o(_r)o (ead)s Fa(.)s(.)6 b(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)g -(.)h(.)f(.)g(.)g(.)g(.)g(.)h(.)16 b Fb(24)75 902 y Fd(rl_numeric)o(_a)o -(rg)8 b Fa(.)s(.)e(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.)h(.)f(.)g(.)g +(.)h(.)f(.)g(.)g(.)g(.)g(.)h(.)16 b Fb(24)75 1066 y Fd(rl_numeric)o(_a) +o(rg)8 b Fa(.)s(.)e(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.)h(.)f(.)g(.)g (.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)21 -b Fb(28)75 946 y Fd(rl_on_new_)o(li)o(ne)8 b Fa(.)s(.)e(.)g(.)g(.)g(.)h -(.)f(.)g(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.) -h(.)f(.)g(.)g(.)g(.)21 b Fb(33)75 990 y Fd(rl_on_new_)o(li)o(ne_)o(wi)o -(th_)o(pro)o(mp)o(t)8 b Fa(.)t(.)e(.)g(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g -(.)g(.)g(.)h(.)f(.)21 b Fb(33)75 1035 y Fd(rl_outstre)o(am)6 +b Fb(28)75 1109 y Fd(rl_on_new_)o(li)o(ne)8 b Fa(.)s(.)e(.)g(.)g(.)g(.) +h(.)f(.)g(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)g +(.)h(.)f(.)g(.)g(.)g(.)21 b Fb(33)75 1153 y Fd(rl_on_new_)o(li)o(ne_)o +(wi)o(th_)o(pro)o(mp)o(t)8 b Fa(.)t(.)e(.)g(.)g(.)g(.)g(.)h(.)f(.)g(.)g +(.)g(.)g(.)g(.)h(.)f(.)21 b Fb(33)75 1197 y Fd(rl_outstre)o(am)6 b Fa(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.)g(.) h(.)f(.)g(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.)h(.)f(.)22 -b Fb(25)75 1079 y Fd(rl_parse_a)o(nd)o(_bi)o(nd)5 b Fa(.)s(.)i(.)f(.)g +b Fb(25)75 1240 y Fd(rl_parse_a)o(nd)o(_bi)o(nd)5 b Fa(.)s(.)i(.)f(.)g (.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.)h(.)f(.) -g(.)g(.)g(.)g(.)19 b Fb(30)75 1123 y Fd(rl_pending)o(_i)o(npu)o(t)6 +g(.)g(.)g(.)g(.)19 b Fb(30)75 1284 y Fd(rl_pending)o(_i)o(npu)o(t)6 b Fa(.)t(.)g(.)g(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.) g(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.)g(.)h(.)19 b Fb(24)75 -1167 y Fd(rl_point)s Fa(.)s(.)7 b(.)f(.)g(.)g(.)g(.)g(.)h(.)f(.)g(.)g +1328 y Fd(rl_point)s Fa(.)s(.)7 b(.)f(.)g(.)g(.)g(.)g(.)h(.)f(.)g(.)g (.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.)h(.)f(.) -g(.)g(.)g(.)g(.)h(.)f(.)g(.)16 b Fb(24)75 1212 y Fd(rl_possibl)o(e_)o +g(.)g(.)g(.)g(.)h(.)f(.)g(.)16 b Fb(24)75 1371 y Fd(rl_possibl)o(e_)o (com)o(pl)o(eti)o(ons)7 b Fa(.)f(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.) -h(.)f(.)g(.)g(.)g(.)g(.)g(.)h(.)23 b Fb(42)75 1256 y +h(.)f(.)g(.)g(.)g(.)g(.)g(.)h(.)23 b Fb(42)75 1415 y Fd(rl_pre_inp)o(ut)o(_ho)o(ok)5 b Fa(.)s(.)i(.)f(.)g(.)g(.)g(.)g(.)h(.) f(.)g(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.)19 -b Fb(25)75 1300 y Fd(rl_prep_te)o(rm)o(_fu)o(nc)o(tio)o(n)9 +b Fb(25)75 1459 y Fd(rl_prep_te)o(rm)o(_fu)o(nc)o(tio)o(n)9 b Fa(.)d(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.)h(.) -f(.)g(.)g(.)g(.)25 b Fb(26)75 1344 y Fd(rl_prep_te)o(rm)o(ina)o(l)6 +f(.)g(.)g(.)g(.)25 b Fb(26)75 1502 y Fd(rl_prep_te)o(rm)o(ina)o(l)6 b Fa(.)t(.)g(.)g(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.) g(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.)g(.)h(.)19 b Fb(35)75 -1389 y Fd(rl_prompt)8 b Fa(.)e(.)h(.)f(.)g(.)g(.)g(.)g(.)h(.)f(.)g(.)g +1546 y Fd(rl_prompt)8 b Fa(.)e(.)h(.)f(.)g(.)g(.)g(.)g(.)h(.)f(.)g(.)g (.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.)h(.)f(.) -g(.)g(.)g(.)g(.)h(.)24 b Fb(25)75 1433 y Fd(rl_push_ma)o(cr)o(o_i)o(np) +g(.)g(.)g(.)g(.)h(.)24 b Fb(25)75 1589 y Fd(rl_push_ma)o(cr)o(o_i)o(np) o(ut)t Fa(.)s(.)6 b(.)h(.)f(.)g(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.)h -(.)f(.)g(.)g(.)g(.)g(.)g(.)h(.)f(.)17 b Fb(34)75 1477 +(.)f(.)g(.)g(.)g(.)g(.)g(.)h(.)f(.)17 b Fb(34)75 1633 y Fd(rl_read_in)o(it)o(_fi)o(le)5 b Fa(.)s(.)i(.)f(.)g(.)g(.)g(.)g(.)h (.)f(.)g(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.) -19 b Fb(31)75 1521 y Fd(rl_read_ke)o(y)7 b Fa(.)f(.)g(.)g(.)h(.)f(.)g +19 b Fb(31)75 1677 y Fd(rl_read_ke)o(y)7 b Fa(.)f(.)g(.)g(.)h(.)f(.)g (.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.)h(.)f(.) -g(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)23 b Fb(34)75 1566 y +g(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)23 b Fb(34)75 1720 y Fd(rl_readlin)o(e_)o(nam)o(e)6 b Fa(.)t(.)g(.)g(.)g(.)g(.)g(.)h(.)f(.)g (.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.)g(.)h(.) -19 b Fb(25)75 1610 y Fd(rl_readlin)o(e_)o(sta)o(te)5 +19 b Fb(25)75 1764 y Fd(rl_readlin)o(e_)o(sta)o(te)5 b Fa(.)s(.)i(.)f(.)g(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.)h(.)f(.)g(.) -g(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.)19 b Fb(26)75 1654 +g(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.)19 b Fb(26)75 1808 y Fd(rl_readlin)o(e_)o(ver)o(si)o(on)t Fa(.)s(.)6 b(.)h(.)f(.)g(.)g(.)g (.)g(.)h(.)f(.)g(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.)g(.)h(.)f(.)17 -b Fb(25)75 1698 y Fd(rl_redispl)o(ay)6 b Fa(.)g(.)g(.)g(.)h(.)f(.)g(.)g +b Fb(25)75 1851 y Fd(rl_redispl)o(ay)6 b Fa(.)g(.)g(.)g(.)h(.)f(.)g(.)g (.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.)h(.)f(.) -g(.)g(.)g(.)g(.)h(.)f(.)22 b Fb(32)75 1743 y Fd(rl_redispl)o(ay)o(_fu)o +g(.)g(.)g(.)g(.)h(.)f(.)22 b Fb(32)75 1895 y Fd(rl_redispl)o(ay)o(_fu)o (nc)o(tio)o(n)9 b Fa(.)d(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.)h(.)f(.)g(.) -g(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)25 b Fb(26)75 1787 y +g(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)25 b Fb(26)75 1939 y Fd(rl_replace)o(_l)o(ine)6 b Fa(.)t(.)g(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g (.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.)h(.)f(.)g(.) -20 b Fb(35)75 1831 y Fd(rl_reset_a)o(ft)o(er_)o(si)o(gna)o(l)9 +20 b Fb(35)75 1982 y Fd(rl_reset_a)o(ft)o(er_)o(si)o(gna)o(l)9 b Fa(.)d(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.)h(.) -f(.)g(.)g(.)g(.)25 b Fb(40)75 1875 y Fd(rl_reset_l)o(in)o(e_s)o(ta)o +f(.)g(.)g(.)g(.)25 b Fb(40)75 2026 y Fd(rl_reset_l)o(in)o(e_s)o(ta)o (te)t Fa(.)s(.)6 b(.)h(.)f(.)g(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.)h -(.)f(.)g(.)g(.)g(.)g(.)g(.)h(.)f(.)17 b Fb(33)75 1920 +(.)f(.)g(.)g(.)g(.)g(.)g(.)h(.)f(.)17 b Fb(33)75 2069 y Fd(rl_reset_t)o(er)o(min)o(al)5 b Fa(.)s(.)i(.)f(.)g(.)g(.)g(.)g(.)h (.)f(.)g(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.) -19 b Fb(35)75 1964 y Fd(rl_resize_)o(te)o(rmi)o(na)o(l)5 +19 b Fb(35)75 2113 y Fd(rl_resize_)o(te)o(rmi)o(na)o(l)5 b Fa(.)s(.)i(.)f(.)g(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.)g(.)h(.)f(.) -g(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)18 b Fb(40)75 2008 y +g(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)18 b Fb(40)75 2157 y Fd(rl_restore)o(_p)o(rom)o(pt)5 b Fa(.)s(.)i(.)f(.)g(.)g(.)g(.)g(.)h(.) f(.)g(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.)19 -b Fb(33)75 2052 y Fd(rl_save_pr)o(om)o(pt)8 b Fa(.)s(.)e(.)g(.)g(.)g(.) +b Fb(33)75 2200 y Fd(rl_save_pr)o(om)o(pt)8 b Fa(.)s(.)e(.)g(.)g(.)g(.) h(.)f(.)g(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)g -(.)h(.)f(.)g(.)g(.)g(.)21 b Fb(33)75 2097 y Fd(rl_set_key)7 +(.)h(.)f(.)g(.)g(.)g(.)21 b Fb(33)75 2244 y Fd(rl_set_key)7 b Fa(.)f(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.)h(.)f(.) g(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)24 -b Fb(30)75 2141 y Fd(rl_set_key)o(bo)o(ard)o(_i)o(npu)o(t_t)o(im)o(eou) +b Fb(30)75 2288 y Fd(rl_set_key)o(bo)o(ard)o(_i)o(npu)o(t_t)o(im)o(eou) o(t)6 b Fa(.)s(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)19 -b Fb(35)75 2185 y Fd(rl_set_key)o(ma)o(p)9 b Fa(.)s(.)d(.)g(.)g(.)h(.)f +b Fb(35)75 2331 y Fd(rl_set_key)o(ma)o(p)9 b Fa(.)s(.)d(.)g(.)g(.)h(.)f (.)g(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.)g(.) -h(.)f(.)g(.)g(.)g(.)g(.)22 b Fb(29)75 2229 y Fd(rl_set_par)o(en)o(_bl)o +h(.)f(.)g(.)g(.)g(.)g(.)22 b Fb(29)75 2375 y Fd(rl_set_par)o(en)o(_bl)o (in)o(k_t)o(ime)o(ou)o(t)8 b Fa(.)t(.)e(.)g(.)g(.)g(.)g(.)h(.)f(.)g(.)g -(.)g(.)g(.)g(.)h(.)f(.)21 b Fb(37)75 2274 y Fd(rl_set_pro)o(mp)o(t)9 +(.)g(.)g(.)g(.)h(.)f(.)21 b Fb(37)75 2419 y Fd(rl_set_pro)o(mp)o(t)9 b Fa(.)s(.)d(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.) h(.)f(.)g(.)g(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.)22 -b Fb(34)75 2318 y Fd(rl_set_scr)o(ee)o(n_s)o(iz)o(e)5 -b Fa(.)s(.)i(.)f(.)g(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.)g(.)h(.)f(.) -g(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)18 b Fb(40)1012 149 y -Fd(rl_set_sign)o(al)o(s)8 b Fa(.)s(.)e(.)h(.)f(.)g(.)g(.)g(.)g(.)h(.)f -(.)g(.)g(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.) -h(.)21 b Fb(41)1012 193 y Fd(rl_show_cha)o(r)6 b Fa(.)g(.)h(.)f(.)g(.)g -(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.)h(.)f(.)g(.) -g(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)23 b Fb(33)1012 237 y -Fd(rl_special_)o(pr)o(efi)o(xe)o(s)t Fa(.)t(.)6 b(.)g(.)g(.)g(.)g(.)h -(.)f(.)g(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)18 -b Fb(45)1012 280 y Fd(rl_startup_)o(ho)o(ok)7 b Fa(.)s(.)f(.)g(.)h(.)f -(.)g(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.)g(.) -h(.)f(.)g(.)g(.)g(.)21 b Fb(25)1012 324 y Fd(rl_stuff_ch)o(ar)8 -b Fa(.)s(.)e(.)h(.)f(.)g(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.)h(.)f(.) -g(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.)h(.)f(.)g(.)22 -b Fb(34)1012 367 y Fd(rl_terminal)o(_n)o(ame)6 b Fa(.)s(.)g(.)g(.)g(.)h +b Fb(34)1012 149 y Fd(rl_set_scre)o(en)o(_si)o(ze)t Fa(.)t(.)6 +b(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.)h(.)f +(.)g(.)g(.)g(.)g(.)g(.)19 b Fb(40)1012 193 y Fd(rl_set_sign)o(al)o(s)8 +b Fa(.)s(.)e(.)h(.)f(.)g(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.)g(.)h(.) +f(.)g(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.)h(.)21 b +Fb(41)1012 237 y Fd(rl_show_cha)o(r)6 b Fa(.)g(.)h(.)f(.)g(.)g(.)g(.)g +(.)h(.)f(.)g(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.) +g(.)g(.)h(.)f(.)g(.)g(.)23 b Fb(33)1012 281 y Fd(rl_special_)o(pr)o +(efi)o(xe)o(s)t Fa(.)t(.)6 b(.)g(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.) +h(.)f(.)g(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)18 b Fb(45)1012 +325 y Fd(rl_startup_)o(ho)o(ok)7 b Fa(.)s(.)f(.)g(.)h(.)f(.)g(.)g(.)g +(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.)g(.)h(.)f(.)g(.) +g(.)g(.)21 b Fb(25)1012 368 y Fd(rl_stuff_ch)o(ar)8 b +Fa(.)s(.)e(.)h(.)f(.)g(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.)h(.)f(.)g +(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.)h(.)f(.)g(.)22 +b Fb(34)1012 412 y Fd(rl_terminal)o(_n)o(ame)6 b Fa(.)s(.)g(.)g(.)g(.)h (.)f(.)g(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.) -h(.)f(.)g(.)g(.)20 b Fb(25)1012 411 y Fd(rl_tty_set_)o(de)o(fau)o(lt)o +h(.)f(.)g(.)g(.)20 b Fb(25)1012 456 y Fd(rl_tty_set_)o(de)o(fau)o(lt)o (_bi)o(nd)o(ing)o(s)8 b Fa(.)s(.)e(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)g -(.)h(.)f(.)g(.)21 b Fb(35)1012 455 y Fd(rl_tty_unse)o(t_)o(def)o(au)o +(.)h(.)f(.)g(.)21 b Fb(35)1012 500 y Fd(rl_tty_unse)o(t_)o(def)o(au)o (lt_)o(bi)o(ndi)o(ngs)5 b Fa(.)t(.)h(.)g(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.) -g(.)g(.)20 b Fb(35)1012 498 y Fd(rl_unbind_c)o(om)o(man)o(d_)o(in_)o +g(.)g(.)20 b Fb(35)1012 544 y Fd(rl_unbind_c)o(om)o(man)o(d_)o(in_)o (ma)o(p)7 b Fa(.)f(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g -(.)g(.)h(.)f(.)23 b Fb(30)1012 542 y Fd(rl_unbind_f)o(un)o(cti)o(on)o +(.)g(.)h(.)f(.)23 b Fb(30)1012 587 y Fd(rl_unbind_f)o(un)o(cti)o(on)o (_in)o(_m)o(ap)9 b Fa(.)s(.)d(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.)h(.)f(.)g -(.)g(.)g(.)g(.)g(.)23 b Fb(30)1012 585 y Fd(rl_unbind_k)o(ey)8 +(.)g(.)g(.)g(.)g(.)23 b Fb(30)1012 631 y Fd(rl_unbind_k)o(ey)8 b Fa(.)s(.)e(.)h(.)f(.)g(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.)h(.)f(.) g(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.)h(.)f(.)g(.)22 -b Fb(30)1012 629 y Fd(rl_unbind_k)o(ey)o(_in)o(_m)o(ap)s +b Fb(30)1012 675 y Fd(rl_unbind_k)o(ey)o(_in)o(_m)o(ap)s Fa(.)t(.)6 b(.)g(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.)g(.)h(.)f(.)g(.) -g(.)g(.)g(.)h(.)f(.)g(.)17 b Fb(30)1012 673 y Fd(rl_username)o(_c)o +g(.)g(.)g(.)h(.)f(.)g(.)17 b Fb(30)1012 719 y Fd(rl_username)o(_c)o (omp)o(le)o(tio)o(n_)o(fun)o(cti)o(on)t Fa(.)s(.)7 b(.)f(.)g(.)g(.)g(.) -g(.)h(.)f(.)g(.)18 b Fb(43)1012 716 y Fd(rl_variable)o(_b)o(ind)6 +g(.)h(.)f(.)g(.)18 b Fb(43)1012 763 y Fd(rl_variable)o(_b)o(ind)6 b Fa(.)s(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.) h(.)f(.)g(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)20 b Fb(37)1012 -760 y Fd(rl_variable)o(_d)o(ump)o(er)t Fa(.)t(.)6 b(.)g(.)g(.)g(.)h(.)f +806 y Fd(rl_variable)o(_d)o(ump)o(er)t Fa(.)t(.)6 b(.)g(.)g(.)g(.)h(.)f (.)g(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.)g(.) -19 b Fb(37)1012 886 y Fr(S)1012 944 y Fd(self-insert)9 +19 b Fb(37)1012 933 y Fr(S)1012 992 y Fd(self-insert)9 b(\(a,)j(b,)g(A,)g(1,)g(!,)g(...)o(\))6 b Fa(.)g(.)g(.)g(.)g(.)g(.)g(.) -h(.)f(.)g(.)g(.)g(.)20 b Fb(15)1012 987 y Fd(set-mark)10 +h(.)f(.)g(.)g(.)g(.)20 b Fb(15)1012 1035 y Fd(set-mark)10 b(\(C-@\))g Fa(.)c(.)g(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.)h(.)f(.)g (.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)25 -b Fb(18)1012 1031 y(sho)o(w-all-if-am)o(bigu)q(ous)14 +b Fb(18)1012 1079 y(sho)o(w-all-if-am)o(bigu)q(ous)14 b Fa(.)6 b(.)g(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g -(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.)h(.)23 b Fb(7)1012 1074 +(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.)h(.)23 b Fb(7)1012 1123 y(sho)o(w-all-if-unmo)q(di)q(\014ed)7 b Fa(.)i(.)d(.)g(.)g(.)h(.)f(.)g (.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.)h(.)f(.) -19 b Fb(7)1012 1118 y Fd(start-kbd-m)o(ac)o(ro)9 b(\(C-x)j(\(\))c +19 b Fb(7)1012 1167 y Fd(start-kbd-m)o(ac)o(ro)9 b(\(C-x)j(\(\))c Fa(.)d(.)i(.)f(.)g(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.)g(.)h(.)f(.)g -(.)g(.)g(.)22 b Fb(18)1012 1238 y Fr(T)1012 1296 y Fd(tab-insert)9 -b(\(M-)1281 1294 y Fk(h)p 1292 1268 74 2 v 1292 1296 -a Fj(T)m(AB)p 1292 1304 V 1364 1294 a Fk(i)1379 1296 +(.)g(.)g(.)22 b Fb(18)1012 1288 y Fr(T)1012 1347 y Fd(tab-insert)9 +b(\(M-)1281 1345 y Fk(h)p 1292 1319 74 2 v 1292 1347 +a Fj(T)m(AB)p 1292 1354 V 1364 1345 a Fk(i)1379 1347 y Fd(\))e Fa(.)f(.)g(.)g(.)g(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.)h(.) -f(.)g(.)g(.)g(.)g(.)h(.)f(.)g(.)20 b Fb(15)1012 1340 +f(.)g(.)g(.)g(.)g(.)h(.)f(.)g(.)20 b Fb(15)1012 1391 y Fd(tilde-expan)o(d)10 b(\(M-~\))f Fa(.)s(.)e(.)f(.)g(.)g(.)g(.)g(.)g (.)h(.)f(.)g(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)22 -b Fb(18)1012 1384 y Fd(transpose-c)o(ha)o(rs)9 b(\(C-t\))d +b Fb(18)1012 1434 y Fd(transpose-c)o(ha)o(rs)9 b(\(C-t\))d Fa(.)f(.)h(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.)h -(.)f(.)g(.)g(.)g(.)20 b Fb(15)1012 1427 y Fd(transpose-w)o(or)o(ds)9 +(.)f(.)g(.)g(.)g(.)20 b Fb(15)1012 1478 y Fd(transpose-w)o(or)o(ds)9 b(\(M-t\))d Fa(.)f(.)h(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.)g(.)h(.)f(.)g(.)g -(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)20 b Fb(15)1012 1553 y -Fr(U)1012 1611 y Fd(undo)12 b(\(C-_)f(or)h(C-x)g(C-u\))c +(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)20 b Fb(15)1012 1605 y +Fr(U)1012 1663 y Fd(undo)12 b(\(C-_)f(or)h(C-x)g(C-u\))c Fa(.)t(.)e(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g -(.)g(.)h(.)f(.)g(.)g(.)21 b Fb(18)1012 1655 y Fd(universal-a)o(rg)o +(.)g(.)h(.)f(.)g(.)g(.)21 b Fb(18)1012 1707 y Fd(universal-a)o(rg)o (ume)o(nt)9 b(\(\))d Fa(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.)g(.)h(.)f (.)g(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)20 b Fb(17)1012 -1698 y Fd(unix-line-d)o(is)o(car)o(d)10 b(\(C-u\))5 b -Fa(.)t(.)h(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)g -(.)h(.)f(.)18 b Fb(16)1012 1742 y Fd(unix-word-r)o(ub)o(out)9 -b(\(C-w\))d Fa(.)t(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.)h(.)f(.)g(.)g -(.)g(.)g(.)g(.)h(.)f(.)g(.)19 b Fb(16)1012 1785 y Fd(upcase-word)9 -b(\(M-u\))e Fa(.)f(.)h(.)f(.)g(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.)h -(.)f(.)g(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.)23 b Fb(15)1012 -1911 y Fr(V)1012 1969 y Fd(vi-editing-)o(mo)o(de)9 b(\(M-C-j\))c -Fa(.)t(.)h(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)g -(.)h(.)f(.)18 b Fb(19)1012 2013 y(visible-stats)c Fa(.)6 -b(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.)h(.)f(.)g -(.)g(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)24 -b Fb(7)1012 2129 y Fr(Y)1012 2187 y Fd(yank)12 b(\(C-y\))5 +1751 y Fd(unix-filena)o(me)o(-ru)o(bo)o(ut)9 b(\(\))c +Fa(.)h(.)g(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)g +(.)h(.)f(.)18 b Fb(16)1012 1795 y Fd(unix-line-d)o(is)o(car)o(d)10 +b(\(C-u\))5 b Fa(.)t(.)h(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.)h(.)f(.) +g(.)g(.)g(.)g(.)h(.)f(.)18 b Fb(16)1012 1839 y Fd(unix-word-r)o(ub)o +(out)9 b(\(C-w\))d Fa(.)t(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.)h(.)f +(.)g(.)g(.)g(.)g(.)g(.)h(.)f(.)g(.)19 b Fb(16)1012 1882 +y Fd(upcase-word)9 b(\(M-u\))e Fa(.)f(.)h(.)f(.)g(.)g(.)g(.)g(.)h(.)f +(.)g(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.)23 +b Fb(15)1012 2009 y Fr(V)1012 2068 y Fd(vi-editing-)o(mo)o(de)9 +b(\(M-C-j\))c Fa(.)t(.)h(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.)h(.)f(.) +g(.)g(.)g(.)g(.)h(.)f(.)18 b Fb(19)1012 2111 y(visible-stats)c +Fa(.)6 b(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.)h(.) +f(.)g(.)g(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)24 +b Fb(7)1012 2229 y Fr(Y)1012 2287 y Fd(yank)12 b(\(C-y\))5 b Fa(.)t(.)h(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.)h(.) f(.)g(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.)19 -b Fb(16)1012 2231 y Fd(yank-last-a)o(rg)9 b(\(M-.)i(or)h(M-_\))c +b Fb(17)1012 2331 y Fd(yank-last-a)o(rg)9 b(\(M-.)i(or)h(M-_\))c Fa(.)f(.)f(.)g(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)23 -b Fb(14)1012 2274 y Fd(yank-nth-ar)o(g)10 b(\(M-C-y\))d +b Fb(14)1012 2375 y Fd(yank-nth-ar)o(g)10 b(\(M-C-y\))d Fa(.)s(.)f(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.)h(.)f -(.)g(.)g(.)g(.)g(.)h(.)20 b Fb(14)1012 2318 y Fd(yank-pop)10 +(.)g(.)g(.)g(.)g(.)h(.)20 b Fb(14)1012 2419 y Fd(yank-pop)10 b(\(M-y\))g Fa(.)c(.)g(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.)h(.)f(.)g (.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)25 b Fb(17)p eop -%%Page: 68 72 -68 71 bop 75 -58 a Ft(68)1299 b(GNU)15 b(Readline)h(Library)p +%%Page: 70 74 +70 73 bop 75 -58 a Ft(70)1299 b(GNU)15 b(Readline)h(Library)p eop %%Trailer end diff --git a/lib/readline/doc/rlman.aux b/lib/readline/doc/rlman.aux index b54c096c..b5c2d1cb 100644 --- a/lib/readline/doc/rlman.aux +++ b/lib/readline/doc/rlman.aux @@ -140,17 +140,17 @@ @xrdef{Completion Variables-pg}{43} @xrdef{Completion Variables-snt}{Section@tie 2.6.3} @xrdef{A Short Completion Example-title}{A Short Completion Example} -@xrdef{A Short Completion Example-pg}{46} +@xrdef{A Short Completion Example-pg}{47} @xrdef{A Short Completion Example-snt}{Section@tie 2.6.4} @xrdef{Copying This Manual-title}{Copying This Manual} -@xrdef{Copying This Manual-pg}{55} +@xrdef{Copying This Manual-pg}{57} @xrdef{Copying This Manual-snt}{Appendix@tie @char65{}} @xrdef{GNU Free Documentation License-title}{GNU Free Documentation License} -@xrdef{GNU Free Documentation License-pg}{55} +@xrdef{GNU Free Documentation License-pg}{57} @xrdef{GNU Free Documentation License-snt}{Section@tie @char65.1} @xrdef{Concept Index-title}{Concept Index} -@xrdef{Concept Index-pg}{63} +@xrdef{Concept Index-pg}{65} @xrdef{Concept Index-snt}{} @xrdef{Function and Variable Index-title}{Function and Variable Index} -@xrdef{Function and Variable Index-pg}{65} +@xrdef{Function and Variable Index-pg}{67} @xrdef{Function and Variable Index-snt}{} diff --git a/lib/readline/doc/rlman.cp b/lib/readline/doc/rlman.cp index 8b165829..30f7d906 100644 --- a/lib/readline/doc/rlman.cp +++ b/lib/readline/doc/rlman.cp @@ -9,4 +9,4 @@ \entry{variables, readline}{5}{variables, readline} \entry{readline, function}{21}{readline, function} \entry{application-specific completion functions}{41}{application-specific completion functions} -\entry{FDL, GNU Free Documentation License}{55}{FDL, GNU Free Documentation License} +\entry{FDL, GNU Free Documentation License}{57}{FDL, GNU Free Documentation License} diff --git a/lib/readline/doc/rlman.cps b/lib/readline/doc/rlman.cps index f4ec8c77..380e3345 100644 --- a/lib/readline/doc/rlman.cps +++ b/lib/readline/doc/rlman.cps @@ -5,7 +5,7 @@ \initial {E} \entry {editing command lines}{1} \initial {F} -\entry {FDL, GNU Free Documentation License}{55} +\entry {FDL, GNU Free Documentation License}{57} \initial {I} \entry {initialization file, readline}{4} \entry {interaction, readline}{1} diff --git a/lib/readline/doc/rlman.fn b/lib/readline/doc/rlman.fn index 114fdd07..15ab423d 100644 --- a/lib/readline/doc/rlman.fn +++ b/lib/readline/doc/rlman.fn @@ -60,12 +60,13 @@ \entry{kill-word (M-d)}{16}{\code {kill-word (M-d)}} \entry{backward-kill-word (M-DEL)}{16}{\code {backward-kill-word (M-\key {DEL})}} \entry{unix-word-rubout (C-w)}{16}{\code {unix-word-rubout (C-w)}} +\entry{unix-filename-rubout ()}{16}{\code {unix-filename-rubout ()}} \entry{delete-horizontal-space ()}{16}{\code {delete-horizontal-space ()}} \entry{kill-region ()}{16}{\code {kill-region ()}} \entry{copy-region-as-kill ()}{16}{\code {copy-region-as-kill ()}} \entry{copy-backward-word ()}{16}{\code {copy-backward-word ()}} \entry{copy-forward-word ()}{16}{\code {copy-forward-word ()}} -\entry{yank (C-y)}{16}{\code {yank (C-y)}} +\entry{yank (C-y)}{17}{\code {yank (C-y)}} \entry{yank-pop (M-y)}{17}{\code {yank-pop (M-y)}} \entry{digit-argument (M-0, M-1, ...{} M--)}{17}{\code {digit-argument (\kbd {M-0}, \kbd {M-1}, \dots {} \kbd {M--})}} \entry{universal-argument ()}{17}{\code {universal-argument ()}} @@ -188,7 +189,7 @@ \entry{rl_read_key}{34}{\code {rl_read_key}} \entry{rl_getc}{34}{\code {rl_getc}} \entry{rl_stuff_char}{34}{\code {rl_stuff_char}} -\entry{rl_execute_next}{34}{\code {rl_execute_next}} +\entry{rl_execute_next}{35}{\code {rl_execute_next}} \entry{rl_clear_pending_input}{35}{\code {rl_clear_pending_input}} \entry{rl_set_keyboard_input_timeout}{35}{\code {rl_set_keyboard_input_timeout}} \entry{rl_prep_terminal}{35}{\code {rl_prep_terminal}} @@ -198,7 +199,7 @@ \entry{rl_reset_terminal}{35}{\code {rl_reset_terminal}} \entry{rl_replace_line}{35}{\code {rl_replace_line}} \entry{rl_extend_line_buffer}{35}{\code {rl_extend_line_buffer}} -\entry{rl_initialize}{35}{\code {rl_initialize}} +\entry{rl_initialize}{36}{\code {rl_initialize}} \entry{rl_ding}{36}{\code {rl_ding}} \entry{rl_alphabetic}{36}{\code {rl_alphabetic}} \entry{rl_display_match_list}{36}{\code {rl_display_match_list}} @@ -248,16 +249,20 @@ \entry{rl_basic_word_break_characters}{44}{\code {rl_basic_word_break_characters}} \entry{rl_basic_quote_characters}{44}{\code {rl_basic_quote_characters}} \entry{rl_completer_word_break_characters}{45}{\code {rl_completer_word_break_characters}} +\entry{rl_completion_word_break_hook}{45}{\code {rl_completion_word_break_hook}} \entry{rl_completer_quote_characters}{45}{\code {rl_completer_quote_characters}} \entry{rl_filename_quote_characters}{45}{\code {rl_filename_quote_characters}} \entry{rl_special_prefixes}{45}{\code {rl_special_prefixes}} \entry{rl_completion_query_items}{45}{\code {rl_completion_query_items}} \entry{rl_completion_append_character}{45}{\code {rl_completion_append_character}} \entry{rl_completion_suppress_append}{45}{\code {rl_completion_suppress_append}} -\entry{rl_completion_mark_symlink_dirs}{45}{\code {rl_completion_mark_symlink_dirs}} -\entry{rl_ignore_completion_duplicates}{45}{\code {rl_ignore_completion_duplicates}} +\entry{rl_completion_quote_character}{45}{\code {rl_completion_quote_character}} +\entry{rl_completion_suppress_quote}{46}{\code {rl_completion_suppress_quote}} +\entry{rl_completion_found_quote}{46}{\code {rl_completion_found_quote}} +\entry{rl_completion_mark_symlink_dirs}{46}{\code {rl_completion_mark_symlink_dirs}} +\entry{rl_ignore_completion_duplicates}{46}{\code {rl_ignore_completion_duplicates}} \entry{rl_filename_completion_desired}{46}{\code {rl_filename_completion_desired}} \entry{rl_filename_quoting_desired}{46}{\code {rl_filename_quoting_desired}} \entry{rl_attempted_completion_over}{46}{\code {rl_attempted_completion_over}} \entry{rl_completion_type}{46}{\code {rl_completion_type}} -\entry{rl_inhibit_completion}{46}{\code {rl_inhibit_completion}} +\entry{rl_inhibit_completion}{47}{\code {rl_inhibit_completion}} diff --git a/lib/readline/doc/rlman.fns b/lib/readline/doc/rlman.fns index b1dfd486..b8e0863e 100644 --- a/lib/readline/doc/rlman.fns +++ b/lib/readline/doc/rlman.fns @@ -133,12 +133,16 @@ \entry {\code {rl_completion_append_character}}{45} \entry {\code {rl_completion_display_matches_hook}}{44} \entry {\code {rl_completion_entry_function}}{42, 43} -\entry {\code {rl_completion_mark_symlink_dirs}}{45} +\entry {\code {rl_completion_found_quote}}{46} +\entry {\code {rl_completion_mark_symlink_dirs}}{46} \entry {\code {rl_completion_matches}}{42} \entry {\code {rl_completion_mode}}{42} \entry {\code {rl_completion_query_items}}{45} +\entry {\code {rl_completion_quote_character}}{45} \entry {\code {rl_completion_suppress_append}}{45} +\entry {\code {rl_completion_suppress_quote}}{46} \entry {\code {rl_completion_type}}{46} +\entry {\code {rl_completion_word_break_hook}}{45} \entry {\code {rl_copy_keymap}}{28} \entry {\code {rl_copy_text}}{34} \entry {\code {rl_crlf}}{33} @@ -157,7 +161,7 @@ \entry {\code {rl_end_undo_group}}{32} \entry {\code {rl_erase_empty_line}}{24} \entry {\code {rl_event_hook}}{26} -\entry {\code {rl_execute_next}}{34} +\entry {\code {rl_execute_next}}{35} \entry {\code {rl_executing_keymap}}{26} \entry {\code {rl_executing_macro}}{26} \entry {\code {rl_expand_prompt}}{33} @@ -184,10 +188,10 @@ \entry {\code {rl_getc}}{34} \entry {\code {rl_getc_function}}{26} \entry {\code {rl_gnu_readline_p}}{25} -\entry {\code {rl_ignore_completion_duplicates}}{45} +\entry {\code {rl_ignore_completion_duplicates}}{46} \entry {\code {rl_ignore_some_completions_function}}{44} -\entry {\code {rl_inhibit_completion}}{46} -\entry {\code {rl_initialize}}{35} +\entry {\code {rl_inhibit_completion}}{47} +\entry {\code {rl_initialize}}{36} \entry {\code {rl_insert_completions}}{42} \entry {\code {rl_insert_text}}{34} \entry {\code {rl_instream}}{25} @@ -269,6 +273,7 @@ \initial {U} \entry {\code {undo (C-_ or C-x C-u)}}{18} \entry {\code {universal-argument ()}}{17} +\entry {\code {unix-filename-rubout ()}}{16} \entry {\code {unix-line-discard (C-u)}}{16} \entry {\code {unix-word-rubout (C-w)}}{16} \entry {\code {upcase-word (M-u)}}{15} @@ -276,7 +281,7 @@ \entry {\code {vi-editing-mode (M-C-j)}}{19} \entry {visible-stats}{7} \initial {Y} -\entry {\code {yank (C-y)}}{16} +\entry {\code {yank (C-y)}}{17} \entry {\code {yank-last-arg (M-. or M-_)}}{14} \entry {\code {yank-nth-arg (M-C-y)}}{14} \entry {\code {yank-pop (M-y)}}{17} diff --git a/lib/readline/doc/rlman.log b/lib/readline/doc/rlman.log index 08f7ef0e..4fa21f57 100644 --- a/lib/readline/doc/rlman.log +++ b/lib/readline/doc/rlman.log @@ -1,9 +1,9 @@ -This is TeX, Version 3.14159 (Web2C 7.3.1) (format=tex 2001.2.12) 22 SEP 2003 09:04 -**/net/granite/fs4/src/ns-engr/work/chet/src/bash/src/lib/readline/doc/rlman.te -xi +This is TeX, Version 3.14159 (Web2C 7.3.1) (format=tex 2001.2.12) 27 JUL 2004 09:31 +**/net/celerra-dm1/fs04/src/ns-engr/work/chet/src/bash/src/lib/readline/doc/rlm +an.texi -(/net/granite/fs4/src/ns-engr/work/chet/src/bash/src/lib/readline/doc/rlman.tex -i (texinfo.tex Loading texinfo [version 2003-02-03.16]: Basics, +(/net/celerra-dm1/fs04/src/ns-engr/work/chet/src/bash/src/lib/readline/doc/rlma +n.texi (texinfo.tex Loading texinfo [version 2003-02-03.16]: Basics, \bindingoffset=\dimen16 \normaloffset=\dimen17 \pagewidth=\dimen18 @@ -34,13 +34,13 @@ i (texinfo.tex Loading texinfo [version 2003-02-03.16]: Basics, \toksD=\toks18 \boxA=\box19 \countA=\count30 - fonts, + +fonts, \sffam=\fam8 \textleading=\dimen26 \mainmagstep=\count31 \fontdepth=\count32 - -page headings, + page headings, \titlepagetopglue=\skip20 \titlepagebottomglue=\skip21 \evenheadline=\toks19 @@ -81,7 +81,8 @@ page headings, \lastnegativepageno=\count43 \shortappendixwidth=\dimen33 \tocindent=\dimen34 - environments, + +environments, \errorbox=\box22 \lispnarrowing=\skip30 \envskipamount=\skip31 @@ -94,8 +95,7 @@ page headings, \lskip=\skip35 \rskip=\skip36 \tabw=\dimen38 - -defuns, + defuns, \defbodyindent=\skip37 \defargsindent=\skip38 \deflastargmargin=\skip39 @@ -186,7 +186,7 @@ gnored[] | [11] [12] [13] [14] [15] [16] [17] [18]) (rltech.texi Chapter 2 [19] [20] [21] [22] [23] [24] [25] [26] [27] [28] [29] [30] [31] [32] [33] [34] [35] [36] [37] [38] [39] [40] [41] [42] [43] [44] [45] -Underfull \hbox (badness 7379) in paragraph at lines 1757--1762 +Underfull \hbox (badness 7379) in paragraph at lines 1792--1797 []@textrm If an application-specific com-ple-tion func-tion as-signed to @text tt rl_attempted_ @@ -198,16 +198,16 @@ tt rl_attempted_ .@glue 3.65 plus 1.825 minus 1.21666 .etc. -[46] [47] [48] [49] [50] [51] [52] [53]) Appendix A [54] (fdl.texi [55] -[56] [57] [58] [59] [60]) (Concept Index) [61] [62] (rlman.cps) -(Function and Variable Index) [63] [64] (rlman.fns [65] [66]) [67] [68] ) +[46] [47] [48] [49] [50] [51] [52] [53] [54]) Appendix A [55] [56] (fdl.texi +[57] [58] [59] [60] [61] [62]) (Concept Index) [63] [64] (rlman.cps) +(Function and Variable Index) [65] [66] (rlman.fns [67] [68]) [69] [70] ) Here is how much of TeX's memory you used: 1489 strings out of 13013 - 18350 string characters out of 97233 - 56934 words of memory out of 263001 + 18360 string characters out of 97233 + 58248 words of memory out of 263001 2361 multiletter control sequences out of 10000+0 31953 words of font info for 111 fonts, out of 400000 for 1000 19 hyphenation exceptions out of 1000 - 15i,8n,17p,304b,695s stack positions out of 300i,100n,500p,50000b,4000s + 15i,8n,17p,309b,695s stack positions out of 300i,100n,500p,50000b,4000s -Output written on rlman.dvi (72 pages, 270424 bytes). +Output written on rlman.dvi (74 pages, 274068 bytes). diff --git a/lib/readline/doc/rlman.toc b/lib/readline/doc/rlman.toc index 9d08ef50..0dc63018 100644 --- a/lib/readline/doc/rlman.toc +++ b/lib/readline/doc/rlman.toc @@ -45,9 +45,9 @@ \subsecentry{How Completing Works}{2}{6}{1}{41} \subsecentry{Completion Functions}{2}{6}{2}{42} \subsecentry{Completion Variables}{2}{6}{3}{43} -\subsecentry{A Short Completion Example}{2}{6}{4}{46} -\appendixentry{Copying This Manual}{A}{55} -\secentry{GNU Free Documentation License}{A}{1}{55} -\subsecentry{ADDENDUM: How to use this License for your documents}{A}{1}{1}{61} -\unnumbchapentry{Concept Index}{2}{63} -\unnumbchapentry{Function and Variable Index}{2}{65} +\subsecentry{A Short Completion Example}{2}{6}{4}{47} +\appendixentry{Copying This Manual}{A}{57} +\secentry{GNU Free Documentation License}{A}{1}{57} +\subsecentry{ADDENDUM: How to use this License for your documents}{A}{1}{1}{63} +\unnumbchapentry{Concept Index}{2}{65} +\unnumbchapentry{Function and Variable Index}{2}{67} diff --git a/lib/readline/doc/rluserman.dvi b/lib/readline/doc/rluserman.dvi index f77eb4e6..55667c31 100644 Binary files a/lib/readline/doc/rluserman.dvi and b/lib/readline/doc/rluserman.dvi differ diff --git a/lib/readline/doc/rluserman.fn b/lib/readline/doc/rluserman.fn index e073421a..14643e56 100644 --- a/lib/readline/doc/rluserman.fn +++ b/lib/readline/doc/rluserman.fn @@ -38,12 +38,13 @@ \entry{kill-word (M-d)}{16}{\code {kill-word (M-d)}} \entry{backward-kill-word (M-DEL)}{16}{\code {backward-kill-word (M-\key {DEL})}} \entry{unix-word-rubout (C-w)}{16}{\code {unix-word-rubout (C-w)}} +\entry{unix-filename-rubout ()}{16}{\code {unix-filename-rubout ()}} \entry{delete-horizontal-space ()}{16}{\code {delete-horizontal-space ()}} \entry{kill-region ()}{16}{\code {kill-region ()}} \entry{copy-region-as-kill ()}{16}{\code {copy-region-as-kill ()}} \entry{copy-backward-word ()}{16}{\code {copy-backward-word ()}} \entry{copy-forward-word ()}{16}{\code {copy-forward-word ()}} -\entry{yank (C-y)}{16}{\code {yank (C-y)}} +\entry{yank (C-y)}{17}{\code {yank (C-y)}} \entry{yank-pop (M-y)}{17}{\code {yank-pop (M-y)}} \entry{digit-argument (M-0, M-1, ...{} M--)}{17}{\code {digit-argument (\kbd {M-0}, \kbd {M-1}, \dots {} \kbd {M--})}} \entry{universal-argument ()}{17}{\code {universal-argument ()}} diff --git a/lib/readline/doc/rluserman.fns b/lib/readline/doc/rluserman.fns index 95140153..0ead5878 100644 --- a/lib/readline/doc/rluserman.fns +++ b/lib/readline/doc/rluserman.fns @@ -82,13 +82,14 @@ \initial {U} \entry {\code {undo (C-_ or C-x C-u)}}{18} \entry {\code {universal-argument ()}}{17} +\entry {\code {unix-filename-rubout ()}}{16} \entry {\code {unix-line-discard (C-u)}}{16} \entry {\code {unix-word-rubout (C-w)}}{16} \entry {\code {upcase-word (M-u)}}{15} \initial {V} \entry {\code {vi-editing-mode (M-C-j)}}{19} \initial {Y} -\entry {\code {yank (C-y)}}{16} +\entry {\code {yank (C-y)}}{17} \entry {\code {yank-last-arg (M-. or M-_)}}{14} \entry {\code {yank-nth-arg (M-C-y)}}{14} \entry {\code {yank-pop (M-y)}}{17} diff --git a/lib/readline/doc/rluserman.html b/lib/readline/doc/rluserman.html index 1aa77787..6055fbe7 100644 --- a/lib/readline/doc/rluserman.html +++ b/lib/readline/doc/rluserman.html @@ -1,6 +1,6 @@ - +
- +
digit-argument (M-0, M-1, ... M--) -
+
Add this digit to the argument already accumulating, or start a new argument. M-- starts a negative argument.

- +

universal-argument () -
+
This is another way to specify an argument. If this command is followed by one or more digits, optionally with a leading minus sign, those digits define the argument. @@ -1658,30 +1666,30 @@ By default, this is not bound to a key.

- +
complete (TAB) -
+
Attempt to perform completion on the text before point. The actual completion performed is application-specific. The default is filename completion.

- +

possible-completions (M-?) -
+
List the possible completions of the text before point.

- +

insert-completions (M-*) -
+
Insert all completions of the text before point that would have 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 @@ -1696,9 +1704,9 @@ This command is intended to be bound to TAB, but is unbound by default.

- +

delete-char-or-list () -
+
Deletes the character under the cursor if not at the beginning or end of the line (like delete-char). If at the end of the line, behaves identically to @@ -1727,22 +1735,22 @@ This command is unbound by default.
- +
start-kbd-macro (C-x () -
+
Begin saving the characters typed into the current keyboard macro.

- +

end-kbd-macro (C-x )) -
+
Stop saving the characters typed into the current keyboard macro and save the definition.

- +

call-last-kbd-macro (C-x e) -
+
Re-execute the last keyboard macro defined, by making the characters in the macro appear as if typed at the keyboard.

@@ -1768,87 +1776,87 @@ in the macro appear as if typed at the keyboard.

- +
re-read-init-file (C-x C-r) -
+
Read in the contents of the inputrc file, and incorporate any bindings or variable assignments found there.

- +

abort (C-g) -
+
Abort the current editing command and ring the terminal's bell (subject to the setting of bell-style).

- +

do-uppercase-version (M-a, M-b, M-x, ...) -
+
If the metafied character x is lowercase, run the command that is bound to the corresponding uppercase character.

- +

prefix-meta (ESC) -
+
Metafy the next character typed. This is for keyboards without a meta key. Typing `ESC f' is equivalent to typing M-f.

- +

undo (C-_ or C-x C-u) -
+
Incremental undo, separately remembered for each line.

- +

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-~) -
+
Perform tilde expansion on the current word.

- +

set-mark (C-@) -
+
Set the mark to the point. If a numeric argument is supplied, the mark is set to that position.

- +

exchange-point-and-mark (C-x C-x) -
+
Swap the point with the mark. The current cursor position is set to the saved position, and the old cursor position is saved as the mark.

- +

character-search (C-]) -
+
A character is read and point is moved to the next occurrence of that character. A negative count searches for previous occurrences.

- +

character-search-backward (M-C-]) -
+
A character is read and point is moved to the previous occurrence of that character. A negative count searches for subsequent occurrences.

- +

insert-comment (M-#) -
+
Without a numeric argument, the value of the comment-begin variable is inserted at the beginning of the current line. If a numeric argument is supplied, this command acts as a toggle: if @@ -1859,43 +1867,43 @@ the line. In either case, the line is accepted as if a newline had been typed.

- +

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 file. This command is unbound by default.

- +

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 output. 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.

- +

emacs-editing-mode (C-e) -
+
When in vi command mode, this causes a switch to emacs editing mode.

- +

vi-editing-mode (M-C-j) -
+
When in emacs editing mode, this causes a switch to vi editing mode.

@@ -1982,7 +1990,7 @@ so forth.

- +

Version 1.2, November 2002
@@ -2600,7 +2608,7 @@ to permit their use in free software. [ ? ]

About this document

-This document was generated by Chet Ramey on September, 22 2003 +This document was generated by Chet Ramey on July, 27 2004 using texi2html

@@ -2762,7 +2770,7 @@ the following structure:
This document was generated -by Chet Ramey on September, 22 2003 +by Chet Ramey on July, 27 2004 using texi2html diff --git a/lib/readline/doc/rluserman.info b/lib/readline/doc/rluserman.info index 50c6b174..80958ec6 100644 --- a/lib/readline/doc/rluserman.info +++ b/lib/readline/doc/rluserman.info @@ -2,11 +2,11 @@ This is rluserman.info, produced by makeinfo version 4.5 from ./rluserman.texi. This manual describes the end user interface of the GNU Readline Library -(version 5.0, 19 September 2003), a library which aids in the -consistency of user interface across discrete programs which provide a -command line interface. +(version 5.0, 28 January 2004), a library which aids in the consistency +of user interface across discrete programs which provide a command line +interface. - Copyright (C) 1988-2003 Free Software Foundation, Inc. + Copyright (C) 1988-2004 Free Software Foundation, Inc. Permission is granted to make and distribute verbatim copies of this manual provided the copyright notice and this permission notice are @@ -1036,6 +1036,11 @@ Killing And Yanking Kill the word behind point, using white space as a word boundary. The killed text is saved on the kill-ring. +`unix-filename-rubout ()' + Kill the word behind point, using white space and the slash + character as the word boundaries. The killed text is saved on the + kill-ring. + `delete-horizontal-space ()' Delete all spaces and tabs around point. By default, this is unbound. @@ -1697,30 +1702,30 @@ permit their use in free software.  Tag Table: -Node: Top1341 -Node: Command Line Editing1776 -Node: Introduction and Notation2418 -Node: Readline Interaction4037 -Node: Readline Bare Essentials5225 -Node: Readline Movement Commands7007 -Node: Readline Killing Commands7965 -Node: Readline Arguments9876 -Node: Searching10913 -Node: Readline Init File13057 -Node: Readline Init File Syntax14119 -Node: Conditional Init Constructs25483 -Node: Sample Init File28009 -Node: Bindable Readline Commands31194 -Node: Commands For Moving32245 -Node: Commands For History33096 -Node: Commands For Text35956 -Node: Commands For Killing38672 -Node: Numeric Arguments40624 -Node: Commands For Completion41753 -Node: Keyboard Macros43287 -Node: Miscellaneous Commands43848 -Node: Readline vi Mode47199 -Node: Copying This Manual48115 -Node: GNU Free Documentation License48325 +Node: Top1339 +Node: Command Line Editing1774 +Node: Introduction and Notation2416 +Node: Readline Interaction4035 +Node: Readline Bare Essentials5223 +Node: Readline Movement Commands7005 +Node: Readline Killing Commands7963 +Node: Readline Arguments9874 +Node: Searching10911 +Node: Readline Init File13055 +Node: Readline Init File Syntax14117 +Node: Conditional Init Constructs25481 +Node: Sample Init File28007 +Node: Bindable Readline Commands31192 +Node: Commands For Moving32243 +Node: Commands For History33094 +Node: Commands For Text35954 +Node: Commands For Killing38670 +Node: Numeric Arguments40802 +Node: Commands For Completion41931 +Node: Keyboard Macros43465 +Node: Miscellaneous Commands44026 +Node: Readline vi Mode47377 +Node: Copying This Manual48293 +Node: GNU Free Documentation License48503  End Tag Table diff --git a/lib/readline/doc/rluserman.log b/lib/readline/doc/rluserman.log index 01f9a4dc..a5870c90 100644 --- a/lib/readline/doc/rluserman.log +++ b/lib/readline/doc/rluserman.log @@ -1,9 +1,9 @@ -This is TeX, Version 3.14159 (Web2C 7.3.1) (format=tex 2001.2.12) 22 SEP 2003 09:04 -**/net/granite/fs4/src/ns-engr/work/chet/src/bash/src/lib/readline/doc/rluserma -n.texi +This is TeX, Version 3.14159 (Web2C 7.3.1) (format=tex 2001.2.12) 27 JUL 2004 09:31 +**/net/celerra-dm1/fs04/src/ns-engr/work/chet/src/bash/src/lib/readline/doc/rlu +serman.texi -(/net/granite/fs4/src/ns-engr/work/chet/src/bash/src/lib/readline/doc/rluserman -.texi (texinfo.tex Loading texinfo [version 2003-02-03.16]: Basics, +(/net/celerra-dm1/fs04/src/ns-engr/work/chet/src/bash/src/lib/readline/doc/rlus +erman.texi (texinfo.tex Loading texinfo [version 2003-02-03.16]: Basics, \bindingoffset=\dimen16 \normaloffset=\dimen17 \pagewidth=\dimen18 @@ -187,11 +187,11 @@ gnored[] | [21] [22] [23] [24] [25] [26]) [27] [28] ) Here is how much of TeX's memory you used: 1398 strings out of 13013 - 16279 string characters out of 97233 - 44937 words of memory out of 263001 + 16289 string characters out of 97233 + 44933 words of memory out of 263001 2276 multiletter control sequences out of 10000+0 31953 words of font info for 111 fonts, out of 400000 for 1000 19 hyphenation exceptions out of 1000 - 13i,8n,10p,308b,695s stack positions out of 300i,100n,500p,50000b,4000s + 13i,8n,10p,313b,695s stack positions out of 300i,100n,500p,50000b,4000s -Output written on rluserman.dvi (32 pages, 91652 bytes). +Output written on rluserman.dvi (32 pages, 91852 bytes). diff --git a/lib/readline/doc/rluserman.ps b/lib/readline/doc/rluserman.ps index eb65adcf..dd3249da 100644 --- a/lib/readline/doc/rluserman.ps +++ b/lib/readline/doc/rluserman.ps @@ -8,7 +8,7 @@ %DVIPSWebPage: (www.radicaleye.com) %DVIPSCommandLine: dvips -D 300 -o rluserman.ps rluserman.dvi %DVIPSParameters: dpi=300, compressed -%DVIPSSource: TeX output 2003.09.22:0904 +%DVIPSSource: TeX output 2004.07.27:0931 %%BeginProcSet: texc.pro %! /TeXDict 300 dict def TeXDict begin/N{def}def/B{bind def}N/S{exch}N/X{S @@ -908,23 +908,23 @@ TeXDict begin %%Page: 1 1 1 0 bop 75 659 a Fp(GNU)33 b(Readline)h(Library)e(User)h(In)m(terface)p 75 709 1800 17 v 936 757 a Fo(Edition)17 b(5.0,)c(for)i -Fn(Readline)f(Library)g Fo(V)l(ersion)i(5.0.)1559 811 -y(Septem)o(b)q(er)g(2003)75 2467 y Fm(Chet)22 b(Ramey)-6 -b(,)23 b(Case)e(W)-6 b(estern)23 b(Reserv)n(e)f(Univ)n(ersit)n(y)75 +Fn(Readline)f(Library)g Fo(V)l(ersion)i(5.0.)1609 811 +y(Jan)o(uary)f(2004)75 2467 y Fm(Chet)22 b(Ramey)-6 b(,)23 +b(Case)e(W)-6 b(estern)23 b(Reserv)n(e)f(Univ)n(ersit)n(y)75 2534 y(Brian)h(F)-6 b(o)n(x,)23 b(F)-6 b(ree)23 b(Soft)n(w)n(are)f(F)-6 b(oundation)p 75 2570 1800 9 v eop %%Page: 2 2 -2 1 bop 75 1512 a Fo(This)15 b(man)o(ual)g(describ)q(es)i(the)d(end)i -(user)f(in)o(terface)g(of)f(the)h(GNU)f(Readline)i(Library)f(\(v)o -(ersion)g(5.0,)f(19)75 1567 y(Septem)o(b)q(er)19 b(2003\),)e(a)h -(library)h(whic)o(h)g(aids)g(in)g(the)f(consistency)h(of)f(user)g(in)o -(terface)h(across)e(discrete)75 1621 y(programs)d(whic)o(h)i(pro)o -(vide)g(a)f(command)g(line)i(in)o(terface.)75 1689 y(Cop)o(yrigh)o(t) -301 1688 y(c)289 1689 y Fl(\015)d Fo(1988-2003)f(F)l(ree)i(Soft)o(w)o -(are)f(F)l(oundation,)h(Inc.)75 1756 y(P)o(ermission)i(is)f(gran)o(ted) -g(to)f(mak)o(e)h(and)g(distribute)i(v)o(erbatim)d(copies)i(of)f(this)h -(man)o(ual)f(pro)o(vided)h(the)75 1811 y(cop)o(yrigh)o(t)e(notice)h -(and)f(this)h(p)q(ermission)g(notice)g(are)f(preserv)o(ed)h(on)f(all)h +2 1 bop 75 1512 a Fo(This)20 b(man)o(ual)f(describ)q(es)i(the)f(end)g +(user)f(in)o(terface)h(of)f(the)g(GNU)g(Readline)i(Library)f(\(v)o +(ersion)f(5.0,)75 1567 y(28)e(Jan)o(uary)g(2004\),)f(a)h(library)h +(whic)o(h)g(aids)f(in)h(the)g(consistency)g(of)f(user)g(in)o(terface)h +(across)e(discrete)75 1621 y(programs)e(whic)o(h)i(pro)o(vide)g(a)f +(command)g(line)i(in)o(terface.)75 1689 y(Cop)o(yrigh)o(t)301 +1688 y(c)289 1689 y Fl(\015)d Fo(1988-2004)f(F)l(ree)i(Soft)o(w)o(are)f +(F)l(oundation,)h(Inc.)75 1756 y(P)o(ermission)i(is)f(gran)o(ted)g(to)f +(mak)o(e)h(and)g(distribute)i(v)o(erbatim)d(copies)i(of)f(this)h(man)o +(ual)f(pro)o(vided)h(the)75 1811 y(cop)o(yrigh)o(t)e(notice)h(and)f +(this)h(p)q(ermission)g(notice)g(are)f(preserv)o(ed)h(on)f(all)h (copies.)195 1878 y(P)o(ermission)i(is)g(gran)o(ted)f(to)g(cop)o(y)l(,) h(distribute)h(and/or)e(mo)q(dify)h(this)g(do)q(cumen)o(t)g(under)195 1933 y(the)h(terms)f(of)h(the)g(GNU)g(F)l(ree)g(Do)q(cumen)o(tation)g @@ -1922,114 +1922,119 @@ b(With)11 b(an)g(explicit)i(non-p)q(ositiv)o(e)f(n)o(umeric)g(argumen)o Fn(emacs)e Fo(mo)q(de;)h Fn(vi)g Fo(mo)q(de)h(do)q(es)g(o)o(v)o (erwrite)315 204 y(di\013eren)o(tly)l(.)21 b(Eac)o(h)15 b(call)h(to)f Fn(readline\(\))f Fo(starts)f(in)k(insert)e(mo)q(de.)315 -271 y(In)g(o)o(v)o(erwrite)f(mo)q(de,)h(c)o(haracters)f(b)q(ound)h(to)f +269 y(In)g(o)o(v)o(erwrite)f(mo)q(de,)h(c)o(haracters)f(b)q(ound)h(to)f Fn(self-insert)f Fo(replace)j(the)e(text)h(at)e(p)q(oin)o(t)315 -326 y(rather)20 b(than)h(pushing)h(the)f(text)f(to)g(the)h(righ)o(t.)36 -b(Characters)20 b(b)q(ound)i(to)e Fn(backward-)315 381 +324 y(rather)20 b(than)h(pushing)h(the)f(text)f(to)g(the)h(righ)o(t.)36 +b(Characters)20 b(b)q(ound)i(to)e Fn(backward-)315 379 y(delete-char)14 b Fo(replace)i(the)f(c)o(haracter)g(b)q(efore)g(p)q -(oin)o(t)h(with)f(a)g(space.)315 448 y(By)g(default,)h(this)f(command)g -(is)h(un)o(b)q(ound.)75 559 y Fc(1.4.4)30 b(Killing)20 -b(And)h(Y)-5 b(anking)75 680 y Fn(kill-line)14 b(\(C-k\))315 -735 y Fo(Kill)j(the)f(text)e(from)h(p)q(oin)o(t)h(to)e(the)h(end)h(of)f -(the)g(line.)75 814 y Fn(backward-kill-line)e(\(C-x)h(Rubout\))315 -869 y Fo(Kill)j(bac)o(kw)o(ard)e(to)f(the)i(b)q(eginning)h(of)e(the)g -(line.)75 948 y Fn(unix-line-discard)e(\(C-u\))315 1003 +(oin)o(t)h(with)f(a)g(space.)315 444 y(By)g(default,)h(this)f(command)g +(is)h(un)o(b)q(ound.)75 550 y Fc(1.4.4)30 b(Killing)20 +b(And)h(Y)-5 b(anking)75 669 y Fn(kill-line)14 b(\(C-k\))315 +724 y Fo(Kill)j(the)f(text)e(from)h(p)q(oin)o(t)h(to)e(the)h(end)h(of)f +(the)g(line.)75 800 y Fn(backward-kill-line)e(\(C-x)h(Rubout\))315 +854 y Fo(Kill)j(bac)o(kw)o(ard)e(to)f(the)i(b)q(eginning)h(of)e(the)g +(line.)75 930 y Fn(unix-line-discard)e(\(C-u\))315 985 y Fo(Kill)k(bac)o(kw)o(ard)e(from)f(the)i(cursor)e(to)h(the)g(b)q -(eginning)j(of)c(the)i(curren)o(t)f(line.)75 1082 y Fn(kill-whole-line) -e(\(\))315 1137 y Fo(Kill)20 b(all)g(c)o(haracters)d(on)h(the)h(curren) +(eginning)j(of)c(the)i(curren)o(t)f(line.)75 1060 y Fn(kill-whole-line) +e(\(\))315 1115 y Fo(Kill)20 b(all)g(c)o(haracters)d(on)h(the)h(curren) o(t)f(line,)i(no)e(matter)g(where)g(p)q(oin)o(t)h(is.)29 -b(By)19 b(default,)315 1192 y(this)d(is)f(un)o(b)q(ound.)75 -1271 y Fn(kill-word)f(\(M-d\))315 1325 y Fo(Kill)j(from)d(p)q(oin)o(t)h +b(By)19 b(default,)315 1170 y(this)d(is)f(un)o(b)q(ound.)75 +1245 y Fn(kill-word)f(\(M-d\))315 1300 y Fo(Kill)j(from)d(p)q(oin)o(t)h (to)f(the)h(end)g(of)f(the)h(curren)o(t)g(w)o(ord,)e(or)i(if)g(b)q(et)o -(w)o(een)g(w)o(ords,)e(to)i(the)f(end)315 1380 y(of)h(the)g(next)g(w)o +(w)o(een)g(w)o(ords,)e(to)i(the)f(end)315 1355 y(of)h(the)g(next)g(w)o (ord.)20 b(W)l(ord)14 b(b)q(oundaries)j(are)e(the)g(same)g(as)g -Fn(forward-word)p Fo(.)75 1459 y Fn(backward-kill-word)e(\(M-)592 -1457 y Ff(h)p 603 1431 73 2 v 603 1459 a Fe(DEL)p 603 -1467 V 674 1457 a Ff(i)689 1459 y Fn(\))315 1514 y Fo(Kill)k(the)d(w)o +Fn(forward-word)p Fo(.)75 1430 y Fn(backward-kill-word)e(\(M-)592 +1428 y Ff(h)p 603 1402 73 2 v 603 1430 a Fe(DEL)p 603 +1438 V 674 1428 a Ff(i)689 1430 y Fn(\))315 1485 y Fo(Kill)k(the)d(w)o (ord)g(b)q(ehind)i(p)q(oin)o(t.)21 b(W)l(ord)14 b(b)q(oundaries)h(are)f -(the)h(same)f(as)g Fn(backward-word)p Fo(.)75 1593 y -Fn(unix-word-rubout)f(\(C-w\))315 1648 y Fo(Kill)18 b(the)e(w)o(ord)f +(the)h(same)f(as)g Fn(backward-word)p Fo(.)75 1560 y +Fn(unix-word-rubout)f(\(C-w\))315 1615 y Fo(Kill)18 b(the)e(w)o(ord)f (b)q(ehind)j(p)q(oin)o(t,)e(using)h(white)f(space)g(as)g(a)f(w)o(ord)g -(b)q(oundary)l(.)23 b(The)16 b(killed)315 1703 y(text)f(is)g(sa)o(v)o -(ed)g(on)g(the)h(kill-ring.)75 1782 y Fn(delete-horizontal-space)c -(\(\))315 1836 y Fo(Delete)k(all)g(spaces)f(and)h(tabs)e(around)i(p)q -(oin)o(t.)k(By)15 b(default,)h(this)f(is)h(un)o(b)q(ound.)75 -1915 y Fn(kill-region)e(\(\))315 1970 y Fo(Kill)j(the)f(text)e(in)i -(the)g(curren)o(t)f(region.)20 b(By)15 b(default,)h(this)f(command)g -(is)h(un)o(b)q(ound.)75 2049 y Fn(copy-region-as-kill)d(\(\))315 -2104 y Fo(Cop)o(y)j(the)i(text)e(in)i(the)f(region)g(to)g(the)g(kill)h -(bu\013er,)f(so)g(it)g(can)g(b)q(e)h(y)o(ank)o(ed)f(righ)o(t)g(a)o(w)o -(a)o(y)l(.)315 2159 y(By)e(default,)h(this)f(command)g(is)h(un)o(b)q -(ound.)75 2238 y Fn(copy-backward-word)d(\(\))315 2293 -y Fo(Cop)o(y)19 b(the)g(w)o(ord)g(b)q(efore)g(p)q(oin)o(t)h(to)e(the)i -(kill)h(bu\013er.)32 b(The)19 b(w)o(ord)g(b)q(oundaries)h(are)f(the)315 -2348 y(same)c(as)g Fn(backward-word)p Fo(.)j(By)d(default,)g(this)h -(command)f(is)h(un)o(b)q(ound.)75 2427 y Fn(copy-forward-word)d(\(\)) -315 2481 y Fo(Cop)o(y)i(the)h(w)o(ord)e(follo)o(wing)j(p)q(oin)o(t)f +(b)q(oundary)l(.)23 b(The)16 b(killed)315 1670 y(text)f(is)g(sa)o(v)o +(ed)g(on)g(the)h(kill-ring.)75 1745 y Fn(unix-filename-rubout)c(\(\)) +315 1800 y Fo(Kill)20 b(the)f(w)o(ord)e(b)q(ehind)j(p)q(oin)o(t,)f +(using)g(white)g(space)f(and)h(the)f(slash)h(c)o(haracter)e(as)h(the) +315 1855 y(w)o(ord)d(b)q(oundaries.)21 b(The)15 b(killed)j(text)c(is)i +(sa)o(v)o(ed)f(on)g(the)g(kill-ring.)75 1930 y Fn +(delete-horizontal-space)d(\(\))315 1985 y Fo(Delete)k(all)g(spaces)f +(and)h(tabs)e(around)i(p)q(oin)o(t.)k(By)15 b(default,)h(this)f(is)h +(un)o(b)q(ound.)75 2060 y Fn(kill-region)e(\(\))315 2115 +y Fo(Kill)j(the)f(text)e(in)i(the)g(curren)o(t)f(region.)20 +b(By)15 b(default,)h(this)f(command)g(is)h(un)o(b)q(ound.)75 +2190 y Fn(copy-region-as-kill)d(\(\))315 2245 y Fo(Cop)o(y)j(the)i +(text)e(in)i(the)f(region)g(to)g(the)g(kill)h(bu\013er,)f(so)g(it)g +(can)g(b)q(e)h(y)o(ank)o(ed)f(righ)o(t)g(a)o(w)o(a)o(y)l(.)315 +2300 y(By)e(default,)h(this)f(command)g(is)h(un)o(b)q(ound.)75 +2375 y Fn(copy-backward-word)d(\(\))315 2430 y Fo(Cop)o(y)19 +b(the)g(w)o(ord)g(b)q(efore)g(p)q(oin)o(t)h(to)e(the)i(kill)h +(bu\013er.)32 b(The)19 b(w)o(ord)g(b)q(oundaries)h(are)f(the)315 +2485 y(same)c(as)g Fn(backward-word)p Fo(.)j(By)d(default,)g(this)h +(command)f(is)h(un)o(b)q(ound.)75 2560 y Fn(copy-forward-word)d(\(\)) +315 2615 y Fo(Cop)o(y)i(the)h(w)o(ord)e(follo)o(wing)j(p)q(oin)o(t)f (to)f(the)g(kill)j(bu\013er.)i(The)c(w)o(ord)f(b)q(oundaries)i(are)e -(the)315 2536 y(same)g(as)g Fn(forward-word)p Fo(.)j(By)d(default,)h -(this)f(command)g(is)h(un)o(b)q(ound.)75 2615 y Fn(yank)f(\(C-y\))315 -2670 y Fo(Y)l(ank)g(the)h(top)f(of)f(the)i(kill)h(ring)e(in)o(to)g(the) -h(bu\013er)f(at)f(p)q(oin)o(t.)p eop +(the)315 2670 y(same)g(as)g Fn(forward-word)p Fo(.)j(By)d(default,)h +(this)f(command)g(is)h(un)o(b)q(ound.)p eop %%Page: 17 21 17 20 bop 75 -58 a Fo(Chapter)15 b(1:)k(Command)c(Line)i(Editing)1055 -b(17)75 149 y Fn(yank-pop)14 b(\(M-y\))315 204 y Fo(Rotate)i(the)h -(kill-ring,)j(and)d(y)o(ank)g(the)h(new)f(top.)26 b(Y)l(ou)17 -b(can)h(only)g(do)f(this)h(if)f(the)h(prior)315 259 y(command)d(is)h -Fn(yank)e Fo(or)h Fn(yank-pop)p Fo(.)75 382 y Fc(1.4.5)30 -b(Sp)r(ecifying)20 b(Numeric)h(Argumen)n(ts)75 507 y -Fn(digit-argument)13 b(\()p Fg(M-0)p Fn(,)i Fg(M-1)p -Fn(,)f(...)h Fg(M--)p Fn(\))315 562 y Fo(Add)f(this)g(digit)g(to)f(the) -h(argumen)o(t)e(already)i(accum)o(ulating,)g(or)f(start)f(a)h(new)h -(argumen)o(t.)315 616 y Fg(M--)h Fo(starts)f(a)h(negativ)o(e)g(argumen) -o(t.)75 702 y Fn(universal-argument)e(\(\))315 756 y -Fo(This)g(is)h(another)e(w)o(a)o(y)g(to)g(sp)q(ecify)i(an)f(argumen)o -(t.)18 b(If)13 b(this)g(command)g(is)g(follo)o(w)o(ed)g(b)o(y)g(one)315 -811 y(or)h(more)h(digits,)g(optionally)h(with)f(a)g(leading)h(min)o(us) -f(sign,)g(those)g(digits)g(de\014ne)h(the)f(ar-)315 866 +b(17)75 149 y Fn(yank)15 b(\(C-y\))315 204 y Fo(Y)l(ank)g(the)h(top)f +(of)f(the)i(kill)h(ring)e(in)o(to)g(the)h(bu\013er)f(at)f(p)q(oin)o(t.) +75 276 y Fn(yank-pop)g(\(M-y\))315 331 y Fo(Rotate)i(the)h(kill-ring,)j +(and)d(y)o(ank)g(the)h(new)f(top.)26 b(Y)l(ou)17 b(can)h(only)g(do)f +(this)h(if)f(the)h(prior)315 386 y(command)d(is)h Fn(yank)e +Fo(or)h Fn(yank-pop)p Fo(.)75 486 y Fc(1.4.5)30 b(Sp)r(ecifying)20 +b(Numeric)h(Argumen)n(ts)75 604 y Fn(digit-argument)13 +b(\()p Fg(M-0)p Fn(,)i Fg(M-1)p Fn(,)f(...)h Fg(M--)p +Fn(\))315 658 y Fo(Add)f(this)g(digit)g(to)f(the)h(argumen)o(t)e +(already)i(accum)o(ulating,)g(or)f(start)f(a)h(new)h(argumen)o(t.)315 +713 y Fg(M--)h Fo(starts)f(a)h(negativ)o(e)g(argumen)o(t.)75 +785 y Fn(universal-argument)e(\(\))315 840 y Fo(This)g(is)h(another)e +(w)o(a)o(y)g(to)g(sp)q(ecify)i(an)f(argumen)o(t.)18 b(If)13 +b(this)g(command)g(is)g(follo)o(w)o(ed)g(b)o(y)g(one)315 +895 y(or)h(more)h(digits,)g(optionally)h(with)f(a)g(leading)h(min)o(us) +f(sign,)g(those)g(digits)g(de\014ne)h(the)f(ar-)315 949 y(gumen)o(t.)k(If)c(the)g(command)f(is)h(follo)o(w)o(ed)g(b)o(y)g -(digits,)g(executing)g Fn(universal-argument)315 921 +(digits,)g(executing)g Fn(universal-argument)315 1004 y Fo(again)h(ends)g(the)g(n)o(umeric)h(argumen)o(t,)e(but)h(is)h (otherwise)f(ignored.)22 b(As)16 b(a)g(sp)q(ecial)h(case,)315 -976 y(if)g(this)g(command)f(is)h(immediately)h(follo)o(w)o(ed)f(b)o(y)f -(a)g(c)o(haracter)g(that)g(is)h(neither)g(a)f(digit)315 -1030 y(or)d(min)o(us)i(sign,)f(the)g(argumen)o(t)g(coun)o(t)f(for)h +1059 y(if)g(this)g(command)f(is)h(immediately)h(follo)o(w)o(ed)f(b)o(y) +f(a)g(c)o(haracter)g(that)g(is)h(neither)g(a)f(digit)315 +1114 y(or)d(min)o(us)i(sign,)f(the)g(argumen)o(t)g(coun)o(t)f(for)h (the)g(next)g(command)g(is)g(m)o(ultiplied)j(b)o(y)d(four.)315 -1085 y(The)19 b(argumen)o(t)f(coun)o(t)g(is)h(initially)j(one,)d(so)f +1169 y(The)19 b(argumen)o(t)f(coun)o(t)g(is)h(initially)j(one,)d(so)f (executing)i(this)f(function)h(the)e(\014rst)h(time)315 -1140 y(mak)o(es)c(the)h(argumen)o(t)f(coun)o(t)h(four,)f(a)h(second)g +1223 y(mak)o(es)c(the)h(argumen)o(t)f(coun)o(t)h(four,)f(a)h(second)g (time)g(mak)o(es)g(the)g(argumen)o(t)f(coun)o(t)g(six-)315 -1195 y(teen,)g(and)g(so)g(on.)20 b(By)15 b(default,)h(this)f(is)h(not)f -(b)q(ound)h(to)f(a)g(k)o(ey)l(.)75 1318 y Fc(1.4.6)30 +1278 y(teen,)g(and)g(so)g(on.)20 b(By)15 b(default,)h(this)f(is)h(not)f +(b)q(ound)h(to)f(a)g(k)o(ey)l(.)75 1378 y Fc(1.4.6)30 b(Letting)20 b(Readline)g(T)n(yp)r(e)h(F)-5 b(or)19 b(Y)-5 -b(ou)75 1443 y Fn(complete)14 b(\()305 1441 y Ff(h)p -317 1414 74 2 v 317 1443 a Fe(T)m(AB)p 317 1450 V 389 -1441 a Ff(i)404 1443 y Fn(\))315 1497 y Fo(A)o(ttempt)c(to)h(p)q +b(ou)75 1496 y Fn(complete)14 b(\()305 1494 y Ff(h)p +317 1468 74 2 v 317 1496 a Fe(T)m(AB)p 317 1504 V 389 +1494 a Ff(i)404 1496 y Fn(\))315 1551 y Fo(A)o(ttempt)c(to)h(p)q (erform)g(completion)i(on)e(the)g(text)g(b)q(efore)h(p)q(oin)o(t.)19 -b(The)11 b(actual)h(completion)315 1552 y(p)q(erformed)j(is)h +b(The)11 b(actual)h(completion)315 1606 y(p)q(erformed)j(is)h (application-sp)q(eci\014)q(c.)23 b(The)15 b(default)h(is)g(\014lename) -g(completion.)75 1637 y Fn(possible-completions)c(\(M-?\))315 -1692 y Fo(List)k(the)f(p)q(ossible)i(completions)f(of)f(the)g(text)g(b) -q(efore)h(p)q(oin)o(t.)75 1777 y Fn(insert-completions)d(\(M-*\))315 -1832 y Fo(Insert)j(all)g(completions)g(of)f(the)g(text)g(b)q(efore)h(p) +g(completion.)75 1678 y Fn(possible-completions)c(\(M-?\))315 +1732 y Fo(List)k(the)f(p)q(ossible)i(completions)f(of)f(the)g(text)g(b) +q(efore)h(p)q(oin)o(t.)75 1804 y Fn(insert-completions)d(\(M-*\))315 +1859 y Fo(Insert)j(all)g(completions)g(of)f(the)g(text)g(b)q(efore)h(p) q(oin)o(t)f(that)g(w)o(ould)h(ha)o(v)o(e)f(b)q(een)h(generated)315 -1887 y(b)o(y)f Fn(possible-completions)p Fo(.)75 1972 -y Fn(menu-complete)e(\(\))315 2027 y Fo(Similar)g(to)f +1914 y(b)o(y)f Fn(possible-completions)p Fo(.)75 1985 +y Fn(menu-complete)e(\(\))315 2040 y Fo(Similar)g(to)f Fn(complete)p Fo(,)f(but)h(replaces)h(the)f(w)o(ord)f(to)g(b)q(e)i -(completed)f(with)h(a)e(single)j(matc)o(h)315 2082 y(from)k(the)h(list) +(completed)f(with)h(a)e(single)j(matc)o(h)315 2095 y(from)k(the)h(list) h(of)e(p)q(ossible)j(completions.)32 b(Rep)q(eated)19 -b(execution)h(of)f Fn(menu-complete)315 2136 y Fo(steps)h(through)g +b(execution)h(of)f Fn(menu-complete)315 2150 y Fo(steps)h(through)g (the)g(list)h(of)f(p)q(ossible)i(completions,)g(inserting)f(eac)o(h)f -(matc)o(h)f(in)i(turn.)315 2191 y(A)o(t)d(the)g(end)h(of)f(the)h(list)g +(matc)o(h)f(in)i(turn.)315 2205 y(A)o(t)d(the)g(end)h(of)f(the)h(list)g (of)f(completions,)i(the)e(b)q(ell)j(is)d(rung)h(\(sub)s(ject)f(to)f -(the)i(setting)315 2246 y(of)f Fn(bell-style)p Fo(\))e(and)i(the)g +(the)i(setting)315 2259 y(of)f Fn(bell-style)p Fo(\))e(and)i(the)g (original)h(text)f(is)g(restored.)28 b(An)19 b(argumen)o(t)e(of)g -Fd(n)i Fo(mo)o(v)o(es)e Fd(n)315 2301 y Fo(p)q(ositions)h(forw)o(ard)e +Fd(n)i Fo(mo)o(v)o(es)e Fd(n)315 2314 y Fo(p)q(ositions)h(forw)o(ard)e (in)j(the)e(list)h(of)f(matc)o(hes;)h(a)f(negativ)o(e)g(argumen)o(t)g -(ma)o(y)g(b)q(e)h(used)g(to)315 2356 y(mo)o(v)o(e)g(bac)o(kw)o(ard)h +(ma)o(y)g(b)q(e)h(used)g(to)315 2369 y(mo)o(v)o(e)g(bac)o(kw)o(ard)h (through)g(the)g(list.)32 b(This)20 b(command)f(is)h(in)o(tended)g(to)f -(b)q(e)h(b)q(ound)g(to)315 2408 y Ff(h)p 327 2382 V 327 -2410 a Fe(T)m(AB)p 327 2418 V 399 2408 a Ff(i)414 2410 +(b)q(e)h(b)q(ound)g(to)315 2422 y Ff(h)p 327 2396 V 327 +2424 a Fe(T)m(AB)p 327 2431 V 399 2422 a Ff(i)414 2424 y Fo(,)15 b(but)g(is)h(un)o(b)q(ound)g(b)o(y)f(default.)75 2496 y Fn(delete-char-or-list)e(\(\))315 2550 y Fo(Deletes)h(the)f(c)o (haracter)g(under)h(the)g(cursor)f(if)h(not)f(at)g(the)g(b)q(eginning)j diff --git a/lib/readline/posixdir.h b/lib/readline/posixdir.h deleted file mode 100644 index 91f6d961..00000000 --- a/lib/readline/posixdir.h +++ /dev/null @@ -1,61 +0,0 @@ -/* posixdir.h -- Posix directory reading includes and defines. */ - -/* Copyright (C) 1987,1991 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 2, 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, 59 Temple Place, Suite 330, Boston, MA 02111 USA. */ - -/* This file should be included instead of or . */ - -#if !defined (_POSIXDIR_H_) -#define _POSIXDIR_H_ - -#if defined (HAVE_DIRENT_H) -# include -# if defined (HAVE_STRUCT_DIRENT_D_NAMLEN) -# define D_NAMLEN(d) ((d)->d_namlen) -# else -# define D_NAMLEN(d) (strlen ((d)->d_name)) -# endif /* !HAVE_STRUCT_DIRENT_D_NAMLEN */ -#else -# if defined (HAVE_SYS_NDIR_H) -# include -# endif -# if defined (HAVE_SYS_DIR_H) -# include -# endif -# if defined (HAVE_NDIR_H) -# include -# endif -# if !defined (dirent) -# define dirent direct -# endif /* !dirent */ -# define D_NAMLEN(d) ((d)->d_namlen) -#endif /* !HAVE_DIRENT_H */ - -#if defined (HAVE_STRUCT_DIRENT_D_INO) && !defined (HAVE_STRUCT_DIRENT_D_FILENO) -# define d_fileno d_ino -#endif - -#if defined (_POSIX_SOURCE) && (!defined (HAVE_STRUCT_DIRENT_D_INO) || defined (BROKEN_DIRENT_D_INO)) -/* Posix does not require that the d_ino field be present, and some - systems do not provide it. */ -# define REAL_DIR_ENTRY(dp) 1 -#else -# define REAL_DIR_ENTRY(dp) (dp->d_ino != 0) -#endif /* _POSIX_SOURCE */ - -#endif /* !_POSIXDIR_H_ */ diff --git a/lib/readline/posixdir.h b/lib/readline/posixdir.h new file mode 120000 index 00000000..8b163845 --- /dev/null +++ b/lib/readline/posixdir.h @@ -0,0 +1 @@ +../../include/posixdir.h \ No newline at end of file diff --git a/lib/readline/posixjmp.h b/lib/readline/posixjmp.h deleted file mode 100644 index b52aa003..00000000 --- a/lib/readline/posixjmp.h +++ /dev/null @@ -1,40 +0,0 @@ -/* posixjmp.h -- wrapper for setjmp.h with changes for POSIX systems. */ - -/* Copyright (C) 1987,1991 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 2, 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, 59 Temple Place, Suite 330, Boston, MA 02111 USA. */ - -#ifndef _POSIXJMP_H_ -#define _POSIXJMP_H_ - -#include - -/* This *must* be included *after* config.h */ - -#if defined (HAVE_POSIX_SIGSETJMP) -# define procenv_t sigjmp_buf -# if !defined (__OPENNT) -# undef setjmp -# define setjmp(x) sigsetjmp((x), 1) -# undef longjmp -# define longjmp(x, n) siglongjmp((x), (n)) -# endif /* !__OPENNT */ -#else -# define procenv_t jmp_buf -#endif - -#endif /* _POSIXJMP_H_ */ diff --git a/lib/readline/posixjmp.h b/lib/readline/posixjmp.h new file mode 120000 index 00000000..b4d3ee74 --- /dev/null +++ b/lib/readline/posixjmp.h @@ -0,0 +1 @@ +../../include/posixjmp.h \ No newline at end of file diff --git a/lib/readline/posixstat.h b/lib/readline/posixstat.h deleted file mode 100644 index c93b5288..00000000 --- a/lib/readline/posixstat.h +++ /dev/null @@ -1,142 +0,0 @@ -/* posixstat.h -- Posix stat(2) definitions for systems that - don't have them. */ - -/* Copyright (C) 1987,1991 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 2, 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, 59 Temple Place, Suite 330, Boston, MA 02111 USA. */ - -/* This file should be included instead of . - It relies on the local sys/stat.h to work though. */ -#if !defined (_POSIXSTAT_H_) -#define _POSIXSTAT_H_ - -#include - -#if defined (STAT_MACROS_BROKEN) -# undef S_ISBLK -# undef S_ISCHR -# undef S_ISDIR -# undef S_ISFIFO -# undef S_ISREG -# undef S_ISLNK -#endif /* STAT_MACROS_BROKEN */ - -/* These are guaranteed to work only on isc386 */ -#if !defined (S_IFDIR) && !defined (S_ISDIR) -# define S_IFDIR 0040000 -#endif /* !S_IFDIR && !S_ISDIR */ -#if !defined (S_IFMT) -# define S_IFMT 0170000 -#endif /* !S_IFMT */ - -/* Posix 1003.1 5.6.1.1 file types */ - -/* Some Posix-wannabe systems define _S_IF* macros instead of S_IF*, but - do not provide the S_IS* macros that Posix requires. */ - -#if defined (_S_IFMT) && !defined (S_IFMT) -#define S_IFMT _S_IFMT -#endif -#if defined (_S_IFIFO) && !defined (S_IFIFO) -#define S_IFIFO _S_IFIFO -#endif -#if defined (_S_IFCHR) && !defined (S_IFCHR) -#define S_IFCHR _S_IFCHR -#endif -#if defined (_S_IFDIR) && !defined (S_IFDIR) -#define S_IFDIR _S_IFDIR -#endif -#if defined (_S_IFBLK) && !defined (S_IFBLK) -#define S_IFBLK _S_IFBLK -#endif -#if defined (_S_IFREG) && !defined (S_IFREG) -#define S_IFREG _S_IFREG -#endif -#if defined (_S_IFLNK) && !defined (S_IFLNK) -#define S_IFLNK _S_IFLNK -#endif -#if defined (_S_IFSOCK) && !defined (S_IFSOCK) -#define S_IFSOCK _S_IFSOCK -#endif - -/* Test for each symbol individually and define the ones necessary (some - systems claiming Posix compatibility define some but not all). */ - -#if defined (S_IFBLK) && !defined (S_ISBLK) -#define S_ISBLK(m) (((m)&S_IFMT) == S_IFBLK) /* block device */ -#endif - -#if defined (S_IFCHR) && !defined (S_ISCHR) -#define S_ISCHR(m) (((m)&S_IFMT) == S_IFCHR) /* character device */ -#endif - -#if defined (S_IFDIR) && !defined (S_ISDIR) -#define S_ISDIR(m) (((m)&S_IFMT) == S_IFDIR) /* directory */ -#endif - -#if defined (S_IFREG) && !defined (S_ISREG) -#define S_ISREG(m) (((m)&S_IFMT) == S_IFREG) /* file */ -#endif - -#if defined (S_IFIFO) && !defined (S_ISFIFO) -#define S_ISFIFO(m) (((m)&S_IFMT) == S_IFIFO) /* fifo - named pipe */ -#endif - -#if defined (S_IFLNK) && !defined (S_ISLNK) -#define S_ISLNK(m) (((m)&S_IFMT) == S_IFLNK) /* symbolic link */ -#endif - -#if defined (S_IFSOCK) && !defined (S_ISSOCK) -#define S_ISSOCK(m) (((m)&S_IFMT) == S_IFSOCK) /* socket */ -#endif - -/* - * POSIX 1003.1 5.6.1.2 File Modes - */ - -#if !defined (S_IRWXU) -# if !defined (S_IREAD) -# define S_IREAD 00400 -# define S_IWRITE 00200 -# define S_IEXEC 00100 -# endif /* S_IREAD */ - -# if !defined (S_IRUSR) -# define S_IRUSR S_IREAD /* read, owner */ -# define S_IWUSR S_IWRITE /* write, owner */ -# define S_IXUSR S_IEXEC /* execute, owner */ - -# define S_IRGRP (S_IREAD >> 3) /* read, group */ -# define S_IWGRP (S_IWRITE >> 3) /* write, group */ -# define S_IXGRP (S_IEXEC >> 3) /* execute, group */ - -# define S_IROTH (S_IREAD >> 6) /* read, other */ -# define S_IWOTH (S_IWRITE >> 6) /* write, other */ -# define S_IXOTH (S_IEXEC >> 6) /* execute, other */ -# endif /* !S_IRUSR */ - -# define S_IRWXU (S_IRUSR | S_IWUSR | S_IXUSR) -# define S_IRWXG (S_IRGRP | S_IWGRP | S_IXGRP) -# define S_IRWXO (S_IROTH | S_IWOTH | S_IXOTH) -#endif /* !S_IRWXU */ - -/* These are non-standard, but are used in builtins.c$symbolic_umask() */ -#define S_IRUGO (S_IRUSR | S_IRGRP | S_IROTH) -#define S_IWUGO (S_IWUSR | S_IWGRP | S_IWOTH) -#define S_IXUGO (S_IXUSR | S_IXGRP | S_IXOTH) - -#endif /* _POSIXSTAT_H_ */ diff --git a/lib/readline/posixstat.h b/lib/readline/posixstat.h new file mode 120000 index 00000000..c6164b79 --- /dev/null +++ b/lib/readline/posixstat.h @@ -0,0 +1 @@ +../../include/posixstat.h \ No newline at end of file diff --git a/lib/readline/tilde.c b/lib/readline/tilde.c deleted file mode 100644 index 154f7f81..00000000 --- a/lib/readline/tilde.c +++ /dev/null @@ -1,458 +0,0 @@ -/* tilde.c -- Tilde expansion code (~/foo := $HOME/foo). */ - -/* Copyright (C) 1988,1989 Free Software Foundation, Inc. - - This file is part of GNU Readline, a library for reading lines - of text with interactive input and history editing. - - Readline 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 2, or (at your option) any - later version. - - Readline 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 Readline; see the file COPYING. If not, write to the Free - Software Foundation, 59 Temple Place, Suite 330, Boston, MA 02111 USA. */ - -#if defined (HAVE_CONFIG_H) -# include -#endif - -#if defined (HAVE_UNISTD_H) -# ifdef _MINIX -# include -# endif -# include -#endif - -#if defined (HAVE_STRING_H) -# include -#else /* !HAVE_STRING_H */ -# include -#endif /* !HAVE_STRING_H */ - -#if defined (HAVE_STDLIB_H) -# include -#else -# include "ansi_stdlib.h" -#endif /* HAVE_STDLIB_H */ - -#include -#include - -#include "tilde.h" - -#if defined (TEST) || defined (STATIC_MALLOC) -static void *xmalloc (), *xrealloc (); -#else -# include "xmalloc.h" -#endif /* TEST || STATIC_MALLOC */ - -#if !defined (HAVE_GETPW_DECLS) -extern struct passwd *getpwuid PARAMS((uid_t)); -extern struct passwd *getpwnam PARAMS((const char *)); -#endif /* !HAVE_GETPW_DECLS */ - -#if !defined (savestring) -#define savestring(x) strcpy ((char *)xmalloc (1 + strlen (x)), (x)) -#endif /* !savestring */ - -#if !defined (NULL) -# if defined (__STDC__) -# define NULL ((void *) 0) -# else -# define NULL 0x0 -# endif /* !__STDC__ */ -#endif /* !NULL */ - -/* If being compiled as part of bash, these will be satisfied from - variables.o. If being compiled as part of readline, they will - be satisfied from shell.o. */ -extern char *sh_get_home_dir PARAMS((void)); -extern char *sh_get_env_value PARAMS((const char *)); - -/* The default value of tilde_additional_prefixes. This is set to - whitespace preceding a tilde so that simple programs which do not - perform any word separation get desired behaviour. */ -static const char *default_prefixes[] = - { " ~", "\t~", (const char *)NULL }; - -/* The default value of tilde_additional_suffixes. This is set to - whitespace or newline so that simple programs which do not - perform any word separation get desired behaviour. */ -static const char *default_suffixes[] = - { " ", "\n", (const char *)NULL }; - -/* If non-null, this contains the address of a function that the application - wants called before trying the standard tilde expansions. The function - is called with the text sans tilde, and returns a malloc()'ed string - which is the expansion, or a NULL pointer if the expansion fails. */ -tilde_hook_func_t *tilde_expansion_preexpansion_hook = (tilde_hook_func_t *)NULL; - -/* If non-null, this contains the address of a function to call if the - standard meaning for expanding a tilde fails. The function is called - with the text (sans tilde, as in "foo"), and returns a malloc()'ed string - which is the expansion, or a NULL pointer if there is no expansion. */ -tilde_hook_func_t *tilde_expansion_failure_hook = (tilde_hook_func_t *)NULL; - -/* When non-null, this is a NULL terminated array of strings which - are duplicates for a tilde prefix. Bash uses this to expand - `=~' and `:~'. */ -char **tilde_additional_prefixes = (char **)default_prefixes; - -/* When non-null, this is a NULL terminated array of strings which match - the end of a username, instead of just "/". Bash sets this to - `:' and `=~'. */ -char **tilde_additional_suffixes = (char **)default_suffixes; - -static int tilde_find_prefix PARAMS((const char *, int *)); -static int tilde_find_suffix PARAMS((const char *)); -static char *isolate_tilde_prefix PARAMS((const char *, int *)); -static char *glue_prefix_and_suffix PARAMS((char *, const char *, int)); - -/* Find the start of a tilde expansion in STRING, and return the index of - the tilde which starts the expansion. Place the length of the text - which identified this tilde starter in LEN, excluding the tilde itself. */ -static int -tilde_find_prefix (string, len) - const char *string; - int *len; -{ - register int i, j, string_len; - register char **prefixes; - - prefixes = tilde_additional_prefixes; - - string_len = strlen (string); - *len = 0; - - if (*string == '\0' || *string == '~') - return (0); - - if (prefixes) - { - for (i = 0; i < string_len; i++) - { - for (j = 0; prefixes[j]; j++) - { - if (strncmp (string + i, prefixes[j], strlen (prefixes[j])) == 0) - { - *len = strlen (prefixes[j]) - 1; - return (i + *len); - } - } - } - } - return (string_len); -} - -/* Find the end of a tilde expansion in STRING, and return the index of - the character which ends the tilde definition. */ -static int -tilde_find_suffix (string) - const char *string; -{ - register int i, j, string_len; - register char **suffixes; - - suffixes = tilde_additional_suffixes; - string_len = strlen (string); - - for (i = 0; i < string_len; i++) - { -#if defined (__MSDOS__) - if (string[i] == '/' || string[i] == '\\' /* || !string[i] */) -#else - if (string[i] == '/' /* || !string[i] */) -#endif - break; - - for (j = 0; suffixes && suffixes[j]; j++) - { - if (strncmp (string + i, suffixes[j], strlen (suffixes[j])) == 0) - return (i); - } - } - return (i); -} - -/* Return a new string which is the result of tilde expanding STRING. */ -char * -tilde_expand (string) - const char *string; -{ - char *result; - int result_size, result_index; - - result_index = result_size = 0; - if (result = strchr (string, '~')) - result = (char *)xmalloc (result_size = (strlen (string) + 16)); - else - result = (char *)xmalloc (result_size = (strlen (string) + 1)); - - /* Scan through STRING expanding tildes as we come to them. */ - while (1) - { - register int start, end; - char *tilde_word, *expansion; - int len; - - /* Make START point to the tilde which starts the expansion. */ - start = tilde_find_prefix (string, &len); - - /* Copy the skipped text into the result. */ - if ((result_index + start + 1) > result_size) - result = (char *)xrealloc (result, 1 + (result_size += (start + 20))); - - strncpy (result + result_index, string, start); - result_index += start; - - /* Advance STRING to the starting tilde. */ - string += start; - - /* Make END be the index of one after the last character of the - username. */ - end = tilde_find_suffix (string); - - /* If both START and END are zero, we are all done. */ - if (!start && !end) - break; - - /* Expand the entire tilde word, and copy it into RESULT. */ - tilde_word = (char *)xmalloc (1 + end); - strncpy (tilde_word, string, end); - tilde_word[end] = '\0'; - string += end; - - expansion = tilde_expand_word (tilde_word); - free (tilde_word); - - len = strlen (expansion); -#ifdef __CYGWIN__ - /* Fix for Cygwin to prevent ~user/xxx from expanding to //xxx when - $HOME for `user' is /. On cygwin, // denotes a network drive. */ - if (len > 1 || *expansion != '/' || *string != '/') -#endif - { - if ((result_index + len + 1) > result_size) - result = (char *)xrealloc (result, 1 + (result_size += (len + 20))); - - strcpy (result + result_index, expansion); - result_index += len; - } - free (expansion); - } - - result[result_index] = '\0'; - - return (result); -} - -/* Take FNAME and return the tilde prefix we want expanded. If LENP is - non-null, the index of the end of the prefix into FNAME is returned in - the location it points to. */ -static char * -isolate_tilde_prefix (fname, lenp) - const char *fname; - int *lenp; -{ - char *ret; - int i; - - ret = (char *)xmalloc (strlen (fname)); -#if defined (__MSDOS__) - for (i = 1; fname[i] && fname[i] != '/' && fname[i] != '\\'; i++) -#else - for (i = 1; fname[i] && fname[i] != '/'; i++) -#endif - ret[i - 1] = fname[i]; - ret[i - 1] = '\0'; - if (lenp) - *lenp = i; - return ret; -} - -/* Return a string that is PREFIX concatenated with SUFFIX starting at - SUFFIND. */ -static char * -glue_prefix_and_suffix (prefix, suffix, suffind) - char *prefix; - const char *suffix; - int suffind; -{ - char *ret; - int plen, slen; - - plen = (prefix && *prefix) ? strlen (prefix) : 0; - slen = strlen (suffix + suffind); - ret = (char *)xmalloc (plen + slen + 1); - if (plen) - strcpy (ret, prefix); - strcpy (ret + plen, suffix + suffind); - return ret; -} - -/* Do the work of tilde expansion on FILENAME. FILENAME starts with a - tilde. If there is no expansion, call tilde_expansion_failure_hook. - This always returns a newly-allocated string, never static storage. */ -char * -tilde_expand_word (filename) - const char *filename; -{ - char *dirname, *expansion, *username; - int user_len; - struct passwd *user_entry; - - if (filename == 0) - return ((char *)NULL); - - if (*filename != '~') - return (savestring (filename)); - - /* A leading `~/' or a bare `~' is *always* translated to the value of - $HOME or the home directory of the current user, regardless of any - preexpansion hook. */ - if (filename[1] == '\0' || filename[1] == '/') - { - /* Prefix $HOME to the rest of the string. */ - expansion = sh_get_env_value ("HOME"); - - /* If there is no HOME variable, look up the directory in - the password database. */ - if (expansion == 0) - expansion = sh_get_home_dir (); - - return (glue_prefix_and_suffix (expansion, filename, 1)); - } - - username = isolate_tilde_prefix (filename, &user_len); - - if (tilde_expansion_preexpansion_hook) - { - expansion = (*tilde_expansion_preexpansion_hook) (username); - if (expansion) - { - dirname = glue_prefix_and_suffix (expansion, filename, user_len); - free (username); - free (expansion); - return (dirname); - } - } - - /* No preexpansion hook, or the preexpansion hook failed. Look in the - password database. */ - dirname = (char *)NULL; - user_entry = getpwnam (username); - if (user_entry == 0) - { - /* If the calling program has a special syntax for expanding tildes, - and we couldn't find a standard expansion, then let them try. */ - if (tilde_expansion_failure_hook) - { - expansion = (*tilde_expansion_failure_hook) (username); - if (expansion) - { - dirname = glue_prefix_and_suffix (expansion, filename, user_len); - free (expansion); - } - } - free (username); - /* If we don't have a failure hook, or if the failure hook did not - expand the tilde, return a copy of what we were passed. */ - if (dirname == 0) - dirname = savestring (filename); - } - else - { - free (username); - dirname = glue_prefix_and_suffix (user_entry->pw_dir, filename, user_len); - } - - endpwent (); - return (dirname); -} - - -#if defined (TEST) -#undef NULL -#include - -main (argc, argv) - int argc; - char **argv; -{ - char *result, line[512]; - int done = 0; - - while (!done) - { - printf ("~expand: "); - fflush (stdout); - - if (!gets (line)) - strcpy (line, "done"); - - if ((strcmp (line, "done") == 0) || - (strcmp (line, "quit") == 0) || - (strcmp (line, "exit") == 0)) - { - done = 1; - break; - } - - result = tilde_expand (line); - printf (" --> %s\n", result); - free (result); - } - exit (0); -} - -static void memory_error_and_abort (); - -static void * -xmalloc (bytes) - size_t bytes; -{ - void *temp = (char *)malloc (bytes); - - if (!temp) - memory_error_and_abort (); - return (temp); -} - -static void * -xrealloc (pointer, bytes) - void *pointer; - int bytes; -{ - void *temp; - - if (!pointer) - temp = malloc (bytes); - else - temp = realloc (pointer, bytes); - - if (!temp) - memory_error_and_abort (); - - return (temp); -} - -static void -memory_error_and_abort () -{ - fprintf (stderr, "readline: out of virtual memory\n"); - abort (); -} - -/* - * Local variables: - * compile-command: "gcc -g -DTEST -o tilde tilde.c" - * end: - */ -#endif /* TEST */ diff --git a/lib/readline/tilde.c b/lib/readline/tilde.c new file mode 120000 index 00000000..439ceede --- /dev/null +++ b/lib/readline/tilde.c @@ -0,0 +1 @@ +../tilde/tilde.c \ No newline at end of file diff --git a/lib/readline/tilde.h b/lib/readline/tilde.h deleted file mode 100644 index f8182c99..00000000 --- a/lib/readline/tilde.h +++ /dev/null @@ -1,78 +0,0 @@ -/* tilde.h: Externally available variables and function in libtilde.a. */ - -/* Copyright (C) 1992 Free Software Foundation, Inc. - - This file contains the Readline Library (the Library), a set of - routines for providing Emacs style line input to programs that ask - for it. - - The Library 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 2, or (at your option) - any later version. - - The Library 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. - - The GNU General Public License is often shipped with GNU software, and - is generally kept in a file called COPYING or LICENSE. If you do not - have a copy of the license, write to the Free Software Foundation, - 59 Temple Place, Suite 330, Boston, MA 02111 USA. */ - -#if !defined (_TILDE_H_) -# define _TILDE_H_ - -#ifdef __cplusplus -extern "C" { -#endif - -/* A function can be defined using prototypes and compile on both ANSI C - and traditional C compilers with something like this: - extern char *func PARAMS((char *, char *, int)); */ - -#if !defined (PARAMS) -# if defined (__STDC__) || defined (__GNUC__) || defined (__cplusplus) -# define PARAMS(protos) protos -# else -# define PARAMS(protos) () -# endif -#endif - -typedef char *tilde_hook_func_t PARAMS((char *)); - -/* If non-null, this contains the address of a function that the application - wants called before trying the standard tilde expansions. The function - is called with the text sans tilde, and returns a malloc()'ed string - which is the expansion, or a NULL pointer if the expansion fails. */ -extern tilde_hook_func_t *tilde_expansion_preexpansion_hook; - -/* If non-null, this contains the address of a function to call if the - standard meaning for expanding a tilde fails. The function is called - with the text (sans tilde, as in "foo"), and returns a malloc()'ed string - which is the expansion, or a NULL pointer if there is no expansion. */ -extern tilde_hook_func_t *tilde_expansion_failure_hook; - -/* When non-null, this is a NULL terminated array of strings which - are duplicates for a tilde prefix. Bash uses this to expand - `=~' and `:~'. */ -extern char **tilde_additional_prefixes; - -/* When non-null, this is a NULL terminated array of strings which match - the end of a username, instead of just "/". Bash sets this to - `:' and `=~'. */ -extern char **tilde_additional_suffixes; - -/* Return a new string which is the result of tilde expanding STRING. */ -extern char *tilde_expand PARAMS((const char *)); - -/* Do the work of tilde expansion on FILENAME. FILENAME starts with a - tilde. If there is no expansion, call tilde_expansion_failure_hook. */ -extern char *tilde_expand_word PARAMS((const char *)); - -#ifdef __cplusplus -} -#endif - -#endif /* _TILDE_H_ */ diff --git a/lib/readline/tilde.h b/lib/readline/tilde.h new file mode 120000 index 00000000..6fea2aea --- /dev/null +++ b/lib/readline/tilde.h @@ -0,0 +1 @@ +../tilde/tilde.h \ No newline at end of file diff --git a/make_cmd.c b/make_cmd.c index 479d9c3e..4ccbf669 100644 --- a/make_cmd.c +++ b/make_cmd.c @@ -355,6 +355,7 @@ COMMAND * make_case_command (word, clauses, lineno) WORD_DESC *word; PATTERN_LIST *clauses; + int lineno; { CASE_COM *temp; diff --git a/pathnames.h b/pathnames.h deleted file mode 100644 index 27817afa..00000000 --- a/pathnames.h +++ /dev/null @@ -1,30 +0,0 @@ -/* pathnames.h -- absolute filenames that bash wants for various defaults. */ - -/* Copyright (C) 1987,1991 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 2, 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, 59 Temple Place, Suite 330, Boston, MA 02111 USA. */ - -#if !defined (_PATHNAMES_H_) -#define _PATHNAMES_H_ - -/* The default file for hostname completion. */ -#define DEFAULT_HOSTS_FILE "/etc/hosts" - -/* The default login shell startup file. */ -#define SYS_PROFILE "/etc/profile" - -#endif /* _PATHNAMES_H */ diff --git a/po/bash.po.orig b/po/bash.po.orig new file mode 100644 index 00000000..023388d9 --- /dev/null +++ b/po/bash.po.orig @@ -0,0 +1,5623 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER +# This file is distributed under the same license as the PACKAGE package. +# FIRST AUTHOR , YEAR. +# +#: array.c:695 array.c:755 array.c:879 bashhist.c:661 bashline.c:801 +#: bashline.c:1416 error.c:88 error.c:318 error.c:320 error.c:322 +#: execute_cmd.c:2005 execute_cmd.c:2007 execute_cmd.c:2195 execute_cmd.c:2441 +#: execute_cmd.c:2580 execute_cmd.c:3186 execute_cmd.c:3838 expr.c:1092 +#: expr.c:1093 general.c:132 jobs.c:1128 jobs.c:1143 jobs.c:2318 jobs.c:2319 +#: locale.c:64 locale.c:422 parse.y:1209 pcomplete.c:937 pcomplete.c:947 +#: pcomplete.c:1076 print_cmd.c:142 print_cmd.c:305 print_cmd.c:364 +#: print_cmd.c:368 print_cmd.c:374 print_cmd.c:378 print_cmd.c:548 +#: print_cmd.c:733 print_cmd.c:847 print_cmd.c:851 subst.c:1483 subst.c:1510 +#: subst.c:1734 subst.c:1754 subst.c:4238 subst.c:4274 subst.c:6391 +#: syntax.h:43 unwind_prot.c:173 variables.c:1631 variables.c:2381 +#: /usr/homes/chet/src/bash/src/parse.y:1209 builtins/common.c:144 +#: builtins/common.c:640 builtins/getopt.c:204 builtins/mkbuiltins.c:1067 +#: builtins/mkbuiltins.c:1070 builtins/mkbuiltins.c:1072 +#: builtins/mkbuiltins.c:1074 builtins/mkbuiltins.c:1079 +#: builtins/mkbuiltins.c:1084 builtins/mkbuiltins.c:1088 +#: builtins/mkbuiltins.c:1094 builtins/mkbuiltins.c:1100 +#: builtins/mkbuiltins.c:1108 builtins/mkbuiltins.c:1111 +#: builtins/mkbuiltins.c:1207 builtins/mkbuiltins.c:1208 +#: builtins/caller.def:127 builtins/caller.def:131 builtins/command.def:134 +#: builtins/complete.def:567 builtins/declare.def:238 builtins/declare.def:355 +#: builtins/declare.def:438 builtins/fc.def:338 builtins/getopts.def:310 +#: builtins/help.def:105 builtins/help.def:110 builtins/history.def:291 +#: builtins/printf.def:123 builtins/printf.def:726 builtins/pushd.def:330 +#: builtins/pushd.def:371 builtins/pushd.def:654 builtins/pushd.def:662 +#: builtins/pushd.def:665 builtins/pushd.def:675 builtins/pushd.def:679 +#: builtins/pushd.def:683 builtins/pushd.def:686 builtins/pushd.def:689 +#: builtins/pushd.def:698 builtins/pushd.def:702 builtins/pushd.def:706 +#: builtins/pushd.def:709 builtins/read.def:258 builtins/read.def:386 +#: builtins/read.def:595 builtins/setattr.def:353 builtins/setattr.def:396 +#: builtins/ulimit.def:111 builtins/umask.def:131 lib/sh/snprintf.c:394 +#: lib/sh/snprintf.c:1691 lib/sh/stringlist.c:235 lib/sh/stringvec.c:223 +#: lib/malloc/stats.c:99 +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: PACKAGE VERSION\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2003-12-04 16:07-0500\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: FULL NAME \n" +"Language-Team: LANGUAGE \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=CHARSET\n" +"Content-Transfer-Encoding: 8bit\n" + +#: arrayfunc.c:43 +msgid "bad array subscript" +msgstr "" + +#: arrayfunc.c:304 +#, c-format +msgid "%s: cannot assign to non-numeric index" +msgstr "" + +#: bashhist.c:319 +#, c-format +msgid "%s: cannot create: %s" +msgstr "" + +#: bashline.c:2789 +msgid "bash_execute_unix_command: cannot find keymap for command" +msgstr "" + +#: bashline.c:2838 +#, c-format +msgid "%s: first non-whitespace character is not `\"'" +msgstr "" + +#: bashline.c:2867 braces.c:129 +#, c-format +msgid "no closing `%c' in %s" +msgstr "" + +#: bashline.c:2901 +#, c-format +msgid "%s: missing colon separator" +msgstr "" + +#: error.c:163 +#, c-format +msgid "last command: %s\n" +msgstr "" + +#: error.c:168 +#, c-format +msgid "Report this to %s\n" +msgstr "" + +#: error.c:171 +msgid "Stopping myself..." +msgstr "" + +#: error.c:258 +#, c-format +msgid "%s: warning: " +msgstr "" + +#: error.c:403 +msgid "unknown command error" +msgstr "" + +#: error.c:404 +msgid "bad command type" +msgstr "" + +#: error.c:405 +msgid "bad connector" +msgstr "" + +#: error.c:406 +msgid "bad jump" +msgstr "" + +#: error.c:444 +#, c-format +msgid "%s: unbound variable" +msgstr "" + +#: error.c:451 builtins/common.c:221 +#, c-format +msgid "%s: readonly variable" +msgstr "" + +#: eval.c:173 +msgid "timed out waiting for input: auto-logout\n" +msgstr "" + +#: execute_cmd.c:447 +msgid "close" +msgstr "" + +#: execute_cmd.c:447 +msgid "open" +msgstr "" + +#: execute_cmd.c:465 +#, c-format +msgid "cannot redirect standard input from /dev/null: %s" +msgstr "" + +#: execute_cmd.c:1035 +#, c-format +msgid "TIMEFORMAT: `%c': invalid format character" +msgstr "" + +#: execute_cmd.c:3520 +#, c-format +msgid "%s: restricted: cannot specify `/' in command names" +msgstr "" + +#: execute_cmd.c:3608 +#, c-format +msgid "%s: command not found" +msgstr "" + +#: execute_cmd.c:3820 shell.c:1393 builtins/evalfile.c:127 +#: builtins/hash.def:158 +#, c-format +msgid "%s: is a directory" +msgstr "" + +#: execute_cmd.c:3838 +#, c-format +msgid "%s: %s: bad interpreter" +msgstr "" + +#: execute_cmd.c:3875 shell.c:1403 builtins/evalfile.c:172 +#, c-format +msgid "%s: cannot execute binary file" +msgstr "" + +#: execute_cmd.c:3948 builtins/declare.def:306 +#, c-format +msgid "%s: readonly function" +msgstr "" + +#: execute_cmd.c:3987 +#, c-format +msgid "cannot duplicate fd %d to fd %d" +msgstr "" + +#: expr.c:238 +msgid "expression recursion level exceeded" +msgstr "" + +#: expr.c:262 +msgid "recursion stack underflow" +msgstr "" + +#: expr.c:373 +msgid "syntax error in expression" +msgstr "" + +#: expr.c:413 +msgid "attempted assignment to non-variable" +msgstr "" + +#: expr.c:434 expr.c:439 expr.c:749 +msgid "division by 0" +msgstr "" + +#: expr.c:465 +msgid "bug: bad expassign token" +msgstr "" + +#: expr.c:495 expr.c:510 builtins/let.def:92 builtins/let.def:117 +msgid "expression expected" +msgstr "" + +#: expr.c:507 +msgid "`:' expected for conditional expression" +msgstr "" + +#: expr.c:774 +msgid "exponent less than 0" +msgstr "" + +#: expr.c:818 +msgid "identifier expected after pre-increment or pre-decrement" +msgstr "" + +#: expr.c:846 +msgid "missing `)'" +msgstr "" + +#: expr.c:870 +msgid "syntax error: operand expected" +msgstr "" + +#: expr.c:1091 +#, c-format +msgid "%s%s%s: %s (error token is \"%s\")" +msgstr "" + +#: expr.c:1145 +msgid "bad number" +msgstr "" + +#: expr.c:1149 +msgid "invalid arithmetic base" +msgstr "" + +#: expr.c:1169 +msgid "value too great for base" +msgstr "" + +#: expr.c:1217 +#, c-format +msgid "%s: expression error\n" +msgstr "" + +#: general.c:58 +msgid "getcwd: cannot access parent directories" +msgstr "" + +#: general.c:227 general.c:232 builtins/common.c:193 +#, c-format +msgid "`%s': not a valid identifier" +msgstr "" + +#: input.c:229 +#, c-format +msgid "cannot allocate new file descriptor for bash input from fd %d" +msgstr "" + +#: input.c:237 +#, c-format +msgid "save_bash_input: buffer already exists for new fd %d" +msgstr "" + +#: jobs.c:692 +#, c-format +msgid "deleting stopped job %d with process group %ld" +msgstr "" + +#: jobs.c:1631 nojobs.c:646 +#, c-format +msgid "wait: pid %ld is not a child of this shell" +msgstr "" + +#: jobs.c:1814 +#, c-format +msgid "wait_for: No record of process %ld" +msgstr "" + +#: jobs.c:1957 +#, c-format +msgid "wait_for: job == NO_JOB, giving the terminal to shell_pgrp (%ld)" +msgstr "" + +#: jobs.c:2061 +#, c-format +msgid "wait_for_job: job %d is stopped" +msgstr "" + +#: jobs.c:2283 +#, c-format +msgid "%s: job has terminated" +msgstr "" + +#: jobs.c:2292 +#, c-format +msgid "%s: job %d already in background" +msgstr "" + +#: jobs.c:3036 +msgid "no job control in this shell" +msgstr "" + +#: jobs.c:3250 +#, c-format +msgid "tcsetpgrp(%d) failed: pid %ld to pgrp %ld" +msgstr "" + +#: mailcheck.c:381 +msgid "You have mail in $_" +msgstr "" + +#: mailcheck.c:406 +msgid "You have new mail in $_" +msgstr "" + +#: mailcheck.c:422 +#, c-format +msgid "The mail in %s has been read\n" +msgstr "" + +#: make_cmd.c:316 +msgid "syntax error: arithmetic expression required" +msgstr "" + +#: make_cmd.c:318 +msgid "syntax error: `;' unexpected" +msgstr "" + +#: make_cmd.c:558 +#, c-format +msgid "make_here_document: bad instruction type %d" +msgstr "" + +#: make_cmd.c:728 +#, c-format +msgid "make_redirection: redirection instruction `%d' out of range" +msgstr "" + +#: mksyntax.c:334 +#, c-format +msgid "%s: %s: cannot open: %s\n" +msgstr "" + +#: parse.y:1663 /usr/homes/chet/src/bash/src/parse.y:1663 +msgid "read_a_line: ignored null byte in input" +msgstr "" + +#: parse.y:1928 /usr/homes/chet/src/bash/src/parse.y:1928 +msgid "shell_getc: ignored null byte in input" +msgstr "" + +#: parse.y:2724 /usr/homes/chet/src/bash/src/parse.y:2724 +#, c-format +msgid "unexpected EOF while looking for matching `%c'" +msgstr "" + +#: parse.y:3009 /usr/homes/chet/src/bash/src/parse.y:3009 +msgid "unexpected EOF while looking for `]]'" +msgstr "" + +#: parse.y:3014 /usr/homes/chet/src/bash/src/parse.y:3014 +#, c-format +msgid "syntax error in conditional expression: unexpected token `%s'" +msgstr "" + +#: parse.y:3018 /usr/homes/chet/src/bash/src/parse.y:3018 +msgid "syntax error in conditional expression" +msgstr "" + +#: parse.y:3096 /usr/homes/chet/src/bash/src/parse.y:3096 +#, c-format +msgid "unexpected token `%s', expected `)'" +msgstr "" + +#: parse.y:3100 /usr/homes/chet/src/bash/src/parse.y:3100 +msgid "expected `)'" +msgstr "" + +#: parse.y:3128 /usr/homes/chet/src/bash/src/parse.y:3128 +#, c-format +msgid "unexpected argument `%s' to conditional unary operator" +msgstr "" + +#: parse.y:3132 /usr/homes/chet/src/bash/src/parse.y:3132 +msgid "unexpected argument to conditional unary operator" +msgstr "" + +#: parse.y:3160 /usr/homes/chet/src/bash/src/parse.y:3160 +msgid "-n" +msgstr "" + +#: parse.y:3169 /usr/homes/chet/src/bash/src/parse.y:3169 +#, c-format +msgid "unexpected token `%s', conditional binary operator expected" +msgstr "" + +#: parse.y:3173 /usr/homes/chet/src/bash/src/parse.y:3173 +msgid "conditional binary operator expected" +msgstr "" + +#: parse.y:3189 /usr/homes/chet/src/bash/src/parse.y:3189 +#, c-format +msgid "unexpected argument `%s' to conditional binary operator" +msgstr "" + +#: parse.y:3193 /usr/homes/chet/src/bash/src/parse.y:3193 +msgid "unexpected argument to conditional binary operator" +msgstr "" + +#: parse.y:3204 /usr/homes/chet/src/bash/src/parse.y:3204 +#, c-format +msgid "unexpected token `%c' in conditional command" +msgstr "" + +#: parse.y:3207 /usr/homes/chet/src/bash/src/parse.y:3207 +#, c-format +msgid "unexpected token `%s' in conditional command" +msgstr "" + +#: parse.y:3211 /usr/homes/chet/src/bash/src/parse.y:3211 +#, c-format +msgid "unexpected token %d in conditional command" +msgstr "" + +#: parse.y:4398 /usr/homes/chet/src/bash/src/parse.y:4398 +#, c-format +msgid "syntax error near unexpected token `%s'" +msgstr "" + +#: parse.y:4416 /usr/homes/chet/src/bash/src/parse.y:4416 +#, c-format +msgid "syntax error near `%s'" +msgstr "" + +#: parse.y:4426 /usr/homes/chet/src/bash/src/parse.y:4426 +msgid "syntax error: unexpected end of file" +msgstr "" + +#: parse.y:4426 /usr/homes/chet/src/bash/src/parse.y:4426 +msgid "syntax error" +msgstr "" + +#: parse.y:4488 /usr/homes/chet/src/bash/src/parse.y:4488 +#, c-format +msgid "Use \"%s\" to leave the shell.\n" +msgstr "" + +#: parse.y:4647 /usr/homes/chet/src/bash/src/parse.y:4647 +msgid "unexpected EOF while looking for matching `)'" +msgstr "" + +#: pcomplete.c:987 +#, c-format +msgid "completion: function `%s' not found" +msgstr "" + +#: pcomplete.c:1222 +msgid "ERROR: command_line_to_word_list returns NULL" +msgstr "" + +#: pcomplib.c:177 +#, c-format +msgid "progcomp_insert: %s: NULL COMPSPEC" +msgstr "" + +#: print_cmd.c:259 +#, c-format +msgid "print_command: bad connector `%d'" +msgstr "" + +#: print_cmd.c:1171 +#, c-format +msgid "cprintf: `%c': invalid format character" +msgstr "" + +#: redir.c:98 redir.c:133 +msgid "file descriptor out of range" +msgstr "" + +#: redir.c:140 +#, c-format +msgid "%s: ambiguous redirect" +msgstr "" + +#: redir.c:144 +#, c-format +msgid "%s: cannot overwrite existing file" +msgstr "" + +#: redir.c:149 +#, c-format +msgid "%s: restricted: cannot redirect output" +msgstr "" + +#: redir.c:154 +#, c-format +msgid "cannot create temp file for here document: %s" +msgstr "" + +#: redir.c:508 +msgid "/dev/(tcp|udp)/host/port not supported without networking" +msgstr "" + +#: redir.c:948 +msgid "redirection error: cannot duplicate fd" +msgstr "" + +#: shell.c:300 +msgid "could not find /tmp, please create!" +msgstr "" + +#: shell.c:304 +msgid "/tmp must be a valid directory name" +msgstr "" + +#: shell.c:463 shell.c:735 builtins/common.c:156 +#, c-format +msgid "%s: option requires an argument" +msgstr "" + +#: shell.c:748 builtins/common.c:179 +#, c-format +msgid "%s: invalid option" +msgstr "" + +#: shell.c:837 +#, c-format +msgid "%c%c: invalid option" +msgstr "" + +#: shell.c:1588 +msgid "I have no name!" +msgstr "" + +#: shell.c:1721 +#, c-format +msgid "GNU bash, version %s-(%s)\n" +msgstr "" + +#: shell.c:1722 +#, c-format +msgid "" +"Usage:\t%s [GNU long option] [option] ...\n" +"\t%s [GNU long option] [option] script-file ...\n" +msgstr "" + +#: shell.c:1724 +msgid "GNU long options:\n" +msgstr "" + +#: shell.c:1726 +#, c-format +msgid "\t--%s\n" +msgstr "" + +#: shell.c:1728 +msgid "Shell options:\n" +msgstr "" + +#: shell.c:1729 +msgid "\t-irsD or -c command or -O shopt_option\t\t(invocation only)\n" +msgstr "" + +#: shell.c:1732 builtins/mkbuiltins.c:131 builtins/set.def:2 +msgid "set" +msgstr "" + +#: shell.c:1744 +#, c-format +msgid "\t-%s or -o option\n" +msgstr "" + +#: shell.c:1750 +#, c-format +msgid "Type `%s -c \"help set\"' for more information about shell options.\n" +msgstr "" + +#: shell.c:1751 +#, c-format +msgid "Type `%s -c help' for more information about shell builtin commands.\n" +msgstr "" + +#: shell.c:1752 +msgid "Use the `bashbug' command to report bugs.\n" +msgstr "" + +#: sig.c:483 +msgid "Bad code in sig.c: sigprocmask" +msgstr "" + +#: siglist.c:47 +msgid "Bogus signal" +msgstr "" + +#: siglist.c:50 +msgid "Hangup" +msgstr "" + +#: siglist.c:54 +msgid "Interrupt" +msgstr "" + +#: siglist.c:58 +msgid "Quit" +msgstr "" + +#: siglist.c:62 +msgid "Illegal instruction" +msgstr "" + +#: siglist.c:66 +msgid "BPT trace/trap" +msgstr "" + +#: siglist.c:74 +msgid "ABORT instruction" +msgstr "" + +#: siglist.c:78 +msgid "EMT instruction" +msgstr "" + +#: siglist.c:82 +msgid "Floating point exception" +msgstr "" + +#: siglist.c:86 +msgid "Killed" +msgstr "" + +#: siglist.c:90 +msgid "Bus error" +msgstr "" + +#: siglist.c:94 +msgid "Segmentation fault" +msgstr "" + +#: siglist.c:98 +msgid "Bad system call" +msgstr "" + +#: siglist.c:102 +msgid "Broken pipe" +msgstr "" + +#: siglist.c:106 +msgid "Alarm clock" +msgstr "" + +#: siglist.c:110 +msgid "Terminated" +msgstr "" + +#: siglist.c:114 +msgid "Urgent IO condition" +msgstr "" + +#: siglist.c:118 +msgid "Stopped (signal)" +msgstr "" + +#: siglist.c:126 +msgid "Continue" +msgstr "" + +#: siglist.c:134 +msgid "Child death or stop" +msgstr "" + +#: siglist.c:138 +msgid "Stopped (tty input)" +msgstr "" + +#: siglist.c:142 +msgid "Stopped (tty output)" +msgstr "" + +#: siglist.c:146 +msgid "I/O ready" +msgstr "" + +#: siglist.c:150 +msgid "CPU limit" +msgstr "" + +#: siglist.c:154 +msgid "File limit" +msgstr "" + +#: siglist.c:158 +msgid "Alarm (virtual)" +msgstr "" + +#: siglist.c:162 +msgid "Alarm (profile)" +msgstr "" + +#: siglist.c:166 +msgid "Window changed" +msgstr "" + +#: siglist.c:170 +msgid "Record lock" +msgstr "" + +#: siglist.c:174 +msgid "User signal 1" +msgstr "" + +#: siglist.c:178 +msgid "User signal 2" +msgstr "" + +#: siglist.c:182 +msgid "HFT input data pending" +msgstr "" + +#: siglist.c:186 +msgid "power failure imminent" +msgstr "" + +#: siglist.c:190 +msgid "system crash imminent" +msgstr "" + +#: siglist.c:194 +msgid "migrate process to another CPU" +msgstr "" + +#: siglist.c:198 +msgid "programming error" +msgstr "" + +#: siglist.c:202 +msgid "HFT monitor mode granted" +msgstr "" + +#: siglist.c:206 +msgid "HFT monitor mode retracted" +msgstr "" + +#: siglist.c:210 +msgid "HFT sound sequence has completed" +msgstr "" + +#: siglist.c:214 +msgid "Information request" +msgstr "" + +#: siglist.c:222 +msgid "Unknown Signal #" +msgstr "" + +#: siglist.c:224 +#, c-format +msgid "Unknown Signal #%d" +msgstr "" + +#: subst.c:666 subst.c:752 subst.c:865 subst.c:1107 subst.c:1370 +msgid "$(" +msgstr "" + +#: subst.c:876 +msgid "$[" +msgstr "" + +#: subst.c:876 +msgid "[" +msgstr "" + +#: subst.c:876 +msgid "]" +msgstr "" + +#: subst.c:1010 subst.c:1131 +#, c-format +msgid "bad substitution: no closing `%s' in %s" +msgstr "" + +#: subst.c:2006 +#, c-format +msgid "%s%s=(%s)\n" +msgstr "" + +#: subst.c:2009 variables.c:2123 +#, c-format +msgid "%s%s=%s\n" +msgstr "" + +#: subst.c:2019 +#, c-format +msgid "%s: cannot assign list to array member" +msgstr "" + +#: subst.c:3381 +msgid "sh-np" +msgstr "" + +#: subst.c:3449 +#, c-format +msgid "pid %ld: dev_fd_list:" +msgstr "" + +#: subst.c:3455 /usr/local/share/bison/bison.simple:719 +#: /usr/local/share/bison/bison.simple:864 +#, c-format +msgid " %d" +msgstr "" + +#: subst.c:3515 subst.c:3531 +msgid "cannot make pipe for process substitution" +msgstr "" + +#: subst.c:3562 +msgid "cannot make child for process substitution" +msgstr "" + +#: subst.c:3605 +#, c-format +msgid "cannot open named pipe %s for %s" +msgstr "" + +#: subst.c:3606 +msgid "reading" +msgstr "" + +#: subst.c:3606 +msgid "writing" +msgstr "" + +#: subst.c:3613 +#, c-format +msgid "cannout reset nodelay mode for fd %d" +msgstr "" + +#: subst.c:3623 +#, c-format +msgid "cannot duplicate named pipe %s as fd %d" +msgstr "" + +#: subst.c:3647 +msgid "process substitution" +msgstr "" + +#: subst.c:3697 +msgid "read_comsub: ignored null byte in input" +msgstr "" + +#: subst.c:3798 +msgid "cannot make pipe for command substitution" +msgstr "" + +#: subst.c:3827 +msgid "cannot make child for command substitution" +msgstr "" + +#: subst.c:3844 +msgid "command_substitute: cannot duplicate pipe as fd 1" +msgstr "" + +#: subst.c:3901 +msgid "command substitution" +msgstr "" + +#: subst.c:4279 +#, c-format +msgid "%s: parameter null or not set" +msgstr "" + +#: subst.c:4524 +#, c-format +msgid "%s: substring expression < 0" +msgstr "" + +#: subst.c:4966 subst.c:4983 +msgid "#%:-=?+/}" +msgstr "" + +#: subst.c:5033 +msgid "%:=+/" +msgstr "" + +#: subst.c:5204 +#, c-format +msgid "%s: bad substitution" +msgstr "" + +#: subst.c:5204 builtins/history.def:247 +msgid "??" +msgstr "" + +#: subst.c:5278 +#, c-format +msgid "$%s: cannot assign in this way" +msgstr "" + +#: subst.c:5792 +msgid "<(" +msgstr "" + +#: subst.c:5792 +msgid ">(" +msgstr "" + +#: subst.c:6647 +#, c-format +msgid "no match: %s" +msgstr "" + +#: syntax.h:26 +msgid "\\`$\"\n" +msgstr "" + +#: syntax.h:27 +msgid "\\`$" +msgstr "" + +#: syntax.h:29 +msgid "()<>;&|" +msgstr "" + +#: syntax.h:32 +msgid "\"`'" +msgstr "" + +#: syntax.h:35 +msgid "$<>" +msgstr "" + +#: syntax.h:41 +msgid "@*+?!" +msgstr "" + +#: syntax.h:45 +msgid "*?[]^" +msgstr "" + +#: test.c:152 +msgid "argument expected" +msgstr "" + +#: test.c:161 +#, c-format +msgid "%s: integer expression expected" +msgstr "" + +#: test.c:176 +msgid "/dev/fd/" +msgstr "" + +#: test.c:202 +msgid "/dev/std" +msgstr "" + +#: test.c:206 +msgid "out" +msgstr "" + +#: test.c:208 +msgid "err" +msgstr "" + +#: test.c:359 +msgid "`)' expected" +msgstr "" + +#: test.c:361 +#, c-format +msgid "`)' expected, found %s" +msgstr "" + +#: test.c:376 test.c:785 test.c:788 +#, c-format +msgid "%s: unary operator expected" +msgstr "" + +#: test.c:541 test.c:828 +#, c-format +msgid "%s: binary operator expected" +msgstr "" + +#: test.c:903 builtins/test.def:134 +msgid "missing `]'" +msgstr "" + +#: test.c:919 builtins/common.c:132 +msgid "too many arguments" +msgstr "" + +#: trap.c:171 +msgid "DEFAULT_SIG" +msgstr "" + +#: trap.c:173 +msgid "IGNORE_SIG" +msgstr "" + +#: trap.c:175 +msgid "IMPOSSIBLE_TRAP_HANDLER" +msgstr "" + +#: trap.c:179 builtins/caller.def:94 +msgid "NULL" +msgstr "" + +#: trap.c:192 +msgid "invalid signal number" +msgstr "" + +#: trap.c:222 builtins/common.c:638 builtins/trap.def:218 +msgid "SIG" +msgstr "" + +#: trap.c:307 +#, c-format +msgid "run_pending_traps: bad value in trap_list[%d]: %p" +msgstr "" + +#: trap.c:311 +#, c-format +msgid "" +"run_pending_traps: signal handler is SIG_DFL, resending %d (%s) to myself" +msgstr "" + +#: trap.c:347 +#, c-format +msgid "trap_handler: bad signal %d" +msgstr "" + +#: trap.c:673 +msgid "exit trap" +msgstr "" + +#: trap.c:781 +msgid "debug trap" +msgstr "" + +#: trap.c:800 +msgid "error trap" +msgstr "" + +#: trap.c:811 +msgid "return trap" +msgstr "" + +#: trap.c:821 +msgid "interrupt trap" +msgstr "" + +#: variables.c:287 +msgid "() {" +msgstr "" + +#: variables.c:309 +#, c-format +msgid "error importing function definition for `%s'" +msgstr "" + +#: variables.c:370 +msgid "NODE" +msgstr "" + +#: variables.c:383 +msgid "# " +msgstr "" + +#: variables.c:387 +msgid "+ " +msgstr "" + +#: variables.c:390 variables.c:2867 variables.c:3464 variables.c:3500 +#: variables.c:3632 variables.c:3735 +msgid "IFS" +msgstr "" + +#: variables.c:401 +msgid "600" +msgstr "" + +#: variables.c:401 +msgid "60" +msgstr "" + +#: variables.c:409 variables.c:3647 variables.c:3955 builtins/getopts.def:231 +msgid "OPTIND" +msgstr "" + +#: variables.c:411 variables.c:3646 variables.c:3976 +msgid "OPTERR" +msgstr "" + +#: variables.c:420 +msgid "BASH" +msgstr "" + +#: variables.c:430 +msgid "BASH_VERSION" +msgstr "" + +#: variables.c:436 +msgid "BASH_EXECUTION_STRING" +msgstr "" + +#: variables.c:452 +msgid "~/.sh_history" +msgstr "" + +#: variables.c:452 +msgid "~/.bash_history" +msgstr "" + +#: variables.c:457 +msgid "500" +msgstr "" + +#: variables.c:469 variables.c:3633 builtins/set.def:313 builtins/set.def:315 +#: builtins/set.def:316 +msgid "IGNOREEOF" +msgstr "" + +#: variables.c:471 variables.c:3669 builtins/set.def:191 builtins/set.def:311 +msgid "ignoreeof" +msgstr "" + +#: variables.c:527 +msgid "HOSTTYPE" +msgstr "" + +#: variables.c:528 +msgid "OSTYPE" +msgstr "" + +#: variables.c:529 +msgid "MACHTYPE" +msgstr "" + +#: variables.c:531 +msgid "HOSTNAME" +msgstr "" + +#: variables.c:660 variables.c:694 +msgid "SHLVL" +msgstr "" + +#: variables.c:669 +#, c-format +msgid "shell level (%d) too high, resetting to 1" +msgstr "" + +#: variables.c:734 +msgid "shell-init" +msgstr "" + +#: variables.c:758 variables.c:761 +msgid "PPID" +msgstr "" + +#: variables.c:772 variables.c:775 +msgid "UID" +msgstr "" + +#: variables.c:782 variables.c:785 +msgid "EUID" +msgstr "" + +#: variables.c:798 variables.c:800 +msgid "BASH_VERSINFO" +msgstr "" + +#: variables.c:893 +#, c-format +msgid "%s=" +msgstr "" + +#: variables.c:1087 variables.c:1093 +msgid "SECONDS" +msgstr "" + +#: variables.c:1395 +msgid "BASH_COMMAND" +msgstr "" + +#: variables.c:1396 +msgid "BASH_SUBSHELL" +msgstr "" + +#: variables.c:1398 +msgid "RANDOM" +msgstr "" + +#: variables.c:1399 +msgid "LINENO" +msgstr "" + +#: variables.c:1402 +msgid "HISTCMD" +msgstr "" + +#: variables.c:1406 +msgid "COMP_WORDBREAKS" +msgstr "" + +#: variables.c:1410 +msgid "DIRSTACK" +msgstr "" + +#: variables.c:1414 +msgid "GROUPS" +msgstr "" + +#: variables.c:1417 variables.c:3554 variables.c:3578 builtins/evalfile.c:101 +msgid "BASH_ARGC" +msgstr "" + +#: variables.c:1418 variables.c:3553 variables.c:3577 builtins/evalfile.c:100 +msgid "BASH_ARGV" +msgstr "" + +#: variables.c:1609 +msgid "make_local_variable: no function context at current scope" +msgstr "" + +#: variables.c:2708 +msgid "all_local_variables: no function context at current scope" +msgstr "" + +#: variables.c:2922 variables.c:2931 +#, c-format +msgid "invalid character %d in exportstr for %s" +msgstr "" + +#: variables.c:2937 +#, c-format +msgid "no `=' in exportstr for %s" +msgstr "" + +#: variables.c:3071 +msgid ") {" +msgstr "" + +#: variables.c:3222 +msgid "_=" +msgstr "" + +#: variables.c:3242 +msgid "_GNU_nonoption_argv_flags_" +msgstr "" + +#: variables.c:3362 +msgid "pop_var_context: head of shell_variables not a function context" +msgstr "" + +#: variables.c:3375 +msgid "pop_var_context: no global_variables context" +msgstr "" + +#: variables.c:3441 +msgid "pop_scope: head of shell_variables not a temporary environment scope" +msgstr "" + +#: variables.c:3625 builtins/history.def:282 +msgid "HISTTIMEFORMAT" +msgstr "" + +#: variables.c:3635 +msgid "LANG" +msgstr "" + +#: variables.c:3636 +msgid "LC_ALL" +msgstr "" + +#: variables.c:3654 +msgid "TERMCAP" +msgstr "" + +#: variables.c:3655 +msgid "TERMINFO" +msgstr "" + +#: variables.c:3662 lib/sh/strftime.c:185 lib/sh/strftime.c:187 +msgid "TZ" +msgstr "" + +#: variables.c:3867 +msgid "ignorespace" +msgstr "" + +#: variables.c:3869 +msgid "ignoredups" +msgstr "" + +#: variables.c:3871 +msgid "ignoreboth" +msgstr "" + +#: variables.c:3873 +msgid "erasedups" +msgstr "" + +#: version.c:60 version.c:62 +#, c-format +msgid "%s.%d(%d)-%s" +msgstr "" + +#: version.c:66 version.c:68 +#, c-format +msgid "%s.%d(%d)" +msgstr "" + +#: version.c:78 +#, c-format +msgid "GNU bash, version %s (%s)\n" +msgstr "" + +#: version.c:80 +msgid "Copyright (C) 2003 Free Software Foundation, Inc.\n" +msgstr "" + +#: xmalloc.c:91 +#, c-format +msgid "xmalloc: cannot allocate %lu bytes (%lu bytes allocated)" +msgstr "" + +#: xmalloc.c:93 +#, c-format +msgid "xmalloc: cannot allocate %lu bytes" +msgstr "" + +#: xmalloc.c:113 +#, c-format +msgid "xrealloc: cannot reallocate %lu bytes (%lu bytes allocated)" +msgstr "" + +#: xmalloc.c:115 +#, c-format +msgid "xrealloc: cannot allocate %lu bytes" +msgstr "" + +#: xmalloc.c:149 +#, c-format +msgid "xmalloc: %s:%d: cannot allocate %lu bytes (%lu bytes allocated)" +msgstr "" + +#: xmalloc.c:151 +#, c-format +msgid "xmalloc: %s:%d: cannot allocate %lu bytes" +msgstr "" + +#: xmalloc.c:173 +#, c-format +msgid "xrealloc: %s:%d: cannot reallocate %lu bytes (%lu bytes allocated)" +msgstr "" + +#: xmalloc.c:175 +#, c-format +msgid "xrealloc: %s:%d: cannot allocate %lu bytes" +msgstr "" + +#: /usr/homes/chet/src/bash/src/parse.y:469 +msgid "error" +msgstr "" + +#: /usr/homes/chet/src/bash/src/parse.y:469 +msgid "$undefined." +msgstr "" + +#: /usr/homes/chet/src/bash/src/parse.y:469 +msgid "IF" +msgstr "" + +#: /usr/homes/chet/src/bash/src/parse.y:469 +msgid "THEN" +msgstr "" + +#: /usr/homes/chet/src/bash/src/parse.y:469 +msgid "ELSE" +msgstr "" + +#: /usr/homes/chet/src/bash/src/parse.y:469 +msgid "ELIF" +msgstr "" + +#: /usr/homes/chet/src/bash/src/parse.y:469 +msgid "FI" +msgstr "" + +#: /usr/homes/chet/src/bash/src/parse.y:469 +msgid "CASE" +msgstr "" + +#: /usr/homes/chet/src/bash/src/parse.y:470 +msgid "ESAC" +msgstr "" + +#: /usr/homes/chet/src/bash/src/parse.y:470 +msgid "FOR" +msgstr "" + +#: /usr/homes/chet/src/bash/src/parse.y:470 +msgid "SELECT" +msgstr "" + +#: /usr/homes/chet/src/bash/src/parse.y:470 +msgid "WHILE" +msgstr "" + +#: /usr/homes/chet/src/bash/src/parse.y:470 +msgid "UNTIL" +msgstr "" + +#: /usr/homes/chet/src/bash/src/parse.y:470 +msgid "DO" +msgstr "" + +#: /usr/homes/chet/src/bash/src/parse.y:470 +msgid "DONE" +msgstr "" + +#: /usr/homes/chet/src/bash/src/parse.y:470 builtins/mkbuiltins.c:425 +msgid "FUNCTION" +msgstr "" + +#: /usr/homes/chet/src/bash/src/parse.y:471 +msgid "COND_START" +msgstr "" + +#: /usr/homes/chet/src/bash/src/parse.y:471 +msgid "COND_END" +msgstr "" + +#: /usr/homes/chet/src/bash/src/parse.y:471 +msgid "COND_ERROR" +msgstr "" + +#: /usr/homes/chet/src/bash/src/parse.y:471 +msgid "IN" +msgstr "" + +#: /usr/homes/chet/src/bash/src/parse.y:471 +msgid "BANG" +msgstr "" + +#: /usr/homes/chet/src/bash/src/parse.y:471 +msgid "TIME" +msgstr "" + +#: /usr/homes/chet/src/bash/src/parse.y:471 +msgid "TIMEOPT" +msgstr "" + +#: /usr/homes/chet/src/bash/src/parse.y:472 +msgid "WORD" +msgstr "" + +#: /usr/homes/chet/src/bash/src/parse.y:472 +msgid "ASSIGNMENT_WORD" +msgstr "" + +#: /usr/homes/chet/src/bash/src/parse.y:472 +msgid "NUMBER" +msgstr "" + +#: /usr/homes/chet/src/bash/src/parse.y:472 +msgid "ARITH_CMD" +msgstr "" + +#: /usr/homes/chet/src/bash/src/parse.y:472 +msgid "ARITH_FOR_EXPRS" +msgstr "" + +#: /usr/homes/chet/src/bash/src/parse.y:473 +msgid "COND_CMD" +msgstr "" + +#: /usr/homes/chet/src/bash/src/parse.y:473 +msgid "AND_AND" +msgstr "" + +#: /usr/homes/chet/src/bash/src/parse.y:473 +msgid "OR_OR" +msgstr "" + +#: /usr/homes/chet/src/bash/src/parse.y:473 +msgid "GREATER_GREATER" +msgstr "" + +#: /usr/homes/chet/src/bash/src/parse.y:473 +msgid "LESS_LESS" +msgstr "" + +#: /usr/homes/chet/src/bash/src/parse.y:474 +msgid "LESS_AND" +msgstr "" + +#: /usr/homes/chet/src/bash/src/parse.y:474 +msgid "LESS_LESS_LESS" +msgstr "" + +#: /usr/homes/chet/src/bash/src/parse.y:474 +msgid "GREATER_AND" +msgstr "" + +#: /usr/homes/chet/src/bash/src/parse.y:474 +msgid "SEMI_SEMI" +msgstr "" + +#: /usr/homes/chet/src/bash/src/parse.y:475 +msgid "LESS_LESS_MINUS" +msgstr "" + +#: /usr/homes/chet/src/bash/src/parse.y:475 +msgid "AND_GREATER" +msgstr "" + +#: /usr/homes/chet/src/bash/src/parse.y:475 +msgid "LESS_GREATER" +msgstr "" + +#: /usr/homes/chet/src/bash/src/parse.y:475 +msgid "GREATER_BAR" +msgstr "" + +#: /usr/homes/chet/src/bash/src/parse.y:475 +msgid "'&'" +msgstr "" + +#: /usr/homes/chet/src/bash/src/parse.y:476 +msgid "';'" +msgstr "" + +#: /usr/homes/chet/src/bash/src/parse.y:476 +msgid "'\\n'" +msgstr "" + +#: /usr/homes/chet/src/bash/src/parse.y:476 +msgid "yacc_EOF" +msgstr "" + +#: /usr/homes/chet/src/bash/src/parse.y:476 +msgid "'|'" +msgstr "" + +#: /usr/homes/chet/src/bash/src/parse.y:476 +msgid "'>'" +msgstr "" + +#: /usr/homes/chet/src/bash/src/parse.y:476 +msgid "'<'" +msgstr "" + +#: /usr/homes/chet/src/bash/src/parse.y:476 +msgid "'-'" +msgstr "" + +#: /usr/homes/chet/src/bash/src/parse.y:476 +msgid "'{'" +msgstr "" + +#: /usr/homes/chet/src/bash/src/parse.y:476 +msgid "'}'" +msgstr "" + +#: /usr/homes/chet/src/bash/src/parse.y:477 +msgid "'('" +msgstr "" + +#: /usr/homes/chet/src/bash/src/parse.y:477 +msgid "')'" +msgstr "" + +#: /usr/homes/chet/src/bash/src/parse.y:477 +msgid "inputunit" +msgstr "" + +#: /usr/homes/chet/src/bash/src/parse.y:477 +msgid "word_list" +msgstr "" + +#: /usr/homes/chet/src/bash/src/parse.y:477 +msgid "redirection" +msgstr "" + +#: /usr/homes/chet/src/bash/src/parse.y:478 +msgid "simple_command_element" +msgstr "" + +#: /usr/homes/chet/src/bash/src/parse.y:478 +msgid "redirection_list" +msgstr "" + +#: /usr/homes/chet/src/bash/src/parse.y:478 +msgid "simple_command" +msgstr "" + +#: /usr/homes/chet/src/bash/src/parse.y:479 builtins/command.def:2 +#: builtins/complete.def:82 +msgid "command" +msgstr "" + +#: /usr/homes/chet/src/bash/src/parse.y:479 +msgid "shell_command" +msgstr "" + +#: /usr/homes/chet/src/bash/src/parse.y:479 +msgid "for_command" +msgstr "" + +#: /usr/homes/chet/src/bash/src/parse.y:479 +msgid "arith_for_command" +msgstr "" + +#: /usr/homes/chet/src/bash/src/parse.y:480 +msgid "select_command" +msgstr "" + +#: /usr/homes/chet/src/bash/src/parse.y:480 +msgid "case_command" +msgstr "" + +#: /usr/homes/chet/src/bash/src/parse.y:480 +msgid "function_def" +msgstr "" + +#: /usr/homes/chet/src/bash/src/parse.y:480 +msgid "function_body" +msgstr "" + +#: /usr/homes/chet/src/bash/src/parse.y:481 +msgid "subshell" +msgstr "" + +#: /usr/homes/chet/src/bash/src/parse.y:481 +msgid "if_command" +msgstr "" + +#: /usr/homes/chet/src/bash/src/parse.y:481 +msgid "group_command" +msgstr "" + +#: /usr/homes/chet/src/bash/src/parse.y:481 +msgid "arith_command" +msgstr "" + +#: /usr/homes/chet/src/bash/src/parse.y:482 +msgid "cond_command" +msgstr "" + +#: /usr/homes/chet/src/bash/src/parse.y:482 +msgid "elif_clause" +msgstr "" + +#: /usr/homes/chet/src/bash/src/parse.y:482 +msgid "case_clause" +msgstr "" + +#: /usr/homes/chet/src/bash/src/parse.y:482 +msgid "pattern_list" +msgstr "" + +#: /usr/homes/chet/src/bash/src/parse.y:483 +msgid "case_clause_sequence" +msgstr "" + +#: /usr/homes/chet/src/bash/src/parse.y:483 +msgid "pattern" +msgstr "" + +#: /usr/homes/chet/src/bash/src/parse.y:483 +msgid "list" +msgstr "" + +#: /usr/homes/chet/src/bash/src/parse.y:483 +msgid "compound_list" +msgstr "" + +#: /usr/homes/chet/src/bash/src/parse.y:483 +msgid "list0" +msgstr "" + +#: /usr/homes/chet/src/bash/src/parse.y:484 +msgid "list1" +msgstr "" + +#: /usr/homes/chet/src/bash/src/parse.y:484 +msgid "simple_list_terminator" +msgstr "" + +#: /usr/homes/chet/src/bash/src/parse.y:484 +msgid "list_terminator" +msgstr "" + +#: /usr/homes/chet/src/bash/src/parse.y:484 +msgid "newline_list" +msgstr "" + +#: /usr/homes/chet/src/bash/src/parse.y:485 +msgid "simple_list" +msgstr "" + +#: /usr/homes/chet/src/bash/src/parse.y:485 +msgid "simple_list1" +msgstr "" + +#: /usr/homes/chet/src/bash/src/parse.y:485 +msgid "pipeline_command" +msgstr "" + +#: /usr/homes/chet/src/bash/src/parse.y:485 +msgid "pipeline" +msgstr "" + +#: /usr/homes/chet/src/bash/src/parse.y:486 +msgid "timespec" +msgstr "" + +#: /usr/local/share/bison/bison.simple:156 +msgid "syntax error: cannot back up" +msgstr "" + +#: /usr/local/share/bison/bison.simple:442 +msgid "Starting parse\n" +msgstr "" + +#: /usr/local/share/bison/bison.simple:492 +#: /usr/local/share/bison/bison.simple:499 +#: /usr/local/share/bison/bison.simple:924 +msgid "parser stack overflow" +msgstr "" + +#: /usr/local/share/bison/bison.simple:538 +#, c-format +msgid "Stack size increased to %lu\n" +msgstr "" + +#: /usr/local/share/bison/bison.simple:545 +#, c-format +msgid "Entering state %d\n" +msgstr "" + +#: /usr/local/share/bison/bison.simple:572 +msgid "Reading a token: " +msgstr "" + +#: /usr/local/share/bison/bison.simple:583 +msgid "Now at end of input.\n" +msgstr "" + +#: /usr/local/share/bison/bison.simple:594 +#, c-format +msgid "Next token is %d (%s" +msgstr "" + +#: /usr/local/share/bison/bison.simple:633 +#, c-format +msgid "Shifting token %d (%s), " +msgstr "" + +#: /usr/local/share/bison/bison.simple:695 +#, c-format +msgid "Reducing via rule %d (line %d), " +msgstr "" + +#: /usr/local/share/bison/bison.simple:701 +#, c-format +msgid " -> %s\n" +msgstr "" + +#: /usr/local/share/bison/bison.simple:717 +msgid "state stack now" +msgstr "" + +#: /usr/local/share/bison/bison.simple:769 +#: /usr/local/share/bison/bison.simple:774 +msgid "parse error, unexpected " +msgstr "" + +#: /usr/local/share/bison/bison.simple:785 +msgid ", expecting " +msgstr "" + +#: /usr/local/share/bison/bison.simple:785 +msgid " or " +msgstr "" + +#: /usr/local/share/bison/bison.simple:795 +msgid "parse error; also virtual memory exhausted" +msgstr "" + +#: /usr/local/share/bison/bison.simple:799 +msgid "parse error" +msgstr "" + +#: /usr/local/share/bison/bison.simple:816 +#, c-format +msgid "Discarding token %d (%s).\n" +msgstr "" + +#: /usr/local/share/bison/bison.simple:862 +msgid "Error: state stack now" +msgstr "" + +#: /usr/local/share/bison/bison.simple:895 +msgid "Shifting error token, " +msgstr "" + +#: builtins/common.c:102 +#, c-format +msgid "line %d: " +msgstr "" + +#: builtins/common.c:119 +#, c-format +msgid "%s: usage: " +msgstr "" + +#: builtins/common.c:163 +#, c-format +msgid "%s: numeric argument required" +msgstr "" + +#: builtins/common.c:170 +#, c-format +msgid "%s: not found" +msgstr "" + +#: builtins/common.c:186 +#, c-format +msgid "%s: invalid option name" +msgstr "" + +#: builtins/common.c:200 +#, c-format +msgid "%s: invalid number" +msgstr "" + +#: builtins/common.c:207 +#, c-format +msgid "%s: invalid signal specification" +msgstr "" + +#: builtins/common.c:214 +#, c-format +msgid "`%s': not a pid or valid job spec" +msgstr "" + +#: builtins/common.c:229 +#, c-format +msgid "%s: %s out of range" +msgstr "" + +#: builtins/common.c:229 builtins/common.c:231 +msgid "argument" +msgstr "" + +#: builtins/common.c:231 +#, c-format +msgid "%s out of range" +msgstr "" + +#: builtins/common.c:239 +#, c-format +msgid "%s: no such job" +msgstr "" + +#: builtins/common.c:247 +#, c-format +msgid "%s: no job control" +msgstr "" + +#: builtins/common.c:249 +msgid "no job control" +msgstr "" + +#: builtins/common.c:259 +#, c-format +msgid "%s: restricted" +msgstr "" + +#: builtins/common.c:269 +#, c-format +msgid "%s: not a shell builtin" +msgstr "" + +#: builtins/common.c:417 +msgid "`'" +msgstr "" + +#: builtins/common.c:480 +#, c-format +msgid "%s: could not get current directory: %s: %s\n" +msgstr "" + +#: builtins/common.c:547 builtins/common.c:549 +#, c-format +msgid "%s: ambiguous job spec" +msgstr "" + +#: builtins/common.c:631 builtins/common.c:680 builtins/trap.def:214 +msgid "SIGJUNK" +msgstr "" + +#: builtins/common.c:631 builtins/common.c:680 +msgid "Unknown" +msgstr "" + +#: builtins/common.c:644 +#, c-format +msgid "%2d) %s" +msgstr "" + +#: builtins/evalfile.c:132 +#, c-format +msgid "%s: not a regular file" +msgstr "" + +#: builtins/evalfile.c:140 +#, c-format +msgid "%s: file is too large" +msgstr "" + +#: builtins/evalfile.c:178 builtins/evalfile.c:237 +msgid "_evalfile" +msgstr "" + +#: builtins/evalfile.c:204 builtins/mkbuiltins.c:130 builtins/source.def:2 +#: builtins/source.def:143 builtins/source.def:170 +msgid "source" +msgstr "" + +#: builtins/evalstring.c:76 builtins/evalstring.c:103 +#: builtins/evalstring.c:287 +msgid "parse_and_execute_top" +msgstr "" + +#: builtins/evalstring.c:181 builtins/evalstring.c:189 +#: builtins/evalstring.c:223 builtins/evalstring.c:272 +msgid "pe_dispose" +msgstr "" + +#: builtins/evalstring.c:205 +msgid "parse_and_execute" +msgstr "" + +#: builtins/getopt.c:108 +#, c-format +msgid "%s: illegal option -- %c\n" +msgstr "" + +#: builtins/getopt.c:109 +#, c-format +msgid "%s: option requires an argument -- %c\n" +msgstr "" + +#: builtins/getopt.c:231 +msgid "sh_getopt_debug_restore_state: resetting nextchar" +msgstr "" + +#: builtins/getopt.c:254 +msgid "abc:d:0123456789" +msgstr "" + +#: builtins/getopt.c:271 +msgid "digits occur in two different argv-elements.\n" +msgstr "" + +#: builtins/getopt.c:273 +#, c-format +msgid "option %c\n" +msgstr "" + +#: builtins/getopt.c:277 +msgid "option a\n" +msgstr "" + +#: builtins/getopt.c:281 +msgid "option b\n" +msgstr "" + +#: builtins/getopt.c:285 +#, c-format +msgid "option c with value `%s'\n" +msgstr "" + +#: builtins/getopt.c:292 +#, c-format +msgid "?? sh_getopt returned character code 0%o ??\n" +msgstr "" + +#: builtins/getopt.c:298 +msgid "non-option ARGV-elements: " +msgstr "" + +#: builtins/mkbuiltins.c:47 +msgid "builtins.texi" +msgstr "" + +#: builtins/mkbuiltins.c:130 builtins/break.def:2 +msgid "break" +msgstr "" + +#: builtins/mkbuiltins.c:130 builtins/break.def:2 +msgid "continue" +msgstr "" + +#: builtins/mkbuiltins.c:130 builtins/eval.def:2 builtins/eval.def:52 +msgid "eval" +msgstr "" + +#: builtins/mkbuiltins.c:130 builtins/exec.def:2 +msgid "exec" +msgstr "" + +#: builtins/mkbuiltins.c:131 builtins/mkbuiltins.c:138 +#: builtins/complete.def:86 builtins/setattr.def:2 +msgid "export" +msgstr "" + +#: builtins/mkbuiltins.c:131 builtins/mkbuiltins.c:138 builtins/setattr.def:2 +msgid "readonly" +msgstr "" + +#: builtins/mkbuiltins.c:131 builtins/return.def:2 +msgid "return" +msgstr "" + +#: builtins/mkbuiltins.c:131 builtins/shift.def:2 +msgid "shift" +msgstr "" + +#: builtins/mkbuiltins.c:131 builtins/set.def:2 +msgid "unset" +msgstr "" + +#: builtins/mkbuiltins.c:138 builtins/alias.def:2 builtins/complete.def:78 +#: builtins/type.def:228 +msgid "alias" +msgstr "" + +#: builtins/mkbuiltins.c:138 builtins/declare.def:2 +msgid "declare" +msgstr "" + +#: builtins/mkbuiltins.c:138 builtins/declare.def:2 +msgid "local" +msgstr "" + +#: builtins/mkbuiltins.c:138 +msgid "typeset" +msgstr "" + +#: builtins/mkbuiltins.c:194 +msgid "-externfile" +msgstr "" + +#: builtins/mkbuiltins.c:196 +msgid "-structfile" +msgstr "" + +#: builtins/mkbuiltins.c:198 +msgid "-noproduction" +msgstr "" + +#: builtins/mkbuiltins.c:200 +msgid "-document" +msgstr "" + +#: builtins/mkbuiltins.c:202 +msgid "-D" +msgstr "" + +#: builtins/mkbuiltins.c:218 +msgid "-documentonly" +msgstr "" + +#: builtins/mkbuiltins.c:223 +msgid "-H" +msgstr "" + +#: builtins/mkbuiltins.c:230 +#, c-format +msgid "%s: Unknown flag %s.\n" +msgstr "" + +#: builtins/mkbuiltins.c:245 +#, c-format +msgid "mk-%ld" +msgstr "" + +#: builtins/mkbuiltins.c:266 +#, c-format +msgid "@c Table of builtins created with %s.\n" +msgstr "" + +#: builtins/mkbuiltins.c:268 +msgid "@ftable @asis\n" +msgstr "" + +#: builtins/mkbuiltins.c:305 +msgid "@end ftable\n" +msgstr "" + +#: builtins/mkbuiltins.c:423 +msgid "BUILTIN" +msgstr "" + +#: builtins/mkbuiltins.c:424 +msgid "DOCNAME" +msgstr "" + +#: builtins/mkbuiltins.c:426 +msgid "SHORT_DOC" +msgstr "" + +#: builtins/mkbuiltins.c:428 +msgid "COMMENT" +msgstr "" + +#: builtins/mkbuiltins.c:429 +msgid "DEPENDS_ON" +msgstr "" + +#: builtins/mkbuiltins.c:430 +msgid "PRODUCES" +msgstr "" + +#: builtins/mkbuiltins.c:431 +msgid "END" +msgstr "" + +#: builtins/mkbuiltins.c:500 +#, c-format +msgid "mkbuiltins: %s: skipping zero-length file\n" +msgstr "" + +#: builtins/mkbuiltins.c:551 +#, c-format +msgid "Unknown directive `%s'" +msgstr "" + +#: builtins/mkbuiltins.c:577 +#, c-format +msgid "#line %d \"%s\"\n" +msgstr "" + +#: builtins/mkbuiltins.c:580 +#, c-format +msgid "#line %d \"%s%s\"\n" +msgstr "" + +#: builtins/mkbuiltins.c:582 builtins/mkbuiltins.c:954 +msgid "./" +msgstr "" + +#: builtins/mkbuiltins.c:703 +#, c-format +msgid "%s requires an argument" +msgstr "" + +#: builtins/mkbuiltins.c:715 +#, c-format +msgid "%s must be inside of a $BUILTIN block" +msgstr "" + +#: builtins/mkbuiltins.c:740 +msgid "(implied LONGDOC)" +msgstr "" + +#: builtins/mkbuiltins.c:766 +#, c-format +msgid "%s found before $END" +msgstr "" + +#: builtins/mkbuiltins.c:812 +msgid "syntax error: no current builtin for $FUNCTION directive" +msgstr "" + +#: builtins/mkbuiltins.c:816 +#, c-format +msgid "%s already has a function (%s)" +msgstr "" + +#: builtins/mkbuiltins.c:836 +#, c-format +msgid "%s already had a docname (%s)" +msgstr "" + +#: builtins/mkbuiltins.c:856 +#, c-format +msgid "%s already has short documentation (%s)" +msgstr "" + +#: builtins/mkbuiltins.c:910 +#, c-format +msgid "%s already has a %s definition" +msgstr "" + +#: builtins/mkbuiltins.c:923 +#, c-format +msgid "/* %s, created from %s. */\n" +msgstr "" + +#: builtins/mkbuiltins.c:955 +#, c-format +msgid "%s:%d:" +msgstr "" + +#: builtins/mkbuiltins.c:1010 +msgid "mkbuiltins: out of virtual memory\n" +msgstr "" + +#: builtins/mkbuiltins.c:1066 +msgid "/* builtins.c -- the built in shell commands. */" +msgstr "" + +#: builtins/mkbuiltins.c:1068 +msgid "/* This file is manufactured by ./mkbuiltins, and should not be" +msgstr "" + +#: builtins/mkbuiltins.c:1069 +msgid " edited by hand. See the source to mkbuiltins for details. */" +msgstr "" + +#: builtins/mkbuiltins.c:1071 +msgid "/* Copyright (C) 1987-2002 Free Software Foundation, Inc." +msgstr "" + +#: builtins/mkbuiltins.c:1073 +msgid " This file is part of GNU Bash, the Bourne Again SHell." +msgstr "" + +#: builtins/mkbuiltins.c:1075 +msgid " Bash is free software; you can redistribute it and/or modify it" +msgstr "" + +#: builtins/mkbuiltins.c:1076 +msgid " under the terms of the GNU General Public License as published by" +msgstr "" + +#: builtins/mkbuiltins.c:1077 +msgid " the Free Software Foundation; either version 2, or (at your option)" +msgstr "" + +#: builtins/mkbuiltins.c:1078 +msgid " any later version." +msgstr "" + +#: builtins/mkbuiltins.c:1080 +msgid " Bash is distributed in the hope that it will be useful, but WITHOUT" +msgstr "" + +#: builtins/mkbuiltins.c:1081 +msgid " ANY WARRANTY; without even the implied warranty of MERCHANTABILITY" +msgstr "" + +#: builtins/mkbuiltins.c:1082 +msgid " or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public" +msgstr "" + +#: builtins/mkbuiltins.c:1083 +msgid " License for more details." +msgstr "" + +#: builtins/mkbuiltins.c:1085 +msgid " You should have received a copy of the GNU General Public License" +msgstr "" + +#: builtins/mkbuiltins.c:1086 +msgid " along with Bash; see the file COPYING. If not, write to the Free" +msgstr "" + +#: builtins/mkbuiltins.c:1087 +msgid "" +" Software Foundation, 59 Temple Place, Suite 330, Boston, MA 02111 USA. */" +msgstr "" + +#: builtins/mkbuiltins.c:1089 +msgid "/* The list of shell builtins. Each element is name, function, flags," +msgstr "" + +#: builtins/mkbuiltins.c:1090 +msgid "" +" long-doc, short-doc. The long-doc field contains a pointer to an array" +msgstr "" + +#: builtins/mkbuiltins.c:1091 +msgid "" +" of help lines. The function takes a WORD_LIST *; the first word in the" +msgstr "" + +#: builtins/mkbuiltins.c:1092 +msgid " list is the first arg to the command. The list has already had word" +msgstr "" + +#: builtins/mkbuiltins.c:1093 +msgid " expansion performed." +msgstr "" + +#: builtins/mkbuiltins.c:1095 +msgid " Functions which need to look at only the simple commands (e.g." +msgstr "" + +#: builtins/mkbuiltins.c:1096 +msgid " the enable_builtin ()), should ignore entries where" +msgstr "" + +#: builtins/mkbuiltins.c:1097 +msgid "" +" (array[i].function == (sh_builtin_func_t *)NULL). Such entries are for" +msgstr "" + +#: builtins/mkbuiltins.c:1098 +msgid "" +" the list of shell reserved control structures, like `if' and `while'." +msgstr "" + +#: builtins/mkbuiltins.c:1099 +msgid " The end of the list is denoted with a NULL name field. */" +msgstr "" + +#: builtins/mkbuiltins.c:1101 +msgid "#include \"../builtins.h\"" +msgstr "" + +#: builtins/mkbuiltins.c:1106 +msgid "" +" { (char *)0x0, (sh_builtin_func_t *)0x0, 0, (char **)0x0, (char *)0x0 }" +msgstr "" + +#: builtins/mkbuiltins.c:1107 +msgid "};" +msgstr "" + +#: builtins/mkbuiltins.c:1109 +msgid "struct builtin *shell_builtins = static_shell_builtins;" +msgstr "" + +#: builtins/mkbuiltins.c:1110 +msgid "struct builtin *current_builtin;" +msgstr "" + +#: builtins/mkbuiltins.c:1112 +msgid "int num_shell_builtins =" +msgstr "" + +#: builtins/mkbuiltins.c:1113 +msgid "\tsizeof (static_shell_builtins) / sizeof (struct builtin) - 1;" +msgstr "" + +#: builtins/mkbuiltins.c:1130 +#, c-format +msgid "#include \"%s\"\n" +msgstr "" + +#: builtins/mkbuiltins.c:1131 builtins/mkbuiltins.c:1138 +msgid "builtext.h" +msgstr "" + +#: builtins/mkbuiltins.c:1132 +msgid "" +"\n" +"struct builtin static_shell_builtins[] = {\n" +msgstr "" + +#: builtins/mkbuiltins.c:1137 +#, c-format +msgid "/* %s - The list of builtins found in libbuiltins.a. */\n" +msgstr "" + +#: builtins/mkbuiltins.c:1188 +#, c-format +msgid "extern int %s __P((WORD_LIST *));\n" +msgstr "" + +#: builtins/mkbuiltins.c:1191 +#, c-format +msgid "extern char * const %s_doc[];\n" +msgstr "" + +#: builtins/mkbuiltins.c:1198 +#, c-format +msgid " { \"%s\", " +msgstr "" + +#: builtins/mkbuiltins.c:1201 +#, c-format +msgid "%s, " +msgstr "" + +#: builtins/mkbuiltins.c:1203 +msgid "(sh_builtin_func_t *)0x0, " +msgstr "" + +#: builtins/mkbuiltins.c:1205 +#, c-format +msgid "%s%s%s, %s_doc,\n" +msgstr "" + +#: builtins/mkbuiltins.c:1206 +msgid "BUILTIN_ENABLED | STATIC_BUILTIN" +msgstr "" + +#: builtins/mkbuiltins.c:1207 +msgid " | SPECIAL_BUILTIN" +msgstr "" + +#: builtins/mkbuiltins.c:1208 +msgid " | ASSIGNMENT_BUILTIN" +msgstr "" + +#: builtins/mkbuiltins.c:1212 +#, c-format +msgid " \"%s\", (char *)NULL },\n" +msgstr "" + +#: builtins/mkbuiltins.c:1235 +#, c-format +msgid "@item %s\n" +msgstr "" + +#: builtins/mkbuiltins.c:1263 +#, c-format +msgid "char * const %s_doc[] =" +msgstr "" + +#: builtins/mkbuiltins.c:1269 lib/sh/mailstat.c:126 +#, c-format +msgid "%s/%s" +msgstr "" + +#: builtins/mkbuiltins.c:1299 +msgid "#if " +msgstr "" + +#: builtins/mkbuiltins.c:1306 +#, c-format +msgid "!defined (%s)" +msgstr "" + +#: builtins/mkbuiltins.c:1308 +#, c-format +msgid "defined (%s)" +msgstr "" + +#: builtins/mkbuiltins.c:1330 +msgid "#endif /* " +msgstr "" + +#: builtins/mkbuiltins.c:1340 +msgid " */\n" +msgstr "" + +#: builtins/mkbuiltins.c:1360 +msgid "" +" {\n" +"#if defined (HELP_BUILTIN)\n" +msgstr "" + +#: builtins/mkbuiltins.c:1373 +msgid " \"" +msgstr "" + +#: builtins/mkbuiltins.c:1387 +#, c-format +msgid "\\%c" +msgstr "" + +#: builtins/mkbuiltins.c:1391 builtins/mkbuiltins.c:1410 +#, c-format +msgid "%c" +msgstr "" + +#: builtins/mkbuiltins.c:1395 +msgid "\",\n" +msgstr "" + +#: builtins/mkbuiltins.c:1406 +#, c-format +msgid "@%c" +msgstr "" + +#: builtins/mkbuiltins.c:1420 +msgid "" +"#endif /* HELP_BUILTIN */\n" +" (char *)NULL\n" +"};\n" +msgstr "" + +#: builtins/mkbuiltins.c:1432 +msgid "helpfiles" +msgstr "" + +#: builtins/mkbuiltins.c:1435 +msgid "write_helpfiles: helpfiles: cannot create directory\n" +msgstr "" + +#: builtins/mkbuiltins.c:1439 +msgid "helpfiles/" +msgstr "" + +#: builtins/mkbuiltins.c:1446 +#, c-format +msgid "helpfiles/%s" +msgstr "" + +#: builtins/mkbuiltins.c:1451 +#, c-format +msgid "write_helpfiles: cannot open %s\n" +msgstr "" + +#: builtins/alias.def:2 +msgid "unalias" +msgstr "" + +#: builtins/alias.def:73 +msgid "p" +msgstr "" + +#: builtins/alias.def:160 +msgid "a" +msgstr "" + +#: builtins/alias.def:210 +msgid "alias " +msgstr "" + +#: builtins/bind.def:2 +msgid "bind" +msgstr "" + +#: builtins/bind.def:121 builtins/bind.def:265 +msgid "bind_builtin" +msgstr "" + +#: builtins/bind.def:127 +msgid "lvpVPsSf:q:u:m:r:x:" +msgstr "" + +#: builtins/bind.def:192 +#, c-format +msgid "`%s': invalid keymap name" +msgstr "" + +#: builtins/bind.def:231 +#, c-format +msgid "%s: cannot read: %s" +msgstr "" + +#: builtins/bind.def:246 +#, c-format +msgid "`%s': cannot unbind" +msgstr "" + +#: builtins/bind.def:281 builtins/bind.def:311 +#, c-format +msgid "`%s': unknown function name" +msgstr "" + +#: builtins/bind.def:289 +#, c-format +msgid "%s is not bound to any keys.\n" +msgstr "" + +#: builtins/bind.def:293 +#, c-format +msgid "%s can be invoked via " +msgstr "" + +#: builtins/bind.def:295 +#, c-format +msgid "\"%s\"%s" +msgstr "" + +#: builtins/bind.def:295 builtins/help.def:106 +msgid ", " +msgstr "" + +#: builtins/bind.def:295 +msgid ".\n" +msgstr "" + +#: builtins/bind.def:297 +msgid "...\n" +msgstr "" + +#: builtins/break.def:71 builtins/break.def:106 +msgid "loop count" +msgstr "" + +#: builtins/break.def:126 +msgid "only meaningful in a `for', `while', or `until' loop" +msgstr "" + +#: builtins/builtin.def:2 builtins/complete.def:81 builtins/type.def:294 +msgid "builtin" +msgstr "" + +#: builtins/caller.def:2 builtins/caller.def:138 +msgid "caller" +msgstr "" + +#: builtins/caller.def:31 +msgid "$line $filename" +msgstr "" + +#: builtins/caller.def:32 +msgid "$line $subroutine $filename" +msgstr "" + +#: builtins/caller.def:70 +msgid "1 NULL\n" +msgstr "" + +#: builtins/caller.def:94 +#, c-format +msgid "%s %s\n" +msgstr "" + +#: builtins/caller.def:110 +#, c-format +msgid "%s %s %s\n" +msgstr "" + +#: builtins/caller.def:126 +msgid "Returns the context of the current subroutine call." +msgstr "" + +#: builtins/caller.def:128 +msgid "Without EXPR, returns returns \"$line $filename\". With EXPR," +msgstr "" + +#: builtins/caller.def:129 +msgid "returns \"$line $subroutine $filename\"; this extra information" +msgstr "" + +#: builtins/caller.def:130 +msgid "can be used used to provide a stack trace." +msgstr "" + +#: builtins/caller.def:132 +msgid "The value of EXPR indicates how many call frames to go back before the" +msgstr "" + +#: builtins/caller.def:133 +msgid "current one; the top frame is frame 0." +msgstr "" + +#: builtins/caller.def:142 +msgid "caller [EXPR]" +msgstr "" + +#: builtins/cd.def:2 builtins/cd.def:96 builtins/cd.def:130 +msgid "cd" +msgstr "" + +#: builtins/cd.def:2 builtins/cd.def:338 +msgid "pwd" +msgstr "" + +#: builtins/cd.def:105 +msgid "OLDPWD=" +msgstr "" + +#: builtins/cd.def:112 +msgid "PWD=" +msgstr "" + +#: builtins/cd.def:160 builtins/cd.def:318 +msgid "LP" +msgstr "" + +#: builtins/cd.def:187 +msgid "HOME not set" +msgstr "" + +#: builtins/cd.def:199 +msgid "OLDPWD not set" +msgstr "" + +#: builtins/cd.def:210 +msgid "CDPATH" +msgstr "" + +#: builtins/cd.def:349 +#, c-format +msgid "write error: %s" +msgstr "" + +#: builtins/cd.def:378 +msgid "chdir" +msgstr "" + +#: builtins/command.def:29 +msgid "command ls" +msgstr "" + +#: builtins/command.def:73 +msgid "pvV" +msgstr "" + +#: builtins/command.def:120 builtins/command.def:160 +msgid "command_builtin" +msgstr "" + +#: builtins/complete.def:2 +msgid "complete" +msgstr "" + +#: builtins/complete.def:2 builtins/complete.def:589 +msgid "compgen" +msgstr "" + +#: builtins/complete.def:79 builtins/complete.def:458 +msgid "arrayvar" +msgstr "" + +#: builtins/complete.def:80 builtins/complete.def:459 +msgid "binding" +msgstr "" + +#: builtins/complete.def:83 +msgid "directory" +msgstr "" + +#: builtins/complete.def:84 builtins/complete.def:460 +msgid "disabled" +msgstr "" + +#: builtins/complete.def:85 builtins/complete.def:461 +msgid "enabled" +msgstr "" + +#: builtins/complete.def:87 builtins/type.def:315 builtins/type.def:335 +#: builtins/type.def:380 +msgid "file" +msgstr "" + +#: builtins/complete.def:89 builtins/complete.def:463 +msgid "helptopic" +msgstr "" + +#: builtins/complete.def:90 builtins/complete.def:464 +msgid "hostname" +msgstr "" + +#: builtins/complete.def:91 +msgid "group" +msgstr "" + +#: builtins/complete.def:92 +msgid "job" +msgstr "" + +#: builtins/complete.def:93 builtins/set.def:193 builtins/type.def:249 +msgid "keyword" +msgstr "" + +#: builtins/complete.def:94 builtins/complete.def:465 +msgid "running" +msgstr "" + +#: builtins/complete.def:95 +msgid "service" +msgstr "" + +#: builtins/complete.def:96 builtins/complete.def:466 +msgid "setopt" +msgstr "" + +#: builtins/complete.def:97 builtins/complete.def:467 +msgid "shopt" +msgstr "" + +#: builtins/complete.def:98 builtins/complete.def:468 +msgid "signal" +msgstr "" + +#: builtins/complete.def:99 builtins/complete.def:469 +msgid "stopped" +msgstr "" + +#: builtins/complete.def:100 +msgid "user" +msgstr "" + +#: builtins/complete.def:101 builtins/set.def:787 +msgid "variable" +msgstr "" + +#: builtins/complete.def:110 builtins/complete.def:434 +msgid "bashdefault" +msgstr "" + +#: builtins/complete.def:111 builtins/complete.def:435 +msgid "default" +msgstr "" + +#: builtins/complete.def:112 builtins/complete.def:436 +msgid "dirnames" +msgstr "" + +#: builtins/complete.def:113 builtins/complete.def:437 +msgid "filenames" +msgstr "" + +#: builtins/complete.def:114 builtins/complete.def:438 +msgid "nospace" +msgstr "" + +#: builtins/complete.def:115 builtins/complete.def:439 +msgid "plusdirs" +msgstr "" + +#: builtins/complete.def:170 +msgid "abcdefgjko:prsuvA:G:W:P:S:X:F:C:" +msgstr "" + +#: builtins/complete.def:183 +msgid "-r" +msgstr "" + +#: builtins/complete.def:250 +#, c-format +msgid "%s: invalid action name" +msgstr "" + +#: builtins/complete.def:380 builtins/complete.def:523 +#, c-format +msgid "%s: no completion specification" +msgstr "" + +#: builtins/complete.def:392 builtins/complete.def:400 +#, c-format +msgid "%s %s " +msgstr "" + +#: builtins/complete.def:412 +#, c-format +msgid "-A %s " +msgstr "" + +#: builtins/complete.def:418 +#, c-format +msgid "-o %s " +msgstr "" + +#: builtins/complete.def:429 +msgid "complete " +msgstr "" + +#: builtins/complete.def:444 +msgid "-a" +msgstr "" + +#: builtins/complete.def:445 +msgid "-b" +msgstr "" + +#: builtins/complete.def:447 +msgid "-d" +msgstr "" + +#: builtins/complete.def:448 +msgid "-e" +msgstr "" + +#: builtins/complete.def:449 +msgid "-f" +msgstr "" + +#: builtins/complete.def:450 +msgid "-g" +msgstr "" + +#: builtins/complete.def:451 +msgid "-j" +msgstr "" + +#: builtins/complete.def:452 +msgid "-k" +msgstr "" + +#: builtins/complete.def:453 builtins/shopt.def:325 +msgid "-s" +msgstr "" + +#: builtins/complete.def:454 builtins/shopt.def:325 +msgid "-u" +msgstr "" + +#: builtins/complete.def:455 +msgid "-v" +msgstr "" + +#: builtins/complete.def:474 +msgid "-G" +msgstr "" + +#: builtins/complete.def:475 +msgid "-W" +msgstr "" + +#: builtins/complete.def:476 +msgid "-P" +msgstr "" + +#: builtins/complete.def:477 +msgid "-S" +msgstr "" + +#: builtins/complete.def:478 +msgid "-X" +msgstr "" + +#: builtins/complete.def:481 +msgid "-F" +msgstr "" + +#: builtins/complete.def:482 +msgid "-C" +msgstr "" + +#: builtins/complete.def:570 +msgid "warning: -F option may not work as you expect" +msgstr "" + +#: builtins/complete.def:572 +msgid "warning: -C option may not work as you expect" +msgstr "" + +#: builtins/declare.def:104 +msgid "can only be used in a function" +msgstr "" + +#: builtins/declare.def:110 +msgid "+afiprtxF" +msgstr "" + +#: builtins/declare.def:112 +msgid "+fiprtxF" +msgstr "" + +#: builtins/declare.def:294 +msgid "cannot use `-f' to make functions" +msgstr "" + +#: builtins/declare.def:319 +#, c-format +msgid "%s %d %s\n" +msgstr "" + +#: builtins/declare.def:388 +#, c-format +msgid "%s: cannot destroy array variables in this way" +msgstr "" + +#: builtins/echo.def:2 +msgid "echo" +msgstr "" + +#: builtins/echo.def:65 +msgid "neE" +msgstr "" + +#: builtins/echo.def:67 +msgid "n" +msgstr "" + +#: builtins/enable.def:2 +msgid "enable" +msgstr "" + +#: builtins/enable.def:104 +msgid "adnpsf:" +msgstr "" + +#: builtins/enable.def:126 builtins/enable.def:134 +msgid "dynamic loading not available" +msgstr "" + +#: builtins/enable.def:227 +#, c-format +msgid "enable %s\n" +msgstr "" + +#: builtins/enable.def:230 +#, c-format +msgid "enable -n %s\n" +msgstr "" + +#: builtins/enable.def:301 +#, c-format +msgid "cannot open shared object %s: %s" +msgstr "" + +#: builtins/enable.def:319 +msgid "_struct" +msgstr "" + +#: builtins/enable.def:324 +#, c-format +msgid "cannot find %s in shared object %s: %s" +msgstr "" + +#: builtins/enable.def:448 +#, c-format +msgid "%s: not dynamically loaded" +msgstr "" + +#: builtins/enable.def:463 +#, c-format +msgid "%s: cannot delete: %s" +msgstr "" + +#: builtins/exec.def:100 +msgid "cla:" +msgstr "" + +#: builtins/exec.def:204 +#, c-format +msgid "%s: cannot execute: %s" +msgstr "" + +#: builtins/exit.def:61 +msgid "logout\n" +msgstr "" + +#: builtins/exit.def:61 +msgid "exit\n" +msgstr "" + +#: builtins/exit.def:81 +msgid "not login shell: use `exit'" +msgstr "" + +#: builtins/exit.def:109 +msgid "There are stopped jobs.\n" +msgstr "" + +#: builtins/exit.def:145 +msgid "~/.bash_logout" +msgstr "" + +#: builtins/fc.def:2 builtins/fc.def:269 builtins/fc.def:370 +msgid "fc" +msgstr "" + +#: builtins/fc.def:157 +msgid "${FCEDIT:-${EDITOR:-vi}}" +msgstr "" + +#: builtins/fc.def:181 +msgid ":e:lnrs" +msgstr "" + +#: builtins/fc.def:252 +msgid "no command found" +msgstr "" + +#: builtins/fc.def:317 +msgid "history specification" +msgstr "" + +#: builtins/fc.def:335 +msgid "bash-fc" +msgstr "" + +#: builtins/fc.def:338 +#, c-format +msgid "cannot open temp file %s" +msgstr "" + +#: builtins/fc.def:350 +#, c-format +msgid "\t%c" +msgstr "" + +#: builtins/fc.def:363 builtins/fc.def:368 +#, c-format +msgid "%s %s" +msgstr "" + +#: builtins/fc.def:386 builtins/fc.def:394 +msgid "fc builtin" +msgstr "" + +#: builtins/fg_bg.def:123 builtins/jobs.def:264 +msgid "current" +msgstr "" + +#: builtins/fg_bg.def:131 +#, c-format +msgid "job %%%d started without job control" +msgstr "" + +#: builtins/getopts.def:2 +msgid "getopts" +msgstr "" + +#: builtins/getopts.def:248 builtins/getopts.def:255 builtins/getopts.def:282 +#: lib/sh/strftime.c:235 lib/sh/strftime.c:242 lib/sh/strftime.c:250 +#: lib/sh/strftime.c:257 +msgid "?" +msgstr "" + +#: builtins/getopts.def:261 builtins/getopts.def:264 builtins/getopts.def:278 +#: builtins/getopts.def:283 builtins/getopts.def:288 +msgid "OPTARG" +msgstr "" + +#: builtins/hash.def:2 +msgid "hash" +msgstr "" + +#: builtins/hash.def:82 +msgid "hashing disabled" +msgstr "" + +#: builtins/hash.def:89 +msgid "dlp:rt" +msgstr "" + +#: builtins/hash.def:118 +msgid "-t" +msgstr "" + +#: builtins/hash.def:127 +#, c-format +msgid "%s: hash table empty\n" +msgstr "" + +#: builtins/hash.def:210 +#, c-format +msgid "%4d\t%s\n" +msgstr "" + +#: builtins/hash.def:218 builtins/hash.def:257 +#, c-format +msgid "builtin hash -p %s %s\n" +msgstr "" + +#: builtins/hash.def:230 +msgid "hits\tcommand\n" +msgstr "" + +#: builtins/hash.def:261 +#, c-format +msgid "%s\t" +msgstr "" + +#: builtins/help.def:80 builtins/help.def:105 +msgid "s" +msgstr "" + +#: builtins/help.def:105 +#, c-format +msgid "Shell commands matching keyword%s `" +msgstr "" + +#: builtins/help.def:107 +msgid "" +"'\n" +"\n" +msgstr "" + +#: builtins/help.def:121 +#, c-format +msgid "%s: %s\n" +msgstr "" + +#: builtins/help.def:133 +#, c-format +msgid "" +"no help topics match `%s'. Try `help help' or `man -k %s' or `info %s'." +msgstr "" + +#: builtins/help.def:159 +#, c-format +msgid "%s: cannot open: %s" +msgstr "" + +#: builtins/help.def:167 +#, c-format +msgid " %s\n" +msgstr "" + +#: builtins/help.def:177 +msgid "" +"These shell commands are defined internally. Type `help' to see this list.\n" +"Type `help name' to find out more about the function `name'.\n" +"Use `info bash' to find out more about the shell in general.\n" +"Use `man -k' or `info' to find out more about commands not in this list.\n" +"\n" +"A star (*) next to a name means that the command is disabled.\n" +"\n" +msgstr "" + +#: builtins/history.def:2 builtins/set.def:189 +msgid "history" +msgstr "" + +#: builtins/history.def:106 +msgid "acd:npsrw" +msgstr "" + +#: builtins/history.def:147 +msgid "cannot use more than one of -anrw" +msgstr "" + +#: builtins/history.def:179 +msgid "history position" +msgstr "" + +#: builtins/history.def:289 +#, c-format +msgid "%5d%c %s%s\n" +msgstr "" + +#: builtins/history.def:389 +#, c-format +msgid "%s: history expansion failed" +msgstr "" + +#: builtins/inlib.def:2 +msgid "inlib" +msgstr "" + +#: builtins/inlib.def:67 +#, c-format +msgid "%s: inlib failed" +msgstr "" + +#: builtins/jobs.def:2 +msgid "jobs" +msgstr "" + +#: builtins/jobs.def:2 +msgid "disown" +msgstr "" + +#: builtins/jobs.def:85 +msgid "lpnxrs" +msgstr "" + +#: builtins/jobs.def:101 +msgid "no other options allowed with `-x'" +msgstr "" + +#: builtins/jobs.def:185 builtins/jobs.def:197 +msgid "jobs_builtin" +msgstr "" + +#: builtins/jobs.def:224 +msgid "ahr" +msgstr "" + +#: builtins/kill.def:2 +msgid "kill" +msgstr "" + +#: builtins/kill.def:186 +#, c-format +msgid "%s: arguments must be process or job IDs" +msgstr "" + +#: builtins/kill.def:247 +msgid "Unknown error" +msgstr "" + +#: builtins/kill.def:248 +#, c-format +msgid "(%ld) - %s" +msgstr "" + +#: builtins/let.def:2 +msgid "let" +msgstr "" + +#: builtins/printf.def:2 +msgid "printf" +msgstr "" + +#: builtins/printf.def:66 +msgid "lld" +msgstr "" + +#: builtins/printf.def:68 +msgid "ld" +msgstr "" + +#: builtins/printf.def:103 +msgid "#'-+ 0" +msgstr "" + +#: builtins/printf.def:104 +msgid "hjlLtz" +msgstr "" + +#: builtins/printf.def:119 +msgid "L" +msgstr "" + +#: builtins/printf.def:248 +#, c-format +msgid "`%s': missing format character" +msgstr "" + +#: builtins/printf.def:346 builtins/printf.def:373 +msgid "" +msgstr "" + +#: builtins/printf.def:355 builtins/printf.def:378 +msgid "l" +msgstr "" + +#: builtins/printf.def:407 +#, c-format +msgid "`%c': invalid format character" +msgstr "" + +#: builtins/printf.def:427 +#, c-format +msgid "warning: %s: %s" +msgstr "" + +#: builtins/printf.def:504 +#, c-format +msgid "format parsing problem: %s" +msgstr "" + +#: builtins/printf.def:600 +msgid "missing hex digit for \\x" +msgstr "" + +#: builtins/pushd.def:2 builtins/pushd.def:171 builtins/pushd.def:230 +#: builtins/pushd.def:263 builtins/pushd.def:715 +msgid "pushd" +msgstr "" + +#: builtins/pushd.def:2 builtins/pushd.def:724 +msgid "popd" +msgstr "" + +#: builtins/pushd.def:2 builtins/pushd.def:432 builtins/pushd.def:733 +msgid "dirs" +msgstr "" + +#: builtins/pushd.def:167 +msgid "no other directory" +msgstr "" + +#: builtins/pushd.def:434 +msgid "" +msgstr "" + +#: builtins/pushd.def:436 builtins/pushd.def:455 +#, c-format +msgid "%2d %s" +msgstr "" + +#: builtins/pushd.def:463 +#, c-format +msgid "" +"\n" +"%2d %s" +msgstr "" + +#: builtins/pushd.def:478 +msgid "directory stack empty" +msgstr "" + +#: builtins/pushd.def:480 +msgid "directory stack index" +msgstr "" + +#: builtins/pushd.def:625 +msgid "dirstack" +msgstr "" + +#: builtins/pushd.def:651 +msgid "Display the list of currently remembered directories. Directories" +msgstr "" + +#: builtins/pushd.def:652 +msgid "find their way onto the list with the `pushd' command; you can get" +msgstr "" + +#: builtins/pushd.def:653 +msgid "back up through the list with the `popd' command." +msgstr "" + +#: builtins/pushd.def:655 +msgid "The -l flag specifies that `dirs' should not print shorthand versions" +msgstr "" + +#: builtins/pushd.def:656 +msgid "of directories which are relative to your home directory. This means" +msgstr "" + +#: builtins/pushd.def:657 +msgid "that `~/bin' might be displayed as `/homes/bfox/bin'. The -v flag" +msgstr "" + +#: builtins/pushd.def:658 +msgid "causes `dirs' to print the directory stack with one entry per line," +msgstr "" + +#: builtins/pushd.def:659 +msgid "prepending the directory name with its position in the stack. The -p" +msgstr "" + +#: builtins/pushd.def:660 +msgid "flag does the same thing, but the stack position is not prepended." +msgstr "" + +#: builtins/pushd.def:661 +msgid "The -c flag clears the directory stack by deleting all of the elements." +msgstr "" + +#: builtins/pushd.def:663 +msgid "+N displays the Nth entry counting from the left of the list shown by" +msgstr "" + +#: builtins/pushd.def:664 builtins/pushd.def:667 +msgid " dirs when invoked without options, starting with zero." +msgstr "" + +#: builtins/pushd.def:666 +msgid "" +"-N displays the Nth entry counting from the right of the list shown by" +msgstr "" + +#: builtins/pushd.def:672 +msgid "Adds a directory to the top of the directory stack, or rotates" +msgstr "" + +#: builtins/pushd.def:673 +msgid "the stack, making the new top of the stack the current working" +msgstr "" + +#: builtins/pushd.def:674 +msgid "directory. With no arguments, exchanges the top two directories." +msgstr "" + +#: builtins/pushd.def:676 +msgid "+N Rotates the stack so that the Nth directory (counting" +msgstr "" + +#: builtins/pushd.def:677 +msgid " from the left of the list shown by `dirs', starting with" +msgstr "" + +#: builtins/pushd.def:678 builtins/pushd.def:682 +msgid " zero) is at the top." +msgstr "" + +#: builtins/pushd.def:680 +msgid "-N Rotates the stack so that the Nth directory (counting" +msgstr "" + +#: builtins/pushd.def:681 +msgid " from the right of the list shown by `dirs', starting with" +msgstr "" + +#: builtins/pushd.def:684 +msgid "-n suppress the normal change of directory when adding directories" +msgstr "" + +#: builtins/pushd.def:685 +msgid " to the stack, so only the stack is manipulated." +msgstr "" + +#: builtins/pushd.def:687 +msgid "dir adds DIR to the directory stack at the top, making it the" +msgstr "" + +#: builtins/pushd.def:688 +msgid " new current working directory." +msgstr "" + +#: builtins/pushd.def:690 builtins/pushd.def:710 +msgid "You can see the directory stack with the `dirs' command." +msgstr "" + +#: builtins/pushd.def:695 +msgid "Removes entries from the directory stack. With no arguments," +msgstr "" + +#: builtins/pushd.def:696 +msgid "removes the top directory from the stack, and cd's to the new" +msgstr "" + +#: builtins/pushd.def:697 +msgid "top directory." +msgstr "" + +#: builtins/pushd.def:699 +msgid "+N removes the Nth entry counting from the left of the list" +msgstr "" + +#: builtins/pushd.def:700 +msgid " shown by `dirs', starting with zero. For example: `popd +0'" +msgstr "" + +#: builtins/pushd.def:701 +msgid " removes the first directory, `popd +1' the second." +msgstr "" + +#: builtins/pushd.def:703 +msgid "-N removes the Nth entry counting from the right of the list" +msgstr "" + +#: builtins/pushd.def:704 +msgid " shown by `dirs', starting with zero. For example: `popd -0'" +msgstr "" + +#: builtins/pushd.def:705 +msgid " removes the last directory, `popd -1' the next to last." +msgstr "" + +#: builtins/pushd.def:707 +msgid "-n suppress the normal change of directory when removing directories" +msgstr "" + +#: builtins/pushd.def:708 +msgid " from the stack, so only the stack is manipulated." +msgstr "" + +#: builtins/pushd.def:719 +msgid "pushd [+N | -N] [-n] [dir]" +msgstr "" + +#: builtins/pushd.def:728 +msgid "popd [+N | -N] [-n]" +msgstr "" + +#: builtins/pushd.def:737 +msgid "dirs [-clpv] [+N] [-N]" +msgstr "" + +#: builtins/read.def:2 +msgid "read" +msgstr "" + +#: builtins/read.def:178 +msgid "ersa:d:n:p:t:u:" +msgstr "" + +#: builtins/read.def:205 +#, c-format +msgid "%s: invalid timeout specification" +msgstr "" + +#: builtins/read.def:228 +#, c-format +msgid "%s: invalid file descriptor specification" +msgstr "" + +#: builtins/read.def:235 +#, c-format +msgid "%d: invalid file descriptor: %s" +msgstr "" + +#: builtins/read.def:272 builtins/read.def:317 builtins/read.def:491 +msgid "read_builtin" +msgstr "" + +#: builtins/read.def:461 +#, c-format +msgid "read error: %d: %s" +msgstr "" + +#: builtins/reserved.def:123 +msgid "let EXPRESSION" +msgstr "" + +#: builtins/return.def:61 +msgid "can only `return' from a function or sourced script" +msgstr "" + +#: builtins/set.def:161 builtins/shopt.def:170 +msgid "on" +msgstr "" + +#: builtins/set.def:162 builtins/shopt.def:171 +msgid "off" +msgstr "" + +#: builtins/set.def:174 +msgid "allexport" +msgstr "" + +#: builtins/set.def:176 +msgid "braceexpand" +msgstr "" + +#: builtins/set.def:181 +msgid "errexit" +msgstr "" + +#: builtins/set.def:182 +msgid "errtrace" +msgstr "" + +#: builtins/set.def:183 +msgid "functrace" +msgstr "" + +#: builtins/set.def:184 +msgid "hashall" +msgstr "" + +#: builtins/set.def:186 +msgid "histexpand" +msgstr "" + +#: builtins/set.def:192 +msgid "interactive-comments" +msgstr "" + +#: builtins/set.def:194 +msgid "monitor" +msgstr "" + +#: builtins/set.def:195 +msgid "noclobber" +msgstr "" + +#: builtins/set.def:196 +msgid "noexec" +msgstr "" + +#: builtins/set.def:197 +msgid "noglob" +msgstr "" + +#: builtins/set.def:199 +msgid "nolog" +msgstr "" + +#: builtins/set.def:202 +msgid "notify" +msgstr "" + +#: builtins/set.def:204 +msgid "nounset" +msgstr "" + +#: builtins/set.def:205 +msgid "onecmd" +msgstr "" + +#: builtins/set.def:206 +msgid "physical" +msgstr "" + +#: builtins/set.def:207 +msgid "pipefail" +msgstr "" + +#: builtins/set.def:209 +msgid "privileged" +msgstr "" + +#: builtins/set.def:212 +msgid "vi" +msgstr "" + +#: builtins/set.def:214 +msgid "xtrace" +msgstr "" + +#: builtins/set.def:252 builtins/shopt.def:56 +#, c-format +msgid "%-15s\t%s\n" +msgstr "" + +#: builtins/set.def:262 builtins/shopt.def:414 +#, c-format +msgid "set %co %s\n" +msgstr "" + +#: builtins/set.def:313 +msgid "10" +msgstr "" + +#: builtins/set.def:345 +msgid "editing-mode" +msgstr "" + +#: builtins/set.def:493 builtins/set.def:505 builtins/set.def:541 +msgid "SHELLOPTS" +msgstr "" + +#: builtins/set.def:722 +msgid "fv" +msgstr "" + +#: builtins/set.def:742 +msgid "cannot simultaneously unset a function and a variable" +msgstr "" + +#: builtins/set.def:779 +#, c-format +msgid "%s: cannot unset" +msgstr "" + +#: builtins/set.def:786 +#, c-format +msgid "%s: cannot unset: readonly %s" +msgstr "" + +#: builtins/set.def:797 +#, c-format +msgid "%s: not an array variable" +msgstr "" + +#: builtins/setattr.def:98 +msgid "afnp" +msgstr "" + +#: builtins/setattr.def:100 +msgid "fnp" +msgstr "" + +#: builtins/setattr.def:164 +#, c-format +msgid "%s: not a function" +msgstr "" + +#: builtins/setattr.def:201 +msgid "-ra" +msgstr "" + +#: builtins/setattr.def:332 +#, c-format +msgid "declare -%s " +msgstr "" + +#: builtins/setattr.def:334 +#, c-format +msgid "%s -%s " +msgstr "" + +#: builtins/shift.def:65 builtins/shift.def:71 +msgid "shift count" +msgstr "" + +#: builtins/shopt.def:115 +msgid "cdable_vars" +msgstr "" + +#: builtins/shopt.def:116 +msgid "cdspell" +msgstr "" + +#: builtins/shopt.def:117 +msgid "checkhash" +msgstr "" + +#: builtins/shopt.def:118 +msgid "checkwinsize" +msgstr "" + +#: builtins/shopt.def:120 +msgid "cmdhist" +msgstr "" + +#: builtins/shopt.def:122 +msgid "dotglob" +msgstr "" + +#: builtins/shopt.def:123 +msgid "execfail" +msgstr "" + +#: builtins/shopt.def:124 +msgid "expand_aliases" +msgstr "" + +#: builtins/shopt.def:126 +msgid "extdebug" +msgstr "" + +#: builtins/shopt.def:129 +msgid "extglob" +msgstr "" + +#: builtins/shopt.def:131 +msgid "extquote" +msgstr "" + +#: builtins/shopt.def:132 +msgid "failglob" +msgstr "" + +#: builtins/shopt.def:134 +msgid "force_fignore" +msgstr "" + +#: builtins/shopt.def:135 +msgid "gnu_errfmt" +msgstr "" + +#: builtins/shopt.def:136 +msgid "histreedit" +msgstr "" + +#: builtins/shopt.def:139 +msgid "histappend" +msgstr "" + +#: builtins/shopt.def:142 +msgid "histverify" +msgstr "" + +#: builtins/shopt.def:143 +msgid "hostcomplete" +msgstr "" + +#: builtins/shopt.def:145 +msgid "huponexit" +msgstr "" + +#: builtins/shopt.def:146 +msgid "interactive_comments" +msgstr "" + +#: builtins/shopt.def:148 +msgid "lithist" +msgstr "" + +#: builtins/shopt.def:150 +msgid "login_shell" +msgstr "" + +#: builtins/shopt.def:151 +msgid "mailwarn" +msgstr "" + +#: builtins/shopt.def:153 +msgid "no_empty_cmd_completion" +msgstr "" + +#: builtins/shopt.def:155 +msgid "nocaseglob" +msgstr "" + +#: builtins/shopt.def:156 +msgid "nullglob" +msgstr "" + +#: builtins/shopt.def:158 +msgid "progcomp" +msgstr "" + +#: builtins/shopt.def:160 +msgid "promptvars" +msgstr "" + +#: builtins/shopt.def:162 +msgid "restricted_shell" +msgstr "" + +#: builtins/shopt.def:164 +msgid "shift_verbose" +msgstr "" + +#: builtins/shopt.def:165 +msgid "sourcepath" +msgstr "" + +#: builtins/shopt.def:166 +msgid "xpg_echo" +msgstr "" + +#: builtins/shopt.def:196 +msgid "psuoq" +msgstr "" + +#: builtins/shopt.def:224 +msgid "cannot set and unset shell options simultaneously" +msgstr "" + +#: builtins/shopt.def:289 +#, c-format +msgid "%s: invalid shell option name" +msgstr "" + +#: builtins/shopt.def:325 +#, c-format +msgid "shopt %s %s\n" +msgstr "" + +#: builtins/source.def:116 +msgid "filename argument required" +msgstr "" + +#: builtins/source.def:136 +#, c-format +msgid "%s: file not found" +msgstr "" + +#: builtins/suspend.def:2 +msgid "suspend" +msgstr "" + +#: builtins/suspend.def:77 +msgid "f" +msgstr "" + +#: builtins/suspend.def:92 +msgid "cannot suspend" +msgstr "" + +#: builtins/suspend.def:102 +msgid "cannot suspend a login shell" +msgstr "" + +#: builtins/test.def:2 builtins/test.def:98 +msgid "test" +msgstr "" + +#: builtins/times.def:2 +msgid "times" +msgstr "" + +#: builtins/times.def:109 +msgid "" +"0.00 0.00\n" +"0.00 0.00\n" +msgstr "" + +#: builtins/trap.def:39 +msgid "kill -signal $$" +msgstr "" + +#: builtins/trap.def:94 +msgid "lp" +msgstr "" + +#: builtins/trap.def:215 +#, c-format +msgid "trap -- %s %d\n" +msgstr "" + +#: builtins/trap.def:219 builtins/trap.def:221 builtins/trap.def:224 +#, c-format +msgid "trap -- %s %s\n" +msgstr "" + +#: builtins/type.def:2 builtins/type.def:127 +msgid "type" +msgstr "" + +#: builtins/type.def:127 +msgid "-type" +msgstr "" + +#: builtins/type.def:132 +msgid "path" +msgstr "" + +#: builtins/type.def:132 +msgid "-path" +msgstr "" + +#: builtins/type.def:137 +msgid "all" +msgstr "" + +#: builtins/type.def:137 +msgid "-all" +msgstr "" + +#: builtins/type.def:145 +msgid "afptP" +msgstr "" + +#: builtins/type.def:230 +#, c-format +msgid "%s is aliased to `%s'\n" +msgstr "" + +#: builtins/type.def:234 +#, c-format +msgid "alias %s=%s\n" +msgstr "" + +#: builtins/type.def:251 +#, c-format +msgid "%s is a shell keyword\n" +msgstr "" + +#: builtins/type.def:271 +#, c-format +msgid "%s is a function\n" +msgstr "" + +#: builtins/type.def:296 +#, c-format +msgid "%s is a shell builtin\n" +msgstr "" + +#: builtins/type.def:317 builtins/type.def:382 +#, c-format +msgid "%s is %s\n" +msgstr "" + +#: builtins/type.def:337 +#, c-format +msgid "%s is hashed (%s)\n" +msgstr "" + +#: builtins/ulimit.def:2 +msgid "ulimit" +msgstr "" + +#: builtins/ulimit.def:111 +#, c-format +msgid "%ld%s" +msgstr "" + +#: builtins/ulimit.def:195 +msgid "core file size" +msgstr "" + +#: builtins/ulimit.def:195 builtins/ulimit.def:200 +msgid "blocks" +msgstr "" + +#: builtins/ulimit.def:198 +msgid "data seg size" +msgstr "" + +#: builtins/ulimit.def:198 builtins/ulimit.def:202 builtins/ulimit.def:205 +#: builtins/ulimit.def:210 builtins/ulimit.def:217 builtins/ulimit.def:220 +msgid "kbytes" +msgstr "" + +#: builtins/ulimit.def:200 +msgid "file size" +msgstr "" + +#: builtins/ulimit.def:202 +msgid "max locked memory" +msgstr "" + +#: builtins/ulimit.def:205 +msgid "max memory size" +msgstr "" + +#: builtins/ulimit.def:207 +msgid "open files" +msgstr "" + +#: builtins/ulimit.def:208 +msgid "pipe size" +msgstr "" + +#: builtins/ulimit.def:208 +msgid "512 bytes" +msgstr "" + +#: builtins/ulimit.def:210 +msgid "stack size" +msgstr "" + +#: builtins/ulimit.def:213 +msgid "cpu time" +msgstr "" + +#: builtins/ulimit.def:213 +msgid "seconds" +msgstr "" + +#: builtins/ulimit.def:215 +msgid "max user processes" +msgstr "" + +#: builtins/ulimit.def:217 +msgid "virtual memory" +msgstr "" + +#: builtins/ulimit.def:220 +msgid "swap size" +msgstr "" + +#: builtins/ulimit.def:328 builtins/ulimit.def:401 builtins/ulimit.def:674 +msgid "unlimited" +msgstr "" + +#: builtins/ulimit.def:330 +#, c-format +msgid "%s: invalid limit argument" +msgstr "" + +#: builtins/ulimit.def:356 +#, c-format +msgid "`%c': bad command" +msgstr "" + +#: builtins/ulimit.def:385 builtins/ulimit.def:649 +#, c-format +msgid "%s: cannot get limit: %s" +msgstr "" + +#: builtins/ulimit.def:397 builtins/ulimit.def:676 +msgid "hard" +msgstr "" + +#: builtins/ulimit.def:399 builtins/ulimit.def:678 +msgid "soft" +msgstr "" + +#: builtins/ulimit.def:411 +msgid "limit" +msgstr "" + +#: builtins/ulimit.def:423 builtins/ulimit.def:716 +#, c-format +msgid "%s: cannot modify limit: %s" +msgstr "" + +#: builtins/ulimit.def:667 +#, c-format +msgid "(%s, -%c) " +msgstr "" + +#: builtins/ulimit.def:669 +#, c-format +msgid "(-%c) " +msgstr "" + +#: builtins/ulimit.def:671 +#, c-format +msgid "%-18s %16s" +msgstr "" + +#: builtins/umask.def:2 +msgid "umask" +msgstr "" + +#: builtins/umask.def:80 +msgid "Sp" +msgstr "" + +#: builtins/umask.def:110 +msgid "octal number" +msgstr "" + +#: builtins/umask.def:131 +#, c-format +msgid "umask%s " +msgstr "" + +#: builtins/umask.def:131 +msgid " -S" +msgstr "" + +#: builtins/umask.def:135 +#, c-format +msgid "%04lo\n" +msgstr "" + +#: builtins/umask.def:178 +#, c-format +msgid "u=%s,g=%s,o=%s\n" +msgstr "" + +#: builtins/umask.def:194 +msgid "agou" +msgstr "" + +#: builtins/umask.def:224 +#, c-format +msgid "`%c': invalid symbolic mode operator" +msgstr "" + +#: builtins/umask.def:229 +msgid "rwx" +msgstr "" + +#: builtins/umask.def:277 +#, c-format +msgid "`%c': invalid symbolic mode character" +msgstr "" + +#: lib/sh/clock.c:79 lib/sh/timeval.c:143 +#, c-format +msgid "%ldm%d.%03ds" +msgstr "" + +#: lib/sh/fmtulong.c:55 lib/sh/snprintf.c:167 +msgid "0123456789abcdef" +msgstr "" + +#: lib/sh/fmtulong.c:56 lib/sh/snprintf.c:168 +msgid "0123456789ABCDEF" +msgstr "" + +#: lib/sh/fmtulong.c:99 +msgid "invalid base" +msgstr "" + +#: lib/sh/getcwd.c:75 +msgid "../../../../../../../../../../../../../../../../../../../../../../../../../../../../../../../../../../../../../../../../../../../../../../../../../../../../../../../../../../../../../../../../../../../../../../../../../../.." +msgstr "" + +#: lib/sh/getcwd.c:304 +msgid "cwd: getcwd" +msgstr "" + +#: lib/sh/inet_aton.c:59 +msgid "@(#)inet_addr.c\t8.1 (Berkeley) 6/17/93" +msgstr "" + +#: lib/sh/inet_aton.c:60 +msgid "$Id: inet_addr.c,v 1.5 1996/08/14 03:48:37 drepper Exp $" +msgstr "" + +#: lib/sh/mailstat.c:95 +#, c-format +msgid "%s/cur" +msgstr "" + +#: lib/sh/mailstat.c:101 +#, c-format +msgid "%s/tmp" +msgstr "" + +#: lib/sh/mailstat.c:107 +#, c-format +msgid "%s/new" +msgstr "" + +#: lib/sh/mailstat.c:126 +msgid "cur" +msgstr "" + +#: lib/sh/mailstat.c:126 +msgid "new" +msgstr "" + +#: lib/sh/mailstat.c:127 +#, c-format +msgid "%s/" +msgstr "" + +#: lib/sh/makepath.c:77 +msgid "sh_makepath" +msgstr "" + +#: lib/sh/mktime.c:330 +#, c-format +msgid "%04d-%02d-%02d %02d:%02d:%02d yday %03d wday %d isdst %d" +msgstr "" + +#: lib/sh/mktime.c:345 +msgid "mktime (" +msgstr "" + +#: lib/sh/mktime.c:347 +msgid "" +")\n" +"yields (" +msgstr "" + +#: lib/sh/mktime.c:349 +#, c-format +msgid ") == %ld, should be %ld\n" +msgstr "" + +#: lib/sh/mktime.c:367 +#, c-format +msgid "%d-%d-%d%c" +msgstr "" + +#: lib/sh/mktime.c:370 +#, c-format +msgid "%d:%d:%d%c" +msgstr "" + +#: lib/sh/mktime.c:380 +#, c-format +msgid "mktime returns %ld == " +msgstr "" + +#: lib/sh/mktime.c:410 +#, c-format +msgid "" +"Usage:\t%s YYYY-MM-DD HH:MM:SS [ISDST] # Test given time.\n" +"\t%s FROM BY TO # Test values FROM, FROM+BY, ..., TO.\n" +"\t%s FROM BY TO - # Do not test those values (for benchmark).\n" +msgstr "" + +#: lib/sh/netopen.c:128 +msgid "tcp" +msgstr "" + +#: lib/sh/netopen.c:128 +msgid "udp" +msgstr "" + +#: lib/sh/netopen.c:156 +#, c-format +msgid "%s: host unknown" +msgstr "" + +#: lib/sh/netopen.c:163 +#, c-format +msgid "%s: invalid service" +msgstr "" + +#: lib/sh/netopen.c:176 lib/sh/netopen.c:234 +msgid "socket" +msgstr "" + +#: lib/sh/netopen.c:183 lib/sh/netopen.c:246 +msgid "connect" +msgstr "" + +#: lib/sh/netopen.c:294 +#, c-format +msgid "%s: bad network path specification" +msgstr "" + +#: lib/sh/netopen.c:334 +msgid "network operations not supported" +msgstr "" + +#: lib/sh/pathphys.c:269 +msgid "sh_realpath" +msgstr "" + +#: lib/sh/shmatch.c:95 lib/sh/shmatch.c:96 +msgid "BASH_REMATCH" +msgstr "" + +#: lib/sh/snprintf.c:402 +msgid "" +msgstr "" + +#: lib/sh/snprintf.c:892 +msgid "INF" +msgstr "" + +#: lib/sh/snprintf.c:892 +msgid "NAN" +msgstr "" + +#: lib/sh/snprintf.c:893 +msgid "inf" +msgstr "" + +#: lib/sh/snprintf.c:893 +msgid "nan" +msgstr "" + +#: lib/sh/snprintf.c:1646 +msgid "out of virtual memory\n" +msgstr "" + +#: lib/sh/snprintf.c:1695 lib/sh/snprintf.c:1697 lib/sh/snprintf.c:1699 +msgid "abcde\n" +msgstr "" + +#: lib/sh/snprintf.c:1696 +#, c-format +msgid "snprintf returns %d with NULL first argument and size of 0\n" +msgstr "" + +#: lib/sh/snprintf.c:1698 +#, c-format +msgid "snprintf returns %d with non-NULL first argument and size of 0\n" +msgstr "" + +#: lib/sh/snprintf.c:1700 +#, c-format +msgid "snprintf returns %d with NULL first argument and non-zero size\n" +msgstr "" + +#: lib/sh/snprintf.c:1710 +#, c-format +msgid "/%%ld %%ld/, 336, 336\n" +msgstr "" + +#: lib/sh/snprintf.c:1711 lib/sh/snprintf.c:1712 lib/sh/snprintf.c:1713 +#, c-format +msgid "/%ld %ld/\n" +msgstr "" + +#: lib/sh/snprintf.c:1717 +#, c-format +msgid "/%%d/, 336\n" +msgstr "" + +#: lib/sh/snprintf.c:1718 lib/sh/snprintf.c:1719 lib/sh/snprintf.c:1720 +#, c-format +msgid "/%d/\n" +msgstr "" + +#: lib/sh/snprintf.c:1724 +#, c-format +msgid "/%%2d/, 336\n" +msgstr "" + +#: lib/sh/snprintf.c:1725 lib/sh/snprintf.c:1726 lib/sh/snprintf.c:1727 +#, c-format +msgid "/%2d/\n" +msgstr "" + +#: lib/sh/snprintf.c:1731 +#, c-format +msgid "/%%10d/, 336\n" +msgstr "" + +#: lib/sh/snprintf.c:1732 lib/sh/snprintf.c:1733 lib/sh/snprintf.c:1734 +#, c-format +msgid "/%10d/\n" +msgstr "" + +#: lib/sh/snprintf.c:1738 +#, c-format +msgid "/%%-10d/, 336\n" +msgstr "" + +#: lib/sh/snprintf.c:1739 lib/sh/snprintf.c:1740 lib/sh/snprintf.c:1741 +#, c-format +msgid "/%-10d/\n" +msgstr "" + +#: lib/sh/snprintf.c:1748 +#, c-format +msgid "/%%f/, 1234.56\n" +msgstr "" + +#: lib/sh/snprintf.c:1749 lib/sh/snprintf.c:1750 lib/sh/snprintf.c:1751 +#, c-format +msgid "/%f/\n" +msgstr "" + +#: lib/sh/snprintf.c:1755 +#, c-format +msgid "/%%e/, 1234.56\n" +msgstr "" + +#: lib/sh/snprintf.c:1756 lib/sh/snprintf.c:1757 lib/sh/snprintf.c:1758 +#, c-format +msgid "/%e/\n" +msgstr "" + +#: lib/sh/snprintf.c:1762 +#, c-format +msgid "/%%4.2f/, 1234.56\n" +msgstr "" + +#: lib/sh/snprintf.c:1763 lib/sh/snprintf.c:1764 lib/sh/snprintf.c:1765 +#, c-format +msgid "/%4.2f/\n" +msgstr "" + +#: lib/sh/snprintf.c:1769 +#, c-format +msgid "/%%3.1f/, 1234.56\n" +msgstr "" + +#: lib/sh/snprintf.c:1770 lib/sh/snprintf.c:1771 lib/sh/snprintf.c:1772 +#, c-format +msgid "/%3.1f/\n" +msgstr "" + +#: lib/sh/snprintf.c:1776 +#, c-format +msgid "/%%10.3f/, 1234.56\n" +msgstr "" + +#: lib/sh/snprintf.c:1777 lib/sh/snprintf.c:1778 lib/sh/snprintf.c:1779 +#, c-format +msgid "/%10.3f/\n" +msgstr "" + +#: lib/sh/snprintf.c:1783 +#, c-format +msgid "/%%10.3e/, 1234.56\n" +msgstr "" + +#: lib/sh/snprintf.c:1784 lib/sh/snprintf.c:1785 lib/sh/snprintf.c:1786 +#, c-format +msgid "/%10.3e/\n" +msgstr "" + +#: lib/sh/snprintf.c:1790 +#, c-format +msgid "/%%+4.2f/, 1234.56\n" +msgstr "" + +#: lib/sh/snprintf.c:1791 lib/sh/snprintf.c:1792 lib/sh/snprintf.c:1793 +#, c-format +msgid "/%+4.2f/\n" +msgstr "" + +#: lib/sh/snprintf.c:1797 +#, c-format +msgid "/%%010.2f/, 1234.56\n" +msgstr "" + +#: lib/sh/snprintf.c:1798 lib/sh/snprintf.c:1799 lib/sh/snprintf.c:1800 +#, c-format +msgid "/%010.2f/\n" +msgstr "" + +#: lib/sh/snprintf.c:1804 +msgid "Outstanding acting !" +msgstr "" + +#: lib/sh/snprintf.c:1807 +#, c-format +msgid "/%%2s/, \"%s\"\n" +msgstr "" + +#: lib/sh/snprintf.c:1808 lib/sh/snprintf.c:1809 lib/sh/snprintf.c:1810 +#, c-format +msgid "/%2s/\n" +msgstr "" + +#: lib/sh/snprintf.c:1814 +#, c-format +msgid "/%%22s/ %s\n" +msgstr "" + +#: lib/sh/snprintf.c:1815 lib/sh/snprintf.c:1816 lib/sh/snprintf.c:1817 +#, c-format +msgid "/%22s/\n" +msgstr "" + +#: lib/sh/snprintf.c:1821 +#, c-format +msgid "/%%22.5s/ %s\n" +msgstr "" + +#: lib/sh/snprintf.c:1822 lib/sh/snprintf.c:1823 lib/sh/snprintf.c:1824 +#, c-format +msgid "/%22.5s/\n" +msgstr "" + +#: lib/sh/snprintf.c:1828 +#, c-format +msgid "/%%-22.5s/ %s\n" +msgstr "" + +#: lib/sh/snprintf.c:1829 lib/sh/snprintf.c:1830 lib/sh/snprintf.c:1831 +#, c-format +msgid "/%-22.5s/\n" +msgstr "" + +#: lib/sh/snprintf.c:1837 +#, c-format +msgid "%%x %%X %%#x, 31, 31, 31\n" +msgstr "" + +#: lib/sh/snprintf.c:1838 lib/sh/snprintf.c:1839 lib/sh/snprintf.c:1840 +#, c-format +msgid "%x %X %#x\n" +msgstr "" + +#: lib/sh/snprintf.c:1844 +#, c-format +msgid "**%%d**%% d**%% d**, 42, 42, -42\n" +msgstr "" + +#: lib/sh/snprintf.c:1845 lib/sh/snprintf.c:1846 lib/sh/snprintf.c:1847 +#, c-format +msgid "**%d**% d**% d**\n" +msgstr "" + +#: lib/sh/snprintf.c:1853 +#, c-format +msgid "/%%g/, 31.4\n" +msgstr "" + +#: lib/sh/snprintf.c:1854 lib/sh/snprintf.c:1855 lib/sh/snprintf.c:1856 +#: lib/sh/snprintf.c:1975 lib/sh/snprintf.c:1976 lib/sh/snprintf.c:1977 +#: lib/sh/snprintf.c:1982 lib/sh/snprintf.c:1983 lib/sh/snprintf.c:1984 +#, c-format +msgid "/%g/\n" +msgstr "" + +#: lib/sh/snprintf.c:1860 +#, c-format +msgid "/%%.6g/, 31.4\n" +msgstr "" + +#: lib/sh/snprintf.c:1861 lib/sh/snprintf.c:1862 lib/sh/snprintf.c:1863 +#, c-format +msgid "/%.6g/\n" +msgstr "" + +#: lib/sh/snprintf.c:1867 +#, c-format +msgid "/%%.1G/, 31.4\n" +msgstr "" + +#: lib/sh/snprintf.c:1868 lib/sh/snprintf.c:1869 lib/sh/snprintf.c:1870 +#: lib/sh/snprintf.c:1875 lib/sh/snprintf.c:1876 lib/sh/snprintf.c:1877 +#, c-format +msgid "/%.1G/\n" +msgstr "" + +#: lib/sh/snprintf.c:1874 +#, c-format +msgid "/%%.1G/, 3100000000.4\n" +msgstr "" + +#: lib/sh/snprintf.c:1881 +#, c-format +msgid "abc%%n\n" +msgstr "" + +#: lib/sh/snprintf.c:1882 lib/sh/snprintf.c:1883 lib/sh/snprintf.c:1885 +#, c-format +msgid "abc%n" +msgstr "" + +#: lib/sh/snprintf.c:1884 lib/sh/snprintf.c:1886 +#, c-format +msgid "" +"%d\n" +"\n" +msgstr "" + +#: lib/sh/snprintf.c:1888 +#, c-format +msgid "%%*.*s --> 10.10\n" +msgstr "" + +#: lib/sh/snprintf.c:1889 lib/sh/snprintf.c:1890 lib/sh/snprintf.c:1891 +#, c-format +msgid "%*.*s\n" +msgstr "" + +#: lib/sh/snprintf.c:1895 +#, c-format +msgid "%%%%%%%%\n" +msgstr "" + +#: lib/sh/snprintf.c:1896 lib/sh/snprintf.c:1897 lib/sh/snprintf.c:1898 +#, c-format +msgid "%%%%\n" +msgstr "" + +#: lib/sh/snprintf.c:1902 +msgid "Hello this is a too big string for the buffer" +msgstr "" + +#: lib/sh/snprintf.c:1904 +#, c-format +msgid "<%%>, %s\n" +msgstr "" + +#: lib/sh/snprintf.c:1907 lib/sh/snprintf.c:1908 lib/sh/snprintf.c:1915 +#: lib/sh/snprintf.c:1922 lib/sh/snprintf.c:1930 lib/sh/snprintf.c:1939 +#: lib/sh/snprintf.c:1948 lib/sh/snprintf.c:1955 +#, c-format +msgid "<%s>\n" +msgstr "" + +#: lib/sh/snprintf.c:1909 lib/sh/snprintf.c:1916 lib/sh/snprintf.c:1923 +#: lib/sh/snprintf.c:1931 lib/sh/snprintf.c:1940 lib/sh/snprintf.c:1949 +#: lib/sh/snprintf.c:1956 +#, c-format +msgid "" +"<%s>\n" +"\n" +msgstr "" + +#: lib/sh/snprintf.c:1911 +#, c-format +msgid "<%%p> vsnprintf\n" +msgstr "" + +#: lib/sh/snprintf.c:1912 lib/sh/snprintf.c:1913 +#, c-format +msgid "%p" +msgstr "" + +#: lib/sh/snprintf.c:1914 +#, c-format +msgid "<%p>\n" +msgstr "" + +#: lib/sh/snprintf.c:1918 +#, c-format +msgid "<%%lu> LONG_MAX+1\n" +msgstr "" + +#: lib/sh/snprintf.c:1919 lib/sh/snprintf.c:1920 +#, c-format +msgid "%lu" +msgstr "" + +#: lib/sh/snprintf.c:1921 +#, c-format +msgid "<%lu>\n" +msgstr "" + +#: lib/sh/snprintf.c:1926 +#, c-format +msgid "<%%llu> LLONG_MAX+1\n" +msgstr "" + +#: lib/sh/snprintf.c:1927 lib/sh/snprintf.c:1928 +#, c-format +msgid "%llu" +msgstr "" + +#: lib/sh/snprintf.c:1929 +#, c-format +msgid "<%llu>\n" +msgstr "" + +#: lib/sh/snprintf.c:1935 +#, c-format +msgid "<%%6.2LE> 42.42\n" +msgstr "" + +#: lib/sh/snprintf.c:1936 lib/sh/snprintf.c:1937 +#, c-format +msgid "%6.2LE" +msgstr "" + +#: lib/sh/snprintf.c:1938 +#, c-format +msgid "<%6.2LE>\n" +msgstr "" + +#: lib/sh/snprintf.c:1944 +#, c-format +msgid "<%%6.2A> 42.42\n" +msgstr "" + +#: lib/sh/snprintf.c:1945 lib/sh/snprintf.c:1946 +#, c-format +msgid "%6.2A" +msgstr "" + +#: lib/sh/snprintf.c:1947 +#, c-format +msgid "<%6.2A>\n" +msgstr "" + +#: lib/sh/snprintf.c:1951 +#, c-format +msgid "<%%6.2LA> 42.42\n" +msgstr "" + +#: lib/sh/snprintf.c:1952 lib/sh/snprintf.c:1953 +#, c-format +msgid "%6.2LA" +msgstr "" + +#: lib/sh/snprintf.c:1954 +#, c-format +msgid "<%6.2LA>\n" +msgstr "" + +#: lib/sh/snprintf.c:1959 +#, c-format +msgid "<%%.10240f> DBL_MAX\n" +msgstr "" + +#: lib/sh/snprintf.c:1960 lib/sh/snprintf.c:1961 +#, c-format +msgid "%.10240f" +msgstr "" + +#: lib/sh/snprintf.c:1962 +#, c-format +msgid "<%.10240f>\n" +msgstr "" + +#: lib/sh/snprintf.c:1963 lib/sh/snprintf.c:1970 +#, c-format +msgid "<%d> <%s>\n" +msgstr "" + +#: lib/sh/snprintf.c:1964 lib/sh/snprintf.c:1971 +#, c-format +msgid "" +"<%d> <%s>\n" +"\n" +msgstr "" + +#: lib/sh/snprintf.c:1966 +#, c-format +msgid "<%%.10240Lf> LDBL_MAX\n" +msgstr "" + +#: lib/sh/snprintf.c:1967 lib/sh/snprintf.c:1968 +#, c-format +msgid "%.10240Lf" +msgstr "" + +#: lib/sh/snprintf.c:1969 +#, c-format +msgid "<%.10240Lf>\n" +msgstr "" + +#: lib/sh/snprintf.c:1974 +#, c-format +msgid "/%%g/, 421.2345\n" +msgstr "" + +#: lib/sh/snprintf.c:1981 +#, c-format +msgid "/%%g/, 4214.2345\n" +msgstr "" + +#: lib/sh/snprintf.c:1988 +#, c-format +msgid "/%%.5g/, 4214.2345\n" +msgstr "" + +#: lib/sh/snprintf.c:1989 lib/sh/snprintf.c:1990 lib/sh/snprintf.c:1991 +#, c-format +msgid "/%.5g/\n" +msgstr "" + +#: lib/sh/snprintf.c:1995 +#, c-format +msgid "/%%.4g/, 4214.2345\n" +msgstr "" + +#: lib/sh/snprintf.c:1996 lib/sh/snprintf.c:1997 lib/sh/snprintf.c:1998 +#, c-format +msgid "/%.4g/\n" +msgstr "" + +#: lib/sh/snprintf.c:2002 +#, c-format +msgid "/%%'ld %%'ld/, 12345, 1234567\n" +msgstr "" + +#: lib/sh/snprintf.c:2003 lib/sh/snprintf.c:2004 lib/sh/snprintf.c:2005 +#: lib/sh/snprintf.c:2010 lib/sh/snprintf.c:2011 lib/sh/snprintf.c:2012 +#: lib/sh/snprintf.c:2017 lib/sh/snprintf.c:2018 lib/sh/snprintf.c:2019 +#, c-format +msgid "/%'ld %'ld/\n" +msgstr "" + +#: lib/sh/snprintf.c:2009 +#, c-format +msgid "/%%'ld %%'ld/, 336, 3336\n" +msgstr "" + +#: lib/sh/snprintf.c:2016 +#, c-format +msgid "/%%'ld %%'ld/, -42786, -142786\n" +msgstr "" + +#: lib/sh/snprintf.c:2023 +#, c-format +msgid "/%%'f %%'f/, 421.2345, 421234.56789\n" +msgstr "" + +#: lib/sh/snprintf.c:2024 lib/sh/snprintf.c:2025 lib/sh/snprintf.c:2026 +#: lib/sh/snprintf.c:2031 lib/sh/snprintf.c:2032 lib/sh/snprintf.c:2033 +#, c-format +msgid "/%'f %'f/\n" +msgstr "" + +#: lib/sh/snprintf.c:2030 +#, c-format +msgid "/%%'f %%'f/, -421.2345, -421234.56789\n" +msgstr "" + +#: lib/sh/snprintf.c:2037 +#, c-format +msgid "/%%'g %%'g/, 421.2345, 421234.56789\n" +msgstr "" + +#: lib/sh/snprintf.c:2038 lib/sh/snprintf.c:2039 lib/sh/snprintf.c:2040 +#: lib/sh/snprintf.c:2045 lib/sh/snprintf.c:2046 lib/sh/snprintf.c:2047 +#, c-format +msgid "/%'g %'g/\n" +msgstr "" + +#: lib/sh/snprintf.c:2044 +#, c-format +msgid "/%%'g %%'g/, -421.2345, -421234.56789\n" +msgstr "" + +#: lib/sh/snprintf.c:2052 +#, c-format +msgid "/%%'g/, 4213455.8392\n" +msgstr "" + +#: lib/sh/snprintf.c:2053 lib/sh/snprintf.c:2054 lib/sh/snprintf.c:2055 +#, c-format +msgid "/%'g/\n" +msgstr "" + +#: lib/sh/strerror.c:49 +msgid "Unknown system error " +msgstr "" + +#: lib/sh/strftime.c:153 +msgid "Sun" +msgstr "" + +#: lib/sh/strftime.c:153 +msgid "Mon" +msgstr "" + +#: lib/sh/strftime.c:153 +msgid "Tue" +msgstr "" + +#: lib/sh/strftime.c:153 +msgid "Wed" +msgstr "" + +#: lib/sh/strftime.c:154 +msgid "Thu" +msgstr "" + +#: lib/sh/strftime.c:154 +msgid "Fri" +msgstr "" + +#: lib/sh/strftime.c:154 +msgid "Sat" +msgstr "" + +#: lib/sh/strftime.c:157 +msgid "Sunday" +msgstr "" + +#: lib/sh/strftime.c:157 +msgid "Monday" +msgstr "" + +#: lib/sh/strftime.c:157 +msgid "Tuesday" +msgstr "" + +#: lib/sh/strftime.c:157 +msgid "Wednesday" +msgstr "" + +#: lib/sh/strftime.c:158 +msgid "Thursday" +msgstr "" + +#: lib/sh/strftime.c:158 +msgid "Friday" +msgstr "" + +#: lib/sh/strftime.c:158 +msgid "Saturday" +msgstr "" + +#: lib/sh/strftime.c:161 +msgid "Jan" +msgstr "" + +#: lib/sh/strftime.c:161 +msgid "Feb" +msgstr "" + +#: lib/sh/strftime.c:161 +msgid "Mar" +msgstr "" + +#: lib/sh/strftime.c:161 +msgid "Apr" +msgstr "" + +#: lib/sh/strftime.c:161 lib/sh/strftime.c:166 +msgid "May" +msgstr "" + +#: lib/sh/strftime.c:161 +msgid "Jun" +msgstr "" + +#: lib/sh/strftime.c:162 +msgid "Jul" +msgstr "" + +#: lib/sh/strftime.c:162 +msgid "Aug" +msgstr "" + +#: lib/sh/strftime.c:162 +msgid "Sep" +msgstr "" + +#: lib/sh/strftime.c:162 +msgid "Oct" +msgstr "" + +#: lib/sh/strftime.c:162 +msgid "Nov" +msgstr "" + +#: lib/sh/strftime.c:162 +msgid "Dec" +msgstr "" + +#: lib/sh/strftime.c:165 +msgid "January" +msgstr "" + +#: lib/sh/strftime.c:165 +msgid "February" +msgstr "" + +#: lib/sh/strftime.c:165 +msgid "March" +msgstr "" + +#: lib/sh/strftime.c:165 +msgid "April" +msgstr "" + +#: lib/sh/strftime.c:166 +msgid "June" +msgstr "" + +#: lib/sh/strftime.c:166 +msgid "July" +msgstr "" + +#: lib/sh/strftime.c:166 +msgid "August" +msgstr "" + +#: lib/sh/strftime.c:166 +msgid "September" +msgstr "" + +#: lib/sh/strftime.c:167 +msgid "October" +msgstr "" + +#: lib/sh/strftime.c:167 +msgid "November" +msgstr "" + +#: lib/sh/strftime.c:167 +msgid "December" +msgstr "" + +#: lib/sh/strftime.c:169 +msgid "AM" +msgstr "" + +#: lib/sh/strftime.c:169 +msgid "PM" +msgstr "" + +#: lib/sh/strftime.c:270 +msgid "%A %B %d %T %Y" +msgstr "" + +#: lib/sh/strftime.c:275 lib/sh/strftime.c:280 lib/sh/strftime.c:321 +#: lib/sh/strftime.c:329 lib/sh/strftime.c:338 lib/sh/strftime.c:347 +#: lib/sh/strftime.c:352 lib/sh/strftime.c:393 lib/sh/strftime.c:413 +#: lib/sh/strftime.c:417 lib/sh/strftime.c:426 lib/sh/strftime.c:440 +#, c-format +msgid "%02d" +msgstr "" + +#: lib/sh/strftime.c:284 +msgid "%m/%d/%y" +msgstr "" + +#: lib/sh/strftime.c:288 lib/sh/strftime.c:519 lib/sh/strftime.c:528 +#, c-format +msgid "%2d" +msgstr "" + +#: lib/sh/strftime.c:296 +msgid "%Y-%m-%d" +msgstr "" + +#: lib/sh/strftime.c:342 +#, c-format +msgid "%03d" +msgstr "" + +#: lib/sh/strftime.c:373 +msgid "%I:%M:%S %p" +msgstr "" + +#: lib/sh/strftime.c:386 lib/malloc/stats.c:181 +#, c-format +msgid "%ld" +msgstr "" + +#: lib/sh/strftime.c:430 +msgid "%A %B %d %Y" +msgstr "" + +#: lib/sh/strftime.c:495 +#, c-format +msgid "%02d%02d" +msgstr "" + +#: lib/sh/strftime.c:544 +#, c-format +msgid "%2d-%3.3s-%4d" +msgstr "" + +#: lib/sh/strftime.c:786 +#, c-format +msgid "(%%A) full weekday name, var length (Sunday..Saturday) %A" +msgstr "" + +#: lib/sh/strftime.c:787 +msgid "(%%B) full month name, var length (January..December) %B" +msgstr "" + +#: lib/sh/strftime.c:788 +#, c-format +msgid "(%%C) Century %C" +msgstr "" + +#: lib/sh/strftime.c:789 +msgid "(%%D) date (%%m/%%d/%%y) %D" +msgstr "" + +#: lib/sh/strftime.c:790 +#, c-format +msgid "(%%E) Locale extensions (ignored) %E" +msgstr "" + +#: lib/sh/strftime.c:791 +#, c-format +msgid "(%%F) full month name, var length (January..December) %F" +msgstr "" + +#: lib/sh/strftime.c:792 +msgid "(%%H) hour (24-hour clock, 00..23) %H" +msgstr "" + +#: lib/sh/strftime.c:793 +msgid "(%%I) hour (12-hour clock, 01..12) %I" +msgstr "" + +#: lib/sh/strftime.c:794 +msgid "(%%M) minute (00..59) %M" +msgstr "" + +#: lib/sh/strftime.c:795 +msgid "(%%N) Emporer/Era Name %N" +msgstr "" + +#: lib/sh/strftime.c:796 +msgid "(%%O) Locale extensions (ignored) %O" +msgstr "" + +#: lib/sh/strftime.c:797 +msgid "(%%R) time, 24-hour (%%H:%%M) %R" +msgstr "" + +#: lib/sh/strftime.c:798 +#, c-format +msgid "(%%S) second (00..60) %S" +msgstr "" + +#: lib/sh/strftime.c:799 +msgid "(%%T) time, 24-hour (%%H:%%M:%%S) %T" +msgstr "" + +#: lib/sh/strftime.c:800 +msgid "(%%U) week of year, Sunday as first day of week (00..53) %U" +msgstr "" + +#: lib/sh/strftime.c:801 +msgid "(%%V) week of year according to ISO 8601 %V" +msgstr "" + +#: lib/sh/strftime.c:802 +msgid "(%%W) week of year, Monday as first day of week (00..53) %W" +msgstr "" + +#: lib/sh/strftime.c:803 +msgid "(%%X) appropriate locale time representation (%H:%M:%S) %X" +msgstr "" + +#: lib/sh/strftime.c:804 +msgid "(%%Y) year with century (1970...) %Y" +msgstr "" + +#: lib/sh/strftime.c:805 +msgid "(%%Z) timezone (EDT), or blank if timezone not determinable %Z" +msgstr "" + +#: lib/sh/strftime.c:806 +#, c-format +msgid "(%%a) locale's abbreviated weekday name (Sun..Sat) %a" +msgstr "" + +#: lib/sh/strftime.c:807 +msgid "(%%b) locale's abbreviated month name (Jan..Dec) %b" +msgstr "" + +#: lib/sh/strftime.c:808 +msgid "(%%c) full date (Sat Nov 4 12:02:33 1989)%n%t%t%t %c" +msgstr "" + +#: lib/sh/strftime.c:809 +#, c-format +msgid "(%%d) day of the month (01..31) %d" +msgstr "" + +#: lib/sh/strftime.c:810 +#, c-format +msgid "(%%e) day of the month, blank-padded ( 1..31) %e" +msgstr "" + +#: lib/sh/strftime.c:811 +msgid "(%%h) should be same as (%%b) %h" +msgstr "" + +#: lib/sh/strftime.c:812 +msgid "(%%j) day of the year (001..366) %j" +msgstr "" + +#: lib/sh/strftime.c:813 +msgid "(%%k) hour, 24-hour clock, blank pad ( 0..23) %k" +msgstr "" + +#: lib/sh/strftime.c:814 +msgid "(%%l) hour, 12-hour clock, blank pad ( 0..12) %l" +msgstr "" + +#: lib/sh/strftime.c:815 +#, c-format +msgid "(%%m) month (01..12) %m" +msgstr "" + +#: lib/sh/strftime.c:816 +#, c-format +msgid "(%%o) Emporer/Era Year %o" +msgstr "" + +#: lib/sh/strftime.c:817 +#, c-format +msgid "(%%p) locale's AM or PM based on 12-hour clock %p" +msgstr "" + +#: lib/sh/strftime.c:818 +msgid "(%%r) time, 12-hour (same as %%I:%%M:%%S %%p) %r" +msgstr "" + +#: lib/sh/strftime.c:819 +#, c-format +msgid "(%%u) ISO 8601: Weekday as decimal number [1 (Monday) - 7] %u" +msgstr "" + +#: lib/sh/strftime.c:820 +msgid "(%%v) VMS date (dd-bbb-YYYY) %v" +msgstr "" + +#: lib/sh/strftime.c:821 +msgid "(%%w) day of week (0..6, Sunday == 0) %w" +msgstr "" + +#: lib/sh/strftime.c:822 +#, c-format +msgid "(%%x) appropriate locale date representation %x" +msgstr "" + +#: lib/sh/strftime.c:823 +msgid "(%%y) last two digits of year (00..99) %y" +msgstr "" + +#: lib/sh/strftime.c:824 +msgid "(%%z) timezone offset east of GMT as HHMM (e.g. -0500) %z" +msgstr "" + +#: lib/sh/stringlist.c:235 +#, c-format +msgid "%s%s\n" +msgstr "" + +#: lib/sh/strtoimax.c:38 lib/sh/strtoimax.c:45 lib/sh/strtoumax.c:38 +#: lib/sh/strtoumax.c:45 +msgid "this configure-time declaration test was not run" +msgstr "" + +#: lib/sh/strtoimax.c:83 +#, c-format +msgid "sizeof intmax_t: %d\n" +msgstr "" + +#: lib/sh/strtoimax.c:86 +#, c-format +msgid "sizeof long long: %d\n" +msgstr "" + +#: lib/sh/strtoimax.c:88 +#, c-format +msgid "sizeof long: %d\n" +msgstr "" + +#: lib/sh/strtoimax.c:98 +#, c-format +msgid "%lld %lld %ld\n" +msgstr "" + +#: lib/sh/strtoumax.c:83 +#, c-format +msgid "sizeof uintmax_t: %d\n" +msgstr "" + +#: lib/sh/strtoumax.c:86 +#, c-format +msgid "sizeof unsigned long long: %d\n" +msgstr "" + +#: lib/sh/strtoumax.c:88 +#, c-format +msgid "sizeof unsigned long: %d\n" +msgstr "" + +#: lib/sh/strtoumax.c:98 +#, c-format +msgid "%llu %llu %lu\n" +msgstr "" + +#: lib/sh/tmpfile.c:46 +msgid "shtmp" +msgstr "" + +#: lib/sh/tmpfile.c:73 +msgid "/var/tmp" +msgstr "" + +#: lib/sh/tmpfile.c:77 +msgid "/usr/tmp" +msgstr "" + +#: lib/sh/tmpfile.c:92 +msgid "TMPDIR" +msgstr "" + +#: lib/sh/tmpfile.c:122 lib/sh/tmpfile.c:167 +#, c-format +msgid "%s/%s.XXXXXX" +msgstr "" + +#: lib/sh/tmpfile.c:135 lib/sh/tmpfile.c:184 +#, c-format +msgid "%s/%s-%lu" +msgstr "" + +#: lib/sh/tmpfile.c:212 +msgid "w+" +msgstr "" + +#: lib/malloc/alloca.c:446 +#, c-format +msgid "%011o %011o %011o\n" +msgstr "" + +#: lib/malloc/alloca.c:467 +#, c-format +msgid "%011o %011o\n" +msgstr "" + +#: lib/malloc/i386-alloca.s:1 +msgid "alloca.s" +msgstr "" + +#: lib/malloc/imalloc.h:52 +msgid "x" +msgstr "" + +#: lib/malloc/malloc.c:298 +#, c-format +msgid "malloc: failed assertion: %s\n" +msgstr "" + +#: lib/malloc/malloc.c:314 +#, c-format +msgid "" +"\r\n" +"malloc: %s:%d: assertion botched\r\n" +msgstr "" + +#: lib/malloc/malloc.c:355 +msgid "bcoalesce: CHAIN(mp2) != mp1" +msgstr "" + +#: lib/malloc/malloc.c:604 +msgid "malloc_debug_dummy\n" +msgstr "" + +#: lib/malloc/malloc.c:740 +msgid "malloc: block on free list clobbered" +msgstr "" + +#: lib/malloc/malloc.c:766 lib/malloc/malloc.c:768 lib/malloc/malloc.c:773 +msgid "malloc" +msgstr "" + +#: lib/malloc/malloc.c:817 +msgid "free: called with already freed block argument" +msgstr "" + +#: lib/malloc/malloc.c:820 +msgid "free: called with unallocated block argument" +msgstr "" + +#: lib/malloc/malloc.c:839 +msgid "free: underflow detected; mh_nbytes out of range" +msgstr "" + +#: lib/malloc/malloc.c:845 +msgid "free: start and end chunk sizes differ" +msgstr "" + +#: lib/malloc/malloc.c:942 +msgid "realloc: called with unallocated block argument" +msgstr "" + +#: lib/malloc/malloc.c:957 +msgid "realloc: underflow detected; mh_nbytes out of range" +msgstr "" + +#: lib/malloc/malloc.c:963 +msgid "realloc: start and end chunk sizes differ" +msgstr "" + +#: lib/malloc/malloc.c:1009 lib/malloc/malloc.c:1011 lib/malloc/malloc.c:1016 +msgid "realloc" +msgstr "" + +#: lib/malloc/memtest.c:125 lib/malloc/memtest.c:138 +msgid "malloc-test: " +msgstr "" + +#: lib/malloc/stats.c:99 +#, c-format +msgid "" +"Memory allocation statistics: %s\n" +" size\tfree\tin use\ttotal\tmorecore lesscore split\tcoalesce\n" +msgstr "" + +#: lib/malloc/stats.c:104 +#, c-format +msgid "%8lu\t%4d\t%6d\t%5d\t%8d\t%d %5d %8d\n" +msgstr "" + +#: lib/malloc/stats.c:108 +#, c-format +msgid "" +"\n" +"Total bytes in use: %lu, total bytes free: %lu\n" +msgstr "" + +#: lib/malloc/stats.c:110 +#, c-format +msgid "" +"\n" +"Total bytes requested by application: %lu\n" +msgstr "" + +#: lib/malloc/stats.c:111 +#, c-format +msgid "Total mallocs: %d, total frees: %d, total reallocs: %d (%d copies)\n" +msgstr "" + +#: lib/malloc/stats.c:113 +#, c-format +msgid "Total sbrks: %d, total bytes via sbrk: %d\n" +msgstr "" + +#: lib/malloc/stats.c:115 +#, c-format +msgid "Total blocks split: %d, total block coalesces: %d\n" +msgstr "" + +#: lib/malloc/stats.c:134 +msgid "/var/tmp/maltrace/stats." +msgstr "" + +#: lib/malloc/stats.c:172 +#, c-format +msgid "%s%ld" +msgstr "" + +#: lib/malloc/table.c:152 +#, c-format +msgid "malloc: %p: %s: last %s from %s:%d\n" +msgstr "" + +#: lib/malloc/table.c:154 lib/malloc/table.c:155 lib/malloc/table.c:239 +#: lib/malloc/watch.c:46 +msgid "allocated" +msgstr "" + +#: lib/malloc/table.c:154 lib/malloc/table.c:222 lib/malloc/table.c:237 +msgid "free" +msgstr "" + +#: lib/malloc/table.c:155 lib/malloc/watch.c:48 +msgid "freed" +msgstr "" + +#: lib/malloc/table.c:175 +msgid "register_alloc: alloc table is full with FIND_ALLOC?\n" +msgstr "" + +#: lib/malloc/table.c:182 +#, c-format +msgid "register_alloc: %p already in table as allocated?\n" +msgstr "" + +#: lib/malloc/table.c:211 +#, c-format +msgid "register_free: %p not in allocation table?\n" +msgstr "" + +#: lib/malloc/table.c:218 +#, c-format +msgid "register_free: %p already in table as free?\n" +msgstr "" + +#: lib/malloc/table.c:241 +msgid "undetermined?" +msgstr "" + +#: lib/malloc/table.c:255 +#, c-format +msgid "[%d] %p:%d:%s:%s:%s:%d:%d:%d\n" +msgstr "" + +#: lib/malloc/trace.c:51 +#, c-format +msgid "alloc: %s: %p (%d bytes) from '%s:%d'\n" +msgstr "" + +#: lib/malloc/trace.c:54 +#, c-format +msgid "alloc:%p:%d:%s:%d\n" +msgstr "" + +#: lib/malloc/trace.c:69 +#, c-format +msgid "free: %p (%d bytes) from '%s:%d'\n" +msgstr "" + +#: lib/malloc/trace.c:72 +#, c-format +msgid "free:%p:%d:%s:%d\n" +msgstr "" + +#: lib/malloc/trace.c:107 +msgid "/var/tmp/maltrace/trace." +msgstr "" + +#: lib/malloc/watch.c:50 +msgid "requesting resize" +msgstr "" + +#: lib/malloc/watch.c:52 +msgid "just resized" +msgstr "" + +#: lib/malloc/watch.c:54 +msgid "bug: unknown operation" +msgstr "" + +#: lib/malloc/watch.c:56 +#, c-format +msgid "malloc: watch alert: %p %s " +msgstr "" + +#: lib/malloc/watch.c:58 +#, c-format +msgid "(size %lu) " +msgstr "" + +#: lib/malloc/watch.c:59 +#, c-format +msgid "from '%s:%d'\n" +msgstr "" + +#: lib/malloc/x386-alloca.s:10 +msgid "masm" +msgstr "" + +#: lib/malloc/xmalloc.c:55 +#, c-format +msgid "%s: out of virtual memory\n" +msgstr "" + +#: lib/malloc/xmalloc.c:70 +msgid "xmalloc" +msgstr "" + +#: lib/malloc/xmalloc.c:84 +msgid "xrealloc" +msgstr "" diff --git a/subst.c.orig b/subst.c.orig new file mode 100644 index 00000000..011930b3 --- /dev/null +++ b/subst.c.orig @@ -0,0 +1,7376 @@ +/* subst.c -- The part of the shell that does parameter, command, and + globbing substitutions. */ + +/* ``Have a little faith, there's magic in the night. You ain't a + beauty, but, hey, you're alright.'' */ + +/* Copyright (C) 1987-2004 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 2, 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, 59 Temple Place, Suite 330, Boston, MA 02111 USA. */ + +#include "config.h" + +#include "bashtypes.h" +#include +#include "chartypes.h" +#include +#include +#include + +#if defined (HAVE_UNISTD_H) +# include +#endif + +#include "bashansi.h" +#include "posixstat.h" +#include "bashintl.h" + +#include "shell.h" +#include "flags.h" +#include "jobs.h" +#include "execute_cmd.h" +#include "filecntl.h" +#include "trap.h" +#include "pathexp.h" +#include "mailcheck.h" + +#include "shmbutil.h" + +#include "builtins/getopt.h" +#include "builtins/common.h" + +#include +#include + +#if !defined (errno) +extern int errno; +#endif /* !errno */ + +/* The size that strings change by. */ +#define DEFAULT_INITIAL_ARRAY_SIZE 112 +#define DEFAULT_ARRAY_SIZE 128 + +/* Variable types. */ +#define VT_VARIABLE 0 +#define VT_POSPARMS 1 +#define VT_ARRAYVAR 2 +#define VT_ARRAYMEMBER 3 + +#define VT_STARSUB 128 /* $* or ${array[*]} -- used to split */ + +/* Flags for quoted_strchr */ +#define ST_BACKSL 0x01 +#define ST_CTLESC 0x02 +#define ST_SQUOTE 0x04 /* unused yet */ +#define ST_DQUOTE 0x08 /* unused yet */ + +/* Flags for the string extraction functions. */ +#define EX_NOALLOC 0x01 /* just skip; don't return substring */ +#define EX_VARNAME 0x02 /* variable name; for string_extract () */ + +/* Flags for the `pflags' argument to param_expand() */ +#define PF_NOCOMSUB 0x01 /* Do not perform command substitution */ + +/* These defs make it easier to use the editor. */ +#define LBRACE '{' +#define RBRACE '}' +#define LPAREN '(' +#define RPAREN ')' + +/* Evaluates to 1 if C is one of the shell's special parameters whose length + can be taken, but is also one of the special expansion characters. */ +#define VALID_SPECIAL_LENGTH_PARAM(c) \ + ((c) == '-' || (c) == '?' || (c) == '#') + +/* Evaluates to 1 if C is one of the shell's special parameters for which an + indirect variable reference may be made. */ +#define VALID_INDIR_PARAM(c) \ + ((c) == '#' || (c) == '?' || (c) == '@' || (c) == '*') + +/* Evaluates to 1 if C is one of the OP characters that follows the parameter + in ${parameter[:]OPword}. */ +#define VALID_PARAM_EXPAND_CHAR(c) (sh_syntaxtab[(unsigned char)c] & CSUBSTOP) + +/* Evaluates to 1 if this is one of the shell's special variables. */ +#define SPECIAL_VAR(name, wi) \ + ((DIGIT (*name) && all_digits (name)) || \ + (name[1] == '\0' && (sh_syntaxtab[(unsigned char)*name] & CSPECVAR)) || \ + (wi && name[2] == '\0' && VALID_INDIR_PARAM (name[1]))) + +/* An expansion function that takes a string and a quoted flag and returns + a WORD_LIST *. Used as the type of the third argument to + expand_string_if_necessary(). */ +typedef WORD_LIST *EXPFUNC __P((char *, int)); + +/* Process ID of the last command executed within command substitution. */ +pid_t last_command_subst_pid = NO_PID; +pid_t current_command_subst_pid = NO_PID; + +/* Variables used to keep track of the characters in IFS. */ +SHELL_VAR *ifs_var; +char *ifs_value; +unsigned char ifs_cmap[UCHAR_MAX + 1]; +unsigned char ifs_firstc; + +/* Extern functions and variables from different files. */ +extern int last_command_exit_value, last_command_exit_signal; +extern int subshell_environment; +extern int subshell_level; +extern int eof_encountered; +extern int return_catch_flag, return_catch_value; +extern pid_t dollar_dollar_pid; +extern int posixly_correct; +extern char *this_command_name; +extern struct fd_bitmap *current_fds_to_close; +extern int wordexp_only; +extern int expanding_redir; + +/* Non-zero means to allow unmatched globbed filenames to expand to + a null file. */ +int allow_null_glob_expansion; + +/* Non-zero means to throw an error when globbing fails to match anything. */ +int fail_glob_expansion; + +#if 0 +/* Variables to keep track of which words in an expanded word list (the + output of expand_word_list_internal) are the result of globbing + expansions. GLOB_ARGV_FLAGS is used by execute_cmd.c. + (CURRENTLY UNUSED). */ +char *glob_argv_flags; +static int glob_argv_flags_size; +#endif + +static WORD_LIST expand_word_error, expand_word_fatal; +static char expand_param_error, expand_param_fatal; + +/* Tell the expansion functions to not longjmp back to top_level on fatal + errors. Enabled when doing completion and prompt string expansion. */ +static int no_longjmp_on_fatal_error = 0; + +/* Set by expand_word_unsplit; used to inhibit splitting and re-joining + $* on $IFS, primarily when doing assignment statements. */ +static int expand_no_split_dollar_star = 0; + +/* Used to hold a list of variable assignments preceding a command. Global + so the SIGCHLD handler in jobs.c can unwind-protect it when it runs a + SIGCHLD trap. */ +WORD_LIST *subst_assign_varlist = (WORD_LIST *)NULL; + +/* A WORD_LIST of words to be expanded by expand_word_list_internal, + without any leading variable assignments. */ +static WORD_LIST *garglist = (WORD_LIST *)NULL; + +static char *quoted_substring __P((char *, int, int)); +static int quoted_strlen __P((char *)); +static char *quoted_strchr __P((char *, int, int)); + +static char *expand_string_if_necessary __P((char *, int, EXPFUNC *)); +static inline char *expand_string_to_string_internal __P((char *, int, EXPFUNC *)); +static WORD_LIST *call_expand_word_internal __P((WORD_DESC *, int, int, int *, int *)); +static WORD_LIST *expand_string_internal __P((char *, int)); +static WORD_LIST *expand_string_leave_quoted __P((char *, int)); +static WORD_LIST *expand_string_for_rhs __P((char *, int, int *, int *)); + +static WORD_LIST *list_quote_escapes __P((WORD_LIST *)); +static char *dequote_escapes __P((char *)); +static char *make_quoted_char __P((int)); +static WORD_LIST *quote_list __P((WORD_LIST *)); +static WORD_LIST *dequote_list __P((WORD_LIST *)); +static char *remove_quoted_escapes __P((char *)); +static char *remove_quoted_nulls __P((char *)); + +static int unquoted_substring __P((char *, char *)); +static int unquoted_member __P((int, char *)); + +static int do_assignment_internal __P((const char *, int)); + +static char *string_extract_verbatim __P((char *, int *, char *)); +static char *string_extract __P((char *, int *, char *, int)); +static char *string_extract_double_quoted __P((char *, int *, int)); +static inline char *string_extract_single_quoted __P((char *, int *)); +static inline int skip_single_quoted __P((char *, size_t, int)); +static int skip_double_quoted __P((char *, size_t, int)); +static char *extract_delimited_string __P((char *, int *, char *, char *, char *, int)); +static char *extract_dollar_brace_string __P((char *, int *, int, int)); + +static char *pos_params __P((char *, int, int, int)); + +static unsigned char *mb_getcharlens __P((char *, int)); + +static char *remove_upattern __P((char *, char *, int)); +#if defined (HANDLE_MULTIBYTE) +# if !defined (HAVE_WCSDUP) +static wchar_t *wcsdup __P((wchar_t *)); +# endif +static wchar_t *remove_wpattern __P((wchar_t *, size_t, wchar_t *, int)); +#endif +static char *remove_pattern __P((char *, char *, int)); + +static int match_pattern_char __P((char *, char *)); +static int match_upattern __P((char *, char *, int, char **, char **)); +#if defined (HANDLE_MULTIBYTE) +static int match_pattern_wchar __P((wchar_t *, wchar_t *)); +static int match_wpattern __P((wchar_t *, char **, size_t, wchar_t *, int, char **, char **)); +#endif +static int match_pattern __P((char *, char *, int, char **, char **)); +static int getpatspec __P((int, char *)); +static char *getpattern __P((char *, int, int)); +static char *variable_remove_pattern __P((char *, char *, int, int)); +static char *list_remove_pattern __P((WORD_LIST *, char *, int, int, int)); +static char *parameter_list_remove_pattern __P((int, char *, int, int)); +#ifdef ARRAY_VARS +static char *array_remove_pattern __P((ARRAY *, char *, int, char *, int)); +#endif +static char *parameter_brace_remove_pattern __P((char *, char *, char *, int, int)); + +static char *process_substitute __P((char *, int)); + +static char *read_comsub __P((int, int)); + +#ifdef ARRAY_VARS +static arrayind_t array_length_reference __P((char *)); +#endif + +static int valid_brace_expansion_word __P((char *, int)); +static int chk_atstar __P((char *, int, int *, int *)); + +static char *parameter_brace_expand_word __P((char *, int, int)); +static char *parameter_brace_expand_indir __P((char *, int, int, int *, int *)); +static char *parameter_brace_expand_rhs __P((char *, char *, int, int, int *, int *)); +static void parameter_brace_expand_error __P((char *, char *)); + +static int valid_length_expression __P((char *)); +static intmax_t parameter_brace_expand_length __P((char *)); + +static char *skiparith __P((char *, int)); +static int verify_substring_values __P((char *, char *, int, intmax_t *, intmax_t *)); +static int get_var_and_type __P((char *, char *, int, SHELL_VAR **, char **)); +static char *mb_substring __P((char *, int, int)); +static char *parameter_brace_substring __P((char *, char *, char *, int)); + +static char *pos_params_pat_subst __P((char *, char *, char *, int)); + +static char *parameter_brace_patsub __P((char *, char *, char *, int)); + +static char *parameter_brace_expand __P((char *, int *, int, int *, int *)); +static char *param_expand __P((char *, int *, int, int *, int *, int *, int *, int)); + +static WORD_LIST *expand_word_internal __P((WORD_DESC *, int, int, int *, int *)); + +static WORD_LIST *word_list_split __P((WORD_LIST *)); + +static void exp_jump_to_top_level __P((int)); + +static WORD_LIST *separate_out_assignments __P((WORD_LIST *)); +static WORD_LIST *glob_expand_word_list __P((WORD_LIST *, int)); +#ifdef BRACE_EXPANSION +static WORD_LIST *brace_expand_word_list __P((WORD_LIST *, int)); +#endif +static WORD_LIST *shell_expand_word_list __P((WORD_LIST *, int)); +static WORD_LIST *expand_word_list_internal __P((WORD_LIST *, int)); + +/* **************************************************************** */ +/* */ +/* Utility Functions */ +/* */ +/* **************************************************************** */ + +#ifdef INCLUDE_UNUSED +static char * +quoted_substring (string, start, end) + char *string; + int start, end; +{ + register int len, l; + register char *result, *s, *r; + + len = end - start; + + /* Move to string[start], skipping quoted characters. */ + for (s = string, l = 0; *s && l < start; ) + { + if (*s == CTLESC) + { + s++; + continue; + } + l++; + if (*s == 0) + break; + } + + r = result = (char *)xmalloc (2*len + 1); /* save room for quotes */ + + /* Copy LEN characters, including quote characters. */ + s = string + l; + for (l = 0; l < len; s++) + { + if (*s == CTLESC) + *r++ = *s++; + *r++ = *s; + l++; + if (*s == 0) + break; + } + *r = '\0'; + return result; +} +#endif + +#ifdef INCLUDE_UNUSED +/* Return the length of S, skipping over quoted characters */ +static int +quoted_strlen (s) + char *s; +{ + register char *p; + int i; + + i = 0; + for (p = s; *p; p++) + { + if (*p == CTLESC) + { + p++; + if (*p == 0) + return (i + 1); + } + i++; + } + + return i; +} +#endif + +/* Find the first occurrence of character C in string S, obeying shell + quoting rules. If (FLAGS & ST_BACKSL) is non-zero, backslash-escaped + characters are skipped. If (FLAGS & ST_CTLESC) is non-zero, characters + escaped with CTLESC are skipped. */ +static char * +quoted_strchr (s, c, flags) + char *s; + int c, flags; +{ + register char *p; + + for (p = s; *p; p++) + { + if (((flags & ST_BACKSL) && *p == '\\') + || ((flags & ST_CTLESC) && *p == CTLESC)) + { + p++; + if (*p == '\0') + return ((char *)NULL); + continue; + } + else if (*p == c) + return p; + } + return ((char *)NULL); +} + +/* Return 1 if CHARACTER appears in an unquoted portion of + STRING. Return 0 otherwise. CHARACTER must be a single-byte character. */ +static int +unquoted_member (character, string) + int character; + char *string; +{ + size_t slen; + int sindex, c; + DECLARE_MBSTATE; + + slen = strlen (string); + sindex = 0; + while (c = string[sindex]) + { + if (c == character) + return (1); + + switch (c) + { + default: + ADVANCE_CHAR (string, slen, sindex); + break; + + case '\\': + sindex++; + if (string[sindex]) + ADVANCE_CHAR (string, slen, sindex); + break; + + case '\'': + sindex = skip_single_quoted (string, slen, ++sindex); + break; + + case '"': + sindex = skip_double_quoted (string, slen, ++sindex); + break; + } + } + return (0); +} + +/* Return 1 if SUBSTR appears in an unquoted portion of STRING. */ +static int +unquoted_substring (substr, string) + char *substr, *string; +{ + size_t slen; + int sindex, c, sublen; + DECLARE_MBSTATE; + + if (substr == 0 || *substr == '\0') + return (0); + + slen = strlen (string); + sublen = strlen (substr); + for (sindex = 0; c = string[sindex]; ) + { + if (STREQN (string + sindex, substr, sublen)) + return (1); + + switch (c) + { + case '\\': + sindex++; + + if (string[sindex]) + ADVANCE_CHAR (string, slen, sindex); + break; + + case '\'': + sindex = skip_single_quoted (string, slen, ++sindex); + break; + + case '"': + sindex = skip_double_quoted (string, slen, ++sindex); + break; + + default: + ADVANCE_CHAR (string, slen, sindex); + break; + } + } + return (0); +} + +/* Most of the substitutions must be done in parallel. In order + to avoid using tons of unclear goto's, I have some functions + for manipulating malloc'ed strings. They all take INDX, a + pointer to an integer which is the offset into the string + where manipulation is taking place. They also take SIZE, a + pointer to an integer which is the current length of the + character array for this string. */ + +/* Append SOURCE to TARGET at INDEX. SIZE is the current amount + of space allocated to TARGET. SOURCE can be NULL, in which + case nothing happens. Gets rid of SOURCE by freeing it. + Returns TARGET in case the location has changed. */ +INLINE char * +sub_append_string (source, target, indx, size) + char *source, *target; + int *indx, *size; +{ + if (source) + { + int srclen, n; + + srclen = STRLEN (source); + if (srclen >= (int)(*size - *indx)) + { + n = srclen + *indx; + n = (n + DEFAULT_ARRAY_SIZE) - (n % DEFAULT_ARRAY_SIZE); + target = (char *)xrealloc (target, (*size = n)); + } + + FASTCOPY (source, target + *indx, srclen); + *indx += srclen; + target[*indx] = '\0'; + + free (source); + } + return (target); +} + +#if 0 +/* UNUSED */ +/* Append the textual representation of NUMBER to TARGET. + INDX and SIZE are as in SUB_APPEND_STRING. */ +char * +sub_append_number (number, target, indx, size) + intmax_t number; + int *indx, *size; + char *target; +{ + char *temp; + + temp = itos (number); + return (sub_append_string (temp, target, indx, size)); +} +#endif + +/* Extract a substring from STRING, starting at SINDEX and ending with + one of the characters in CHARLIST. Don't make the ending character + part of the string. Leave SINDEX pointing at the ending character. + Understand about backslashes in the string. If (flags & EX_VARNAME) + is non-zero, and array variables have been compiled into the shell, + everything between a `[' and a corresponding `]' is skipped over. + If (flags & EX_NOALLOC) is non-zero, don't return the substring, just + update SINDEX. */ +static char * +string_extract (string, sindex, charlist, flags) + char *string; + int *sindex; + char *charlist; + int flags; +{ + register int c, i; + size_t slen; + char *temp; + DECLARE_MBSTATE; + + slen = strlen (string + *sindex) + *sindex; + i = *sindex; + while (c = string[i]) + { + if (c == '\\') + { + if (string[i + 1]) + i++; + else + break; + } +#if defined (ARRAY_VARS) + else if ((flags & EX_VARNAME) && c == '[') + { + int ni; + /* If this is an array subscript, skip over it and continue. */ + ni = skipsubscript (string, i); + if (string[ni] == ']') + i = ni; + } +#endif + else if (MEMBER (c, charlist)) + break; + + ADVANCE_CHAR (string, slen, i); + } + + temp = (flags & EX_NOALLOC) ? (char *)NULL : substring (string, *sindex, i); + *sindex = i; + return (temp); +} + +/* Extract the contents of STRING as if it is enclosed in double quotes. + SINDEX, when passed in, is the offset of the character immediately + following the opening double quote; on exit, SINDEX is left pointing after + the closing double quote. If STRIPDQ is non-zero, unquoted double + quotes are stripped and the string is terminated by a null byte. + Backslashes between the embedded double quotes are processed. If STRIPDQ + is zero, an unquoted `"' terminates the string. */ +static char * +string_extract_double_quoted (string, sindex, stripdq) + char *string; + int *sindex, stripdq; +{ + size_t slen; + char *send; + int j, i, t; + unsigned char c; + char *temp, *ret; /* The new string we return. */ + int pass_next, backquote, si; /* State variables for the machine. */ + int dquote; + DECLARE_MBSTATE; + + slen = strlen (string + *sindex) + *sindex; + send = string + slen; + + pass_next = backquote = dquote = 0; + temp = (char *)xmalloc (1 + slen - *sindex); + + j = 0; + i = *sindex; + while (c = string[i]) + { + /* Process a character that was quoted by a backslash. */ + if (pass_next) + { + /* Posix.2 sez: + + ``The backslash shall retain its special meaning as an escape + character only when followed by one of the characters: + $ ` " \ ''. + + If STRIPDQ is zero, we handle the double quotes here and let + expand_word_internal handle the rest. If STRIPDQ is non-zero, + we have already been through one round of backslash stripping, + and want to strip these backslashes only if DQUOTE is non-zero, + indicating that we are inside an embedded double-quoted string. */ + + /* If we are in an embedded quoted string, then don't strip + backslashes before characters for which the backslash + retains its special meaning, but remove backslashes in + front of other characters. If we are not in an + embedded quoted string, don't strip backslashes at all. + This mess is necessary because the string was already + surrounded by double quotes (and sh has some really weird + quoting rules). + The returned string will be run through expansion as if + it were double-quoted. */ + if ((stripdq == 0 && c != '"') || + (stripdq && ((dquote && (sh_syntaxtab[c] & CBSDQUOTE)) || dquote == 0))) + temp[j++] = '\\'; + pass_next = 0; + +add_one_character: + COPY_CHAR_I (temp, j, string, send, i); + continue; + } + + /* A backslash protects the next character. The code just above + handles preserving the backslash in front of any character but + a double quote. */ + if (c == '\\') + { + pass_next++; + i++; + continue; + } + + /* Inside backquotes, ``the portion of the quoted string from the + initial backquote and the characters up to the next backquote + that is not preceded by a backslash, having escape characters + removed, defines that command''. */ + if (backquote) + { + if (c == '`') + backquote = 0; + temp[j++] = c; + i++; + continue; + } + + if (c == '`') + { + temp[j++] = c; + backquote++; + i++; + continue; + } + + /* Pass everything between `$(' and the matching `)' or a quoted + ${ ... } pair through according to the Posix.2 specification. */ + if (c == '$' && ((string[i + 1] == LPAREN) || (string[i + 1] == LBRACE))) + { + int free_ret = 1; + + si = i + 2; + if (string[i + 1] == LPAREN) + ret = extract_delimited_string (string, &si, "$(", "(", ")", 0); /*)*/ + else + ret = extract_dollar_brace_string (string, &si, 1, 0); + + temp[j++] = '$'; + temp[j++] = string[i + 1]; + + /* Just paranoia; ret will not be 0 unless no_longjmp_on_fatal_error + is set. */ + if (ret == 0 && no_longjmp_on_fatal_error) + { + free_ret = 0; + ret = string + i + 2; + } + + for (t = 0; ret[t]; t++, j++) + temp[j] = ret[t]; + temp[j++] = string[si]; + + i = si + 1; + if (free_ret) + free (ret); + continue; + } + + /* Add any character but a double quote to the quoted string we're + accumulating. */ + if (c != '"') + goto add_one_character; + + /* c == '"' */ + if (stripdq) + { + dquote ^= 1; + i++; + continue; + } + + break; + } + temp[j] = '\0'; + + /* Point to after the closing quote. */ + if (c) + i++; + *sindex = i; + + return (temp); +} + +/* This should really be another option to string_extract_double_quoted. */ +static int +skip_double_quoted (string, slen, sind) + char *string; + size_t slen; + int sind; +{ + int c, i; + char *ret; + int pass_next, backquote, si; + DECLARE_MBSTATE; + + pass_next = backquote = 0; + i = sind; + while (c = string[i]) + { + if (pass_next) + { + pass_next = 0; + ADVANCE_CHAR (string, slen, i); + continue; + } + else if (c == '\\') + { + pass_next++; + i++; + continue; + } + else if (backquote) + { + if (c == '`') + backquote = 0; + ADVANCE_CHAR (string, slen, i); + continue; + } + else if (c == '`') + { + backquote++; + i++; + continue; + } + else if (c == '$' && ((string[i + 1] == LPAREN) || (string[i + 1] == LBRACE))) + { + si = i + 2; + if (string[i + 1] == LPAREN) + ret = extract_delimited_string (string, &si, "$(", "(", ")", EX_NOALLOC); + else + ret = extract_dollar_brace_string (string, &si, 0, EX_NOALLOC); + + i = si + 1; + continue; + } + else if (c != '"') + { + ADVANCE_CHAR (string, slen, i); + continue; + } + else + break; + } + + if (c) + i++; + + return (i); +} + +/* Extract the contents of STRING as if it is enclosed in single quotes. + SINDEX, when passed in, is the offset of the character immediately + following the opening single quote; on exit, SINDEX is left pointing after + the closing single quote. */ +static inline char * +string_extract_single_quoted (string, sindex) + char *string; + int *sindex; +{ + register int i; + size_t slen; + char *t; + DECLARE_MBSTATE; + + slen = strlen (string + *sindex) + *sindex; + i = *sindex; + while (string[i] && string[i] != '\'') + ADVANCE_CHAR (string, slen, i); + + t = substring (string, *sindex, i); + + if (string[i]) + i++; + *sindex = i; + + return (t); +} + +static inline int +skip_single_quoted (string, slen, sind) + char *string; + size_t slen; + int sind; +{ + register int c; + DECLARE_MBSTATE; + + c = sind; + while (string[c] && string[c] != '\'') + ADVANCE_CHAR (string, slen, c); + + if (string[c]) + c++; + return c; +} + +/* Just like string_extract, but doesn't hack backslashes or any of + that other stuff. Obeys CTLESC quoting. Used to do splitting on $IFS. */ +static char * +string_extract_verbatim (string, sindex, charlist) + char *string; + int *sindex; + char *charlist; +{ + register int i = *sindex; + int c; + char *temp; + + if (charlist[0] == '\'' && charlist[1] == '\0') + { + temp = string_extract_single_quoted (string, sindex); + --*sindex; /* leave *sindex at separator character */ + return temp; + } + + for (i = *sindex; c = string[i]; i++) + { + if (c == CTLESC) + { + i++; + continue; + } + + if (MEMBER (c, charlist)) + break; + } + + temp = substring (string, *sindex, i); + *sindex = i; + + return (temp); +} + +/* Extract the $( construct in STRING, and return a new string. + Start extracting at (SINDEX) as if we had just seen "$(". + Make (SINDEX) get the position of the matching ")". */ +char * +extract_command_subst (string, sindex) + char *string; + int *sindex; +{ + return (extract_delimited_string (string, sindex, "$(", "(", ")", 0)); +} + +/* Extract the $[ construct in STRING, and return a new string. (]) + Start extracting at (SINDEX) as if we had just seen "$[". + Make (SINDEX) get the position of the matching "]". */ +char * +extract_arithmetic_subst (string, sindex) + char *string; + int *sindex; +{ + return (extract_delimited_string (string, sindex, "$[", "[", "]", 0)); /*]*/ +} + +#if defined (PROCESS_SUBSTITUTION) +/* Extract the <( or >( construct in STRING, and return a new string. + Start extracting at (SINDEX) as if we had just seen "<(". + Make (SINDEX) get the position of the matching ")". */ /*))*/ +char * +extract_process_subst (string, starter, sindex) + char *string; + char *starter; + int *sindex; +{ + return (extract_delimited_string (string, sindex, starter, "(", ")", 0)); +} +#endif /* PROCESS_SUBSTITUTION */ + +#if defined (ARRAY_VARS) +char * +extract_array_assignment_list (string, sindex) + char *string; + int *sindex; +{ + return (extract_delimited_string (string, sindex, "(", (char *)NULL, ")", 0)); +} +#endif + +/* Extract and create a new string from the contents of STRING, a + character string delimited with OPENER and CLOSER. SINDEX is + the address of an int describing the current offset in STRING; + it should point to just after the first OPENER found. On exit, + SINDEX gets the position of the last character of the matching CLOSER. + If OPENER is more than a single character, ALT_OPENER, if non-null, + contains a character string that can also match CLOSER and thus + needs to be skipped. */ +static char * +extract_delimited_string (string, sindex, opener, alt_opener, closer, flags) + char *string; + int *sindex; + char *opener, *alt_opener, *closer; + int flags; +{ + int i, c, si; + size_t slen; + char *t, *result; + int pass_character, nesting_level; + int len_closer, len_opener, len_alt_opener; + DECLARE_MBSTATE; + + slen = strlen (string + *sindex) + *sindex; + len_opener = STRLEN (opener); + len_alt_opener = STRLEN (alt_opener); + len_closer = STRLEN (closer); + + pass_character = 0; + + nesting_level = 1; + i = *sindex; + + while (nesting_level) + { + c = string[i]; + + if (c == 0) + break; + + if (pass_character) /* previous char was backslash */ + { + pass_character = 0; + ADVANCE_CHAR (string, slen, i); + continue; + } + + if (c == CTLESC || c == '\\') + { + pass_character++; + i++; + continue; + } + + /* Process a nested OPENER. */ + if (STREQN (string + i, opener, len_opener)) + { + si = i + len_opener; + t = extract_delimited_string (string, &si, opener, alt_opener, closer, flags|EX_NOALLOC); + i = si + 1; + continue; + } + + /* Process a nested ALT_OPENER */ + if (len_alt_opener && STREQN (string + i, alt_opener, len_alt_opener)) + { + si = i + len_alt_opener; + t = extract_delimited_string (string, &si, alt_opener, alt_opener, closer, flags|EX_NOALLOC); + i = si + 1; + continue; + } + + /* If the current substring terminates the delimited string, decrement + the nesting level. */ + if (STREQN (string + i, closer, len_closer)) + { + i += len_closer - 1; /* move to last byte of the closer */ + nesting_level--; + if (nesting_level == 0) + break; + } + + /* Pass old-style command substitution through verbatim. */ + if (c == '`') + { + si = i + 1; + t = string_extract (string, &si, "`", flags|EX_NOALLOC); + i = si + 1; + continue; + } + + /* Pass single-quoted and double-quoted strings through verbatim. */ + if (c == '\'' || c == '"') + { + si = i + 1; + i = (c == '\'') ? skip_single_quoted (string, slen, si) + : skip_double_quoted (string, slen, si); + continue; + } + + /* move past this character, which was not special. */ + ADVANCE_CHAR (string, slen, i); + } + + if (c == 0 && nesting_level) + { + if (no_longjmp_on_fatal_error == 0) + { + report_error (_("bad substitution: no closing `%s' in %s"), closer, string); + last_command_exit_value = EXECUTION_FAILURE; + exp_jump_to_top_level (DISCARD); + } + else + { + *sindex = i; + return (char *)NULL; + } + } + + si = i - *sindex - len_closer + 1; + if (flags & EX_NOALLOC) + result = (char *)NULL; + else + { + result = (char *)xmalloc (1 + si); + strncpy (result, string + *sindex, si); + result[si] = '\0'; + } + *sindex = i; + + return (result); +} + +/* Extract a parameter expansion expression within ${ and } from STRING. + Obey the Posix.2 rules for finding the ending `}': count braces while + skipping over enclosed quoted strings and command substitutions. + SINDEX is the address of an int describing the current offset in STRING; + it should point to just after the first `{' found. On exit, SINDEX + gets the position of the matching `}'. QUOTED is non-zero if this + occurs inside double quotes. */ +/* XXX -- this is very similar to extract_delimited_string -- XXX */ +static char * +extract_dollar_brace_string (string, sindex, quoted, flags) + char *string; + int *sindex, quoted, flags; +{ + register int i, c; + size_t slen; + int pass_character, nesting_level, si; + char *result, *t; + DECLARE_MBSTATE; + + pass_character = 0; + nesting_level = 1; + slen = strlen (string + *sindex) + *sindex; + + i = *sindex; + while (c = string[i]) + { + if (pass_character) + { + pass_character = 0; + ADVANCE_CHAR (string, slen, i); + continue; + } + + /* CTLESCs and backslashes quote the next character. */ + if (c == CTLESC || c == '\\') + { + pass_character++; + i++; + continue; + } + + if (string[i] == '$' && string[i+1] == LBRACE) + { + nesting_level++; + i += 2; + continue; + } + + if (c == RBRACE) + { + nesting_level--; + if (nesting_level == 0) + break; + i++; + continue; + } + + /* Pass the contents of old-style command substitutions through + verbatim. */ + if (c == '`') + { + si = i + 1; + t = string_extract (string, &si, "`", flags|EX_NOALLOC); + i = si + 1; + continue; + } + + /* Pass the contents of new-style command substitutions and + arithmetic substitutions through verbatim. */ + if (string[i] == '$' && string[i+1] == LPAREN) + { + si = i + 2; + t = extract_delimited_string (string, &si, "$(", "(", ")", flags|EX_NOALLOC); /*)*/ + i = si + 1; + continue; + } + + /* Pass the contents of single-quoted and double-quoted strings + through verbatim. */ + if (c == '\'' || c == '"') + { + si = i + 1; + i = (c == '\'') ? skip_single_quoted (string, slen, si) + : skip_double_quoted (string, slen, si); + /* skip_XXX_quoted leaves index one past close quote */ + continue; + } + + /* move past this character, which was not special. */ + ADVANCE_CHAR (string, slen, i); + } + + if (c == 0 && nesting_level) + { + if (no_longjmp_on_fatal_error == 0) + { /* { */ + report_error ("bad substitution: no closing `%s' in %s", "}", string); + last_command_exit_value = EXECUTION_FAILURE; + exp_jump_to_top_level (DISCARD); + } + else + { + *sindex = i; + return ((char *)NULL); + } + } + + result = (flags & EX_NOALLOC) ? (char *)NULL : substring (string, *sindex, i); + *sindex = i; + + return (result); +} + +/* Remove backslashes which are quoting backquotes from STRING. Modifies + STRING, and returns a pointer to it. */ +char * +de_backslash (string) + char *string; +{ + register size_t slen; + register int i, j, prev_i; + DECLARE_MBSTATE; + + slen = strlen (string); + i = j = 0; + + /* Loop copying string[i] to string[j], i >= j. */ + while (i < slen) + { + if (string[i] == '\\' && (string[i + 1] == '`' || string[i + 1] == '\\' || + string[i + 1] == '$')) + i++; + prev_i = i; + ADVANCE_CHAR (string, slen, i); + if (j < prev_i) + do string[j++] = string[prev_i++]; while (prev_i < i); + else + j = i; + } + string[j] = '\0'; + + return (string); +} + +#if 0 +/*UNUSED*/ +/* Replace instances of \! in a string with !. */ +void +unquote_bang (string) + char *string; +{ + register int i, j; + register char *temp; + + temp = (char *)xmalloc (1 + strlen (string)); + + for (i = 0, j = 0; (temp[j] = string[i]); i++, j++) + { + if (string[i] == '\\' && string[i + 1] == '!') + { + temp[j] = '!'; + i++; + } + } + strcpy (string, temp); + free (temp); +} +#endif + +#if defined (READLINE) +/* Return 1 if the portion of STRING ending at EINDEX is quoted (there is + an unclosed quoted string), or if the character at EINDEX is quoted + by a backslash. NO_LONGJMP_ON_FATAL_ERROR is used to flag that the various + single and double-quoted string parsing functions should not return an + error if there are unclosed quotes or braces. The characters that this + recognizes need to be the same as the contents of + rl_completer_quote_characters. */ + +#define CQ_RETURN(x) do { no_longjmp_on_fatal_error = 0; return (x); } while (0) + +int +char_is_quoted (string, eindex) + char *string; + int eindex; +{ + int i, pass_next, c; + size_t slen; + DECLARE_MBSTATE; + + slen = strlen (string); + no_longjmp_on_fatal_error = 1; + i = pass_next = 0; + while (i <= eindex) + { + c = string[i]; + + if (pass_next) + { + pass_next = 0; + if (i >= eindex) /* XXX was if (i >= eindex - 1) */ + CQ_RETURN(1); + ADVANCE_CHAR (string, slen, i); + continue; + } + else if (c == '\\') + { + pass_next = 1; + i++; + continue; + } + else if (c == '\'' || c == '"') + { + i = (c == '\'') ? skip_single_quoted (string, slen, ++i) + : skip_double_quoted (string, slen, ++i); + if (i > eindex) + CQ_RETURN(1); + /* no increment, the skip_xxx functions go one past end */ + } + else + ADVANCE_CHAR (string, slen, i); + } + + CQ_RETURN(0); +} + +int +unclosed_pair (string, eindex, openstr) + char *string; + int eindex; + char *openstr; +{ + int i, pass_next, openc, olen; + size_t slen; + DECLARE_MBSTATE; + + slen = strlen (string); + olen = strlen (openstr); + i = pass_next = openc = 0; + while (i <= eindex) + { + if (pass_next) + { + pass_next = 0; + if (i >= eindex) /* XXX was if (i >= eindex - 1) */ + return 0; + ADVANCE_CHAR (string, slen, i); + continue; + } + else if (string[i] == '\\') + { + pass_next = 1; + i++; + continue; + } + else if (STREQN (string + i, openstr, olen)) + { + openc = 1 - openc; + i += olen; + } + else if (string[i] == '\'' || string[i] == '"') + { + i = (string[i] == '\'') ? skip_single_quoted (string, slen, i) + : skip_double_quoted (string, slen, i); + if (i > eindex) + return 0; + } + else + ADVANCE_CHAR (string, slen, i); + } + return (openc); +} + +/* Skip characters in STRING until we find a character in DELIMS, and return + the index of that character. START is the index into string at which we + begin. This is similar in spirit to strpbrk, but it returns an index into + STRING and takes a starting index. This little piece of code knows quite + a lot of shell syntax. It's very similar to skip_double_quoted and other + functions of that ilk. */ +int +skip_to_delim (string, start, delims) + char *string; + int start; + char *delims; +{ + int i, pass_next, backq, si, c; + size_t slen; + char *temp; + DECLARE_MBSTATE; + + slen = strlen (string + start) + start; + no_longjmp_on_fatal_error = 1; + i = start; + pass_next = backq = 0; + while (c = string[i]) + { + if (pass_next) + { + pass_next = 0; + if (c == 0) + CQ_RETURN(i); + ADVANCE_CHAR (string, slen, i); + continue; + } + else if (c == '\\') + { + pass_next = 1; + i++; + continue; + } + else if (backq) + { + if (c == '`') + backq = 0; + ADVANCE_CHAR (string, slen, i); + continue; + } + else if (c == '`') + { + backq = 1; + i++; + continue; + } + else if (c == '\'' || c == '"') + { + i = (c == '\'') ? skip_single_quoted (string, slen, ++i) + : skip_double_quoted (string, slen, ++i); + /* no increment, the skip functions increment past the closing quote. */ + } + else if (c == '$' && (string[i+1] == LPAREN || string[i+1] == LBRACE)) + { + si = i + 2; + if (string[si] == '\0') + CQ_RETURN(si); + + if (string[i+1] == LPAREN) + temp = extract_delimited_string (string, &si, "$(", "(", ")", EX_NOALLOC); /* ) */ + else + temp = extract_dollar_brace_string (string, &si, 0, EX_NOALLOC); + i = si; + if (string[i] == '\0') /* don't increment i past EOS in loop */ + break; + i++; + continue; + } + else if (member (c, delims)) + break; + else + ADVANCE_CHAR (string, slen, i); + } + + CQ_RETURN(i); +} + +/* Split STRING (length SLEN) at DELIMS, and return a WORD_LIST with the + individual words. If DELIMS is NULL, the current value of $IFS is used + to split the string, and the function follows the shell field splitting + rules. SENTINEL is an index to look for. NWP, if non-NULL, + gets the number of words in the returned list. CWP, if non-NULL, gets + the index of the word containing SENTINEL. Non-whitespace chars in + DELIMS delimit separate fields. */ +WORD_LIST * +split_at_delims (string, slen, delims, sentinel, nwp, cwp) + char *string; + int slen; + char *delims; + int sentinel; + int *nwp, *cwp; +{ + int ts, te, i, nw, cw, ifs_split; + char *token, *d, *d2; + WORD_LIST *ret, *tl; + + if (string == 0 || *string == '\0') + { + if (nwp) + *nwp = 0; + if (cwp) + *cwp = 0; + return ((WORD_LIST *)NULL); + } + + d = (delims == 0) ? ifs_value : delims; + ifs_split = delims == 0; + + /* Make d2 the non-whitespace characters in delims */ + d2 = 0; + if (delims) + { + d2 = (char *)xmalloc (strlen (delims) + 1); + for (i = ts = 0; delims[i]; i++) + { + if (whitespace(delims[i]) == 0) + d2[ts++] = delims[i]; + } + d2[ts] = '\0'; + } + + ret = (WORD_LIST *)NULL; + + /* Remove sequences of whitspace characters at the start of the string, as + long as those characters are delimiters. */ + for (i = 0; member (string[i], d) && spctabnl (string[i]); i++) + ; + if (string[i] == '\0') + return (ret); + + ts = i; + nw = 0; + cw = -1; + while (1) + { + te = skip_to_delim (string, ts, d); + + /* If we have a non-whitespace delimiter character, use it to make a + separate field. This is just about what $IFS splitting does and + is closer to the behavior of the shell parser. */ + if (ts == te && d2 && member (string[ts], d2)) + { + te = ts + 1; + /* If we're using IFS splitting, the non-whitespace delimiter char + and any additional IFS whitespace delimits a field. */ + if (ifs_split) + while (member (string[te], d) && spctabnl (string[te])) + te++; + else + while (member (string[te], d2)) + te++; + } + + token = substring (string, ts, te); + + ret = add_string_to_list (token, ret); + free (token); + nw++; + + if (sentinel >= ts && sentinel <= te) + cw = nw; + + /* If the cursor is at whitespace just before word start, set the + sentinel word to the current word. */ + if (cwp && cw == -1 && sentinel == ts-1) + cw = nw; + + /* If the cursor is at whitespace between two words, make a new, empty + word, add it before (well, after, since the list is in reverse order) + the word we just added, and set the current word to that one. */ + if (cwp && cw == -1 && sentinel < ts) + { + tl = make_word_list (make_word (""), ret->next); + ret->next = tl; + cw = nw; + nw++; + } + + if (string[te] == 0) + break; + + i = te; + while (member (string[i], d) && (ifs_split || spctabnl(string[i]))) + i++; + + if (string[i]) + ts = i; + else + break; + } + + /* Special case for SENTINEL at the end of STRING. If we haven't found + the word containing SENTINEL yet, and the index we're looking for is at + the end of STRING, add an additional null argument and set the current + word pointer to that. */ + if (cwp && cw == -1 && sentinel >= slen) + { + if (whitespace (string[sentinel - 1])) + { + token = ""; + ret = add_string_to_list (token, ret); + nw++; + } + cw = nw; + } + + if (nwp) + *nwp = nw; + if (cwp) + *cwp = cw; + + return (REVERSE_LIST (ret, WORD_LIST *)); +} +#endif /* READLINE */ + +#if 0 +/* UNUSED */ +/* Extract the name of the variable to bind to from the assignment string. */ +char * +assignment_name (string) + char *string; +{ + int offset; + char *temp; + + offset = assignment (string, 0); + if (offset == 0) + return (char *)NULL; + temp = substring (string, 0, offset); + return (temp); +} +#endif + +/* **************************************************************** */ +/* */ +/* Functions to convert strings to WORD_LISTs and vice versa */ +/* */ +/* **************************************************************** */ + +/* Return a single string of all the words in LIST. SEP is the separator + to put between individual elements of LIST in the output string. */ +char * +string_list_internal (list, sep) + WORD_LIST *list; + char *sep; +{ + register WORD_LIST *t; + char *result, *r; + int word_len, sep_len, result_size; + + if (list == 0) + return ((char *)NULL); + + /* Short-circuit quickly if we don't need to separate anything. */ + if (list->next == 0) + return (savestring (list->word->word)); + + /* This is nearly always called with either sep[0] == 0 or sep[1] == 0. */ + sep_len = STRLEN (sep); + result_size = 0; + + for (t = list; t; t = t->next) + { + if (t != list) + result_size += sep_len; + result_size += strlen (t->word->word); + } + + r = result = (char *)xmalloc (result_size + 1); + + for (t = list; t; t = t->next) + { + if (t != list && sep_len) + { + if (sep_len > 1) + { + FASTCOPY (sep, r, sep_len); + r += sep_len; + } + else + *r++ = sep[0]; + } + + word_len = strlen (t->word->word); + FASTCOPY (t->word->word, r, word_len); + r += word_len; + } + + *r = '\0'; + return (result); +} + +/* Return a single string of all the words present in LIST, separating + each word with a space. */ +char * +string_list (list) + WORD_LIST *list; +{ + return (string_list_internal (list, " ")); +} + +/* Return a single string of all the words present in LIST, obeying the + quoting rules for "$*", to wit: (P1003.2, draft 11, 3.5.2) "If the + expansion [of $*] appears within a double quoted string, it expands + to a single field with the value of each parameter separated by the + first character of the IFS variable, or by a if IFS is unset." */ +char * +string_list_dollar_star (list) + WORD_LIST *list; +{ + char sep[2]; + + sep[0] = ifs_firstc; + sep[1] = '\0'; + + return (string_list_internal (list, sep)); +} + +/* Turn $@ into a string. If (quoted & (Q_HERE_DOCUMENT|Q_DOUBLE_QUOTES)) + is non-zero, the $@ appears within double quotes, and we should quote + the list before converting it into a string. If IFS is unset, and the + word is not quoted, we just need to quote CTLESC and CTLNUL characters + in the words in the list, because the default value of $IFS is + , IFS characters in the words in the list should + also be split. If IFS is null, and the word is not quoted, we need + to quote the words in the list to preserve the positional parameters + exactly. */ +char * +string_list_dollar_at (list, quoted) + WORD_LIST *list; + int quoted; +{ + char *ifs, sep[2]; + WORD_LIST *tlist; + + /* XXX this could just be ifs = ifs_value; */ + ifs = ifs_var ? value_cell (ifs_var) : (char *)0; + + sep[0] = (ifs == 0 || *ifs == 0) ? ' ' : *ifs; + sep[1] = '\0'; + + tlist = ((quoted & (Q_HERE_DOCUMENT|Q_DOUBLE_QUOTES)) || (ifs && *ifs == 0)) + ? quote_list (list) + : list_quote_escapes (list); + return (string_list_internal (tlist, sep)); +} + +/* Return the list of words present in STRING. Separate the string into + words at any of the characters found in SEPARATORS. If QUOTED is + non-zero then word in the list will have its quoted flag set, otherwise + the quoted flag is left as make_word () deemed fit. + + This obeys the P1003.2 word splitting semantics. If `separators' is + exactly , then the splitting algorithm is that of + the Bourne shell, which treats any sequence of characters from `separators' + as a delimiter. If IFS is unset, which results in `separators' being set + to "", no splitting occurs. If separators has some other value, the + following rules are applied (`IFS white space' means zero or more + occurrences of , , or , as long as those characters + are in `separators'): + + 1) IFS white space is ignored at the start and the end of the + string. + 2) Each occurrence of a character in `separators' that is not + IFS white space, along with any adjacent occurrences of + IFS white space delimits a field. + 3) Any nonzero-length sequence of IFS white space delimits a field. + */ + +/* BEWARE! list_string strips null arguments. Don't call it twice and + expect to have "" preserved! */ + +/* This performs word splitting and quoted null character removal on + STRING. */ +#define issep(c) \ + (((separators)[0]) ? ((separators)[1] ? isifs(c) \ + : (c) == (separators)[0]) \ + : 0) + +WORD_LIST * +list_string (string, separators, quoted) + register char *string, *separators; + int quoted; +{ + WORD_LIST *result; + WORD_DESC *t; + char *current_word, *s; + int sindex, sh_style_split, whitesep; + + if (!string || !*string) + return ((WORD_LIST *)NULL); + + sh_style_split = separators && separators[0] == ' ' && + separators[1] == '\t' && + separators[2] == '\n' && + separators[3] == '\0'; + + /* Remove sequences of whitespace at the beginning of STRING, as + long as those characters appear in IFS. Do not do this if + STRING is quoted or if there are no separator characters. */ + if (!quoted || !separators || !*separators) + { + for (s = string; *s && spctabnl (*s) && issep (*s); s++); + + if (!*s) + return ((WORD_LIST *)NULL); + + string = s; + } + + /* OK, now STRING points to a word that does not begin with white space. + The splitting algorithm is: + extract a word, stopping at a separator + skip sequences of spc, tab, or nl as long as they are separators + This obeys the field splitting rules in Posix.2. */ + for (result = (WORD_LIST *)NULL, sindex = 0; string[sindex]; ) + { + current_word = string_extract_verbatim (string, &sindex, separators); + if (current_word == 0) + break; + + /* If we have a quoted empty string, add a quoted null argument. We + want to preserve the quoted null character iff this is a quoted + empty string; otherwise the quoted null characters are removed + below. */ + if (QUOTED_NULL (current_word)) + { + t = make_bare_word (""); + t->flags |= W_QUOTED; + free (t->word); + t->word = make_quoted_char ('\0'); + result = make_word_list (t, result); + } + else if (current_word[0] != '\0') + { + /* If we have something, then add it regardless. However, + perform quoted null character removal on the current word. */ + remove_quoted_nulls (current_word); + result = add_string_to_list (current_word, result); + if (quoted & (Q_DOUBLE_QUOTES|Q_HERE_DOCUMENT)) + result->word->flags |= W_QUOTED; + } + + /* If we're not doing sequences of separators in the traditional + Bourne shell style, then add a quoted null argument. */ + else if (!sh_style_split && !spctabnl (string[sindex])) + { + t = make_bare_word (""); + t->flags |= W_QUOTED; + free (t->word); + t->word = make_quoted_char ('\0'); + result = make_word_list (t, result); + } + + free (current_word); + + /* Note whether or not the separator is IFS whitespace, used later. */ + whitesep = string[sindex] && spctabnl (string[sindex]); + + /* Move past the current separator character. */ + if (string[sindex]) + sindex++; + + /* Now skip sequences of space, tab, or newline characters if they are + in the list of separators. */ + while (string[sindex] && spctabnl (string[sindex]) && issep (string[sindex])) + sindex++; + + /* If the first separator was IFS whitespace and the current character + is a non-whitespace IFS character, it should be part of the current + field delimiter, not a separate delimiter that would result in an + empty field. Look at POSIX.2, 3.6.5, (3)(b). */ + if (string[sindex] && whitesep && issep (string[sindex]) && !spctabnl (string[sindex])) + sindex++; + } + return (REVERSE_LIST (result, WORD_LIST *)); +} + +/* Parse a single word from STRING, using SEPARATORS to separate fields. + ENDPTR is set to the first character after the word. This is used by + the `read' builtin. This is never called with SEPARATORS != $IFS; + it should be simplified. + + XXX - this function is very similar to list_string; they should be + combined - XXX */ +char * +get_word_from_string (stringp, separators, endptr) + char **stringp, *separators, **endptr; +{ + register char *s; + char *current_word; + int sindex, sh_style_split, whitesep; + + if (!stringp || !*stringp || !**stringp) + return ((char *)NULL); + + s = *stringp; + + sh_style_split = separators && separators[0] == ' ' && + separators[1] == '\t' && + separators[2] == '\n' && + separators[3] == '\0'; + + /* Remove sequences of whitespace at the beginning of STRING, as + long as those characters appear in IFS. */ + if (sh_style_split || !separators || !*separators) + { + for (; *s && spctabnl (*s) && isifs (*s); s++); + + /* If the string is nothing but whitespace, update it and return. */ + if (!*s) + { + *stringp = s; + if (endptr) + *endptr = s; + return ((char *)NULL); + } + } + + /* OK, S points to a word that does not begin with white space. + Now extract a word, stopping at a separator, save a pointer to + the first character after the word, then skip sequences of spc, + tab, or nl as long as they are separators. + + This obeys the field splitting rules in Posix.2. */ + sindex = 0; + current_word = string_extract_verbatim (s, &sindex, separators); + + /* Set ENDPTR to the first character after the end of the word. */ + if (endptr) + *endptr = s + sindex; + + /* Note whether or not the separator is IFS whitespace, used later. */ + whitesep = s[sindex] && spctabnl (s[sindex]); + + /* Move past the current separator character. */ + if (s[sindex]) + sindex++; + + /* Now skip sequences of space, tab, or newline characters if they are + in the list of separators. */ + while (s[sindex] && spctabnl (s[sindex]) && isifs (s[sindex])) + sindex++; + + /* If the first separator was IFS whitespace and the current character is + a non-whitespace IFS character, it should be part of the current field + delimiter, not a separate delimiter that would result in an empty field. + Look at POSIX.2, 3.6.5, (3)(b). */ + if (s[sindex] && whitesep && isifs (s[sindex]) && !spctabnl (s[sindex])) + sindex++; + + /* Update STRING to point to the next field. */ + *stringp = s + sindex; + return (current_word); +} + +/* Remove IFS white space at the end of STRING. Start at the end + of the string and walk backwards until the beginning of the string + or we find a character that's not IFS white space and not CTLESC. + Only let CTLESC escape a white space character if SAW_ESCAPE is + non-zero. */ +char * +strip_trailing_ifs_whitespace (string, separators, saw_escape) + char *string, *separators; + int saw_escape; +{ + char *s; + + s = string + STRLEN (string) - 1; + while (s > string && ((spctabnl (*s) && isifs (*s)) || + (saw_escape && *s == CTLESC && spctabnl (s[1])))) + s--; + *++s = '\0'; + return string; +} + +#if 0 +/* UNUSED */ +/* Split STRING into words at whitespace. Obeys shell-style quoting with + backslashes, single and double quotes. */ +WORD_LIST * +list_string_with_quotes (string) + char *string; +{ + WORD_LIST *list; + char *token, *s; + size_t s_len; + int c, i, tokstart, len; + + for (s = string; s && *s && spctabnl (*s); s++) + ; + if (s == 0 || *s == 0) + return ((WORD_LIST *)NULL); + + s_len = strlen (s); + tokstart = i = 0; + list = (WORD_LIST *)NULL; + while (1) + { + c = s[i]; + if (c == '\\') + { + i++; + if (s[i]) + i++; + } + else if (c == '\'') + i = skip_single_quoted (s, s_len, ++i); + else if (c == '"') + i = skip_double_quoted (s, s_len, ++i); + else if (c == 0 || spctabnl (c)) + { + /* We have found the end of a token. Make a word out of it and + add it to the word list. */ + token = substring (s, tokstart, i); + list = add_string_to_list (token, list); + free (token); + while (spctabnl (s[i])) + i++; + if (s[i]) + tokstart = i; + else + break; + } + else + i++; /* normal character */ + } + return (REVERSE_LIST (list, WORD_LIST *)); +} +#endif + +/********************************************************/ +/* */ +/* Functions to perform assignment statements */ +/* */ +/********************************************************/ + +/* Given STRING, an assignment string, get the value of the right side + of the `=', and bind it to the left side. If EXPAND is true, then + perform parameter expansion, command substitution, and arithmetic + expansion on the right-hand side. Perform tilde expansion in any + case. Do not perform word splitting on the result of expansion. */ +static int +do_assignment_internal (string, expand) + const char *string; + int expand; +{ + int offset; + char *name, *value; + SHELL_VAR *entry; +#if defined (ARRAY_VARS) + char *t; + int ni; +#endif + int assign_list = 0; + + offset = assignment (string, 0); + name = savestring (string); + value = (char *)NULL; + + if (name[offset] == '=') + { + char *temp; + + name[offset] = 0; + temp = name + offset + 1; + +#if defined (ARRAY_VARS) + if (expand && temp[0] == LPAREN && xstrchr (temp, RPAREN)) + { + assign_list = ni = 1; + value = extract_delimited_string (temp, &ni, "(", (char *)NULL, ")", 0); + } + else +#endif + + /* Perform tilde expansion. */ + if (expand && temp[0]) + { + temp = (xstrchr (temp, '~') && unquoted_member ('~', temp)) + ? bash_tilde_expand (temp, 1) + : savestring (temp); + + value = expand_string_if_necessary (temp, 0, expand_string_unsplit); + free (temp); + } + else + value = savestring (temp); + } + + if (value == 0) + { + value = (char *)xmalloc (1); + value[0] = '\0'; + } + + if (echo_command_at_execute) + xtrace_print_assignment (name, value, assign_list, 1); + +#define ASSIGN_RETURN(r) do { FREE (value); free (name); return (r); } while (0) + +#if defined (ARRAY_VARS) + if (t = xstrchr (name, '[')) /*]*/ + { + if (assign_list) + { + report_error (_("%s: cannot assign list to array member"), name); + ASSIGN_RETURN (0); + } + entry = assign_array_element (name, value); + if (entry == 0) + ASSIGN_RETURN (0); + } + else if (assign_list) + entry = assign_array_from_string (name, value); + else +#endif /* ARRAY_VARS */ + entry = bind_variable (name, value); + + stupidly_hack_special_variables (name); + + if (entry) + VUNSETATTR (entry, att_invisible); + + /* Return 1 if the assignment seems to have been performed correctly. */ + ASSIGN_RETURN (entry ? ((readonly_p (entry) == 0) && noassign_p (entry) == 0) : 0); +} + +/* Perform the assignment statement in STRING, and expand the + right side by doing command and parameter expansion. */ +int +do_assignment (string) + const char *string; +{ + return do_assignment_internal (string, 1); +} + +/* Given STRING, an assignment string, get the value of the right side + of the `=', and bind it to the left side. Do not do command and + parameter substitution on the right hand side. */ +int +do_assignment_no_expand (string) + const char *string; +{ + return do_assignment_internal (string, 0); +} + +/*************************************************** + * * + * Functions to manage the positional parameters * + * * + ***************************************************/ + +/* Return the word list that corresponds to `$*'. */ +WORD_LIST * +list_rest_of_args () +{ + register WORD_LIST *list, *args; + int i; + + /* Break out of the loop as soon as one of the dollar variables is null. */ + for (i = 1, list = (WORD_LIST *)NULL; i < 10 && dollar_vars[i]; i++) + list = make_word_list (make_bare_word (dollar_vars[i]), list); + + for (args = rest_of_args; args; args = args->next) + list = make_word_list (make_bare_word (args->word->word), list); + + return (REVERSE_LIST (list, WORD_LIST *)); +} + +int +number_of_args () +{ + register WORD_LIST *list; + int n; + + for (n = 0; n < 9 && dollar_vars[n+1]; n++) + ; + for (list = rest_of_args; list; list = list->next) + n++; + return n; +} + +/* Return the value of a positional parameter. This handles values > 10. */ +char * +get_dollar_var_value (ind) + intmax_t ind; +{ + char *temp; + WORD_LIST *p; + + if (ind < 10) + temp = dollar_vars[ind] ? savestring (dollar_vars[ind]) : (char *)NULL; + else /* We want something like ${11} */ + { + ind -= 10; + for (p = rest_of_args; p && ind--; p = p->next) + ; + temp = p ? savestring (p->word->word) : (char *)NULL; + } + return (temp); +} + +/* Make a single large string out of the dollar digit variables, + and the rest_of_args. If DOLLAR_STAR is 1, then obey the special + case of "$*" with respect to IFS. */ +char * +string_rest_of_args (dollar_star) + int dollar_star; +{ + register WORD_LIST *list; + char *string; + + list = list_rest_of_args (); + string = dollar_star ? string_list_dollar_star (list) : string_list (list); + dispose_words (list); + return (string); +} + +/* Return a string containing the positional parameters from START to + END, inclusive. If STRING[0] == '*', we obey the rules for $*, + which only makes a difference if QUOTED is non-zero. If QUOTED includes + Q_HERE_DOCUMENT or Q_DOUBLE_QUOTES, this returns a quoted list, otherwise + no quoting chars are added. */ +static char * +pos_params (string, start, end, quoted) + char *string; + int start, end, quoted; +{ + WORD_LIST *save, *params, *h, *t; + char *ret; + int i; + + /* see if we can short-circuit. if start == end, we want 0 parameters. */ + if (start == end) + return ((char *)NULL); + + save = params = list_rest_of_args (); + if (save == 0) + return ((char *)NULL); + + for (i = 1; params && i < start; i++) + params = params->next; + if (params == 0) + return ((char *)NULL); + for (h = t = params; params && i < end; i++) + { + t = params; + params = params->next; + } + + t->next = (WORD_LIST *)NULL; + if (string[0] == '*') +#if 0 + ret = (quoted & (Q_HERE_DOCUMENT|Q_DOUBLE_QUOTES)) ? string_list_dollar_star (quote_list (h)) : string_list (h); +#else + { + if (quoted & Q_DOUBLE_QUOTES) + ret = string_list_dollar_star (quote_list (h)); + else if (quoted & Q_HERE_DOCUMENT) + ret = string_list (quote_list (h)); + else + ret = string_list (h); + } +#endif + else + ret = string_list ((quoted & (Q_HERE_DOCUMENT|Q_DOUBLE_QUOTES)) ? quote_list (h) : h); + if (t != params) + t->next = params; + + dispose_words (save); + return (ret); +} + +/******************************************************************/ +/* */ +/* Functions to expand strings to strings or WORD_LISTs */ +/* */ +/******************************************************************/ + +#if defined (PROCESS_SUBSTITUTION) +#define EXP_CHAR(s) (s == '$' || s == '`' || s == '<' || s == '>' || s == CTLESC) +#else +#define EXP_CHAR(s) (s == '$' || s == '`' || s == CTLESC) +#endif + +/* If there are any characters in STRING that require full expansion, + then call FUNC to expand STRING; otherwise just perform quote + removal if necessary. This returns a new string. */ +static char * +expand_string_if_necessary (string, quoted, func) + char *string; + int quoted; + EXPFUNC *func; +{ + WORD_LIST *list; + size_t slen; + int i, saw_quote; + char *ret; + DECLARE_MBSTATE; + + slen = strlen (string); + i = saw_quote = 0; + while (string[i]) + { + if (EXP_CHAR (string[i])) + break; + else if (string[i] == '\'' || string[i] == '\\' || string[i] == '"') + saw_quote = 1; + ADVANCE_CHAR (string, slen, i); + } + + if (string[i]) + { + list = (*func) (string, quoted); + if (list) + { + ret = string_list (list); + dispose_words (list); + } + else + ret = (char *)NULL; + } + else if (saw_quote && ((quoted & (Q_HERE_DOCUMENT|Q_DOUBLE_QUOTES)) == 0)) + ret = string_quote_removal (string, quoted); + else + ret = savestring (string); + + return ret; +} + +static inline char * +expand_string_to_string_internal (string, quoted, func) + char *string; + int quoted; + EXPFUNC *func; +{ + WORD_LIST *list; + char *ret; + + if (string == 0 || *string == '\0') + return ((char *)NULL); + + list = (*func) (string, quoted); + if (list) + { + ret = string_list (list); + dispose_words (list); + } + else + ret = (char *)NULL; + + return (ret); +} + +char * +expand_string_to_string (string, quoted) + char *string; + int quoted; +{ + return (expand_string_to_string_internal (string, quoted, expand_string)); +} + +char * +expand_string_unsplit_to_string (string, quoted) + char *string; + int quoted; +{ + return (expand_string_to_string_internal (string, quoted, expand_string_unsplit)); +} + +#if defined (COND_COMMAND) +/* Just remove backslashes in STRING. Returns a new string. */ +char * +remove_backslashes (string) + char *string; +{ + char *r, *ret, *s; + + r = ret = (char *)xmalloc (strlen (string) + 1); + for (s = string; s && *s; ) + { + if (*s == '\\') + s++; + if (*s == 0) + break; + *r++ = *s++; + } + *r = '\0'; + return ret; +} + +/* This needs better error handling. */ +/* Expand W for use as an argument to a unary or binary operator in a + [[...]] expression. If SPECIAL is nonzero, this is the rhs argument + to the != or == operator, and should be treated as a pattern. In + this case, we quote the string specially for the globbing code. The + caller is responsible for removing the backslashes if the unquoted + words is needed later. */ +char * +cond_expand_word (w, special) + WORD_DESC *w; + int special; +{ + char *r, *p; + WORD_LIST *l; + + if (w->word == 0 || w->word[0] == '\0') + return ((char *)NULL); + + if (xstrchr (w->word, '~') && unquoted_member ('~', w->word)) + { + p = bash_tilde_expand (w->word, 0); + free (w->word); + w->word = p; + } + + l = call_expand_word_internal (w, 0, 0, (int *)0, (int *)0); + if (l) + { + if (special == 0) + { + dequote_list (l); + r = string_list (l); + } + else + { + p = string_list (l); + r = quote_string_for_globbing (p, QGLOB_CVTNULL); + free (p); + } + dispose_words (l); + } + else + r = (char *)NULL; + + return r; +} +#endif + +/* Call expand_word_internal to expand W and handle error returns. + A convenience function for functions that don't want to handle + any errors or free any memory before aborting. */ +static WORD_LIST * +call_expand_word_internal (w, q, i, c, e) + WORD_DESC *w; + int q, i, *c, *e; +{ + WORD_LIST *result; + + result = expand_word_internal (w, q, i, c, e); + if (result == &expand_word_error || result == &expand_word_fatal) + { + /* By convention, each time this error is returned, w->word has + already been freed (it sometimes may not be in the fatal case, + but that doesn't result in a memory leak because we're going + to exit in most cases). */ + w->word = (char *)NULL; + last_command_exit_value = EXECUTION_FAILURE; + exp_jump_to_top_level ((result == &expand_word_error) ? DISCARD : FORCE_EOF); + /* NOTREACHED */ + } + else + return (result); +} + +/* Perform parameter expansion, command substitution, and arithmetic + expansion on STRING, as if it were a word. Leave the result quoted. */ +static WORD_LIST * +expand_string_internal (string, quoted) + char *string; + int quoted; +{ + WORD_DESC td; + WORD_LIST *tresult; + + if (string == 0 || *string == 0) + return ((WORD_LIST *)NULL); + + td.flags = 0; + td.word = savestring (string); + + tresult = call_expand_word_internal (&td, quoted, 0, (int *)NULL, (int *)NULL); + + FREE (td.word); + return (tresult); +} + +/* Expand STRING by performing parameter expansion, command substitution, + and arithmetic expansion. Dequote the resulting WORD_LIST before + returning it, but do not perform word splitting. The call to + remove_quoted_nulls () is in here because word splitting normally + takes care of quote removal. */ +WORD_LIST * +expand_string_unsplit (string, quoted) + char *string; + int quoted; +{ + WORD_LIST *value; + + if (string == 0 || *string == '\0') + return ((WORD_LIST *)NULL); + + expand_no_split_dollar_star = 1; + value = expand_string_internal (string, quoted); + expand_no_split_dollar_star = 0; + + if (value) + { + if (value->word) + remove_quoted_nulls (value->word->word); + dequote_list (value); + } + return (value); +} + + +/* Expand one of the PS? prompt strings. This is a sort of combination of + expand_string_unsplit and expand_string_internal, but returns the + passed string when an error occurs. Might want to trap other calls + to jump_to_top_level here so we don't endlessly loop. */ +WORD_LIST * +expand_prompt_string (string, quoted) + char *string; + int quoted; +{ + WORD_LIST *value; + WORD_DESC td; + + if (string == 0 || *string == 0) + return ((WORD_LIST *)NULL); + + td.flags = 0; + td.word = savestring (string); + + no_longjmp_on_fatal_error = 1; + value = expand_word_internal (&td, quoted, 0, (int *)NULL, (int *)NULL); + no_longjmp_on_fatal_error = 0; + + if (value == &expand_word_error || value == &expand_word_fatal) + { + value = make_word_list (make_bare_word (string), (WORD_LIST *)NULL); + return value; + } + FREE (td.word); + if (value) + { + if (value->word) + remove_quoted_nulls (value->word->word); + dequote_list (value); + } + return (value); +} + +/* Expand STRING just as if you were expanding a word, but do not dequote + the resultant WORD_LIST. This is called only from within this file, + and is used to correctly preserve quoted characters when expanding + things like ${1+"$@"}. This does parameter expansion, command + substitution, arithmetic expansion, and word splitting. */ +static WORD_LIST * +expand_string_leave_quoted (string, quoted) + char *string; + int quoted; +{ + WORD_LIST *tlist; + WORD_LIST *tresult; + + if (string == 0 || *string == '\0') + return ((WORD_LIST *)NULL); + + tlist = expand_string_internal (string, quoted); + + if (tlist) + { + tresult = word_list_split (tlist); + dispose_words (tlist); + return (tresult); + } + return ((WORD_LIST *)NULL); +} + +/* This does not perform word splitting or dequote the WORD_LIST + it returns. */ +static WORD_LIST * +expand_string_for_rhs (string, quoted, dollar_at_p, has_dollar_at) + char *string; + int quoted, *dollar_at_p, *has_dollar_at; +{ + WORD_DESC td; + WORD_LIST *tresult; + + if (string == 0 || *string == '\0') + return (WORD_LIST *)NULL; + + td.flags = 0; + td.word = string; + tresult = call_expand_word_internal (&td, quoted, 1, dollar_at_p, has_dollar_at); + return (tresult); +} + +/* Expand STRING just as if you were expanding a word. This also returns + a list of words. Note that filename globbing is *NOT* done for word + or string expansion, just when the shell is expanding a command. This + does parameter expansion, command substitution, arithmetic expansion, + and word splitting. Dequote the resultant WORD_LIST before returning. */ +WORD_LIST * +expand_string (string, quoted) + char *string; + int quoted; +{ + WORD_LIST *result; + + if (string == 0 || *string == '\0') + return ((WORD_LIST *)NULL); + + result = expand_string_leave_quoted (string, quoted); + return (result ? dequote_list (result) : result); +} + +/*************************************************** + * * + * Functions to handle quoting chars * + * * + ***************************************************/ + +/* Conventions: + + A string with s[0] == CTLNUL && s[1] == 0 is a quoted null string. + The parser passes CTLNUL as CTLESC CTLNUL. */ + +/* Quote escape characters in string s, but no other characters. This is + used to protect CTLESC and CTLNUL in variable values from the rest of + the word expansion process after the variable is expanded. */ +char * +quote_escapes (string) + char *string; +{ + register char *s, *t; + size_t slen; + char *result, *send; + DECLARE_MBSTATE; + + slen = strlen (string); + send = string + slen; + + t = result = (char *)xmalloc ((slen * 2) + 1); + s = string; + + while (*s) + { + if (*s == CTLESC || *s == CTLNUL) + *t++ = CTLESC; + COPY_CHAR_P (t, s, send); + } + *t = '\0'; + return (result); +} + +static WORD_LIST * +list_quote_escapes (list) + WORD_LIST *list; +{ + register WORD_LIST *w; + char *t; + + for (w = list; w; w = w->next) + { + t = w->word->word; + w->word->word = quote_escapes (t); + free (t); + } + return list; +} + +/* Inverse of quote_escapes; remove CTLESC protecting CTLESC or CTLNUL. + + The parser passes us CTLESC as CTLESC CTLESC and CTLNUL as CTLESC CTLNUL. + This is necessary to make unquoted CTLESC and CTLNUL characters in the + data stream pass through properly. + + We need to remove doubled CTLESC characters inside quoted strings before + quoting the entire string, so we do not double the number of CTLESC + characters. + + Also used by parts of the pattern substitution code. */ +static char * +dequote_escapes (string) + char *string; +{ + register char *s, *t; + size_t slen; + char *result, *send; + DECLARE_MBSTATE; + + if (string == 0) + return string; + + slen = strlen (string); + send = string + slen; + + t = result = (char *)xmalloc (slen + 1); + s = string; + + if (strchr (string, CTLESC) == 0) + return (strcpy (result, s)); + + while (*s) + { + if (*s == CTLESC && (s[1] == CTLESC || s[1] == CTLNUL)) + { + s++; + if (*s == '\0') + break; + } + COPY_CHAR_P (t, s, send); + } + *t = '\0'; + return result; +} + +/* Return a new string with the quoted representation of character C. */ +static char * +make_quoted_char (c) + int c; +{ + char *temp; + + temp = (char *)xmalloc (3); + if (c == 0) + { + temp[0] = CTLNUL; + temp[1] = '\0'; + } + else + { + temp[0] = CTLESC; + temp[1] = c; + temp[2] = '\0'; + } + return (temp); +} + +/* Quote STRING. Return a new string. */ +char * +quote_string (string) + char *string; +{ + register char *t; + size_t slen; + char *result, *send; + + if (*string == 0) + { + result = (char *)xmalloc (2); + result[0] = CTLNUL; + result[1] = '\0'; + } + else + { + DECLARE_MBSTATE; + + slen = strlen (string); + send = string + slen; + + result = (char *)xmalloc ((slen * 2) + 1); + + for (t = result; string < send; ) + { + *t++ = CTLESC; + COPY_CHAR_P (t, string, send); + } + *t = '\0'; + } + return (result); +} + +/* De-quoted quoted characters in STRING. */ +char * +dequote_string (string) + char *string; +{ + register char *s, *t; + size_t slen; + char *result, *send; + DECLARE_MBSTATE; + + slen = strlen (string); + + t = result = (char *)xmalloc (slen + 1); + + if (QUOTED_NULL (string)) + { + result[0] = '\0'; + return (result); + } + + /* If no character in the string can be quoted, don't bother examining + each character. Just return a copy of the string passed to us. */ + if (strchr (string, CTLESC) == NULL) + return (strcpy (result, string)); + + send = string + slen; + s = string; + while (*s) + { + if (*s == CTLESC) + { + s++; + if (*s == '\0') + break; + } + COPY_CHAR_P (t, s, send); + } + + *t = '\0'; + return (result); +} + +/* Quote the entire WORD_LIST list. */ +static WORD_LIST * +quote_list (list) + WORD_LIST *list; +{ + register WORD_LIST *w; + char *t; + + for (w = list; w; w = w->next) + { + t = w->word->word; + w->word->word = quote_string (t); + free (t); + w->word->flags |= W_QUOTED; + } + return list; +} + +static WORD_LIST * +dequote_list (list) + WORD_LIST *list; +{ + register char *s; + register WORD_LIST *tlist; + + for (tlist = list; tlist; tlist = tlist->next) + { + s = dequote_string (tlist->word->word); + free (tlist->word->word); + tlist->word->word = s; + } + return list; +} + +/* Remove CTLESC protecting a CTLESC or CTLNUL in place. Return the passed + string. */ +static char * +remove_quoted_escapes (string) + char *string; +{ + char *t; + + if (string) + { + t = dequote_escapes (string); + strcpy (string, t); + free (t); + } + + return (string); +} + +/* Perform quoted null character removal on STRING. We don't allow any + quoted null characters in the middle or at the ends of strings because + of how expand_word_internal works. remove_quoted_nulls () turns + STRING into an empty string iff it only consists of a quoted null, + and removes all unquoted CTLNUL characters. */ +static char * +remove_quoted_nulls (string) + char *string; +{ + register size_t slen; + register int i, j, prev_i; + DECLARE_MBSTATE; + + if (strchr (string, CTLNUL) == 0) /* XXX */ + return string; /* XXX */ + + slen = strlen (string); + i = j = 0; + + while (i < slen) + { + if (string[i] == CTLESC) + { + /* Old code had j++, but we cannot assume that i == j at this + point -- what if a CTLNUL has already been removed from the + string? We don't want to drop the CTLESC or recopy characters + that we've already copied down. */ + i++; string[j++] = CTLESC; + if (i == slen) + break; + } + else if (string[i] == CTLNUL) + i++; + + prev_i = i; + ADVANCE_CHAR (string, slen, i); + if (j < prev_i) + { + do string[j++] = string[prev_i++]; while (prev_i < i); + } + else + j = i; + } + string[j] = '\0'; + + return (string); +} + +/* Perform quoted null character removal on each element of LIST. + This modifies LIST. */ +void +word_list_remove_quoted_nulls (list) + WORD_LIST *list; +{ + register WORD_LIST *t; + + for (t = list; t; t = t->next) + remove_quoted_nulls (t->word->word); +} + +/* **************************************************************** */ +/* */ +/* Functions for Matching and Removing Patterns */ +/* */ +/* **************************************************************** */ + +#if defined (HANDLE_MULTIBYTE) +#if 0 /* Currently unused */ +static unsigned char * +mb_getcharlens (string, len) + char *string; + int len; +{ + int i, offset, last; + unsigned char *ret; + char *p; + DECLARE_MBSTATE; + + i = offset = 0; + last = 0; + ret = (unsigned char *)xmalloc (len); + memset (ret, 0, len); + while (string[last]) + { + ADVANCE_CHAR (string, len, offset); + ret[last] = offset - last; + last = offset; + } + return ret; +} +#endif +#endif + +/* Remove the portion of PARAM matched by PATTERN according to OP, where OP + can have one of 4 values: + RP_LONG_LEFT remove longest matching portion at start of PARAM + RP_SHORT_LEFT remove shortest matching portion at start of PARAM + RP_LONG_RIGHT remove longest matching portion at end of PARAM + RP_SHORT_RIGHT remove shortest matching portion at end of PARAM +*/ + +#define RP_LONG_LEFT 1 +#define RP_SHORT_LEFT 2 +#define RP_LONG_RIGHT 3 +#define RP_SHORT_RIGHT 4 + +static char * +remove_upattern (param, pattern, op) + char *param, *pattern; + int op; +{ + register int len; + register char *end; + register char *p, *ret, c; + + len = STRLEN (param); + end = param + len; + + switch (op) + { + case RP_LONG_LEFT: /* remove longest match at start */ + for (p = end; p >= param; p--) + { + c = *p; *p = '\0'; + if (strmatch (pattern, param, FNMATCH_EXTFLAG) != FNM_NOMATCH) + { + *p = c; + return (savestring (p)); + } + *p = c; + + } + break; + + case RP_SHORT_LEFT: /* remove shortest match at start */ + for (p = param; p <= end; p++) + { + c = *p; *p = '\0'; + if (strmatch (pattern, param, FNMATCH_EXTFLAG) != FNM_NOMATCH) + { + *p = c; + return (savestring (p)); + } + *p = c; + } + break; + + case RP_LONG_RIGHT: /* remove longest match at end */ + for (p = param; p <= end; p++) + { + if (strmatch (pattern, p, FNMATCH_EXTFLAG) != FNM_NOMATCH) + { + c = *p; *p = '\0'; + ret = savestring (param); + *p = c; + return (ret); + } + } + break; + + case RP_SHORT_RIGHT: /* remove shortest match at end */ + for (p = end; p >= param; p--) + { + if (strmatch (pattern, p, FNMATCH_EXTFLAG) != FNM_NOMATCH) + { + c = *p; *p = '\0'; + ret = savestring (param); + *p = c; + return (ret); + } + } + break; + } + + return (savestring (param)); /* no match, return original string */ +} + +#if defined (HANDLE_MULTIBYTE) + +#if !defined (HAVE_WCSDUP) +static wchar_t * +wcsdup (ws) + wchar_t *ws; +{ + wchar_t *ret; + size_t len; + + len = wcslen (ws); + ret = xmalloc ((len + 1) * sizeof (wchar_t)); + if (ret == 0) + return ret; + return (wcscpy (ret, ws)); +} +#endif /* !HAVE_WCSDUP */ + +static wchar_t * +remove_wpattern (wparam, wstrlen, wpattern, op) + wchar_t *wparam; + size_t wstrlen; + wchar_t *wpattern; + int op; +{ + wchar_t wc; + int n, n1; + wchar_t *ret; + + switch (op) + { + case RP_LONG_LEFT: /* remove longest match at start */ + for (n = wstrlen; n >= 0; n--) + { + wc = wparam[n]; wparam[n] = L'\0'; + if (wcsmatch (wpattern, wparam, FNMATCH_EXTFLAG) != FNM_NOMATCH) + { + wparam[n] = wc; + return (wcsdup (wparam + n)); + } + wparam[n] = wc; + } + break; + + case RP_SHORT_LEFT: /* remove shortest match at start */ + for (n = 0; n <= wstrlen; n++) + { + wc = wparam[n]; wparam[n] = L'\0'; + if (wcsmatch (wpattern, wparam, FNMATCH_EXTFLAG) != FNM_NOMATCH) + { + wparam[n] = wc; + return (wcsdup (wparam + n)); + } + wparam[n] = wc; + } + break; + + case RP_LONG_RIGHT: /* remove longest match at end */ + for (n = 0; n <= wstrlen; n++) + { + if (wcsmatch (wpattern, wparam + n, FNMATCH_EXTFLAG) != FNM_NOMATCH) + { + wc = wparam[n]; wparam[n] = L'\0'; + ret = wcsdup (wparam); + wparam[n] = wc; + return (ret); + } + } + break; + + case RP_SHORT_RIGHT: /* remove shortest match at end */ + for (n = wstrlen; n >= 0; n--) + { + if (wcsmatch (wpattern, wparam + n, FNMATCH_EXTFLAG) != FNM_NOMATCH) + { + wc = wparam[n]; wparam[n] = L'\0'; + ret = wcsdup (wparam); + wparam[n] = wc; + return (ret); + } + } + break; + } + + return (wcsdup (wparam)); /* no match, return original string */ +} +#endif /* HANDLE_MULTIBYTE */ + +static char * +remove_pattern (param, pattern, op) + char *param, *pattern; + int op; +{ + if (param == NULL) + return (param); + if (*param == '\0' || pattern == NULL || *pattern == '\0') /* minor optimization */ + return (savestring (param)); + +#if defined (HANDLE_MULTIBYTE) + if (MB_CUR_MAX > 1) + { + wchar_t *ret, *oret; + size_t n; + wchar_t *wparam, *wpattern; + mbstate_t ps; + char *xret; + + n = xdupmbstowcs (&wpattern, NULL, pattern); + if (n == (size_t)-1) + return (remove_upattern (param, pattern, op)); + n = xdupmbstowcs (&wparam, NULL, param); + if (n == (size_t)-1) + { + free (wpattern); + return (remove_upattern (param, pattern, op)); + } + oret = ret = remove_wpattern (wparam, n, wpattern, op); + + free (wparam); + free (wpattern); + + n = strlen (param); + xret = xmalloc (n + 1); + memset (&ps, '\0', sizeof (mbstate_t)); + n = wcsrtombs (xret, (const wchar_t **)&ret, n, &ps); + xret[n] = '\0'; /* just to make sure */ + free (oret); + return xret; + } + else +#endif + return (remove_upattern (param, pattern, op)); +} + +/* Return 1 of the first character of STRING could match the first + character of pattern PAT. Used to avoid n2 calls to strmatch(). */ +static int +match_pattern_char (pat, string) + char *pat, *string; +{ + char c; + + if (*string == 0) + return (0); + + switch (c = *pat++) + { + default: + return (*string == c); + case '\\': + return (*string == *pat); + case '?': + return (*pat == LPAREN ? 1 : (*string != '\0')); + case '*': + return (1); + case '+': + case '!': + case '@': + return (*pat == LPAREN ? 1 : (*string == c)); + case '[': + return (*string != '\0'); + } +} + +/* Match PAT anywhere in STRING and return the match boundaries. + This returns 1 in case of a successful match, 0 otherwise. SP + and EP are pointers into the string where the match begins and + ends, respectively. MTYPE controls what kind of match is attempted. + MATCH_BEG and MATCH_END anchor the match at the beginning and end + of the string, respectively. The longest match is returned. */ +static int +match_upattern (string, pat, mtype, sp, ep) + char *string, *pat; + int mtype; + char **sp, **ep; +{ + int c, len; + register char *p, *p1; + char *end; + + len = STRLEN (string); + end = string + len; + + switch (mtype) + { + case MATCH_ANY: + for (p = string; p <= end; p++) + { + if (match_pattern_char (pat, p)) + { + for (p1 = end; p1 >= p; p1--) + { + c = *p1; *p1 = '\0'; + if (strmatch (pat, p, FNMATCH_EXTFLAG) == 0) + { + *p1 = c; + *sp = p; + *ep = p1; + return 1; + } + *p1 = c; + } + } + } + + return (0); + + case MATCH_BEG: + if (match_pattern_char (pat, string) == 0) + return (0); + + for (p = end; p >= string; p--) + { + c = *p; *p = '\0'; + if (strmatch (pat, string, FNMATCH_EXTFLAG) == 0) + { + *p = c; + *sp = string; + *ep = p; + return 1; + } + *p = c; + } + + return (0); + + case MATCH_END: + for (p = string; p <= end; p++) + { + if (strmatch (pat, p, FNMATCH_EXTFLAG) == 0) + { + *sp = p; + *ep = end; + return 1; + } + + } + + return (0); + } + + return (0); +} + +#if defined (HANDLE_MULTIBYTE) +/* Return 1 of the first character of WSTRING could match the first + character of pattern WPAT. Wide character version. */ +static int +match_pattern_wchar (wpat, wstring) + wchar_t *wpat, *wstring; +{ + wchar_t wc; + + if (*wstring == 0) + return (0); + + switch (wc = *wpat++) + { + default: + return (*wstring == wc); + case L'\\': + return (*wstring == *wpat); + case L'?': + return (*wpat == LPAREN ? 1 : (*wstring != L'\0')); + case L'*': + return (1); + case L'+': + case L'!': + case L'@': + return (*wpat == LPAREN ? 1 : (*wstring == wc)); + case L'[': + return (*wstring != L'\0'); + } +} + +/* Match WPAT anywhere in WSTRING and return the match boundaries. + This returns 1 in case of a successful match, 0 otherwise. Wide + character version. */ +static int +match_wpattern (wstring, indices, wstrlen, wpat, mtype, sp, ep) + wchar_t *wstring; + char **indices; + size_t wstrlen; + wchar_t *wpat; + int mtype; + char **sp, **ep; +{ + wchar_t wc; + int len; +#if 0 + size_t n, n1; /* Apple's gcc seems to miscompile this badly */ +#else + int n, n1; +#endif + + switch (mtype) + { + case MATCH_ANY: + for (n = 0; n <= wstrlen; n++) + { + if (match_pattern_wchar (wpat, wstring + n)) + { + for (n1 = wstrlen; n1 >= n; n1--) + { + wc = wstring[n1]; wstring[n1] = L'\0'; + if (wcsmatch (wpat, wstring + n, FNMATCH_EXTFLAG) == 0) + { + wstring[n1] = wc; + *sp = indices[n]; + *ep = indices[n1]; + return 1; + } + wstring[n1] = wc; + } + } + } + + return (0); + + case MATCH_BEG: + if (match_pattern_wchar (wpat, wstring) == 0) + return (0); + + for (n = wstrlen; n >= 0; n--) + { + wc = wstring[n]; wstring[n] = L'\0'; + if (wcsmatch (wpat, wstring, FNMATCH_EXTFLAG) == 0) + { + wstring[n] = wc; + *sp = indices[0]; + *ep = indices[n]; + return 1; + } + wstring[n] = wc; + } + + return (0); + + case MATCH_END: + for (n = 0; n <= wstrlen; n++) + { + if (wcsmatch (wpat, wstring + n, FNMATCH_EXTFLAG) == 0) + { + *sp = indices[n]; + *ep = indices[wstrlen]; + return 1; + } + } + + return (0); + } + + return (0); +} +#endif /* HANDLE_MULTIBYTE */ + +static int +match_pattern (string, pat, mtype, sp, ep) + char *string, *pat; + int mtype; + char **sp, **ep; +{ +#if defined (HANDLE_MULTIBYTE) + int ret; + size_t n; + wchar_t *wstring, *wpat; + char **indices; +#endif + + if (string == 0 || *string == 0 || pat == 0 || *pat == 0) + return (0); + +#if defined (HANDLE_MULTIBYTE) + if (MB_CUR_MAX > 1) + { + n = xdupmbstowcs (&wpat, NULL, pat); + if (n == (size_t)-1) + return (match_upattern (string, pat, mtype, sp, ep)); + n = xdupmbstowcs (&wstring, &indices, string); + if (n == (size_t)-1) + { + free (wpat); + return (match_upattern (string, pat, mtype, sp, ep)); + } + ret = match_wpattern (wstring, indices, n, wpat, mtype, sp, ep); + + free (wpat); + free (wstring); + free (indices); + + return (ret); + } + else +#endif + return (match_upattern (string, pat, mtype, sp, ep)); +} + +static int +getpatspec (c, value) + int c; + char *value; +{ + if (c == '#') + return ((*value == '#') ? RP_LONG_LEFT : RP_SHORT_LEFT); + else /* c == '%' */ + return ((*value == '%') ? RP_LONG_RIGHT : RP_SHORT_RIGHT); +} + +/* Posix.2 says that the WORD should be run through tilde expansion, + parameter expansion, command substitution and arithmetic expansion. + This leaves the result quoted, so quote_string_for_globbing () has + to be called to fix it up for strmatch (). If QUOTED is non-zero, + it means that the entire expression was enclosed in double quotes. + This means that quoting characters in the pattern do not make any + special pattern characters quoted. For example, the `*' in the + following retains its special meaning: "${foo#'*'}". */ +static char * +getpattern (value, quoted, expandpat) + char *value; + int quoted, expandpat; +{ + char *pat, *tword; + WORD_LIST *l; + int i; + + tword = xstrchr (value, '~') ? bash_tilde_expand (value, 0) : savestring (value); + + /* There is a problem here: how to handle single or double quotes in the + pattern string when the whole expression is between double quotes? + POSIX.2 says that enclosing double quotes do not cause the pattern to + be quoted, but does that leave us a problem with @ and array[@] and their + expansions inside a pattern? */ +#if 0 + if (expandpat && (quoted & (Q_HERE_DOCUMENT|Q_DOUBLE_QUOTES)) && *tword) + { + i = 0; + pat = string_extract_double_quoted (tword, &i, 1); + free (tword); + tword = pat; + } +#endif + + /* expand_string_for_rhs () leaves WORD quoted and does not perform + word splitting. */ + l = *tword ? expand_string_for_rhs (tword, + (quoted & (Q_HERE_DOCUMENT|Q_DOUBLE_QUOTES)) ? Q_PATQUOTE : quoted, + (int *)NULL, (int *)NULL) + : (WORD_LIST *)0; + free (tword); + pat = string_list (l); + dispose_words (l); + if (pat) + { + tword = quote_string_for_globbing (pat, QGLOB_CVTNULL); + free (pat); + pat = tword; + } + return (pat); +} + +#if 0 +/* Handle removing a pattern from a string as a result of ${name%[%]value} + or ${name#[#]value}. */ +static char * +variable_remove_pattern (value, pattern, patspec, quoted) + char *value, *pattern; + int patspec, quoted; +{ + char *tword; + + tword = remove_pattern (value, pattern, patspec); + + return (tword); +} +#endif + +static char * +list_remove_pattern (list, pattern, patspec, itype, quoted) + WORD_LIST *list; + char *pattern; + int patspec, itype, quoted; +{ + WORD_LIST *new, *l; + WORD_DESC *w; + char *tword; + + for (new = (WORD_LIST *)NULL, l = list; l; l = l->next) + { + tword = remove_pattern (l->word->word, pattern, patspec); + w = make_bare_word (tword); + FREE (tword); + new = make_word_list (w, new); + } + + l = REVERSE_LIST (new, WORD_LIST *); + if (itype == '*') +#if 0 + tword = (quoted & (Q_HERE_DOCUMENT|Q_DOUBLE_QUOTES)) ? string_list_dollar_star (l) : string_list (l); +#else + tword = (quoted & Q_DOUBLE_QUOTES) ? string_list_dollar_star (l) : string_list (l); +#endif + else + tword = string_list ((quoted & (Q_HERE_DOCUMENT|Q_DOUBLE_QUOTES)) ? quote_list (l) : l); + + dispose_words (l); + return (tword); +} + +static char * +parameter_list_remove_pattern (itype, pattern, patspec, quoted) + int itype; + char *pattern; + int patspec, quoted; +{ + char *ret; + WORD_LIST *list; + + list = list_rest_of_args (); + if (list == 0) + return ((char *)NULL); + ret = list_remove_pattern (list, pattern, patspec, itype, quoted); + dispose_words (list); + return (ret); +} + +#if defined (ARRAY_VARS) +static char * +array_remove_pattern (a, pattern, patspec, varname, quoted) + ARRAY *a; + char *pattern; + int patspec; + char *varname; /* so we can figure out how it's indexed */ + int quoted; +{ + int itype; + char *ret; + WORD_LIST *list; + SHELL_VAR *v; + + /* compute itype from varname here */ + v = array_variable_part (varname, &ret, 0); + itype = ret[0]; + + list = array_to_word_list (a); + if (list == 0) + return ((char *)NULL); + ret = list_remove_pattern (list, pattern, patspec, itype, quoted); + dispose_words (list); + + return ret; +} +#endif /* ARRAY_VARS */ + +static char * +parameter_brace_remove_pattern (varname, value, patstr, rtype, quoted) + char *varname, *value, *patstr; + int rtype, quoted; +{ + int vtype, patspec, starsub; + char *temp1, *val, *pattern; + SHELL_VAR *v; + + if (value == 0) + return ((char *)NULL); + + this_command_name = varname; + + vtype = get_var_and_type (varname, value, quoted, &v, &val); + if (vtype == -1) + return ((char *)NULL); + + starsub = vtype & VT_STARSUB; + vtype &= ~VT_STARSUB; + + patspec = getpatspec (rtype, patstr); + if (patspec == RP_LONG_LEFT || patspec == RP_LONG_RIGHT) + patstr++; + + pattern = getpattern (patstr, quoted, 1); + + temp1 = (char *)NULL; /* shut up gcc */ + switch (vtype) + { + case VT_VARIABLE: + case VT_ARRAYMEMBER: + temp1 = remove_pattern (val, pattern, patspec); + if (vtype == VT_VARIABLE) + FREE (val); + if (temp1) + { + val = quote_escapes (temp1); + free (temp1); + temp1 = val; + } + break; +#if defined (ARRAY_VARS) + case VT_ARRAYVAR: + temp1 = array_remove_pattern (array_cell (v), pattern, patspec, varname, quoted); + if (temp1 && ((quoted & (Q_HERE_DOCUMENT|Q_DOUBLE_QUOTES)) == 0)) + { + val = quote_escapes (temp1); + free (temp1); + temp1 = val; + } + break; +#endif + case VT_POSPARMS: + temp1 = parameter_list_remove_pattern (varname[0], pattern, patspec, quoted); + if (temp1 && ((quoted & (Q_HERE_DOCUMENT|Q_DOUBLE_QUOTES)) == 0)) + { + val = quote_escapes (temp1); + free (temp1); + temp1 = val; + } + break; + } + + FREE (pattern); + return temp1; +} + +/******************************************* + * * + * Functions to expand WORD_DESCs * + * * + *******************************************/ + +/* Expand WORD, performing word splitting on the result. This does + parameter expansion, command substitution, arithmetic expansion, + word splitting, and quote removal. */ + +WORD_LIST * +expand_word (word, quoted) + WORD_DESC *word; + int quoted; +{ + WORD_LIST *result, *tresult; + + tresult = call_expand_word_internal (word, quoted, 0, (int *)NULL, (int *)NULL); + result = word_list_split (tresult); + dispose_words (tresult); + return (result ? dequote_list (result) : result); +} + +/* Expand WORD, but do not perform word splitting on the result. This + does parameter expansion, command substitution, arithmetic expansion, + and quote removal. */ +WORD_LIST * +expand_word_unsplit (word, quoted) + WORD_DESC *word; + int quoted; +{ + WORD_LIST *result; + + expand_no_split_dollar_star = 1; + result = call_expand_word_internal (word, quoted, 0, (int *)NULL, (int *)NULL); + expand_no_split_dollar_star = 0; + + return (result ? dequote_list (result) : result); +} + +/* Perform shell expansions on WORD, but do not perform word splitting or + quote removal on the result. */ +WORD_LIST * +expand_word_leave_quoted (word, quoted) + WORD_DESC *word; + int quoted; +{ + return (call_expand_word_internal (word, quoted, 0, (int *)NULL, (int *)NULL)); +} + +#if defined (PROCESS_SUBSTITUTION) + +/*****************************************************************/ +/* */ +/* Hacking Process Substitution */ +/* */ +/*****************************************************************/ + +#if !defined (HAVE_DEV_FD) +/* Named pipes must be removed explicitly with `unlink'. This keeps a list + of FIFOs the shell has open. unlink_fifo_list will walk the list and + unlink all of them. add_fifo_list adds the name of an open FIFO to the + list. NFIFO is a count of the number of FIFOs in the list. */ +#define FIFO_INCR 20 + +struct temp_fifo { + char *file; + pid_t proc; +}; + +static struct temp_fifo *fifo_list = (struct temp_fifo *)NULL; +static int nfifo; +static int fifo_list_size; + +static void +add_fifo_list (pathname) + char *pathname; +{ + if (nfifo >= fifo_list_size - 1) + { + fifo_list_size += FIFO_INCR; + fifo_list = (struct temp_fifo *)xrealloc (fifo_list, + fifo_list_size * sizeof (struct temp_fifo)); + } + + fifo_list[nfifo].file = savestring (pathname); + nfifo++; +} + +void +unlink_fifo_list () +{ + int saved, i, j; + + if (nfifo == 0) + return; + + for (i = saved = 0; i < nfifo; i++) + { + if ((fifo_list[i].proc == -1) || (kill(fifo_list[i].proc, 0) == -1)) + { + unlink (fifo_list[i].file); + free (fifo_list[i].file); + fifo_list[i].file = (char *)NULL; + fifo_list[i].proc = -1; + } + else + saved++; + } + + /* If we didn't remove some of the FIFOs, compact the list. */ + if (saved) + { + for (i = j = 0; i < nfifo; i++) + if (fifo_list[i].file) + { + fifo_list[j].file = fifo_list[i].file; + fifo_list[j].proc = fifo_list[i].proc; + j++; + } + nfifo = j; + } + else + nfifo = 0; +} + +static char * +make_named_pipe () +{ + char *tname; + + tname = sh_mktmpname ("sh-np", MT_USERANDOM); + if (mkfifo (tname, 0600) < 0) + { + free (tname); + return ((char *)NULL); + } + + add_fifo_list (tname); + return (tname); +} + +#else /* HAVE_DEV_FD */ + +/* DEV_FD_LIST is a bitmap of file descriptors attached to pipes the shell + has open to children. NFDS is a count of the number of bits currently + set in DEV_FD_LIST. TOTFDS is a count of the highest possible number + of open files. */ +static char *dev_fd_list = (char *)NULL; +static int nfds; +static int totfds; /* The highest possible number of open files. */ + +static void +add_fifo_list (fd) + int fd; +{ + if (!dev_fd_list || fd >= totfds) + { + int ofds; + + ofds = totfds; + totfds = getdtablesize (); + if (totfds < 0 || totfds > 256) + totfds = 256; + if (fd > totfds) + totfds = fd + 2; + + dev_fd_list = (char *)xrealloc (dev_fd_list, totfds); + memset (dev_fd_list + ofds, '\0', totfds - ofds); + } + + dev_fd_list[fd] = 1; + nfds++; +} + +void +unlink_fifo_list () +{ + register int i; + + if (nfds == 0) + return; + + for (i = 0; nfds && i < totfds; i++) + if (dev_fd_list[i]) + { + close (i); + dev_fd_list[i] = 0; + nfds--; + } + + nfds = 0; +} + +#if defined (NOTDEF) +print_dev_fd_list () +{ + register int i; + + fprintf (stderr, "pid %ld: dev_fd_list:", (long)getpid ()); + fflush (stderr); + + for (i = 0; i < totfds; i++) + { + if (dev_fd_list[i]) + fprintf (stderr, " %d", i); + } + fprintf (stderr, "\n"); +} +#endif /* NOTDEF */ + +static char * +make_dev_fd_filename (fd) + int fd; +{ + char *ret, intbuf[INT_STRLEN_BOUND (int) + 1], *p; + + ret = (char *)xmalloc (sizeof (DEV_FD_PREFIX) + 4); + + strcpy (ret, DEV_FD_PREFIX); + p = inttostr (fd, intbuf, sizeof (intbuf)); + strcpy (ret + sizeof (DEV_FD_PREFIX) - 1, p); + + add_fifo_list (fd); + return (ret); +} + +#endif /* HAVE_DEV_FD */ + +/* Return a filename that will open a connection to the process defined by + executing STRING. HAVE_DEV_FD, if defined, means open a pipe and return + a filename in /dev/fd corresponding to a descriptor that is one of the + ends of the pipe. If not defined, we use named pipes on systems that have + them. Systems without /dev/fd and named pipes are out of luck. + + OPEN_FOR_READ_IN_CHILD, if 1, means open the named pipe for reading or + use the read end of the pipe and dup that file descriptor to fd 0 in + the child. If OPEN_FOR_READ_IN_CHILD is 0, we open the named pipe for + writing or use the write end of the pipe in the child, and dup that + file descriptor to fd 1 in the child. The parent does the opposite. */ + +static char * +process_substitute (string, open_for_read_in_child) + char *string; + int open_for_read_in_child; +{ + char *pathname; + int fd, result; + pid_t old_pid, pid; +#if defined (HAVE_DEV_FD) + int parent_pipe_fd, child_pipe_fd; + int fildes[2]; +#endif /* HAVE_DEV_FD */ +#if defined (JOB_CONTROL) + pid_t old_pipeline_pgrp; +#endif + + if (!string || !*string || wordexp_only) + return ((char *)NULL); + +#if !defined (HAVE_DEV_FD) + pathname = make_named_pipe (); +#else /* HAVE_DEV_FD */ + if (pipe (fildes) < 0) + { + sys_error (_("cannot make pipe for process substitution")); + return ((char *)NULL); + } + /* If OPEN_FOR_READ_IN_CHILD == 1, we want to use the write end of + the pipe in the parent, otherwise the read end. */ + parent_pipe_fd = fildes[open_for_read_in_child]; + child_pipe_fd = fildes[1 - open_for_read_in_child]; + /* Move the parent end of the pipe to some high file descriptor, to + avoid clashes with FDs used by the script. */ + parent_pipe_fd = move_to_high_fd (parent_pipe_fd, 1, 64); + + pathname = make_dev_fd_filename (parent_pipe_fd); +#endif /* HAVE_DEV_FD */ + + if (!pathname) + { + sys_error (_("cannot make pipe for process substitution")); + return ((char *)NULL); + } + + old_pid = last_made_pid; + +#if defined (JOB_CONTROL) + old_pipeline_pgrp = pipeline_pgrp; + pipeline_pgrp = shell_pgrp; + save_pipeline (1); +#endif /* JOB_CONTROL */ + + pid = make_child ((char *)NULL, 1); + if (pid == 0) + { + reset_terminating_signals (); /* XXX */ + free_pushed_string_input (); + /* Cancel traps, in trap.c. */ + restore_original_signals (); + setup_async_signals (); + subshell_environment |= SUBSHELL_COMSUB; + } + +#if defined (JOB_CONTROL) + set_sigchld_handler (); + stop_making_children (); + pipeline_pgrp = old_pipeline_pgrp; +#endif /* JOB_CONTROL */ + + if (pid < 0) + { + sys_error (_("cannot make child for process substitution")); + free (pathname); +#if defined (HAVE_DEV_FD) + close (parent_pipe_fd); + close (child_pipe_fd); +#endif /* HAVE_DEV_FD */ + return ((char *)NULL); + } + + if (pid > 0) + { +#if defined (JOB_CONTROL) + restore_pipeline (1); +#endif + +#if !defined (HAVE_DEV_FD) + fifo_list[nfifo-1].proc = pid; +#endif + + last_made_pid = old_pid; + +#if defined (JOB_CONTROL) && defined (PGRP_PIPE) + close_pgrp_pipe (); +#endif /* JOB_CONTROL && PGRP_PIPE */ + +#if defined (HAVE_DEV_FD) + close (child_pipe_fd); +#endif /* HAVE_DEV_FD */ + + return (pathname); + } + + set_sigint_handler (); + +#if defined (JOB_CONTROL) + set_job_control (0); +#endif /* JOB_CONTROL */ + +#if !defined (HAVE_DEV_FD) + /* Open the named pipe in the child. */ + fd = open (pathname, open_for_read_in_child ? O_RDONLY|O_NONBLOCK : O_WRONLY); + if (fd < 0) + { + /* Two separate strings for ease of translation. */ + if (open_for_read_in_child) + sys_error (_("cannot open named pipe %s for reading"), pathname); + else + sys_error (_("cannot open named pipe %s for writing"), pathname); + + exit (127); + } + if (open_for_read_in_child) + { + if (sh_unset_nodelay_mode (fd) < 0) + { + sys_error (_("cannout reset nodelay mode for fd %d"), fd); + exit (127); + } + } +#else /* HAVE_DEV_FD */ + fd = child_pipe_fd; +#endif /* HAVE_DEV_FD */ + + if (dup2 (fd, open_for_read_in_child ? 0 : 1) < 0) + { + sys_error (_("cannot duplicate named pipe %s as fd %d"), pathname, + open_for_read_in_child ? 0 : 1); + exit (127); + } + + if (fd != (open_for_read_in_child ? 0 : 1)) + close (fd); + + /* Need to close any files that this process has open to pipes inherited + from its parent. */ + if (current_fds_to_close) + { + close_fd_bitmap (current_fds_to_close); + current_fds_to_close = (struct fd_bitmap *)NULL; + } + +#if defined (HAVE_DEV_FD) + /* Make sure we close the parent's end of the pipe and clear the slot + in the fd list so it is not closed later, if reallocated by, for + instance, pipe(2). */ + close (parent_pipe_fd); + dev_fd_list[parent_pipe_fd] = 0; +#endif /* HAVE_DEV_FD */ + + result = parse_and_execute (string, "process substitution", (SEVAL_NONINT|SEVAL_NOHIST)); + +#if !defined (HAVE_DEV_FD) + /* Make sure we close the named pipe in the child before we exit. */ + close (open_for_read_in_child ? 0 : 1); +#endif /* !HAVE_DEV_FD */ + + exit (result); + /*NOTREACHED*/ +} +#endif /* PROCESS_SUBSTITUTION */ + +/***********************************/ +/* */ +/* Command Substitution */ +/* */ +/***********************************/ + +static char * +read_comsub (fd, quoted) + int fd, quoted; +{ + char *istring, buf[128], *bufp; + int istring_index, istring_size, c; + ssize_t bufn; + + istring = (char *)NULL; + istring_index = istring_size = bufn = 0; + +#ifdef __CYGWIN__ + setmode (fd, O_TEXT); /* we don't want CR/LF, we want Unix-style */ +#endif + + /* Read the output of the command through the pipe. */ + while (1) + { + if (fd < 0) + break; + if (--bufn <= 0) + { + bufn = zread (fd, buf, sizeof (buf)); + if (bufn <= 0) + break; + bufp = buf; + } + c = *bufp++; + + if (c == 0) + { +#if 0 + internal_warning ("read_comsub: ignored null byte in input"); +#endif + continue; + } + + /* Add the character to ISTRING, possibly after resizing it. */ + RESIZE_MALLOCED_BUFFER (istring, istring_index, 2, istring_size, DEFAULT_ARRAY_SIZE); + + if ((quoted & (Q_HERE_DOCUMENT|Q_DOUBLE_QUOTES)) || c == CTLESC || c == CTLNUL) + istring[istring_index++] = CTLESC; + + istring[istring_index++] = c; + +#if 0 +#if defined (__CYGWIN__) + if (c == '\n' && istring_index > 1 && istring[istring_index - 2] == '\r') + { + istring_index--; + istring[istring_index - 1] = '\n'; + } +#endif +#endif + } + + if (istring) + istring[istring_index] = '\0'; + + /* If we read no output, just return now and save ourselves some + trouble. */ + if (istring_index == 0) + { + FREE (istring); + return (char *)NULL; + } + + /* Strip trailing newlines from the output of the command. */ + if (quoted & (Q_HERE_DOCUMENT|Q_DOUBLE_QUOTES)) + { + while (istring_index > 0) + { + if (istring[istring_index - 1] == '\n') + { + --istring_index; + + /* If the newline was quoted, remove the quoting char. */ + if (istring[istring_index - 1] == CTLESC) + --istring_index; + } + else + break; + } + istring[istring_index] = '\0'; + } + else + strip_trailing (istring, istring_index - 1, 1); + + return istring; +} + +/* Perform command substitution on STRING. This returns a string, + possibly quoted. */ +char * +command_substitute (string, quoted) + char *string; + int quoted; +{ + pid_t pid, old_pid, old_pipeline_pgrp; + char *istring; + int result, fildes[2], function_value, pflags, rc; + + istring = (char *)NULL; + + /* Don't fork () if there is no need to. In the case of no command to + run, just return NULL. */ + if (!string || !*string || (string[0] == '\n' && !string[1])) + return ((char *)NULL); + + if (wordexp_only && read_but_dont_execute) + { + last_command_exit_value = 125; + jump_to_top_level (EXITPROG); + } + + /* We're making the assumption here that the command substitution will + eventually run a command from the file system. Since we'll run + maybe_make_export_env in this subshell before executing that command, + the parent shell and any other shells it starts will have to remake + the environment. If we make it before we fork, other shells won't + have to. Don't bother if we have any temporary variable assignments, + though, because the export environment will be remade after this + command completes anyway, but do it if all the words to be expanded + are variable assignments. */ + if (subst_assign_varlist == 0 || garglist == 0) + maybe_make_export_env (); /* XXX */ + + /* Flags to pass to parse_and_execute() */ + pflags = interactive ? SEVAL_RESETLINE : 0; + + /* Pipe the output of executing STRING into the current shell. */ + if (pipe (fildes) < 0) + { + sys_error (_("cannot make pipe for command substitution")); + goto error_exit; + } + + old_pid = last_made_pid; +#if defined (JOB_CONTROL) + old_pipeline_pgrp = pipeline_pgrp; + /* Don't reset the pipeline pgrp if we're already a subshell in a pipeline. */ + if ((subshell_environment & SUBSHELL_PIPE) == 0) + pipeline_pgrp = shell_pgrp; + cleanup_the_pipeline (); +#endif + + pid = make_child ((char *)NULL, 0); + if (pid == 0) + /* Reset the signal handlers in the child, but don't free the + trap strings. */ + reset_signal_handlers (); + +#if defined (JOB_CONTROL) + set_sigchld_handler (); + stop_making_children (); + pipeline_pgrp = old_pipeline_pgrp; +#else + stop_making_children (); +#endif /* JOB_CONTROL */ + + if (pid < 0) + { + sys_error (_("cannot make child for command substitution")); + error_exit: + + FREE (istring); + close (fildes[0]); + close (fildes[1]); + return ((char *)NULL); + } + + if (pid == 0) + { + set_sigint_handler (); /* XXX */ + + free_pushed_string_input (); + + if (dup2 (fildes[1], 1) < 0) + { + sys_error (_("command_substitute: cannot duplicate pipe as fd 1")); + exit (EXECUTION_FAILURE); + } + + /* If standard output is closed in the parent shell + (such as after `exec >&-'), file descriptor 1 will be + the lowest available file descriptor, and end up in + fildes[0]. This can happen for stdin and stderr as well, + but stdout is more important -- it will cause no output + to be generated from this command. */ + if ((fildes[1] != fileno (stdin)) && + (fildes[1] != fileno (stdout)) && + (fildes[1] != fileno (stderr))) + close (fildes[1]); + + if ((fildes[0] != fileno (stdin)) && + (fildes[0] != fileno (stdout)) && + (fildes[0] != fileno (stderr))) + close (fildes[0]); + + /* The currently executing shell is not interactive. */ + interactive = 0; + + /* This is a subshell environment. */ + subshell_environment |= SUBSHELL_COMSUB; + + /* When not in POSIX mode, command substitution does not inherit + the -e flag. */ + if (posixly_correct == 0) + exit_immediately_on_error = 0; + + remove_quoted_escapes (string); + + startup_state = 2; /* see if we can avoid a fork */ + /* Give command substitution a place to jump back to on failure, + so we don't go back up to main (). */ + result = setjmp (top_level); + + /* If we're running a command substitution inside a shell function, + trap `return' so we don't return from the function in the subshell + and go off to never-never land. */ + if (result == 0 && return_catch_flag) + function_value = setjmp (return_catch); + else + function_value = 0; + + if (result == ERREXIT) + rc = last_command_exit_value; + else if (result == EXITPROG) + rc = last_command_exit_value; + else if (result) + rc = EXECUTION_FAILURE; + else if (function_value) + rc = return_catch_value; + else + { + subshell_level++; + rc = parse_and_execute (string, "command substitution", pflags|SEVAL_NOHIST); + subshell_level--; + } + + last_command_exit_value = rc; + rc = run_exit_trap (); + exit (rc); + } + else + { +#if defined (JOB_CONTROL) && defined (PGRP_PIPE) + close_pgrp_pipe (); +#endif /* JOB_CONTROL && PGRP_PIPE */ + + close (fildes[1]); + + istring = read_comsub (fildes[0], quoted); + + close (fildes[0]); + + current_command_subst_pid = pid; + last_command_exit_value = wait_for (pid); + last_command_subst_pid = pid; + last_made_pid = old_pid; + +#if defined (JOB_CONTROL) + /* If last_command_exit_value > 128, then the substituted command + was terminated by a signal. If that signal was SIGINT, then send + SIGINT to ourselves. This will break out of loops, for instance. */ + if (last_command_exit_value == (128 + SIGINT) && last_command_exit_signal == SIGINT) + kill (getpid (), SIGINT); + + /* wait_for gives the terminal back to shell_pgrp. If some other + process group should have it, give it away to that group here. + pipeline_pgrp is non-zero only while we are constructing a + pipline, so what we are concerned about is whether or not that + pipeline was started in the background. A pipeline started in + the background should never get the tty back here. */ +#if 0 + if (interactive && pipeline_pgrp != (pid_t)0 && pipeline_pgrp != last_asynchronous_pid) +#else + if (interactive && pipeline_pgrp != (pid_t)0 && (subshell_environment & SUBSHELL_ASYNC) == 0) +#endif + give_terminal_to (pipeline_pgrp, 0); +#endif /* JOB_CONTROL */ + + return (istring); + } +} + +/******************************************************** + * * + * Utility functions for parameter expansion * + * * + ********************************************************/ + +#if defined (ARRAY_VARS) + +static arrayind_t +array_length_reference (s) + char *s; +{ + int len; + arrayind_t ind; + char *t, c; + ARRAY *array; + SHELL_VAR *var; + + var = array_variable_part (s, &t, &len); + + /* If unbound variables should generate an error, report one and return + failure. */ + if ((var == 0 || array_p (var) == 0) && unbound_vars_is_error) + { + c = *--t; + *t = '\0'; + err_unboundvar (s); + *t = c; + return (-1); + } + else if (var == 0) + return 0; + + /* We support a couple of expansions for variables that are not arrays. + We'll return the length of the value for v[0], and 1 for v[@] or + v[*]. Return 0 for everything else. */ + + array = array_p (var) ? array_cell (var) : (ARRAY *)NULL; + + if (ALL_ELEMENT_SUB (t[0]) && t[1] == ']') + return (array_p (var) ? array_num_elements (array) : 1); + + ind = array_expand_index (t, len); + if (ind < 0) + { + err_badarraysub (t); + return (-1); + } + + if (array_p (var)) + t = array_reference (array, ind); + else + t = (ind == 0) ? value_cell (var) : (char *)NULL; + + len = STRLEN (t); + return (len); +} +#endif /* ARRAY_VARS */ + +static int +valid_brace_expansion_word (name, var_is_special) + char *name; + int var_is_special; +{ + if (DIGIT (*name) && all_digits (name)) + return 1; + else if (var_is_special) + return 1; +#if defined (ARRAY_VARS) + else if (valid_array_reference (name)) + return 1; +#endif /* ARRAY_VARS */ + else if (legal_identifier (name)) + return 1; + else + return 0; +} + +static int +chk_atstar (name, quoted, quoted_dollar_atp, contains_dollar_at) + char *name; + int quoted; + int *quoted_dollar_atp, *contains_dollar_at; +{ + char *temp1; + + if (name == 0) + { + if (quoted_dollar_atp) + *quoted_dollar_atp = 0; + if (contains_dollar_at) + *contains_dollar_at = 0; + return 0; + } + + /* check for $@ and $* */ + if (name[0] == '@' && name[1] == 0) + { + if ((quoted & (Q_HERE_DOCUMENT|Q_DOUBLE_QUOTES)) && quoted_dollar_atp) + *quoted_dollar_atp = 1; + if (contains_dollar_at) + *contains_dollar_at = 1; + return 1; + } + else if (name[0] == '*' && name[1] == '\0' && quoted == 0) + { + if (contains_dollar_at) + *contains_dollar_at = 1; + return 1; + } + + /* Now check for ${array[@]} and ${array[*]} */ +#if defined (ARRAY_VARS) + else if (valid_array_reference (name)) + { + temp1 = xstrchr (name, '['); + if (temp1 && temp1[1] == '@' && temp1[2] == ']') + { + if ((quoted & (Q_HERE_DOCUMENT|Q_DOUBLE_QUOTES)) && quoted_dollar_atp) + *quoted_dollar_atp = 1; + if (contains_dollar_at) + *contains_dollar_at = 1; + return 1; + } /* [ */ + /* ${array[*]}, when unquoted, should be treated like ${array[@]}, + which should result in separate words even when IFS is unset. */ + if (temp1 && temp1[1] == '*' && temp1[2] == ']' && quoted == 0) + { + if (contains_dollar_at) + *contains_dollar_at = 1; + return 1; + } + } +#endif + return 0; +} + +/* Parameter expand NAME, and return a new string which is the expansion, + or NULL if there was no expansion. + VAR_IS_SPECIAL is non-zero if NAME is one of the special variables in + the shell, e.g., "@", "$", "*", etc. QUOTED, if non-zero, means that + NAME was found inside of a double-quoted expression. */ +static char * +parameter_brace_expand_word (name, var_is_special, quoted) + char *name; + int var_is_special, quoted; +{ + char *temp, *tt; + intmax_t arg_index; + SHELL_VAR *var; + int atype; + + /* Handle multiple digit arguments, as in ${11}. */ + + if (legal_number (name, &arg_index)) + { + tt = get_dollar_var_value (arg_index); + if (tt) + temp = (*tt && (quoted & (Q_DOUBLE_QUOTES|Q_HERE_DOCUMENT))) + ? quote_string (tt) + : quote_escapes (tt); + else + temp = (char *)NULL; + FREE (tt); + } + else if (var_is_special) /* ${@} */ + { + int sindex; + tt = (char *)xmalloc (2 + strlen (name)); + tt[sindex = 0] = '$'; + strcpy (tt + 1, name); + + temp = param_expand (tt, &sindex, quoted, (int *)NULL, (int *)NULL, + (int *)NULL, (int *)NULL, 0); + free (tt); + } +#if defined (ARRAY_VARS) + else if (valid_array_reference (name)) + { + temp = array_value (name, quoted, &atype); + if (atype == 0 && temp) + temp = (*temp && (quoted & (Q_DOUBLE_QUOTES|Q_HERE_DOCUMENT))) + ? quote_string (temp) + : quote_escapes (temp); + } +#endif + else if (var = find_variable (name)) + { + if (var_isset (var) && invisible_p (var) == 0) + { +#if defined (ARRAY_VARS) + temp = array_p (var) ? array_reference (array_cell (var), 0) : value_cell (var); +#else + temp = value_cell (var); +#endif + + if (temp) + temp = (*temp && (quoted & (Q_DOUBLE_QUOTES|Q_HERE_DOCUMENT))) + ? quote_string (temp) + : quote_escapes (temp); + } + else + temp = (char *)NULL; + } + else + temp = (char *)NULL; + + return (temp); +} + +/* Expand an indirect reference to a variable: ${!NAME} expands to the + value of the variable whose name is the value of NAME. */ +static char * +parameter_brace_expand_indir (name, var_is_special, quoted, quoted_dollar_atp, contains_dollar_at) + char *name; + int var_is_special, quoted; + int *quoted_dollar_atp, *contains_dollar_at; +{ + char *temp, *t; + + t = parameter_brace_expand_word (name, var_is_special, quoted); + /* Have to dequote here if necessary */ + if (t) + { + temp = (quoted & (Q_DOUBLE_QUOTES|Q_HERE_DOCUMENT)) + ? dequote_string (t) + : dequote_escapes (t); + free (t); + t = temp; + } + chk_atstar (t, quoted, quoted_dollar_atp, contains_dollar_at); + if (t == 0) + return (t); + temp = parameter_brace_expand_word (t, SPECIAL_VAR(t, 0), quoted); + free (t); + return temp; +} + +/* Expand the right side of a parameter expansion of the form ${NAMEcVALUE}, + depending on the value of C, the separating character. C can be one of + "-", "+", or "=". QUOTED is true if the entire brace expression occurs + between double quotes. */ +static char * +parameter_brace_expand_rhs (name, value, c, quoted, qdollaratp, hasdollarat) + char *name, *value; + int c, quoted, *qdollaratp, *hasdollarat; +{ + WORD_LIST *l; + char *t, *t1, *temp; + int hasdol; + + /* XXX - Should we tilde expand in an assignment context if C is `='? */ + if (*value == '~') + temp = bash_tilde_expand (value, 0); + else if (xstrchr (value, '~') && unquoted_substring ("=~", value)) + temp = bash_tilde_expand (value, 1); + else + temp = savestring (value); + + /* If the entire expression is between double quotes, we want to treat + the value as a double-quoted string, with the exception that we strip + embedded unescaped double quotes. */ + if ((quoted & (Q_HERE_DOCUMENT|Q_DOUBLE_QUOTES)) && *temp) + { + hasdol = 0; + t = string_extract_double_quoted (temp, &hasdol, 1); + free (temp); + temp = t; + } + + hasdol = 0; + /* XXX was 0 not quoted */ + l = *temp ? expand_string_for_rhs (temp, quoted, &hasdol, (int *)NULL) + : (WORD_LIST *)0; + if (hasdollarat) + *hasdollarat = hasdol || (l && l->next); + free (temp); + if (l) + { + /* The expansion of TEMP returned something. We need to treat things + slightly differently if HASDOL is non-zero. If we have "$@", the + individual words have already been quoted. We need to turn them + into a string with the words separated by the first character of + $IFS without any additional quoting, so string_list_dollar_at won't + do the right thing. We use string_list_dollar_star instead. */ + temp = (hasdol || l->next) ? string_list_dollar_star (l) : string_list (l); + + /* If l->next is not null, we know that TEMP contained "$@", since that + is the only expansion that creates more than one word. */ + if (qdollaratp && ((hasdol && quoted) || l->next)) + *qdollaratp = 1; + dispose_words (l); + } + else if ((quoted & (Q_HERE_DOCUMENT|Q_DOUBLE_QUOTES)) && hasdol) + { + /* The brace expansion occurred between double quotes and there was + a $@ in TEMP. It does not matter if the $@ is quoted, as long as + it does not expand to anything. In this case, we want to return + a quoted empty string. */ + temp = (char *)xmalloc (2); + temp[0] = CTLNUL; + temp[1] = '\0'; + } + else + temp = (char *)NULL; + + if (c == '-' || c == '+') + return (temp); + + /* c == '=' */ + t = temp ? savestring (temp) : savestring (""); + t1 = dequote_string (t); + free (t); +#if defined (ARRAY_VARS) + if (valid_array_reference (name)) + assign_array_element (name, t1); + else +#endif /* ARRAY_VARS */ + bind_variable (name, t1); + free (t1); + return (temp); +} + +/* Deal with the right hand side of a ${name:?value} expansion in the case + that NAME is null or not set. If VALUE is non-null it is expanded and + used as the error message to print, otherwise a standard message is + printed. */ +static void +parameter_brace_expand_error (name, value) + char *name, *value; +{ + WORD_LIST *l; + char *temp; + + if (value && *value) + { + if (*value == '~') + temp = bash_tilde_expand (value, 0); + else if (xstrchr (value, '~') && unquoted_substring ("=~", value)) + temp = bash_tilde_expand (value, 1); + else + temp = savestring (value); + + l = expand_string (temp, 0); + FREE (temp); + temp = string_list (l); + report_error ("%s: %s", name, temp ? temp : ""); /* XXX was value not "" */ + FREE (temp); + dispose_words (l); + } + else + report_error (_("%s: parameter null or not set"), name); + + /* Free the data we have allocated during this expansion, since we + are about to longjmp out. */ + free (name); + FREE (value); +} + +/* Return 1 if NAME is something for which parameter_brace_expand_length is + OK to do. */ +static int +valid_length_expression (name) + char *name; +{ + return (name[1] == '\0' || /* ${#} */ + ((sh_syntaxtab[(unsigned char) name[1]] & CSPECVAR) && name[2] == '\0') || /* special param */ + (DIGIT (name[1]) && all_digits (name + 1)) || /* ${#11} */ +#if defined (ARRAY_VARS) + valid_array_reference (name + 1) || /* ${#a[7]} */ +#endif + legal_identifier (name + 1)); /* ${#PS1} */ +} + +/* Handle the parameter brace expansion that requires us to return the + length of a parameter. */ +static intmax_t +parameter_brace_expand_length (name) + char *name; +{ + char *t, *newname; + intmax_t number, arg_index; + WORD_LIST *list; +#if defined (ARRAY_VARS) + SHELL_VAR *var; +#endif + + if (name[1] == '\0') /* ${#} */ + number = number_of_args (); + else if ((name[1] == '@' || name[1] == '*') && name[2] == '\0') /* ${#@}, ${#*} */ + number = number_of_args (); + else if ((sh_syntaxtab[(unsigned char) name[1]] & CSPECVAR) && name[2] == '\0') + { + /* Take the lengths of some of the shell's special parameters. */ + switch (name[1]) + { + case '-': + t = which_set_flags (); + break; + case '?': + t = itos (last_command_exit_value); + break; + case '$': + t = itos (dollar_dollar_pid); + break; + case '!': + if (last_asynchronous_pid == NO_PID) + t = (char *)NULL; + else + t = itos (last_asynchronous_pid); + break; + case '#': + t = itos (number_of_args ()); + break; + } + number = STRLEN (t); + FREE (t); + } +#if defined (ARRAY_VARS) + else if (valid_array_reference (name + 1)) + number = array_length_reference (name + 1); +#endif /* ARRAY_VARS */ + else + { + number = 0; + + if (legal_number (name + 1, &arg_index)) /* ${#1} */ + { + t = get_dollar_var_value (arg_index); + number = STRLEN (t); + FREE (t); + } +#if defined (ARRAY_VARS) + else if ((var = find_variable (name + 1)) && array_p (var)) + { + t = array_reference (array_cell (var), 0); + number = STRLEN (t); + } +#endif + else /* ${#PS1} */ + { + newname = savestring (name); + newname[0] = '$'; + list = expand_string (newname, Q_DOUBLE_QUOTES); + t = list ? string_list (list) : (char *)NULL; + free (newname); + if (list) + dispose_words (list); + + number = STRLEN (t); + FREE (t); + } + } + + return (number); +} + +/* Skip characters in SUBSTR until DELIM. SUBSTR is an arithmetic expression, + so we do some ad-hoc parsing of an arithmetic expression to find + the first DELIM, instead of using strchr(3). Two rules: + 1. If the substring contains a `(', read until closing `)'. + 2. If the substring contains a `?', read past one `:' for each `?'. +*/ + +static char * +skiparith (substr, delim) + char *substr; + int delim; +{ + size_t sublen; + int skipcol, pcount, i; + DECLARE_MBSTATE; + + sublen = strlen (substr); + i = skipcol = pcount = 0; + while (substr[i]) + { + /* Balance parens */ + if (substr[i] == LPAREN) + { + pcount++; + i++; + continue; + } + if (substr[i] == RPAREN && pcount) + { + pcount--; + i++; + continue; + } + if (pcount) + { + ADVANCE_CHAR (substr, sublen, i); + continue; + } + + /* Skip one `:' for each `?' */ + if (substr[i] == ':' && skipcol) + { + skipcol--; + i++; + continue; + } + if (substr[i] == delim) + break; + if (substr[i] == '?') + { + skipcol++; + i++; + continue; + } + ADVANCE_CHAR (substr, sublen, i); + } + + return (substr + i); +} + +/* Verify and limit the start and end of the desired substring. If + VTYPE == 0, a regular shell variable is being used; if it is 1, + then the positional parameters are being used; if it is 2, then + VALUE is really a pointer to an array variable that should be used. + Return value is 1 if both values were OK, 0 if there was a problem + with an invalid expression, or -1 if the values were out of range. */ +static int +verify_substring_values (value, substr, vtype, e1p, e2p) + char *value, *substr; + int vtype; + intmax_t *e1p, *e2p; +{ + char *t, *temp1, *temp2; + arrayind_t len; + int expok; +#if defined (ARRAY_VARS) + ARRAY *a; +#endif + + /* duplicate behavior of strchr(3) */ + t = skiparith (substr, ':'); + if (*t && *t == ':') + *t = '\0'; + else + t = (char *)0; + + temp1 = expand_string_if_necessary (substr, Q_DOUBLE_QUOTES, expand_string); + *e1p = evalexp (temp1, &expok); + free (temp1); + if (expok == 0) + return (0); + + len = -1; /* paranoia */ + switch (vtype) + { + case VT_VARIABLE: + case VT_ARRAYMEMBER: + len = strlen (value); + break; + case VT_POSPARMS: + len = number_of_args () + 1; + break; +#if defined (ARRAY_VARS) + case VT_ARRAYVAR: + a = (ARRAY *)value; + /* For arrays, the first value deals with array indices. */ + len = array_max_index (a); /* arrays index from 0 to n - 1 */ + break; +#endif + } + + if (len == -1) /* paranoia */ + return -1; + + if (*e1p < 0) /* negative offsets count from end */ + *e1p += len; + + if (*e1p >= len || *e1p < 0) + return (-1); + +#if defined (ARRAY_VARS) + /* For arrays, the second offset deals with the number of elements. */ + if (vtype == VT_ARRAYVAR) + len = array_num_elements (a); +#endif + + if (t) + { + t++; + temp2 = savestring (t); + temp1 = expand_string_if_necessary (temp2, Q_DOUBLE_QUOTES, expand_string); + free (temp2); + t[-1] = ':'; + *e2p = evalexp (temp1, &expok); + free (temp1); + if (expok == 0) + return (0); + if (*e2p < 0) + { + internal_error (_("%s: substring expression < 0"), t); + return (0); + } +#if defined (ARRAY_VARS) + /* In order to deal with sparse arrays, push the intelligence about how + to deal with the number of elements desired down to the array- + specific functions. */ + if (vtype != VT_ARRAYVAR) +#endif + { + *e2p += *e1p; /* want E2 chars starting at E1 */ + if (*e2p > len) + *e2p = len; + } + } + else + *e2p = len; + + return (1); +} + +/* Return the type of variable specified by VARNAME (simple variable, + positional param, or array variable). Also return the value specified + by VARNAME (value of a variable or a reference to an array element). + If this returns VT_VARIABLE, the caller assumes that CTLESC and CTLNUL + characters in the value are quoted with CTLESC and takes appropriate + steps. For convenience, *VALP is set to the dequoted VALUE. */ +static int +get_var_and_type (varname, value, quoted, varp, valp) + char *varname, *value; + int quoted; + SHELL_VAR **varp; + char **valp; +{ + int vtype; + char *temp; +#if defined (ARRAY_VARS) + SHELL_VAR *v; +#endif + + /* This sets vtype to VT_VARIABLE or VT_POSPARMS */ + vtype = (varname[0] == '@' || varname[0] == '*') && varname[1] == '\0'; + if (vtype == VT_POSPARMS && varname[0] == '*') + vtype |= VT_STARSUB; + *varp = (SHELL_VAR *)NULL; + +#if defined (ARRAY_VARS) + if (valid_array_reference (varname)) + { + v = array_variable_part (varname, &temp, (int *)0); + if (v && array_p (v)) + { /* [ */ + if (ALL_ELEMENT_SUB (temp[0]) && temp[1] == ']') + { + vtype = VT_ARRAYVAR; + if (temp[0] == '*') + vtype |= VT_STARSUB; + *valp = (char *)array_cell (v); + } + else + { + vtype = VT_ARRAYMEMBER; + *valp = array_value (varname, 1, (int *)NULL); + } + *varp = v; + } + else + return -1; + } + else if ((v = find_variable (varname)) && array_p (v)) + { + vtype = VT_ARRAYMEMBER; + *varp = v; + *valp = array_reference (array_cell (v), 0); + } + else +#endif +#if 1 + { + if (value && vtype == VT_VARIABLE) + { + if (quoted & (Q_DOUBLE_QUOTES|Q_HERE_DOCUMENT)) + *valp = dequote_string (value); + else + *valp = dequote_escapes (value); + } + else + *valp = value; + } +#else + *valp = (value && vtype == VT_VARIABLE) ? dequote_escapes (value) : value; +#endif + + return vtype; +} + +/******************************************************/ +/* */ +/* Functions to extract substrings of variable values */ +/* */ +/******************************************************/ + +#if defined (HANDLE_MULTIBYTE) +/* Character-oriented rather than strictly byte-oriented substrings. S and + E, rather being strict indices into STRING, indicate character (possibly + multibyte character) positions that require calculation. + Used by the ${param:offset[:length]} expansion. */ +static char * +mb_substring (string, s, e) + char *string; + int s, e; +{ + char *tt; + int start, stop, i, slen; + DECLARE_MBSTATE; + + start = 0; + slen = STRLEN (string); + + i = s; + while (string[start] && i--) + ADVANCE_CHAR (string, slen, start); + stop = start; + i = e - s; + while (string[stop] && i--) + ADVANCE_CHAR (string, slen, stop); + tt = substring (string, start, stop); + return tt; +} +#endif + +/* Process a variable substring expansion: ${name:e1[:e2]}. If VARNAME + is `@', use the positional parameters; otherwise, use the value of + VARNAME. If VARNAME is an array variable, use the array elements. */ + +static char * +parameter_brace_substring (varname, value, substr, quoted) + char *varname, *value, *substr; + int quoted; +{ + intmax_t e1, e2; + int vtype, r, starsub; + char *temp, *val, *tt; + SHELL_VAR *v; + + if (value == 0) + return ((char *)NULL); + + this_command_name = varname; + + vtype = get_var_and_type (varname, value, quoted, &v, &val); + if (vtype == -1) + return ((char *)NULL); + + starsub = vtype & VT_STARSUB; + vtype &= ~VT_STARSUB; + + r = verify_substring_values (val, substr, vtype, &e1, &e2); + if (r <= 0) + return ((r == 0) ? &expand_param_error : (char *)NULL); + + switch (vtype) + { + case VT_VARIABLE: + case VT_ARRAYMEMBER: +#if defined (HANDLE_MULTIBYTE) + if (MB_CUR_MAX > 1) + tt = mb_substring (val, e1, e2); + else +#endif + tt = substring (val, e1, e2); + + if (vtype == VT_VARIABLE) + FREE (val); + if (quoted & (Q_DOUBLE_QUOTES|Q_HERE_DOCUMENT)) + temp = quote_string (tt); + else + temp = tt ? quote_escapes (tt) : (char *)NULL; + FREE (tt); + break; + case VT_POSPARMS: + tt = pos_params (varname, e1, e2, quoted); + if ((quoted & (Q_DOUBLE_QUOTES|Q_HERE_DOCUMENT)) == 0) + { + temp = tt ? quote_escapes (tt) : (char *)NULL; + FREE (tt); + } + else + temp = tt; + break; +#if defined (ARRAY_VARS) + case VT_ARRAYVAR: + /* We want E2 to be the number of elements desired (arrays can be sparse, + so verify_substring_values just returns the numbers specified and we + rely on array_subrange to understand how to deal with them). */ + tt = array_subrange (array_cell (v), e1, e2, starsub, quoted); + if ((quoted & (Q_DOUBLE_QUOTES|Q_HERE_DOCUMENT)) == 0) + { + temp = tt ? quote_escapes (tt) : (char *)NULL; + FREE (tt); + } + else + temp = tt; + break; +#endif + default: + temp = (char *)NULL; + } + + return temp; +} + +/****************************************************************/ +/* */ +/* Functions to perform pattern substitution on variable values */ +/* */ +/****************************************************************/ + +char * +pat_subst (string, pat, rep, mflags) + char *string, *pat, *rep; + int mflags; +{ + char *ret, *s, *e, *str; + int rsize, rptr, l, replen, mtype; + + mtype = mflags & MATCH_TYPEMASK; + + /* Special cases: + * 1. A null pattern with mtype == MATCH_BEG means to prefix STRING + * with REP and return the result. + * 2. A null pattern with mtype == MATCH_END means to append REP to + * STRING and return the result. + */ + if ((pat == 0 || *pat == 0) && (mtype == MATCH_BEG || mtype == MATCH_END)) + { + replen = STRLEN (rep); + l = strlen (string); + ret = (char *)xmalloc (replen + l + 2); + if (replen == 0) + strcpy (ret, string); + else if (mtype == MATCH_BEG) + { + strcpy (ret, rep); + strcpy (ret + replen, string); + } + else + { + strcpy (ret, string); + strcpy (ret + l, rep); + } + return (ret); + } + + ret = (char *)xmalloc (rsize = 64); + ret[0] = '\0'; + + for (replen = STRLEN (rep), rptr = 0, str = string;;) + { + if (match_pattern (str, pat, mtype, &s, &e) == 0) + break; + l = s - str; + RESIZE_MALLOCED_BUFFER (ret, rptr, (l + replen), rsize, 64); + + /* OK, now copy the leading unmatched portion of the string (from + str to s) to ret starting at rptr (the current offset). Then copy + the replacement string at ret + rptr + (s - str). Increment + rptr (if necessary) and str and go on. */ + if (l) + { + strncpy (ret + rptr, str, l); + rptr += l; + } + if (replen) + { + strncpy (ret + rptr, rep, replen); + rptr += replen; + } + str = e; /* e == end of match */ + + if (((mflags & MATCH_GLOBREP) == 0) || mtype != MATCH_ANY) + break; + + if (s == e) + e++, str++; /* avoid infinite recursion on zero-length match */ + } + + /* Now copy the unmatched portion of the input string */ + if (*str) + { + RESIZE_MALLOCED_BUFFER (ret, rptr, STRLEN(str) + 1, rsize, 64); + strcpy (ret + rptr, str); + } + else + ret[rptr] = '\0'; + + return ret; +} + +/* Do pattern match and replacement on the positional parameters. */ +static char * +pos_params_pat_subst (string, pat, rep, mflags) + char *string, *pat, *rep; + int mflags; +{ + WORD_LIST *save, *params; + WORD_DESC *w; + char *ret, *tt; + + save = params = list_rest_of_args (); + if (save == 0) + return ((char *)NULL); + + for ( ; params; params = params->next) + { + ret = pat_subst (params->word->word, pat, rep, mflags); + w = make_bare_word (ret); + dispose_word (params->word); + params->word = w; + FREE (ret); + } + + if ((mflags & (MATCH_QUOTED|MATCH_STARSUB)) == (MATCH_QUOTED|MATCH_STARSUB)) + ret = string_list_dollar_star (quote_list (save)); + else + ret = string_list ((mflags & MATCH_QUOTED) ? quote_list (save) : save); + dispose_words (save); + + return (ret); +} + +/* Perform pattern substitution on VALUE, which is the expansion of + VARNAME. PATSUB is an expression supplying the pattern to match + and the string to substitute. QUOTED is a flags word containing + the type of quoting currently in effect. */ +static char * +parameter_brace_patsub (varname, value, patsub, quoted) + char *varname, *value, *patsub; + int quoted; +{ + int vtype, mflags, starsub; + char *val, *temp, *pat, *rep, *p, *lpatsub, *tt; + SHELL_VAR *v; + + if (value == 0) + return ((char *)NULL); + + this_command_name = varname; + + vtype = get_var_and_type (varname, value, quoted, &v, &val); + if (vtype == -1) + return ((char *)NULL); + + starsub = vtype & VT_STARSUB; + vtype &= ~VT_STARSUB; + + mflags = 0; + if (*patsub == '/') + { + mflags |= MATCH_GLOBREP; + patsub++; + } + + /* Malloc this because expand_string_if_necessary or one of the expansion + functions in its call chain may free it on a substitution error. */ + lpatsub = savestring (patsub); + + if (quoted & (Q_HERE_DOCUMENT|Q_DOUBLE_QUOTES)) + mflags |= MATCH_QUOTED; + + if (starsub) + mflags |= MATCH_STARSUB; + + if (rep = quoted_strchr (lpatsub, '/', ST_BACKSL)) + *rep++ = '\0'; + else + rep = (char *)NULL; + + if (rep && *rep == '\0') + rep = (char *)NULL; + +#if 0 + /* Expand PAT and REP for command, variable and parameter, arithmetic, + and process substitution. Also perform quote removal. Do not + perform word splitting or filename generation. */ + pat = expand_string_if_necessary (lpatsub, (quoted & ~Q_DOUBLE_QUOTES), expand_string_unsplit); +#else + /* Perform the same expansions on the pattern as performed by the + pattern removal expansions. */ + pat = getpattern (lpatsub, quoted, 1); +#endif + + if (rep) + { + if ((mflags & MATCH_QUOTED) == 0) + rep = expand_string_if_necessary (rep, quoted, expand_string_unsplit); + else + rep = expand_string_to_string_internal (rep, quoted, expand_string_unsplit); + } + + p = pat; + if (pat && pat[0] == '#') + { + mflags |= MATCH_BEG; + p++; + } + else if (pat && pat[0] == '%') + { + mflags |= MATCH_END; + p++; + } + else + mflags |= MATCH_ANY; + + /* OK, we now want to substitute REP for PAT in VAL. If + flags & MATCH_GLOBREP is non-zero, the substitution is done + everywhere, otherwise only the first occurrence of PAT is + replaced. The pattern matching code doesn't understand + CTLESC quoting CTLESC and CTLNUL so we use the dequoted variable + values passed in (VT_VARIABLE) so the pattern substitution + code works right. We need to requote special chars after + we're done for VT_VARIABLE and VT_ARRAYMEMBER, and for the + other cases if QUOTED == 0, since the posparams and arrays + indexed by * or @ do special things when QUOTED != 0. */ + + switch (vtype) + { + case VT_VARIABLE: + case VT_ARRAYMEMBER: + temp = pat_subst (val, p, rep, mflags); + if (vtype == VT_VARIABLE) + FREE (val); + if (temp) + { + tt = quote_escapes (temp); + free (temp); + temp = tt; + } + break; + case VT_POSPARMS: + temp = pos_params_pat_subst (val, p, rep, mflags); + if (temp && (mflags & MATCH_QUOTED) == 0) + { + tt = quote_escapes (temp); + free (temp); + temp = tt; + } + break; +#if defined (ARRAY_VARS) + case VT_ARRAYVAR: + temp = array_patsub (array_cell (v), p, rep, mflags); + if (temp && (mflags & MATCH_QUOTED) == 0) + { + tt = quote_escapes (temp); + free (temp); + temp = tt; + } + break; +#endif + } + + FREE (pat); + FREE (rep); + free (lpatsub); + + return temp; +} + +/****************************************************************/ +/* */ +/* Functions to perform parameter expansion on a string */ +/* */ +/****************************************************************/ + +/* ${[#][!]name[[:]#[#]%[%]-=?+[word][:e1[:e2]]]} */ +static char * +parameter_brace_expand (string, indexp, quoted, quoted_dollar_atp, contains_dollar_at) + char *string; + int *indexp, quoted, *quoted_dollar_atp, *contains_dollar_at; +{ + int check_nullness, var_is_set, var_is_null, var_is_special; + int want_substring, want_indir, want_patsub; + char *name, *value, *temp, *temp1; + int t_index, sindex, c; + intmax_t number; + + value = (char *)NULL; + var_is_set = var_is_null = var_is_special = check_nullness = 0; + want_substring = want_indir = want_patsub = 0; + + sindex = *indexp; + t_index = ++sindex; + name = string_extract (string, &t_index, "#%:-=?+/}", EX_VARNAME); + + /* If the name really consists of a special variable, then make sure + that we have the entire name. We don't allow indirect references + to special variables except `#', `?', `@' and `*'. */ + if ((sindex == t_index && + (string[t_index] == '-' || + string[t_index] == '?' || + string[t_index] == '#')) || + (sindex == t_index - 1 && string[sindex] == '!' && + (string[t_index] == '#' || + string[t_index] == '?' || + string[t_index] == '@' || + string[t_index] == '*'))) + { + t_index++; + free (name); + temp1 = string_extract (string, &t_index, "#%:-=?+/}", 0); + name = (char *)xmalloc (3 + (strlen (temp1))); + *name = string[sindex]; + if (string[sindex] == '!') + { + /* indirect reference of $#, $?, $@, or $* */ + name[1] = string[sindex + 1]; + strcpy (name + 2, temp1); + } + else + strcpy (name + 1, temp1); + free (temp1); + } + sindex = t_index; + + /* Find out what character ended the variable name. Then + do the appropriate thing. */ + if (c = string[sindex]) + sindex++; + + /* If c is followed by one of the valid parameter expansion + characters, move past it as normal. If not, assume that + a substring specification is being given, and do not move + past it. */ + if (c == ':' && VALID_PARAM_EXPAND_CHAR (string[sindex])) + { + check_nullness++; + if (c = string[sindex]) + sindex++; + } + else if (c == ':' && string[sindex] != RBRACE) + want_substring = 1; + else if (c == '/' && string[sindex] != RBRACE) + want_patsub = 1; + + /* Catch the valid and invalid brace expressions that made it through the + tests above. */ + /* ${#-} is a valid expansion and means to take the length of $-. + Similarly for ${#?} and ${##}... */ + if (name[0] == '#' && name[1] == '\0' && check_nullness == 0 && + VALID_SPECIAL_LENGTH_PARAM (c) && string[sindex] == RBRACE) + { + name = (char *)xrealloc (name, 3); + name[1] = c; + name[2] = '\0'; + c = string[sindex++]; + } + + /* ...but ${#%}, ${#:}, ${#=}, ${#+}, and ${#/} are errors. */ + if (name[0] == '#' && name[1] == '\0' && check_nullness == 0 && + member (c, "%:=+/") && string[sindex] == RBRACE) + { + temp = (char *)NULL; + goto bad_substitution; + } + + /* Indirect expansion begins with a `!'. A valid indirect expansion is + either a variable name, one of the positional parameters or a special + variable that expands to one of the positional parameters. */ + want_indir = *name == '!' && + (legal_variable_starter ((unsigned char)name[1]) || DIGIT (name[1]) + || VALID_INDIR_PARAM (name[1])); + + /* Determine the value of this variable. */ + + /* Check for special variables, directly referenced. */ + if (SPECIAL_VAR (name, want_indir)) + var_is_special++; + + /* Check for special expansion things, like the length of a parameter */ + if (*name == '#' && name[1]) + { + /* If we are not pointing at the character just after the + closing brace, then we haven't gotten all of the name. + Since it begins with a special character, this is a bad + substitution. Also check NAME for validity before trying + to go on. */ + if (string[sindex - 1] != RBRACE || (valid_length_expression (name) == 0)) + { + temp = (char *)NULL; + goto bad_substitution; + } + + number = parameter_brace_expand_length (name); + free (name); + + *indexp = sindex; + return ((number < 0) ? &expand_param_error : itos (number)); + } + + /* ${@} is identical to $@. */ + if (name[0] == '@' && name[1] == '\0') + { + if ((quoted & (Q_HERE_DOCUMENT|Q_DOUBLE_QUOTES)) && quoted_dollar_atp) + *quoted_dollar_atp = 1; + + if (contains_dollar_at) + *contains_dollar_at = 1; + } + + /* Process ${!PREFIX*} expansion. */ + if (want_indir && string[sindex - 1] == RBRACE && + (string[sindex - 2] == '*' || string[sindex - 2] == '@') && + legal_variable_starter ((unsigned char) name[1])) + { + char **x; + WORD_LIST *xlist; + + temp1 = savestring (name + 1); + number = strlen (temp1); + temp1[number - 1] = '\0'; + x = all_variables_matching_prefix (temp1); + xlist = strvec_to_word_list (x, 0, 0); + if (string[sindex - 2] == '*') + temp = string_list_dollar_star (xlist); + else + { + temp = string_list_dollar_at (xlist, quoted); + if ((quoted & (Q_HERE_DOCUMENT|Q_DOUBLE_QUOTES)) && quoted_dollar_atp) + *quoted_dollar_atp = 1; + if (contains_dollar_at) + *contains_dollar_at = 1; + } + free (x); + free (xlist); + free (temp1); + *indexp = sindex; + return (temp); + } + +#if defined (ARRAY_VARS) + /* Process ${!ARRAY[@]} and ${!ARRAY[*]} expansion. */ /* [ */ + if (want_indir && string[sindex - 1] == RBRACE && + string[sindex - 2] == ']' && valid_array_reference (name+1)) + { + char *x, *x1; + + temp1 = savestring (name + 1); + x = array_variable_name (temp1, &x1, (int *)0); /* [ */ + FREE (x); + if (ALL_ELEMENT_SUB (x1[0]) && x1[1] == ']') + { + temp = array_keys (temp1, quoted); + if (x1[0] == '@') + { + if ((quoted & (Q_HERE_DOCUMENT|Q_DOUBLE_QUOTES)) && quoted_dollar_atp) + *quoted_dollar_atp = 1; + if (contains_dollar_at) + *contains_dollar_at = 1; + } + + free (temp1); + *indexp = sindex; + return (temp); + } + + free (temp1); + } +#endif /* ARRAY_VARS */ + + /* Make sure that NAME is valid before trying to go on. */ + if (valid_brace_expansion_word (want_indir ? name + 1 : name, + var_is_special) == 0) + { + temp = (char *)NULL; + goto bad_substitution; + } + + if (want_indir) + temp = parameter_brace_expand_indir (name + 1, var_is_special, quoted, quoted_dollar_atp, contains_dollar_at); + else + temp = parameter_brace_expand_word (name, var_is_special, quoted); + +#if defined (ARRAY_VARS) + if (valid_array_reference (name)) + chk_atstar (name, quoted, quoted_dollar_atp, contains_dollar_at); +#endif + + var_is_set = temp != (char *)0; + var_is_null = check_nullness && (var_is_set == 0 || *temp == 0); + + /* Get the rest of the stuff inside the braces. */ + if (c && c != RBRACE) + { + /* Extract the contents of the ${ ... } expansion + according to the Posix.2 rules. */ + value = extract_dollar_brace_string (string, &sindex, quoted, 0); + if (string[sindex] == RBRACE) + sindex++; + else + goto bad_substitution; + } + else + value = (char *)NULL; + + *indexp = sindex; + + /* If this is a substring spec, process it and add the result. */ + if (want_substring) + { + temp1 = parameter_brace_substring (name, temp, value, quoted); + FREE (name); + FREE (value); + FREE (temp); + return (temp1); + } + else if (want_patsub) + { + temp1 = parameter_brace_patsub (name, temp, value, quoted); + FREE (name); + FREE (value); + FREE (temp); + return (temp1); + } + + /* Do the right thing based on which character ended the variable name. */ + switch (c) + { + default: + case '\0': + bad_substitution: + report_error (_("%s: bad substitution"), string ? string : "??"); + FREE (value); + FREE (temp); + free (name); + return &expand_param_error; + + case RBRACE: + if (var_is_set == 0 && unbound_vars_is_error) + { + err_unboundvar (name); + FREE (value); + FREE (temp); + free (name); + last_command_exit_value = EXECUTION_FAILURE; + return (interactive_shell ? &expand_param_error : &expand_param_fatal); + } + break; + + case '#': /* ${param#[#]pattern} */ + case '%': /* ${param%[%]pattern} */ + if (value == 0 || *value == '\0' || temp == 0 || *temp == '\0') + { + FREE (value); + break; + } + temp1 = parameter_brace_remove_pattern (name, temp, value, c, quoted); + free (temp); + free (value); + temp = temp1; + break; + + case '-': + case '=': + case '?': + case '+': + if (var_is_set && var_is_null == 0) + { + /* If the operator is `+', we don't want the value of the named + variable for anything, just the value of the right hand side. */ + + if (c == '+') + { + /* XXX -- if we're double-quoted and the named variable is "$@", + we want to turn off any special handling of "$@" -- + we're not using it, so whatever is on the rhs applies. */ + if ((quoted & (Q_HERE_DOCUMENT|Q_DOUBLE_QUOTES)) && quoted_dollar_atp) + *quoted_dollar_atp = 0; + if (contains_dollar_at) + *contains_dollar_at = 0; + + FREE (temp); + if (value) + { + temp = parameter_brace_expand_rhs (name, value, c, + quoted, + quoted_dollar_atp, + contains_dollar_at); + free (value); + } + else + temp = (char *)NULL; + } + else + { + FREE (value); + } + /* Otherwise do nothing; just use the value in TEMP. */ + } + else /* VAR not set or VAR is NULL. */ + { + FREE (temp); + temp = (char *)NULL; + if (c == '=' && var_is_special) + { + report_error (_("$%s: cannot assign in this way"), name); + free (name); + free (value); + return &expand_param_error; + } + else if (c == '?') + { + parameter_brace_expand_error (name, value); + return (interactive_shell ? &expand_param_error : &expand_param_fatal); + } + else if (c != '+') + { + /* XXX -- if we're double-quoted and the named variable is "$@", + we want to turn off any special handling of "$@" -- + we're not using it, so whatever is on the rhs applies. */ + if ((quoted & (Q_HERE_DOCUMENT|Q_DOUBLE_QUOTES)) && quoted_dollar_atp) + *quoted_dollar_atp = 0; + if (contains_dollar_at) + *contains_dollar_at = 0; + + temp = parameter_brace_expand_rhs (name, value, c, quoted, + quoted_dollar_atp, + contains_dollar_at); + } + free (value); + } + + break; + } + free (name); + return (temp); +} + +/* Expand a single ${xxx} expansion. The braces are optional. When + the braces are used, parameter_brace_expand() does the work, + possibly calling param_expand recursively. */ +static char * +param_expand (string, sindex, quoted, expanded_something, + contains_dollar_at, quoted_dollar_at_p, had_quoted_null_p, + pflags) + char *string; + int *sindex, quoted, *expanded_something, *contains_dollar_at; + int *quoted_dollar_at_p, *had_quoted_null_p, pflags; +{ + char *temp, *temp1, uerror[3]; + int zindex, t_index, expok; + unsigned char c; + intmax_t number; + SHELL_VAR *var; + WORD_LIST *list; + + zindex = *sindex; + c = string[++zindex]; + + temp = (char *)NULL; + + /* Do simple cases first. Switch on what follows '$'. */ + switch (c) + { + /* $0 .. $9? */ + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': + temp1 = dollar_vars[TODIGIT (c)]; + if (unbound_vars_is_error && temp1 == (char *)NULL) + { + uerror[0] = '$'; + uerror[1] = c; + uerror[2] = '\0'; + err_unboundvar (uerror); + last_command_exit_value = EXECUTION_FAILURE; + return (interactive_shell ? &expand_param_error : &expand_param_fatal); + } +#if 1 + if (temp1) + temp = (*temp1 && (quoted & (Q_HERE_DOCUMENT|Q_DOUBLE_QUOTES))) + ? quote_string (temp1) + : quote_escapes (temp1); + else + temp = (char *)NULL; +#else + temp = temp1 ? quote_escapes (temp1) : (char *)NULL; +#endif + break; + + /* $$ -- pid of the invoking shell. */ + case '$': + temp = itos (dollar_dollar_pid); + break; + + /* $# -- number of positional parameters. */ + case '#': + temp = itos (number_of_args ()); + break; + + /* $? -- return value of the last synchronous command. */ + case '?': + temp = itos (last_command_exit_value); + break; + + /* $- -- flags supplied to the shell on invocation or by `set'. */ + case '-': + temp = which_set_flags (); + break; + + /* $! -- Pid of the last asynchronous command. */ + case '!': + /* If no asynchronous pids have been created, expand to nothing. + If `set -u' has been executed, and no async processes have + been created, this is an expansion error. */ + if (last_asynchronous_pid == NO_PID) + { + if (expanded_something) + *expanded_something = 0; + temp = (char *)NULL; + if (unbound_vars_is_error) + { + uerror[0] = '$'; + uerror[1] = c; + uerror[2] = '\0'; + err_unboundvar (uerror); + last_command_exit_value = EXECUTION_FAILURE; + return (interactive_shell ? &expand_param_error : &expand_param_fatal); + } + } + else + temp = itos (last_asynchronous_pid); + break; + + /* The only difference between this and $@ is when the arg is quoted. */ + case '*': /* `$*' */ + list = list_rest_of_args (); + + /* If there are no command-line arguments, this should just + disappear if there are other characters in the expansion, + even if it's quoted. */ + if ((quoted & (Q_HERE_DOCUMENT|Q_DOUBLE_QUOTES)) && list == 0) + temp = (char *)NULL; + else if (quoted & (Q_HERE_DOCUMENT|Q_DOUBLE_QUOTES)) + { + /* If we have "$*" we want to make a string of the positional + parameters, separated by the first character of $IFS, and + quote the whole string, including the separators. If IFS + is unset, the parameters are separated by ' '; if $IFS is + null, the parameters are concatenated. */ +#if 0 + temp = string_list_dollar_star (list); +#else + temp = (quoted & Q_DOUBLE_QUOTES) ? string_list_dollar_star (list) : string_list (list); +#endif + temp1 = quote_string (temp); + free (temp); + temp = temp1; + } + else + { + /* If the $* is not quoted it is identical to $@ */ + temp = string_list_dollar_at (list, quoted); + if (expand_no_split_dollar_star == 0 && contains_dollar_at) + *contains_dollar_at = 1; + } + + dispose_words (list); + break; + + /* When we have "$@" what we want is "$1" "$2" "$3" ... This + means that we have to turn quoting off after we split into + the individually quoted arguments so that the final split + on the first character of $IFS is still done. */ + case '@': /* `$@' */ + list = list_rest_of_args (); + + /* We want to flag the fact that we saw this. We can't turn + off quoting entirely, because other characters in the + string might need it (consider "\"$@\""), but we need some + way to signal that the final split on the first character + of $IFS should be done, even though QUOTED is 1. */ + if (quoted_dollar_at_p && (quoted & (Q_HERE_DOCUMENT|Q_DOUBLE_QUOTES))) + *quoted_dollar_at_p = 1; + if (contains_dollar_at) + *contains_dollar_at = 1; + + /* We want to separate the positional parameters with the first + character of $IFS in case $IFS is something other than a space. + We also want to make sure that splitting is done no matter what -- + according to POSIX.2, this expands to a list of the positional + parameters no matter what IFS is set to. */ + temp = string_list_dollar_at (list, quoted); + + dispose_words (list); + break; + + case LBRACE: + temp = parameter_brace_expand (string, &zindex, quoted, + quoted_dollar_at_p, + contains_dollar_at); + if (temp == &expand_param_error || temp == &expand_param_fatal) + return (temp); + + /* XXX */ + /* Quoted nulls should be removed if there is anything else + in the string. */ + /* Note that we saw the quoted null so we can add one back at + the end of this function if there are no other characters + in the string, discard TEMP, and go on. The exception to + this is when we have "${@}" and $1 is '', since $@ needs + special handling. */ + if (temp && QUOTED_NULL (temp)) + { + if (had_quoted_null_p) + *had_quoted_null_p = 1; + if (*quoted_dollar_at_p == 0) + { + free (temp); + temp = (char *)NULL; + } + + } + + goto return0; + + /* Do command or arithmetic substitution. */ + case LPAREN: + /* We have to extract the contents of this paren substitution. */ + t_index = zindex + 1; + temp = extract_command_subst (string, &t_index); + zindex = t_index; + + /* For Posix.2-style `$(( ))' arithmetic substitution, + extract the expression and pass it to the evaluator. */ + if (temp && *temp == LPAREN) + { + char *temp2; + temp1 = temp + 1; + temp2 = savestring (temp1); + t_index = strlen (temp2) - 1; + + if (temp2[t_index] != RPAREN) + { + free (temp2); + goto comsub; + } + + /* Cut off ending `)' */ + temp2[t_index] = '\0'; + + /* Expand variables found inside the expression. */ + temp1 = expand_string_if_necessary (temp2, Q_DOUBLE_QUOTES, expand_string); + free (temp2); + +arithsub: + /* No error messages. */ + this_command_name = (char *)NULL; + number = evalexp (temp1, &expok); + free (temp); + free (temp1); + if (expok == 0) + { + if (interactive_shell == 0 && posixly_correct) + { + last_command_exit_value = EXECUTION_FAILURE; + return (&expand_param_fatal); + } + else + return (&expand_param_error); + } + temp = itos (number); + break; + } + +comsub: + if (pflags & PF_NOCOMSUB) + /* we need zindex+1 because string[zindex] == RPAREN */ + temp1 = substring (string, *sindex, zindex+1); + else + temp1 = command_substitute (temp, quoted); + FREE (temp); + temp = temp1; + break; + + /* Do POSIX.2d9-style arithmetic substitution. This will probably go + away in a future bash release. */ + case '[': + /* Extract the contents of this arithmetic substitution. */ + t_index = zindex + 1; + temp = extract_arithmetic_subst (string, &t_index); + zindex = t_index; + + /* Do initial variable expansion. */ + temp1 = expand_string_if_necessary (temp, Q_DOUBLE_QUOTES, expand_string); + + goto arithsub; + + default: + /* Find the variable in VARIABLE_LIST. */ + temp = (char *)NULL; + + for (t_index = zindex; (c = string[zindex]) && legal_variable_char (c); zindex++) + ; + temp1 = (zindex > t_index) ? substring (string, t_index, zindex) : (char *)NULL; + + /* If this isn't a variable name, then just output the `$'. */ + if (temp1 == 0 || *temp1 == '\0') + { + FREE (temp1); + temp = (char *)xmalloc (2); + temp[0] = '$'; + temp[1] = '\0'; + if (expanded_something) + *expanded_something = 0; + goto return0; + } + + /* If the variable exists, return its value cell. */ + var = find_variable (temp1); + + if (var && invisible_p (var) == 0 && var_isset (var)) + { +#if defined (ARRAY_VARS) + if (array_p (var)) + { + temp = array_reference (array_cell (var), 0); + if (temp) + temp = (*temp && (quoted & (Q_HERE_DOCUMENT|Q_DOUBLE_QUOTES))) + ? quote_string (temp) + : quote_escapes (temp); + else if (unbound_vars_is_error) + goto unbound_variable; + } + else +#endif + { + temp = value_cell (var); + + temp = (*temp && (quoted & (Q_HERE_DOCUMENT|Q_DOUBLE_QUOTES))) + ? quote_string (temp) + : quote_escapes (temp); + } + + free (temp1); + + goto return0; + } + + temp = (char *)NULL; + +unbound_variable: + if (unbound_vars_is_error) + err_unboundvar (temp1); + else + { + free (temp1); + goto return0; + } + + free (temp1); + last_command_exit_value = EXECUTION_FAILURE; + return ((unbound_vars_is_error && interactive_shell == 0) + ? &expand_param_fatal + : &expand_param_error); + } + + if (string[zindex]) + zindex++; + +return0: + *sindex = zindex; + return (temp); +} + +/* Make a word list which is the result of parameter and variable + expansion, command substitution, arithmetic substitution, and + quote removal of WORD. Return a pointer to a WORD_LIST which is + the result of the expansion. If WORD contains a null word, the + word list returned is also null. + + QUOTED contains flag values defined in shell.h. + + ISEXP is used to tell expand_word_internal that the word should be + treated as the result of an expansion. This has implications for + how IFS characters in the word are treated. + + CONTAINS_DOLLAR_AT and EXPANDED_SOMETHING are return values; when non-null + they point to an integer value which receives information about expansion. + CONTAINS_DOLLAR_AT gets non-zero if WORD contained "$@", else zero. + EXPANDED_SOMETHING get non-zero if WORD contained any parameter expansions, + else zero. + + This only does word splitting in the case of $@ expansion. In that + case, we split on ' '. */ + +/* Values for the local variable quoted_state. */ +#define UNQUOTED 0 +#define PARTIALLY_QUOTED 1 +#define WHOLLY_QUOTED 2 + +static WORD_LIST * +expand_word_internal (word, quoted, isexp, contains_dollar_at, expanded_something) + WORD_DESC *word; + int quoted, isexp; + int *contains_dollar_at; + int *expanded_something; +{ + WORD_LIST *list; + WORD_DESC *tword; + + /* The intermediate string that we build while expanding. */ + char *istring; + + /* The current size of the above object. */ + int istring_size; + + /* Index into ISTRING. */ + int istring_index; + + /* Temporary string storage. */ + char *temp, *temp1; + + /* The text of WORD. */ + register char *string; + + /* The size of STRING. */ + size_t string_size; + + /* The index into STRING. */ + int sindex; + + /* This gets 1 if we see a $@ while quoted. */ + int quoted_dollar_at; + + /* One of UNQUOTED, PARTIALLY_QUOTED, or WHOLLY_QUOTED, depending on + whether WORD contains no quoting characters, a partially quoted + string (e.g., "xx"ab), or is fully quoted (e.g., "xxab"). */ + int quoted_state; + + int had_quoted_null; + int has_dollar_at; + int tflag; + + register unsigned char c; /* Current character. */ + int t_index; /* For calls to string_extract_xxx. */ + + char twochars[2]; + + DECLARE_MBSTATE; + + istring = (char *)xmalloc (istring_size = DEFAULT_INITIAL_ARRAY_SIZE); + istring[istring_index = 0] = '\0'; + quoted_dollar_at = had_quoted_null = has_dollar_at = 0; + quoted_state = UNQUOTED; + + string = word->word; + if (string == 0) + goto finished_with_string; + string_size = strlen (string); + + if (contains_dollar_at) + *contains_dollar_at = 0; + + /* Begin the expansion. */ + + for (sindex = 0; ;) + { + c = string[sindex]; + + /* Case on toplevel character. */ + switch (c) + { + case '\0': + goto finished_with_string; + + case CTLESC: + sindex++; +#if HANDLE_MULTIBYTE + if (MB_CUR_MAX > 1 && string[sindex]) + { + SADD_MBQCHAR_BODY(temp, string, sindex, string_size); + } + else +#endif + { + temp = (char *)xmalloc (3); + temp[0] = CTLESC; + temp[1] = c = string[sindex]; + temp[2] = '\0'; + } + +dollar_add_string: + if (string[sindex]) + sindex++; + +add_string: + if (temp) + { + istring = sub_append_string (temp, istring, &istring_index, &istring_size); + temp = (char *)0; + } + + break; + +#if defined (PROCESS_SUBSTITUTION) + /* Process substitution. */ + case '<': + case '>': + { + if (string[++sindex] != LPAREN || (quoted & (Q_HERE_DOCUMENT|Q_DOUBLE_QUOTES)) || posixly_correct) + { + sindex--; /* add_character: label increments sindex */ + goto add_character; + } + else + t_index = sindex + 1; /* skip past both '<' and LPAREN */ + + temp1 = extract_process_subst (string, (c == '<') ? "<(" : ">(", &t_index); /*))*/ + sindex = t_index; + + /* If the process substitution specification is `<()', we want to + open the pipe for writing in the child and produce output; if + it is `>()', we want to open the pipe for reading in the child + and consume input. */ + temp = temp1 ? process_substitute (temp1, (c == '>')) : (char *)0; + + FREE (temp1); + + goto dollar_add_string; + } +#endif /* PROCESS_SUBSTITUTION */ + + case '$': + if (expanded_something) + *expanded_something = 1; + + has_dollar_at = 0; + temp = param_expand (string, &sindex, quoted, expanded_something, + &has_dollar_at, "ed_dollar_at, + &had_quoted_null, + (word->flags & W_NOCOMSUB) ? PF_NOCOMSUB : 0); + + if (temp == &expand_param_error || temp == &expand_param_fatal) + { + free (string); + free (istring); + return ((temp == &expand_param_error) ? &expand_word_error + : &expand_word_fatal); + } + if (contains_dollar_at && has_dollar_at) + *contains_dollar_at = 1; + goto add_string; + break; + + case '`': /* Backquoted command substitution. */ + { + t_index = sindex++; + + if (expanded_something) + *expanded_something = 1; + + temp = string_extract (string, &sindex, "`", 0); + if (word->flags & W_NOCOMSUB) + /* sindex + 1 because string[sindex] == '`' */ + temp1 = substring (string, t_index, sindex + 1); + else + { + de_backslash (temp); + temp1 = command_substitute (temp, quoted); + } + FREE (temp); + temp = temp1; + goto dollar_add_string; + } + + case '\\': + if (string[sindex + 1] == '\n') + { + sindex += 2; + continue; + } + + c = string[++sindex]; + + if (quoted & Q_HERE_DOCUMENT) + tflag = CBSHDOC; + else if (quoted & Q_DOUBLE_QUOTES) + tflag = CBSDQUOTE; + else + tflag = 0; + + if ((quoted & (Q_HERE_DOCUMENT|Q_DOUBLE_QUOTES)) && ((sh_syntaxtab[c] & tflag) == 0)) + { + SCOPY_CHAR_I (twochars, '\\', c, string, sindex, string_size); + } + else if (c == 0) + { + c = CTLNUL; + sindex--; /* add_character: label increments sindex */ + goto add_character; + } + else + { + SCOPY_CHAR_I (twochars, CTLESC, c, string, sindex, string_size); + } + + sindex++; +add_twochars: + /* BEFORE jumping here, we need to increment sindex if appropriate */ + RESIZE_MALLOCED_BUFFER (istring, istring_index, 2, istring_size, + DEFAULT_ARRAY_SIZE); + istring[istring_index++] = twochars[0]; + istring[istring_index++] = twochars[1]; + istring[istring_index] = '\0'; + + break; + + case '"': +#if 0 + if (quoted & (Q_DOUBLE_QUOTES|Q_HERE_DOCUMENT|Q_PATQUOTE)) +#else + if (quoted & (Q_DOUBLE_QUOTES|Q_HERE_DOCUMENT)) +#endif + goto add_character; + + t_index = ++sindex; + temp = string_extract_double_quoted (string, &sindex, 0); + + /* If the quotes surrounded the entire string, then the + whole word was quoted. */ + quoted_state = (t_index == 1 && string[sindex] == '\0') + ? WHOLLY_QUOTED + : PARTIALLY_QUOTED; + + if (temp && *temp) + { + tword = make_word (temp); /* XXX */ + free (temp); + temp = (char *)NULL; + + has_dollar_at = 0; + list = expand_word_internal (tword, Q_DOUBLE_QUOTES, 0, &has_dollar_at, (int *)NULL); + + if (list == &expand_word_error || list == &expand_word_fatal) + { + free (istring); + free (string); + /* expand_word_internal has already freed temp_word->word + for us because of the way it prints error messages. */ + tword->word = (char *)NULL; + dispose_word (tword); + return list; + } + + dispose_word (tword); + + /* "$@" (a double-quoted dollar-at) expands into nothing, + not even a NULL word, when there are no positional + parameters. */ + if (list == 0 && has_dollar_at) + { + quoted_dollar_at++; + break; + } + + /* If we get "$@", we know we have expanded something, so we + need to remember it for the final split on $IFS. This is + a special case; it's the only case where a quoted string + can expand into more than one word. It's going to come back + from the above call to expand_word_internal as a list with + a single word, in which all characters are quoted and + separated by blanks. What we want to do is to turn it back + into a list for the next piece of code. */ + if (list) + dequote_list (list); + + if (has_dollar_at) + { + quoted_dollar_at++; + if (contains_dollar_at) + *contains_dollar_at = 1; + if (expanded_something) + *expanded_something = 1; + } + } + else + { + /* What we have is "". This is a minor optimization. */ + FREE (temp); + list = (WORD_LIST *)NULL; + } + + /* The code above *might* return a list (consider the case of "$@", + where it returns "$1", "$2", etc.). We can't throw away the + rest of the list, and we have to make sure each word gets added + as quoted. We test on tresult->next: if it is non-NULL, we + quote the whole list, save it to a string with string_list, and + add that string. We don't need to quote the results of this + (and it would be wrong, since that would quote the separators + as well), so we go directly to add_string. */ + if (list) + { + if (list->next) + { + /* Testing quoted_dollar_at makes sure that "$@" is + split correctly when $IFS does not contain a space. */ + temp = quoted_dollar_at + ? string_list_dollar_at (list, Q_DOUBLE_QUOTES) + : string_list (quote_list (list)); + dispose_words (list); + goto add_string; + } + else + { + temp = savestring (list->word->word); + dispose_words (list); +#if 1 + /* If the string is not a quoted null string, we want + to remove any embedded unquoted CTLNUL characters. + We do not want to turn quoted null strings back into + the empty string, though. We do this because we + want to remove any quoted nulls from expansions that + contain other characters. For example, if we have + x"$*"y or "x$*y" and there are no positional parameters, + the $* should expand into nothing. */ + /* HOWEVER, this fails if the string contains a literal + CTLNUL or CTLNUL is contained in the (non-null) expansion + of some variable. I'm not sure what to do about this + yet. There has to be some way to indicate the difference + between the two. An auxiliary data structure might be + necessary. */ + if (QUOTED_NULL (temp) == 0) + remove_quoted_nulls (temp); /* XXX */ +#endif + } + } + else + temp = (char *)NULL; + + /* We do not want to add quoted nulls to strings that are only + partially quoted; we can throw them away. */ + if (temp == 0 && quoted_state == PARTIALLY_QUOTED) + continue; + + add_quoted_string: + + if (temp) + { + temp1 = temp; + temp = quote_string (temp); + free (temp1); + goto add_string; + } + else + { + /* Add NULL arg. */ + c = CTLNUL; + sindex--; /* add_character: label increments sindex */ + goto add_character; + } + + /* break; */ + + case '\'': +#if 0 + if (quoted & (Q_DOUBLE_QUOTES|Q_HERE_DOCUMENT|Q_PATQUOTE)) +#else + if (quoted & (Q_DOUBLE_QUOTES|Q_HERE_DOCUMENT)) +#endif + goto add_character; + + t_index = ++sindex; + temp = string_extract_single_quoted (string, &sindex); + + /* If the entire STRING was surrounded by single quotes, + then the string is wholly quoted. */ + quoted_state = (t_index == 1 && string[sindex] == '\0') + ? WHOLLY_QUOTED + : PARTIALLY_QUOTED; + + /* If all we had was '', it is a null expansion. */ + if (*temp == '\0') + { + free (temp); + temp = (char *)NULL; + } + else + remove_quoted_escapes (temp); /* ??? */ + + /* We do not want to add quoted nulls to strings that are only + partially quoted; such nulls are discarded. */ + if (temp == 0 && (quoted_state == PARTIALLY_QUOTED)) + continue; + + /* If we have a quoted null expansion, add a quoted NULL to istring. */ + if (temp == 0) + { + c = CTLNUL; + sindex--; /* add_character: label increments sindex */ + goto add_character; + } + else + goto add_quoted_string; + + /* break; */ + + default: + /* This is the fix for " $@ " */ + if ((quoted & (Q_HERE_DOCUMENT|Q_DOUBLE_QUOTES)) || (isexp == 0 && isifs (c))) + { + if (string[sindex]) /* from old goto dollar_add_string */ + sindex++; + if (c == 0) + { + c = CTLNUL; + goto add_character; + } + else + { +#if HANDLE_MULTIBYTE + if (MB_CUR_MAX > 1) + sindex--; + + if (MB_CUR_MAX > 1) + { + SADD_MBQCHAR_BODY(temp, string, sindex, string_size); + } + else +#endif + { + twochars[0] = CTLESC; + twochars[1] = c; + goto add_twochars; + } + } + } + + SADD_MBCHAR (temp, string, sindex, string_size); + + add_character: + RESIZE_MALLOCED_BUFFER (istring, istring_index, 1, istring_size, + DEFAULT_ARRAY_SIZE); + istring[istring_index++] = c; + istring[istring_index] = '\0'; + + /* Next character. */ + sindex++; + } + } + +finished_with_string: + /* OK, we're ready to return. If we have a quoted string, and + quoted_dollar_at is not set, we do no splitting at all; otherwise + we split on ' '. The routines that call this will handle what to + do if nothing has been expanded. */ + + /* Partially and wholly quoted strings which expand to the empty + string are retained as an empty arguments. Unquoted strings + which expand to the empty string are discarded. The single + exception is the case of expanding "$@" when there are no + positional parameters. In that case, we discard the expansion. */ + + /* Because of how the code that handles "" and '' in partially + quoted strings works, we need to make ISTRING into a QUOTED_NULL + if we saw quoting characters, but the expansion was empty. + "" and '' are tossed away before we get to this point when + processing partially quoted strings. This makes "" and $xxx"" + equivalent when xxx is unset. We also look to see whether we + saw a quoted null from a ${} expansion and add one back if we + need to. */ + + /* If we expand to nothing and there were no single or double quotes + in the word, we throw it away. Otherwise, we return a NULL word. + The single exception is for $@ surrounded by double quotes when + there are no positional parameters. In that case, we also throw + the word away. */ + + if (*istring == '\0') + { + if (quoted_dollar_at == 0 && (had_quoted_null || quoted_state == PARTIALLY_QUOTED)) + { + istring[0] = CTLNUL; + istring[1] = '\0'; + tword = make_bare_word (istring); + list = make_word_list (tword, (WORD_LIST *)NULL); + if (quoted & (Q_HERE_DOCUMENT|Q_DOUBLE_QUOTES)) + tword->flags |= W_QUOTED; + } + /* According to sh, ksh, and Posix.2, if a word expands into nothing + and a double-quoted "$@" appears anywhere in it, then the entire + word is removed. */ + else if (quoted_state == UNQUOTED || quoted_dollar_at) + list = (WORD_LIST *)NULL; +#if 0 + else + { + tword = make_bare_word (istring); + list = make_word_list (tword, (WORD_LIST *)NULL); + if (quoted & (Q_HERE_DOCUMENT|Q_DOUBLE_QUOTES)) + tword->flags |= W_QUOTED; + } +#else + else + list = (WORD_LIST *)NULL; +#endif + } + else if (word->flags & W_NOSPLIT) + { + tword = make_bare_word (istring); + list = make_word_list (tword, (WORD_LIST *)NULL); + if (word->flags & W_ASSIGNMENT) + tword->flags |= W_ASSIGNMENT; /* XXX */ + if (word->flags & W_NOGLOB) + tword->flags |= W_NOGLOB; /* XXX */ + if (quoted & (Q_HERE_DOCUMENT|Q_DOUBLE_QUOTES)) + tword->flags |= W_QUOTED; + } + else + { + char *ifs_chars; + + ifs_chars = (quoted_dollar_at || has_dollar_at) ? ifs_value : (char *)NULL; + + /* If we have $@, we need to split the results no matter what. If + IFS is unset or NULL, string_list_dollar_at has separated the + positional parameters with a space, so we split on space (we have + set ifs_chars to " \t\n" above if ifs is unset). If IFS is set, + string_list_dollar_at has separated the positional parameters + with the first character of $IFS, so we split on $IFS. */ + if (has_dollar_at && ifs_chars) + list = list_string (istring, *ifs_chars ? ifs_chars : " ", 1); + else + { + tword = make_bare_word (istring); + list = make_word_list (tword, (WORD_LIST *)NULL); + if ((quoted & (Q_DOUBLE_QUOTES|Q_HERE_DOCUMENT)) || (quoted_state == WHOLLY_QUOTED)) + tword->flags |= W_QUOTED; + if (word->flags & W_ASSIGNMENT) + tword->flags |= W_ASSIGNMENT; + if (word->flags & W_NOGLOB) + tword->flags |= W_NOGLOB; + } + } + + free (istring); + return (list); +} + +/* **************************************************************** */ +/* */ +/* Functions for Quote Removal */ +/* */ +/* **************************************************************** */ + +/* Perform quote removal on STRING. If QUOTED > 0, assume we are obeying the + backslash quoting rules for within double quotes or a here document. */ +char * +string_quote_removal (string, quoted) + char *string; + int quoted; +{ + size_t slen; + char *r, *result_string, *temp, *send; + int sindex, tindex, dquote; + unsigned char c; + DECLARE_MBSTATE; + + /* The result can be no longer than the original string. */ + slen = strlen (string); + send = string + slen; + + r = result_string = (char *)xmalloc (slen + 1); + + for (dquote = sindex = 0; c = string[sindex];) + { + switch (c) + { + case '\\': + c = string[++sindex]; + if (((quoted & (Q_HERE_DOCUMENT|Q_DOUBLE_QUOTES)) || dquote) && (sh_syntaxtab[c] & CBSDQUOTE) == 0) + *r++ = '\\'; + /* FALLTHROUGH */ + + default: + SCOPY_CHAR_M (r, string, send, sindex); + break; + + case '\'': + if ((quoted & (Q_HERE_DOCUMENT|Q_DOUBLE_QUOTES)) || dquote) + { + *r++ = c; + sindex++; + break; + } + tindex = sindex + 1; + temp = string_extract_single_quoted (string, &tindex); + if (temp) + { + strcpy (r, temp); + r += strlen (r); + free (temp); + } + sindex = tindex; + break; + + case '"': + dquote = 1 - dquote; + sindex++; + break; + } + } + *r = '\0'; + return (result_string); +} + +#if 0 +/* UNUSED */ +/* Perform quote removal on word WORD. This allocates and returns a new + WORD_DESC *. */ +WORD_DESC * +word_quote_removal (word, quoted) + WORD_DESC *word; + int quoted; +{ + WORD_DESC *w; + char *t; + + t = string_quote_removal (word->word, quoted); + w = make_bare_word (t); + free (t); + return (w); +} + +/* Perform quote removal on all words in LIST. If QUOTED is non-zero, + the members of the list are treated as if they are surrounded by + double quotes. Return a new list, or NULL if LIST is NULL. */ +WORD_LIST * +word_list_quote_removal (list, quoted) + WORD_LIST *list; + int quoted; +{ + WORD_LIST *result, *t, *tresult; + + for (t = list, result = (WORD_LIST *)NULL; t; t = t->next) + { + tresult = make_word_list (word_quote_removal (t->word, quoted), (WORD_LIST *)NULL); + result = (WORD_LIST *) list_append (result, tresult); + } + return (result); +} +#endif + +/******************************************* + * * + * Functions to perform word splitting * + * * + *******************************************/ + +void +setifs (v) + SHELL_VAR *v; +{ + char *t; + unsigned char uc; + + ifs_var = v; + ifs_value = v ? value_cell (v) : " \t\n"; + + /* Should really merge ifs_cmap with sh_syntaxtab. */ + memset (ifs_cmap, '\0', sizeof (ifs_cmap)); + for (t = ifs_value ; t && *t; t++) + { + uc = *t; + ifs_cmap[uc] = 1; + } + + ifs_firstc = ifs_value ? *ifs_value : 0; +} + +char * +getifs () +{ + return ifs_value; +} + +/* This splits a single word into a WORD LIST on $IFS, but only if the word + is not quoted. list_string () performs quote removal for us, even if we + don't do any splitting. */ +WORD_LIST * +word_split (w, ifs_chars) + WORD_DESC *w; + char *ifs_chars; +{ + WORD_LIST *result; + + if (w) + { + char *xifs; + + xifs = ((w->flags & W_QUOTED) || ifs_chars == 0) ? "" : ifs_chars; + result = list_string (w->word, xifs, w->flags & W_QUOTED); + } + else + result = (WORD_LIST *)NULL; + + return (result); +} + +/* Perform word splitting on LIST and return the RESULT. It is possible + to return (WORD_LIST *)NULL. */ +static WORD_LIST * +word_list_split (list) + WORD_LIST *list; +{ + WORD_LIST *result, *t, *tresult; + + for (t = list, result = (WORD_LIST *)NULL; t; t = t->next) + { + tresult = word_split (t->word, ifs_value); + result = (WORD_LIST *) list_append (result, tresult); + } + return (result); +} + +/************************************************** + * * + * Functions to expand an entire WORD_LIST * + * * + **************************************************/ + +/* Do any word-expansion-specific cleanup and jump to top_level */ +static void +exp_jump_to_top_level (v) + int v; +{ + /* Cleanup code goes here. */ + expand_no_split_dollar_star = 0; /* XXX */ + expanding_redir = 0; + + jump_to_top_level (v); +} + +/* Put NLIST (which is a WORD_LIST * of only one element) at the front of + ELIST, and set ELIST to the new list. */ +#define PREPEND_LIST(nlist, elist) \ + do { nlist->next = elist; elist = nlist; } while (0) + +/* Separate out any initial variable assignments from TLIST. If set -k has + been executed, remove all assignment statements from TLIST. Initial + variable assignments and other environment assignments are placed + on SUBST_ASSIGN_VARLIST. */ +static WORD_LIST * +separate_out_assignments (tlist) + WORD_LIST *tlist; +{ + register WORD_LIST *vp, *lp; + + if (!tlist) + return ((WORD_LIST *)NULL); + + if (subst_assign_varlist) + dispose_words (subst_assign_varlist); /* Clean up after previous error */ + + subst_assign_varlist = (WORD_LIST *)NULL; + vp = lp = tlist; + + /* Separate out variable assignments at the start of the command. + Loop invariant: vp->next == lp + Loop postcondition: + lp = list of words left after assignment statements skipped + tlist = original list of words + */ + while (lp && (lp->word->flags & W_ASSIGNMENT)) + { + vp = lp; + lp = lp->next; + } + + /* If lp != tlist, we have some initial assignment statements. + We make SUBST_ASSIGN_VARLIST point to the list of assignment + words and TLIST point to the remaining words. */ + if (lp != tlist) + { + subst_assign_varlist = tlist; + /* ASSERT(vp->next == lp); */ + vp->next = (WORD_LIST *)NULL; /* terminate variable list */ + tlist = lp; /* remainder of word list */ + } + + /* vp == end of variable list */ + /* tlist == remainder of original word list without variable assignments */ + if (!tlist) + /* All the words in tlist were assignment statements */ + return ((WORD_LIST *)NULL); + + /* ASSERT(tlist != NULL); */ + /* ASSERT((tlist->word->flags & W_ASSIGNMENT) == 0); */ + + /* If the -k option is in effect, we need to go through the remaining + words, separate out the assignment words, and place them on + SUBST_ASSIGN_VARLIST. */ + if (place_keywords_in_env) + { + WORD_LIST *tp; /* tp == running pointer into tlist */ + + tp = tlist; + lp = tlist->next; + + /* Loop Invariant: tp->next == lp */ + /* Loop postcondition: tlist == word list without assignment statements */ + while (lp) + { + if (lp->word->flags & W_ASSIGNMENT) + { + /* Found an assignment statement, add this word to end of + subst_assign_varlist (vp). */ + if (!subst_assign_varlist) + subst_assign_varlist = vp = lp; + else + { + vp->next = lp; + vp = lp; + } + + /* Remove the word pointed to by LP from TLIST. */ + tp->next = lp->next; + /* ASSERT(vp == lp); */ + lp->next = (WORD_LIST *)NULL; + lp = tp->next; + } + else + { + tp = lp; + lp = lp->next; + } + } + } + return (tlist); +} + +#define WEXP_VARASSIGN 0x001 +#define WEXP_BRACEEXP 0x002 +#define WEXP_TILDEEXP 0x004 +#define WEXP_PARAMEXP 0x008 +#define WEXP_PATHEXP 0x010 + +/* All of the expansions, including variable assignments at the start of + the list. */ +#define WEXP_ALL (WEXP_VARASSIGN|WEXP_BRACEEXP|WEXP_TILDEEXP|WEXP_PARAMEXP|WEXP_PATHEXP) + +/* All of the expansions except variable assignments at the start of + the list. */ +#define WEXP_NOVARS (WEXP_BRACEEXP|WEXP_TILDEEXP|WEXP_PARAMEXP|WEXP_PATHEXP) + +/* All of the `shell expansions': brace expansion, tilde expansion, parameter + expansion, command substitution, arithmetic expansion, word splitting, and + quote removal. */ +#define WEXP_SHELLEXP (WEXP_BRACEEXP|WEXP_TILDEEXP|WEXP_PARAMEXP) + +/* Take the list of words in LIST and do the various substitutions. Return + a new list of words which is the expanded list, and without things like + variable assignments. */ + +WORD_LIST * +expand_words (list) + WORD_LIST *list; +{ + return (expand_word_list_internal (list, WEXP_ALL)); +} + +/* Same as expand_words (), but doesn't hack variable or environment + variables. */ +WORD_LIST * +expand_words_no_vars (list) + WORD_LIST *list; +{ + return (expand_word_list_internal (list, WEXP_NOVARS)); +} + +WORD_LIST * +expand_words_shellexp (list) + WORD_LIST *list; +{ + return (expand_word_list_internal (list, WEXP_SHELLEXP)); +} + +static WORD_LIST * +glob_expand_word_list (tlist, eflags) + WORD_LIST *tlist; + int eflags; +{ + char **glob_array, *temp_string; + register int glob_index; + WORD_LIST *glob_list, *output_list, *disposables, *next; + WORD_DESC *tword; + + output_list = disposables = (WORD_LIST *)NULL; + glob_array = (char **)NULL; + while (tlist) + { + /* For each word, either globbing is attempted or the word is + added to orig_list. If globbing succeeds, the results are + added to orig_list and the word (tlist) is added to the list + of disposable words. If globbing fails and failed glob + expansions are left unchanged (the shell default), the + original word is added to orig_list. If globbing fails and + failed glob expansions are removed, the original word is + added to the list of disposable words. orig_list ends up + in reverse order and requires a call to REVERSE_LIST to + be set right. After all words are examined, the disposable + words are freed. */ + next = tlist->next; + + /* If the word isn't an assignment and contains an unquoted + pattern matching character, then glob it. */ + if ((tlist->word->flags & W_NOGLOB) == 0 && + unquoted_glob_pattern_p (tlist->word->word)) + { + glob_array = shell_glob_filename (tlist->word->word); + + /* Handle error cases. + I don't think we should report errors like "No such file + or directory". However, I would like to report errors + like "Read failed". */ + + if (glob_array == 0 || GLOB_FAILED (glob_array)) + { + glob_array = (char **)xmalloc (sizeof (char *)); + glob_array[0] = (char *)NULL; + } + + /* Dequote the current word in case we have to use it. */ + if (glob_array[0] == NULL) + { + temp_string = dequote_string (tlist->word->word); + free (tlist->word->word); + tlist->word->word = temp_string; + } + + /* Make the array into a word list. */ + glob_list = (WORD_LIST *)NULL; + for (glob_index = 0; glob_array[glob_index]; glob_index++) + { + tword = make_bare_word (glob_array[glob_index]); + tword->flags |= W_GLOBEXP; /* XXX */ + glob_list = make_word_list (tword, glob_list); + } + + if (glob_list) + { + output_list = (WORD_LIST *)list_append (glob_list, output_list); + PREPEND_LIST (tlist, disposables); + } + else if (fail_glob_expansion != 0) + { + report_error (_("no match: %s"), tlist->word->word); + jump_to_top_level (DISCARD); + } + else if (allow_null_glob_expansion == 0) + { + /* Failed glob expressions are left unchanged. */ + PREPEND_LIST (tlist, output_list); + } + else + { + /* Failed glob expressions are removed. */ + PREPEND_LIST (tlist, disposables); + } + } + else + { + /* Dequote the string. */ + temp_string = dequote_string (tlist->word->word); + free (tlist->word->word); + tlist->word->word = temp_string; + PREPEND_LIST (tlist, output_list); + } + + strvec_dispose (glob_array); + glob_array = (char **)NULL; + + tlist = next; + } + + if (disposables) + dispose_words (disposables); + + if (output_list) + output_list = REVERSE_LIST (output_list, WORD_LIST *); + + return (output_list); +} + +#if defined (BRACE_EXPANSION) +static WORD_LIST * +brace_expand_word_list (tlist, eflags) + WORD_LIST *tlist; + int eflags; +{ + register char **expansions; + char *temp_string; + WORD_LIST *disposables, *output_list, *next; + WORD_DESC *w; + int eindex; + + for (disposables = output_list = (WORD_LIST *)NULL; tlist; tlist = next) + { + next = tlist->next; + + /* Only do brace expansion if the word has a brace character. If + not, just add the word list element to BRACES and continue. In + the common case, at least when running shell scripts, this will + degenerate to a bunch of calls to `xstrchr', and then what is + basically a reversal of TLIST into BRACES, which is corrected + by a call to REVERSE_LIST () on BRACES when the end of TLIST + is reached. */ + if (xstrchr (tlist->word->word, LBRACE)) + { + expansions = brace_expand (tlist->word->word); + + for (eindex = 0; temp_string = expansions[eindex]; eindex++) + { + w = make_word (temp_string); + /* If brace expansion didn't change the word, preserve + the flags. We may want to preserve the flags + unconditionally someday -- XXX */ + if (STREQ (temp_string, tlist->word->word)) + w->flags = tlist->word->flags; + output_list = make_word_list (w, output_list); + free (expansions[eindex]); + } + free (expansions); + + /* Add TLIST to the list of words to be freed after brace + expansion has been performed. */ + PREPEND_LIST (tlist, disposables); + } + else + PREPEND_LIST (tlist, output_list); + } + + if (disposables) + dispose_words (disposables); + + if (output_list) + output_list = REVERSE_LIST (output_list, WORD_LIST *); + + return (output_list); +} +#endif + +static WORD_LIST * +shell_expand_word_list (tlist, eflags) + WORD_LIST *tlist; + int eflags; +{ + WORD_LIST *expanded, *orig_list, *new_list, *next, *temp_list; + int expanded_something, has_dollar_at; + char *temp_string; + + /* We do tilde expansion all the time. This is what 1003.2 says. */ + new_list = (WORD_LIST *)NULL; + for (orig_list = tlist; tlist; tlist = next) + { + temp_string = tlist->word->word; + + next = tlist->next; + + /* Posix.2 section 3.6.1 says that tildes following `=' in words + which are not assignment statements are not expanded. If the + shell isn't in posix mode, though, we perform tilde expansion + on `likely candidate' unquoted assignment statements (flags + include W_ASSIGNMENT but not W_QUOTED). A likely candidate + contains an unquoted :~ or =~. Something to think about: we + now have a flag that says to perform tilde expansion on arguments + to `assignment builtins' like declare and export that look like + assignment statements. We now do tilde expansion on such words + even in POSIX mode. */ + if (((tlist->word->flags & (W_ASSIGNMENT|W_QUOTED)) == W_ASSIGNMENT) && + (posixly_correct == 0 || (tlist->word->flags & W_TILDEEXP)) && + (unquoted_substring ("=~", temp_string) || unquoted_substring (":~", temp_string))) + { + tlist->word->word = bash_tilde_expand (temp_string, 1); + free (temp_string); + } + else if (temp_string[0] == '~') + { + tlist->word->word = bash_tilde_expand (temp_string, 0); + free (temp_string); + } + + expanded_something = 0; + expanded = expand_word_internal + (tlist->word, 0, 0, &has_dollar_at, &expanded_something); + + if (expanded == &expand_word_error || expanded == &expand_word_fatal) + { + /* By convention, each time this error is returned, + tlist->word->word has already been freed. */ + tlist->word->word = (char *)NULL; + + /* Dispose our copy of the original list. */ + dispose_words (orig_list); + /* Dispose the new list we're building. */ + dispose_words (new_list); + + last_command_exit_value = EXECUTION_FAILURE; + if (expanded == &expand_word_error) + exp_jump_to_top_level (DISCARD); + else + exp_jump_to_top_level (FORCE_EOF); + } + + /* Don't split words marked W_NOSPLIT. */ + if (expanded_something && (tlist->word->flags & W_NOSPLIT) == 0) + { + temp_list = word_list_split (expanded); + dispose_words (expanded); + } + else + { + /* If no parameter expansion, command substitution, process + substitution, or arithmetic substitution took place, then + do not do word splitting. We still have to remove quoted + null characters from the result. */ + word_list_remove_quoted_nulls (expanded); + temp_list = expanded; + } + + expanded = REVERSE_LIST (temp_list, WORD_LIST *); + new_list = (WORD_LIST *)list_append (expanded, new_list); + } + + if (orig_list) + dispose_words (orig_list); + + if (new_list) + new_list = REVERSE_LIST (new_list, WORD_LIST *); + + return (new_list); +} + +/* The workhorse for expand_words () and expand_words_no_vars (). + First arg is LIST, a WORD_LIST of words. + Second arg EFLAGS is a flags word controlling which expansions are + performed. + + This does all of the substitutions: brace expansion, tilde expansion, + parameter expansion, command substitution, arithmetic expansion, + process substitution, word splitting, and pathname expansion, according + to the bits set in EFLAGS. Words with the W_QUOTED or W_NOSPLIT bits + set, or for which no expansion is done, do not undergo word splitting. + Words with the W_NOGLOB bit set do not undergo pathname expansion. */ +static WORD_LIST * +expand_word_list_internal (list, eflags) + WORD_LIST *list; + int eflags; +{ + WORD_LIST *new_list, *temp_list; + int tint; + + if (list == 0) + return ((WORD_LIST *)NULL); + + garglist = new_list = copy_word_list (list); + if (eflags & WEXP_VARASSIGN) + { + garglist = new_list = separate_out_assignments (new_list); + if (new_list == 0) + { + if (subst_assign_varlist) + { + /* All the words were variable assignments, so they are placed + into the shell's environment. */ + for (temp_list = subst_assign_varlist; temp_list; temp_list = temp_list->next) + { + this_command_name = (char *)NULL; /* no arithmetic errors */ + tint = do_assignment (temp_list->word->word); + /* Variable assignment errors in non-interactive shells + running in Posix.2 mode cause the shell to exit. */ + if (tint == 0) + { + last_command_exit_value = EXECUTION_FAILURE; + if (interactive_shell == 0 && posixly_correct) + exp_jump_to_top_level (FORCE_EOF); + else + exp_jump_to_top_level (DISCARD); + } + } + dispose_words (subst_assign_varlist); + subst_assign_varlist = (WORD_LIST *)NULL; + } + return ((WORD_LIST *)NULL); + } + } + + /* Begin expanding the words that remain. The expansions take place on + things that aren't really variable assignments. */ + +#if defined (BRACE_EXPANSION) + /* Do brace expansion on this word if there are any brace characters + in the string. */ + if ((eflags & WEXP_BRACEEXP) && brace_expansion && new_list) + new_list = brace_expand_word_list (new_list, eflags); +#endif /* BRACE_EXPANSION */ + + /* Perform the `normal' shell expansions: tilde expansion, parameter and + variable substitution, command substitution, arithmetic expansion, + and word splitting. */ + new_list = shell_expand_word_list (new_list, eflags); + + /* Okay, we're almost done. Now let's just do some filename + globbing. */ + if (new_list) + { + if ((eflags & WEXP_PATHEXP) && disallow_filename_globbing == 0) + /* Glob expand the word list unless globbing has been disabled. */ + new_list = glob_expand_word_list (new_list, eflags); + else + /* Dequote the words, because we're not performing globbing. */ + new_list = dequote_list (new_list); + } + + if ((eflags & WEXP_VARASSIGN) && subst_assign_varlist) + { + sh_assign_func_t *assign_func; + + /* If the remainder of the words expand to nothing, Posix.2 requires + that the variable and environment assignments affect the shell's + environment. */ + assign_func = new_list ? assign_in_env : do_assignment; + + for (temp_list = subst_assign_varlist; temp_list; temp_list = temp_list->next) + { + this_command_name = (char *)NULL; + tint = (*assign_func) (temp_list->word->word); + /* Variable assignment errors in non-interactive shells running + in Posix.2 mode cause the shell to exit. */ + if (tint == 0 && assign_func == do_assignment) + { + last_command_exit_value = EXECUTION_FAILURE; + if (interactive_shell == 0 && posixly_correct) + exp_jump_to_top_level (FORCE_EOF); + else + exp_jump_to_top_level (DISCARD); + } + } + + dispose_words (subst_assign_varlist); + subst_assign_varlist = (WORD_LIST *)NULL; + } + +#if 0 + tint = list_length (new_list) + 1; + RESIZE_MALLOCED_BUFFER (glob_argv_flags, 0, tint, glob_argv_flags_size, 16); + for (tint = 0, temp_list = new_list; temp_list; temp_list = temp_list->next) + glob_argv_flags[tint++] = (temp_list->word->flags & W_GLOBEXP) ? '1' : '0'; + glob_argv_flags[tint] = '\0'; +#endif + + return (new_list); +} diff --git a/support/mkconffiles b/support/mkconffiles old mode 100755 new mode 100644 diff --git a/support/mkversion.sh b/support/mkversion.sh old mode 100755 new mode 100644 diff --git a/support/rlvers.sh b/support/rlvers.sh old mode 100755 new mode 100644 diff --git a/tests/? b/tests/? deleted file mode 100644 index 857f13ad..00000000 --- a/tests/? +++ /dev/null @@ -1 +0,0 @@ -$ diff --git a/tests/cprint.right.save1 b/tests/cprint.right.save1 new file mode 100644 index 00000000..6b711b8c --- /dev/null +++ b/tests/cprint.right.save1 @@ -0,0 +1,72 @@ +tf is a function +tf () +{ + echo this is ${0##*/} >/dev/null; + echo a | cat - >/dev/null; + test -f ${0##*/} && echo ${0##*/} is a regular file; + test -d ${0##*/} || echo ${0##*/} is not a directory; + echo a; + echo b; + echo c; + echo background >/dev/null & ( exit 1 ); + echo $?; + { + echo a + }; + i=0; + while (( " i < 3 " )); do + test -r /dev/fd/$i; + i=$(( i + 1 )); + done; + [[ -r /dev/fd/0 && -w /dev/fd/1 ]] || echo oops >/dev/null; + for name in $( echo 1 2 3 ); + do + test -r /dev/fd/$name; + done; + if [[ -r /dev/fd/0 && -w /dev/fd/1 ]]; then + echo ok >/dev/null; + else + if (( " 7 > 40 " )); then + echo oops; + else + echo done; + fi; + fi >/dev/null; + case $PATH in + *$PWD*) + echo \$PWD in \$PATH + ;; + *) + echo \$PWD not in \$PATH + ;; + esac >/dev/null; + while false; do + echo z; + done >/dev/null; + until true; do + echo z; + done >/dev/null; + echo \&\|'()' \{ echo abcde \; \}; + eval fu\%nc'()' \{ echo abcde \; \}; + type fu\%nc +} +tf2 is a function +tf2 () +{ + ( { + time -p echo a | cat - >/dev/null + } ) 2>&1 +} +cprint.tests is a regular file +cprint.tests is not a directory +a +b +c +1 +a +&|() { echo abcde ; } +fu%nc is a function +fu%nc () +{ + echo abcde +} diff --git a/tests/history.tests.save b/tests/history.tests.save new file mode 100644 index 00000000..4a218c30 --- /dev/null +++ b/tests/history.tests.save @@ -0,0 +1,97 @@ +trap 'rm /tmp/newhistory' 0 + +# bad options +history -x +# cannot use -r and -w at the same time +history -r -w /dev/null + +# bad option +fc -v + +# all of these should result in an empty history list +history -c +history -r /dev/null +history -n /dev/null +history -c + +HISTFILE=history.list +HISTCONTROL=ignoreboth +HISTIGNORE='&:history*:fc*' +HISTSIZE=32 + +shopt -s cmdhist +set -o history + +history + +fc -l +fc -nl + +fc -lr +fc -nlr + +history -s "echo line for history" +history + +history -p '!!' + +fc -nl + +HISTFILE=/tmp/newhistory +history -a +echo displaying \$HISTFILE after history -a +cat $HISTFILE + +history +history -w +cat $HISTFILE + +history -s "echo line 2 for history" +history +history -p '!e' +history -p '!!' + +# this should show up as one history entry +for x in one two three +do + : +done +history + +# just a basic test. a full test suite for history expansion should be +# created +set -H +!! +!e + +unset HISTSIZE +unset HISTFILE + +fc -l 4 +fc -l 4 8 + +fc -l 502 +fc -l one=two three=four 502 + +history 4 + +shopt -so history +shopt -s expand_aliases + +alias r="fc -s" + +echo aa ab ac + +r a=x +r x=4 b=8 + +# this had better fail with `no command found' +r cc + +unalias -a +alias + +set +o history + +shopt -q -o history +echo $? diff --git a/tests/misc/regress/log.orig b/tests/misc/regress/log.orig new file mode 100644 index 00000000..c1f1e199 --- /dev/null +++ b/tests/misc/regress/log.orig @@ -0,0 +1,50 @@ +:; ./shx + +sh: +<&$fd ok +nlbq Mon Aug 3 02:45:00 EDT 1992 +bang geoff +quote 712824302 +setbq defmsgid=<1992Aug3.024502.6176@host> +bgwait sleep done... wait 6187 + + +bash: +<&$fd ok +nlbq Mon Aug 3 02:45:09 EDT 1992 +bang geoff +quote 712824311 +setbq defmsgid=<1992Aug3.024512.6212@host> +bgwait sleep done... wait 6223 + + +ash: +<&$fd shx1: 4: Syntax error: Bad fd number +nlbq Mon Aug 3 02:45:19 EDT 1992 +bang geoff +quote getdate: `"now"' not a valid date + +setbq defmsgid=<1992Aug3.` echo 024521 +bgwait sleep done... wait 6241 + + +ksh: +<&$fd ok +nlbq ./shx: 6248 Memory fault - core dumped +bang geoff +quote getdate: `"now"' not a valid date + +setbq defmsgid=<1992Aug3.024530.6257@host> +bgwait no such job: 6265 +wait 6265 +sleep done... + +zsh: +<&$fd ok +nlbq Mon Aug 3 02:45:36 EDT 1992 +bang shx3: event not found: /s/ [4] +quote 712824337 +setbq defmsgid=<..6290@host> +bgwait shx7: unmatched " [9] +sleep done... +:; diff --git a/tests/misc/regress/shx.orig b/tests/misc/regress/shx.orig new file mode 100644 index 00000000..4b3bf2b8 --- /dev/null +++ b/tests/misc/regress/shx.orig @@ -0,0 +1,10 @@ +#! /bin/sh +for cmd in sh bash ash ksh zsh +do + echo + echo $cmd: + for demo in shx? + do + $cmd $demo + done +done diff --git a/tests/run-histexpand.debug b/tests/run-histexpand.debug new file mode 100644 index 00000000..16b325fa --- /dev/null +++ b/tests/run-histexpand.debug @@ -0,0 +1,4 @@ +echo "warning: all of these tests will fail if history has not been compiled" >&2 +echo "warning: into the shell" >&2 +${THIS_SH} +o histexpand ./histexp.tests > /tmp/xx 2>&1 +diff /tmp/xx histexp.right && rm -f /tmp/xx -- cgit v1.2.1