From: Chet Ramey Date: Fri, 21 Jun 2024 14:38:39 +0000 (-0400) Subject: better parser error messages; add -p option to source builtin X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=886e4e68be1aa8778b0ec6bbe45edbc4529c8ace;p=thirdparty%2Fbash.git better parser error messages; add -p option to source builtin --- diff --git a/CWRU/CWRU.chlog b/CWRU/CWRU.chlog index 54420f56..1cab359e 100644 --- a/CWRU/CWRU.chlog +++ b/CWRU/CWRU.chlog @@ -9626,3 +9626,23 @@ parse.y - cond_term: if we read a WORD where we expect something else, dispose of the WORD_DESC before returning COND_ERROR Report and patch from Grisha Levit + + 6/10 + ---- +parse.y + - cond_term: if we read a WORD when expecting a close paren, dispose + of the WORD_DESC before returning COND_ERROR + - error_token_from_token: use the TOK argument instead of + current_token if we can't find the token as a reserved word or + symbol + + 6/12 + ---- +builtins/source.def + - source_builtin: add -p PATH option, searches PATH argument instead + of $PATH; overrides sourcepath; does not search $PWD if path search + fails + +doc/bash.1,doc/bashref.texi + - source: document -p + diff --git a/MANIFEST b/MANIFEST index 0d2f5f06..b19ee02c 100644 --- a/MANIFEST +++ b/MANIFEST @@ -1047,6 +1047,7 @@ tests/source4.sub f tests/source5.sub f tests/source6.sub f tests/source7.sub f +tests/source8.sub f tests/case.tests f tests/case.right f tests/case1.sub f diff --git a/builtins/source.def b/builtins/source.def index 3932bf7b..fa3d5ce1 100644 --- a/builtins/source.def +++ b/builtins/source.def @@ -1,7 +1,7 @@ This file is source.def, from which is created source.c. It implements the builtins "." and "source" in Bash. -Copyright (C) 1987-2023 Free Software Foundation, Inc. +Copyright (C) 1987-2024 Free Software Foundation, Inc. This file is part of GNU Bash, the Bourne Again SHell. @@ -22,13 +22,14 @@ $PRODUCES source.c $BUILTIN source $FUNCTION source_builtin -$SHORT_DOC source filename [arguments] +$SHORT_DOC source [-p path] filename [arguments] Execute commands from a file in the current shell. -Read and execute commands from FILENAME in the current shell. The -entries in $PATH are used to find the directory containing FILENAME. -If any ARGUMENTS are supplied, they become the positional parameters -when FILENAME is executed. +Read and execute commands from FILENAME in the current shell. If the +-p option is supplied, the PATH argument is treated as a colon- +separated list of directories to search for FILENAME. If -p is not +supplied, $PATH is searched to find FILENAME. If any ARGUMENTS are +supplied, they become the positional parameters when FILENAME is executed. Exit Status: Returns the status of the last command executed in FILENAME; fails if @@ -38,13 +39,14 @@ $END $BUILTIN . $DOCNAME dot $FUNCTION source_builtin -$SHORT_DOC . filename [arguments] +$SHORT_DOC . [-p path] filename [arguments] Execute commands from a file in the current shell. -Read and execute commands from FILENAME in the current shell. The -entries in $PATH are used to find the directory containing FILENAME. -If any ARGUMENTS are supplied, they become the positional parameters -when FILENAME is executed. +Read and execute commands from FILENAME in the current shell. If the +-p option is supplied, the PATH argument is treated as a colon- +separated list of directories to search for FILENAME. If -p is not +supplied, $PATH is searched to find FILENAME. If any ARGUMENTS are +supplied, they become the positional parameters when FILENAME is executed. Exit Status: Returns the status of the last command executed in FILENAME; fails if @@ -82,7 +84,8 @@ extern int errno; static void uw_maybe_pop_dollar_vars (void *); -/* If non-zero, `.' uses $PATH to look up the script to be sourced. */ +/* If non-zero, `.' uses $PATH to look up the script to be sourced when -p is + not supplied. */ int source_uses_path = 1; /* If non-zero, `.' looks in the current directory if the filename argument @@ -115,11 +118,24 @@ uw_maybe_pop_dollar_vars (void *ignore) int source_builtin (WORD_LIST *list) { - int result, search_cwd; - char *filename, *debug_trap, *x; + int result, search_cwd, opt; + char *filename, *debug_trap, *x, *pathstring; - if (no_options (list)) - return (EX_USAGE); + pathstring = 0; + reset_internal_getopt (); + while ((opt = internal_getopt (list, "p:")) != -1) + { + switch (opt) + { + case 'p': + pathstring = list_optarg; + break; + CASE_HELPOPT; + default: + builtin_usage (); + return (EX_USAGE); + } + } list = loptend; if (list == 0) @@ -130,14 +146,19 @@ source_builtin (WORD_LIST *list) } #if defined (RESTRICTED_SHELL) - if (restricted && strchr (list->word->word, '/')) + if (restricted && (pathstring || strchr (list->word->word, '/'))) { sh_restricted (list->word->word); return (EXECUTION_FAILURE); } #endif - search_cwd = source_searches_cwd; + /* normalize pathstring */ + if (pathstring && *pathstring == 0) + pathstring = "."; + + /* XXX - If we supply -p PATH, don't default to searching $PWD */ + search_cwd = pathstring == 0 && source_searches_cwd; filename = (char *)NULL; /* XXX -- should this be absolute_pathname? */ @@ -145,23 +166,11 @@ source_builtin (WORD_LIST *list) filename = savestring (list->word->word); else if (absolute_pathname (list->word->word)) filename = savestring (list->word->word); + else if (pathstring) + filename = find_in_path (list->word->word, pathstring, FS_READABLE); else if (source_uses_path) - { -#if 0 - char *spath; -#if defined (RESTRICTED_SHELL) - if (restricted == 0 && posixly_correct == 0 && (spath = path_value ("BASH_SOURCE_PATH", 1))) -#else - if (posixly_correct == 0 && (spath = path_value ("BASH_SOURCE_PATH", 1))) -#endif - { - filename = find_in_path (list->word->word, spath, FS_READABLE); - search_cwd = 0; - } - else -#endif - filename = find_path_file (list->word->word); - } + filename = find_path_file (list->word->word); + if (filename == 0) { if (search_cwd == 0) diff --git a/doc/bash.0 b/doc/bash.0 index 125d15e4..6cd41b43 100644 --- a/doc/bash.0 +++ b/doc/bash.0 @@ -371,9 +371,8 @@ SSHHEELLLL GGRRAAMMMMAARR and pathname expansion. The shell performs tilde expansion, pa- rameter and variable expansion, arithmetic expansion, command substitution, process substitution, and quote removal on those - words (the expansions that would occur if the words were en- - closed in double quotes). Conditional operators such as --ff must - be unquoted to be recognized as primaries. + words. Conditional operators such as --ff must be unquoted to be + recognized as primaries. When used with [[[[, the << and >> operators sort lexicographically using the current locale. @@ -1229,10 +1228,11 @@ PPAARRAAMMEETTEERRSS _-_m_t_i_m_e sorts the results in descending order by modification time (newest first). A sort specifier of _n_o_s_o_r_t disables sort- ing completely; the results are returned in the order they are - read from the file system,. If the sort specifier is missing, - it defaults to _n_a_m_e, so a value of _+ is equivalent to the null - string, and a value of _- sorts by name in descending order. Any - invalid value restores the historical sorting behavior. + read from the file system, and any leading _+ or _- is ignored. + If the sort specifier is missing, it defaults to _n_a_m_e, so a + value of _+ is equivalent to the null string, and a value of _- + sorts by name in descending order. Any invalid value restores + the historical sorting behavior. HHIISSTTCCOONNTTRROOLL A colon-separated list of values controlling how commands are saved on the history list. If the list of values includes @@ -3797,9 +3797,11 @@ RREEAADDLLIINNEE CCoommmmaannddss ffoorr MMoovviinngg bbeeggiinnnniinngg--ooff--lliinnee ((CC--aa)) - Move to the start of the current line. + Move to the start of the current line. This may also be bound + to the Home key on some keyboards. eenndd--ooff--lliinnee ((CC--ee)) - Move to the end of the line. + Move to the end of the line. This may also be bound to the End + key on some keyboards. ffoorrwwaarrdd--cchhaarr ((CC--ff)) Move forward a character. bbaacckkwwaarrdd--cchhaarr ((CC--bb)) @@ -3880,74 +3882,76 @@ RREEAADDLLIINNEE nnoonn--iinnccrreemmeennttaall--ffoorrwwaarrdd--sseeaarrcchh--hhiissttoorryy ((MM--nn)) Search forward through the history using a non-incremental search for a string supplied by the user. - hhiissttoorryy--sseeaarrcchh--ffoorrwwaarrdd - 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. hhiissttoorryy--sseeaarrcchh--bbaacckkwwaarrdd 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. + non-incremental search. This may be bound to the Page Up key on + some keyboards. + hhiissttoorryy--sseeaarrcchh--ffoorrwwaarrdd + 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. This may be bound to the Page Down key + on some keyboards. hhiissttoorryy--ssuubbssttrriinngg--sseeaarrcchh--bbaacckkwwaarrdd Search backward through the history for the string of characters between the start of the current line and the current cursor po- - sition (the _p_o_i_n_t). The search string may match anywhere in a + sition (the _p_o_i_n_t). The search string may match anywhere in a history line. This is a non-incremental search. hhiissttoorryy--ssuubbssttrriinngg--sseeaarrcchh--ffoorrwwaarrdd - Search forward through the history for the string of characters + Search forward through the history for the string of characters between the start of the current line and the point. The search - string may match anywhere in a history line. This is a non-in- + string may match anywhere in a history line. This is a non-in- cremental search. yyaannkk--nntthh--aarrgg ((MM--CC--yy)) - Insert the first argument to the previous command (usually the + Insert the first argument to the previous command (usually the second word on the previous line) at point. With an argument _n, - insert the _nth word from the previous command (the words in the - previous command begin with word 0). A negative argument in- - serts the _nth word from the end of the previous command. Once - the argument _n is computed, the argument is extracted as if the + insert the _nth word from the previous command (the words in the + previous command begin with word 0). A negative argument in- + serts the _nth word from the end of the previous command. Once + the argument _n is computed, the argument is extracted as if the "!_n" history expansion had been specified. yyaannkk--llaasstt--aarrgg ((MM--..,, MM--__)) - Insert the last argument to the previous command (the last word + Insert the last argument to the previous command (the last word of the previous history entry). With a numeric argument, behave - exactly like yyaannkk--nntthh--aarrgg. Successive calls to yyaannkk--llaasstt--aarrgg - move back through the history list, inserting the last word (or - the word specified by the argument to the first call) of each + exactly like yyaannkk--nntthh--aarrgg. Successive calls to yyaannkk--llaasstt--aarrgg + move back through the history list, inserting the last word (or + the word specified by the argument to the first call) of each line in turn. Any numeric argument supplied to these successive - calls determines the direction to move through the history. A - negative argument switches the direction through the history + calls determines the direction to move through the history. A + negative argument switches the direction through the history (back or forward). The history expansion facilities are used to extract the last word, as if the "!$" history expansion had been specified. sshheellll--eexxppaanndd--lliinnee ((MM--CC--ee)) - Expand the line by performing shell word expansions. This per- + Expand the line by performing shell word expansions. This per- forms alias and history expansion, $$'_s_t_r_i_n_g' and $$"_s_t_r_i_n_g" quot- - ing, tilde expansion, parameter and variable expansion, arith- - metic expansion, command and process substitution, word split- - ting, and quote removal. An explicit argument suppresses com- - mand and process substitution. See HHIISSTTOORRYY EEXXPPAANNSSIIOONN below for + ing, tilde expansion, parameter and variable expansion, arith- + metic expansion, command and process substitution, word split- + ting, and quote removal. An explicit argument suppresses com- + mand and process substitution. See HHIISSTTOORRYY EEXXPPAANNSSIIOONN below for a description of history expansion. hhiissttoorryy--eexxppaanndd--lliinnee ((MM--^^)) - Perform history expansion on the current line. See HHIISSTTOORRYY EEXX-- + Perform history expansion on the current line. See HHIISSTTOORRYY EEXX-- PPAANNSSIIOONN below for a description of history expansion. mmaaggiicc--ssppaaccee - Perform history expansion on the current line and insert a + Perform history expansion on the current line and insert a space. See HHIISSTTOORRYY EEXXPPAANNSSIIOONN below for a description of history expansion. aalliiaass--eexxppaanndd--lliinnee - Perform alias expansion on the current line. See AALLIIAASSEESS above + Perform alias expansion on the current line. See AALLIIAASSEESS above for a description of alias expansion. hhiissttoorryy--aanndd--aalliiaass--eexxppaanndd--lliinnee Perform history and alias expansion on the current line. iinnsseerrtt--llaasstt--aarrgguummeenntt ((MM--..,, MM--__)) A synonym for yyaannkk--llaasstt--aarrgg. eeddiitt--aanndd--eexxeeccuuttee--ccoommmmaanndd ((CC--xx CC--ee)) - Invoke an editor on the current command line, and execute the + Invoke an editor on the current command line, and execute the result as shell commands. BBaasshh attempts to invoke $$VVIISSUUAALL, $$EEDD-- IITTOORR, and _e_m_a_c_s as the editor, in that order. CCoommmmaannddss ffoorr CChhaannggiinngg TTeexxtt _e_n_d_-_o_f_-_f_i_l_e ((uussuuaallllyy CC--dd)) - The character indicating end-of-file as set, for example, by + The character indicating end-of-file as set, for example, by _s_t_t_y(1). If this character is read when there are no characters on the line, and point is at the beginning of the line, readline interprets it as the end of input and returns EEOOFF. @@ -3956,47 +3960,48 @@ RREEAADDLLIINNEE same character as the tty EEOOFF character, as CC--dd commonly is, see above for the effects. bbaacckkwwaarrdd--ddeelleettee--cchhaarr ((RRuubboouutt)) - Delete the character behind the cursor. When given a numeric + Delete the character behind the cursor. When given a numeric argument, save the deleted text on the kill ring. ffoorrwwaarrdd--bbaacckkwwaarrdd--ddeelleettee--cchhaarr - Delete the character under the cursor, unless the cursor is at + Delete the character under the cursor, unless the cursor is at the end of the line, in which case the character behind the cur- sor is deleted. qquuootteedd--iinnsseerrtt ((CC--qq,, CC--vv)) - Add the next character typed to the line verbatim. This is how + Add the next character typed to the line verbatim. This is how to insert characters like CC--qq, for example. ttaabb--iinnsseerrtt ((CC--vv TTAABB)) Insert a tab character. sseellff--iinnsseerrtt ((aa,, bb,, AA,, 11,, !!,, ...)) Insert the character typed. ttrraannssppoossee--cchhaarrss ((CC--tt)) - 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. + 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. ttrraannssppoossee--wwoorrddss ((MM--tt)) - 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 + 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. uuppccaassee--wwoorrdd ((MM--uu)) - Uppercase the current (or following) word. With a negative ar- + Uppercase the current (or following) word. With a negative ar- gument, uppercase the previous word, but do not move point. ddoowwnnccaassee--wwoorrdd ((MM--ll)) - Lowercase the current (or following) word. With a negative ar- + Lowercase the current (or following) word. With a negative ar- gument, lowercase the previous word, but do not move point. ccaappiittaalliizzee--wwoorrdd ((MM--cc)) Capitalize the current (or following) word. With a negative ar- gument, capitalize the previous word, but do not move point. oovveerrwwrriittee--mmooddee - Toggle overwrite mode. With an explicit positive numeric argu- + Toggle overwrite mode. With an explicit positive numeric argu- ment, switches to overwrite mode. With an explicit non-positive numeric argument, switches to insert mode. This command affects - only eemmaaccss mode; vvii mode does overwrite differently. Each call + only eemmaaccss mode; vvii mode does overwrite differently. Each call to _r_e_a_d_l_i_n_e_(_) starts in insert mode. In overwrite mode, charac- - ters bound to sseellff--iinnsseerrtt replace the text at point rather than - pushing the text to the right. Characters bound to bbaacckk-- - wwaarrdd--ddeelleettee--cchhaarr replace the character before point with a - space. By default, this command is unbound. + ters bound to sseellff--iinnsseerrtt replace the text at point rather than + pushing the text to the right. Characters bound to bbaacckk-- + wwaarrdd--ddeelleettee--cchhaarr replace the character before point with a + space. By default, this command is unbound, but may be bound to + the Insert key on some keyboards. KKiilllliinngg aanndd YYaannkkiinngg kkiillll--lliinnee ((CC--kk)) @@ -4004,31 +4009,31 @@ RREEAADDLLIINNEE bbaacckkwwaarrdd--kkiillll--lliinnee ((CC--xx RRuubboouutt)) Kill backward to the beginning of the line. uunniixx--lliinnee--ddiissccaarrdd ((CC--uu)) - Kill backward from point to the beginning of the line. The + Kill backward from point to the beginning of the line. The killed text is saved on the kill-ring. kkiillll--wwhhoollee--lliinnee - Kill all characters on the current line, no matter where point + Kill all characters on the current line, no matter where point is. kkiillll--wwoorrdd ((MM--dd)) - 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 + 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 ffoorrwwaarrdd--wwoorrdd. bbaacckkwwaarrdd--kkiillll--wwoorrdd ((MM--RRuubboouutt)) - Kill the word behind point. Word boundaries are the same as + Kill the word behind point. Word boundaries are the same as those used by bbaacckkwwaarrdd--wwoorrdd. sshheellll--kkiillll--wwoorrdd - 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 + 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 sshheellll--ffoorrwwaarrdd--wwoorrdd. sshheellll--bbaacckkwwaarrdd--kkiillll--wwoorrdd - Kill the word behind point. Word boundaries are the same as + Kill the word behind point. Word boundaries are the same as those used by sshheellll--bbaacckkwwaarrdd--wwoorrdd. uunniixx--wwoorrdd--rruubboouutt ((CC--ww)) - Kill the word behind point, using white space as a word bound- + Kill the word behind point, using white space as a word bound- ary. The killed text is saved on the kill-ring. uunniixx--ffiilleennaammee--rruubboouutt - Kill the word behind point, using white space and the slash - character as the word boundaries. The killed text is saved on + 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. ddeelleettee--hhoorriizzoonnttaall--ssppaaccee ((MM--\\)) Delete all spaces and tabs around point. @@ -4037,64 +4042,64 @@ RREEAADDLLIINNEE ccooppyy--rreeggiioonn--aass--kkiillll Copy the text in the region to the kill buffer. ccooppyy--bbaacckkwwaarrdd--wwoorrdd - Copy the word before point to the kill buffer. The word bound- + Copy the word before point to the kill buffer. The word bound- aries are the same as bbaacckkwwaarrdd--wwoorrdd. ccooppyy--ffoorrwwaarrdd--wwoorrdd - Copy the word following point to the kill buffer. The word + Copy the word following point to the kill buffer. The word boundaries are the same as ffoorrwwaarrdd--wwoorrdd. yyaannkk ((CC--yy)) Yank the top of the kill ring into the buffer at point. yyaannkk--ppoopp ((MM--yy)) - Rotate the kill ring, and yank the new top. Only works follow- + Rotate the kill ring, and yank the new top. Only works follow- ing yyaannkk or yyaannkk--ppoopp. NNuummeerriicc AArrgguummeennttss ddiiggiitt--aarrgguummeenntt ((MM--00,, MM--11,, ...,, MM----)) - Add this digit to the argument already accumulating, or start a + Add this digit to the argument already accumulating, or start a new argument. M-- starts a negative argument. uunniivveerrssaall--aarrgguummeenntt - 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 fol- + 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 fol- lowed by digits, executing uunniivveerrssaall--aarrgguummeenntt again ends the nu- meric argument, but is otherwise ignored. As a special case, if this command is immediately followed by a character that is nei- - ther a digit nor 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 argu- + ther a digit nor 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 argu- ment count four, a second time makes the argument count sixteen, and so on. CCoommpplleettiinngg ccoommpplleettee ((TTAABB)) - Attempt to perform completion on the text before point. BBaasshh + Attempt to perform completion on the text before point. BBaasshh attempts completion treating the text as a variable (if the text - begins with $$), username (if the text begins with ~~), hostname - (if the text begins with @@), or command (including aliases and + begins with $$), username (if the text begins with ~~), hostname + (if the text begins with @@), or command (including aliases and functions) in turn. If none of these produces a match, filename completion is attempted. ppoossssiibbllee--ccoommpplleettiioonnss ((MM--??)) List the possible completions of the text before point. iinnsseerrtt--ccoommpplleettiioonnss ((MM--**)) - Insert all completions of the text before point that would have + Insert all completions of the text before point that would have been generated by ppoossssiibbllee--ccoommpplleettiioonnss. mmeennuu--ccoommpplleettee - Similar to ccoommpplleettee, but replaces the word to be completed with - a single match from the list of possible completions. Repeated - execution of mmeennuu--ccoommpplleettee steps through the list of possible - completions, inserting each match in turn. At the end of the + Similar to ccoommpplleettee, but replaces the word to be completed with + a single match from the list of possible completions. Repeated + execution of mmeennuu--ccoommpplleettee 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 bbeellll--ssttyyllee) and the original text is restored. An argument of _n moves _n positions forward in the list of matches; a negative ar- gument may be used to move backward through the list. This com- mand is intended to be bound to TTAABB, but is unbound by default. mmeennuu--ccoommpplleettee--bbaacckkwwaarrdd - Identical to mmeennuu--ccoommpplleettee, but moves backward through the list - of possible completions, as if mmeennuu--ccoommpplleettee had been given a + Identical to mmeennuu--ccoommpplleettee, but moves backward through the list + of possible completions, as if mmeennuu--ccoommpplleettee had been given a negative argument. This command is unbound by default. ddeelleettee--cchhaarr--oorr--lliisstt - Deletes the character under the cursor if not at the beginning - or end of the line (like ddeelleettee--cchhaarr). If at the end of the + Deletes the character under the cursor if not at the beginning + or end of the line (like ddeelleettee--cchhaarr). If at the end of the line, behaves identically to ppoossssiibbllee--ccoommpplleettiioonnss. This command is unbound by default. ccoommpplleettee--ffiilleennaammee ((MM--//)) @@ -4103,67 +4108,67 @@ RREEAADDLLIINNEE List the possible completions of the text before point, treating it as a filename. ccoommpplleettee--uusseerrnnaammee ((MM--~~)) - Attempt completion on the text before point, treating it as a + Attempt completion on the text before point, treating it as a username. ppoossssiibbllee--uusseerrnnaammee--ccoommpplleettiioonnss ((CC--xx ~~)) List the possible completions of the text before point, treating it as a username. ccoommpplleettee--vvaarriiaabbllee ((MM--$$)) - Attempt completion on the text before point, treating it as a + Attempt completion on the text before point, treating it as a shell variable. ppoossssiibbllee--vvaarriiaabbllee--ccoommpplleettiioonnss ((CC--xx $$)) List the possible completions of the text before point, treating it as a shell variable. ccoommpplleettee--hhoossttnnaammee ((MM--@@)) - Attempt completion on the text before point, treating it as a + Attempt completion on the text before point, treating it as a hostname. ppoossssiibbllee--hhoossttnnaammee--ccoommpplleettiioonnss ((CC--xx @@)) List the possible completions of the text before point, treating it as a hostname. ccoommpplleettee--ccoommmmaanndd ((MM--!!)) - 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 + 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. ppoossssiibbllee--ccoommmmaanndd--ccoommpplleettiioonnss ((CC--xx !!)) List the possible completions of the text before point, treating it as a command name. ddyynnaammiicc--ccoommpplleettee--hhiissttoorryy ((MM--TTAABB)) - Attempt completion on the text before point, comparing the text - against lines from the history list for possible completion + Attempt completion on the text before point, comparing the text + against lines from the history list for possible completion matches. ddaabbbbrreevv--eexxppaanndd - Attempt menu completion on the text before point, comparing the + Attempt menu completion on the text before point, comparing the text against lines from the history list for possible completion matches. ccoommpplleettee--iinnttoo--bbrraacceess ((MM--{{)) Perform filename completion and insert the list of possible com- - pletions enclosed within braces so the list is available to the + pletions enclosed within braces so the list is available to the shell (see BBrraaccee EExxppaannssiioonn above). KKeeyybbooaarrdd MMaaccrrooss ssttaarrtt--kkbbdd--mmaaccrroo ((CC--xx (()) - Begin saving the characters typed into the current keyboard + Begin saving the characters typed into the current keyboard macro. eenndd--kkbbdd--mmaaccrroo ((CC--xx )))) Stop saving the characters typed into the current keyboard macro and store the definition. ccaallll--llaasstt--kkbbdd--mmaaccrroo ((CC--xx ee)) - Re-execute the last keyboard macro defined, by making the char- + Re-execute the last keyboard macro defined, by making the char- acters in the macro appear as if typed at the keyboard. pprriinntt--llaasstt--kkbbdd--mmaaccrroo (()) - Print the last keyboard macro defined in a format suitable for + Print the last keyboard macro defined in a format suitable for the _i_n_p_u_t_r_c file. MMiisscceellllaanneeoouuss rree--rreeaadd--iinniitt--ffiillee ((CC--xx CC--rr)) - Read in the contents of the _i_n_p_u_t_r_c file, and incorporate any + Read in the contents of the _i_n_p_u_t_r_c file, and incorporate any bindings or variable assignments found there. aabboorrtt ((CC--gg)) - Abort the current editing command and ring the terminal's bell + Abort the current editing command and ring the terminal's bell (subject to the setting of bbeellll--ssttyyllee). ddoo--lloowweerrccaassee--vveerrssiioonn ((MM--AA,, MM--BB,, MM--_x,, ...)) - If the metafied character _x is uppercase, run the command that + If the metafied character _x is uppercase, run the command that is bound to the corresponding metafied lowercase character. The behavior is undefined if _x is already lowercase. pprreeffiixx--mmeettaa ((EESSCC)) @@ -4171,204 +4176,204 @@ RREEAADDLLIINNEE uunnddoo ((CC--__,, CC--xx CC--uu)) Incremental undo, separately remembered for each line. rreevveerrtt--lliinnee ((MM--rr)) - Undo all changes made to this line. This is like executing the - uunnddoo command enough times to return the line to its initial + Undo all changes made to this line. This is like executing the + uunnddoo command enough times to return the line to its initial state. ttiillddee--eexxppaanndd ((MM--&&)) Perform tilde expansion on the current word. sseett--mmaarrkk ((CC--@@,, MM--<>)) - Set the mark to the point. If a numeric argument is supplied, + Set the mark to the point. If a numeric argument is supplied, the mark is set to that position. eexxcchhaannggee--ppooiinntt--aanndd--mmaarrkk ((CC--xx CC--xx)) - Swap the point with the mark. The current cursor position is - set to the saved position, and the old cursor position is saved + 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. cchhaarraacctteerr--sseeaarrcchh ((CC--]])) A character is read and point is moved to the next occurrence of - that character. A negative argument searches for previous oc- + that character. A negative argument searches for previous oc- currences. cchhaarraacctteerr--sseeaarrcchh--bbaacckkwwaarrdd ((MM--CC--]])) - A character is read and point is moved to the previous occur- - rence of that character. A negative argument searches for sub- + A character is read and point is moved to the previous occur- + rence of that character. A negative argument searches for sub- sequent occurrences. sskkiipp--ccssii--sseeqquueennccee - Read enough characters to consume a multi-key sequence such as - those defined for keys like Home and End. Such sequences begin + Read enough characters to consume a multi-key sequence such as + those defined for keys like Home and End. Such sequences begin with a Control Sequence Indicator (CSI), usually ESC-[. If this - sequence is bound to "\[", keys producing such sequences will - have no effect unless explicitly bound to a readline command, - instead of inserting stray characters into the editing buffer. + sequence is bound to "\[", keys producing such sequences will + have no effect unless explicitly bound to a readline command, + instead of inserting stray characters into the editing buffer. This is unbound by default, but usually bound to ESC-[. iinnsseerrtt--ccoommmmeenntt ((MM--##)) - Without a numeric argument, the value of the readline ccoomm-- - mmeenntt--bbeeggiinn variable is inserted at the beginning of the current + Without a numeric argument, the value of the readline ccoomm-- + mmeenntt--bbeeggiinn 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 ccoommmmeenntt--bbeeggiinn, the value is inserted, other- + toggle: if the characters at the beginning of the line do not + match the value of ccoommmmeenntt--bbeeggiinn, the value is inserted, other- wise the characters in ccoommmmeenntt--bbeeggiinn are deleted from the begin- - ning of the line. In either case, the line is accepted as if a - newline had been typed. The default value of ccoommmmeenntt--bbeeggiinn - causes this command to make the current line a shell comment. - If a numeric argument causes the comment character to be re- + ning of the line. In either case, the line is accepted as if a + newline had been typed. The default value of ccoommmmeenntt--bbeeggiinn + causes this command to make the current line a shell comment. + If a numeric argument causes the comment character to be re- moved, the line will be executed by the shell. ssppeellll--ccoorrrreecctt--wwoorrdd ((CC--xx ss)) - Perform spelling correction on the current word, treating it as - a directory or filename, in the same way as the ccddssppeellll shell - option. Word boundaries are the same as those used by + Perform spelling correction on the current word, treating it as + a directory or filename, in the same way as the ccddssppeellll shell + option. Word boundaries are the same as those used by sshheellll--ffoorrwwaarrdd--wwoorrdd. gglloobb--ccoommpplleettee--wwoorrdd ((MM--gg)) - The word before point is treated as a pattern for pathname ex- - pansion, with an asterisk implicitly appended. This pattern is - used to generate a list of matching filenames for possible com- + The word before point is treated as a pattern for pathname ex- + pansion, with an asterisk implicitly appended. This pattern is + used to generate a list of matching filenames for possible com- pletions. gglloobb--eexxppaanndd--wwoorrdd ((CC--xx **)) - The word before point is treated as a pattern for pathname ex- + The word before point is treated as a pattern for pathname ex- pansion, and the list of matching filenames is inserted, replac- ing the word. If a numeric argument is supplied, an asterisk is appended before pathname expansion. gglloobb--lliisstt--eexxppaannssiioonnss ((CC--xx gg)) - The list of expansions that would have been generated by - gglloobb--eexxppaanndd--wwoorrdd is displayed, and the line is redrawn. If a - numeric argument is supplied, an asterisk is appended before + The list of expansions that would have been generated by + gglloobb--eexxppaanndd--wwoorrdd is displayed, and the line is redrawn. If a + numeric argument is supplied, an asterisk is appended before pathname expansion. dduummpp--ffuunnccttiioonnss - Print all of the functions and their key bindings to the read- + Print all of the functions and their key bindings to the read- line output stream. If a numeric argument is supplied, the out- - put is formatted in such a way that it can be made part of an + put is formatted in such a way that it can be made part of an _i_n_p_u_t_r_c file. dduummpp--vvaarriiaabblleess 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 + 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 _i_n_p_u_t_r_c file. dduummpp--mmaaccrrooss - Print all of the readline key sequences bound to macros and the - strings they output. If a numeric argument is supplied, the + 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 _i_n_p_u_t_r_c file. ddiissppllaayy--sshheellll--vveerrssiioonn ((CC--xx CC--vv)) Display version information about the current instance of bbaasshh. PPrrooggrraammmmaabbllee CCoommpplleettiioonn - When word completion is attempted for an argument to a command for - which a completion specification (a _c_o_m_p_s_p_e_c) has been defined using + When word completion is attempted for an argument to a command for + which a completion specification (a _c_o_m_p_s_p_e_c) has been defined using the ccoommpplleettee builtin (see SSHHEELLLL BBUUIILLTTIINN CCOOMMMMAANNDDSS below), the programma- ble completion facilities are invoked. - First, the command name is identified. If the command word is the - empty string (completion attempted at the beginning of an empty line), - any compspec defined with the --EE option to ccoommpplleettee is used. If a - compspec has been defined for that command, the compspec is used to + First, the command name is identified. If the command word is the + empty string (completion attempted at the beginning of an empty line), + any compspec defined with the --EE option to ccoommpplleettee is used. 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. - If those searches do not result in a compspec, any compspec defined - with the --DD option to ccoommpplleettee is used as the default. If there is no - default compspec, bbaasshh attempts alias expansion on the command word as - a final resort, and attempts to find a compspec for the command word + 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. + If those searches do not result in a compspec, any compspec defined + with the --DD option to ccoommpplleettee is used as the default. If there is no + default compspec, bbaasshh attempts alias expansion on the command word as + a final resort, and attempts to find a compspec for the command word from any successful expansion. - Once a compspec has been found, it is used to generate the list of - matching words. If a compspec is not found, the default bbaasshh comple- + Once a compspec has been found, it is used to generate the list of + matching words. If a compspec is not found, the default bbaasshh comple- tion as described above under CCoommpplleettiinngg is performed. - First, the actions specified by the compspec are used. Only matches - which are prefixed by the word being completed are returned. When the - --ff or --dd option is used for filename or directory name completion, the + First, the actions specified by the compspec are used. Only matches + which are prefixed by the word being completed are returned. When the + --ff or --dd option is used for filename or directory name completion, the shell variable FFIIGGNNOORREE is used to filter the matches. Any completions specified by a pathname expansion pattern to the --GG op- - tion are generated next. The words generated by the pattern need not - match the word being completed. The GGLLOOBBIIGGNNOORREE shell variable is not + tion are generated next. The words generated by the pattern need not + match the word being completed. The GGLLOOBBIIGGNNOORREE shell variable is not used to filter the matches, but the FFIIGGNNOORREE variable is used. - Next, the string specified as the argument to the --WW option is consid- - ered. The string is first split using the characters in the IIFFSS spe- - cial variable as delimiters. Shell quoting is honored. Each word is - then expanded using brace expansion, tilde expansion, parameter and - variable expansion, command substitution, and arithmetic expansion, as + Next, the string specified as the argument to the --WW option is consid- + ered. The string is first split using the characters in the IIFFSS spe- + cial variable as delimiters. Shell quoting is honored. Each word is + then expanded using brace expansion, tilde expansion, parameter and + variable expansion, command substitution, and arithmetic expansion, as described above under EEXXPPAANNSSIIOONN. The results are split using the rules described above under WWoorrdd SSpplliittttiinngg. The results of the expansion are prefix-matched against the word being completed, and the matching words become the possible completions. - After these matches have been generated, any shell function or command - specified with the --FF and --CC options is invoked. When the command or + After these matches have been generated, any shell function or command + specified with the --FF and --CC options is invoked. When the command or function is invoked, the CCOOMMPP__LLIINNEE, CCOOMMPP__PPOOIINNTT, CCOOMMPP__KKEEYY, and CCOOMMPP__TTYYPPEE variables are assigned values as described above under SShheellll VVaarriiaabblleess. - If a shell function is being invoked, the CCOOMMPP__WWOORRDDSS and CCOOMMPP__CCWWOORRDD - variables are also set. When the function or command is invoked, the - first argument ($$11) is the name of the command whose arguments are be- - ing completed, the second argument ($$22) is the word being completed, - and the third argument ($$33) is the word preceding the word being com- + If a shell function is being invoked, the CCOOMMPP__WWOORRDDSS and CCOOMMPP__CCWWOORRDD + variables are also set. When the function or command is invoked, the + first argument ($$11) is the name of the command whose arguments are be- + ing completed, the second argument ($$22) is the word being completed, + and the third argument ($$33) is the word preceding the word being com- pleted on the current command line. No filtering of the generated com- pletions against the word being completed is performed; the function or command has complete freedom in generating the matches. - Any function specified with --FF is invoked first. The function may use - any of the shell facilities, including the ccoommppggeenn builtin described - below, to generate the matches. It must put the possible completions + Any function specified with --FF is invoked first. The function may use + any of the shell facilities, including the ccoommppggeenn builtin described + below, to generate the matches. It must put the possible completions in the CCOOMMPPRREEPPLLYY array variable, one per array element. - Next, any command specified with the --CC option is invoked in an envi- - ronment equivalent to command substitution. It should print a list of - completions, one per line, to the standard output. Backslash may be + Next, any command specified with the --CC option is invoked in an envi- + ronment 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. - After all of the possible completions are generated, any filter speci- - fied with the --XX option is applied to the list. The filter is a pat- - tern as used for pathname expansion; a && in the pattern is replaced - with the text of the word being completed. A literal && 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. + After all of the possible completions are generated, any filter speci- + fied with the --XX option is applied to the list. The filter is a pat- + tern as used for pathname expansion; a && in the pattern is replaced + with the text of the word being completed. A literal && 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 !! negates the pattern; in this case any completion not match- - ing the pattern will be removed. If the nnooccaasseemmaattcchh shell option is - enabled, the match is performed without regard to the case of alpha- + ing the pattern will be removed. If the nnooccaasseemmaattcchh shell option is + enabled, the match is performed without regard to the case of alpha- betic characters. Finally, any prefix and suffix specified with the --PP and --SS 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. - If the previously-applied actions do not generate any matches, and the - --oo ddiirrnnaammeess option was supplied to ccoommpplleettee when the compspec was de- + If the previously-applied actions do not generate any matches, and the + --oo ddiirrnnaammeess option was supplied to ccoommpplleettee when the compspec was de- fined, directory name completion is attempted. - If the --oo pplluussddiirrss option was supplied to ccoommpplleettee when the compspec + If the --oo pplluussddiirrss option was supplied to ccoommpplleettee when the compspec was defined, directory name completion is attempted and any matches are added to the results of the other actions. - By default, if a compspec is found, whatever it generates is returned - to the completion code as the full set of possible completions. The + 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 bbaasshh completions are not attempted, and the readline default of filename completion is disabled. If the --oo bbaasshhddeeffaauulltt option was sup- - plied to ccoommpplleettee when the compspec was defined, the bbaasshh default com- + plied to ccoommpplleettee when the compspec was defined, the bbaasshh default com- pletions are attempted if the compspec generates no matches. If the --oo - ddeeffaauulltt option was supplied to ccoommpplleettee when the compspec was defined, - readline's default completion will be performed if the compspec (and, + ddeeffaauulltt option was supplied to ccoommpplleettee when the compspec was defined, + readline's default completion will be performed if the compspec (and, if attempted, the default bbaasshh completions) generate no matches. - 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 mmaarrkk--ddiirreeccttoorriieess readline variable, regardless of the + 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 mmaarrkk--ddiirreeccttoorriieess readline variable, regardless of the setting of the mmaarrkk--ssyymmlliinnkkeedd--ddiirreeccttoorriieess readline variable. - There is some support for dynamically modifying completions. This is - most useful when used in combination with a default completion speci- - fied with ccoommpplleettee --DD. It's possible for shell functions executed as - completion handlers to indicate that completion should be retried by - returning an exit status of 124. If a shell function returns 124, and + There is some support for dynamically modifying completions. This is + most useful when used in combination with a default completion speci- + fied with ccoommpplleettee --DD. It's possible for shell functions executed as + completion handlers to indicate that completion should be retried by + returning an exit status of 124. If a shell function returns 124, and changes the compspec associated with the command on which completion is - being attempted (supplied as the first argument when the function is + being attempted (supplied as the first argument when the function is executed), programmable completion restarts from the beginning, with an - attempt to find a new compspec for that command. This allows a set of - completions to be built dynamically as completion is attempted, rather + attempt to find a new compspec for that command. This allows a set of + completions to be built dynamically as completion is attempted, rather than being loaded all at once. - For instance, assuming that there is a library of compspecs, each kept - in a file corresponding to the name of the command, the following de- + For instance, assuming that there is a library of compspecs, each kept + in a file corresponding to the name of the command, the following de- fault completion function would load completions dynamically: _completion_loader() { @@ -4379,184 +4384,184 @@ RREEAADDLLIINNEE -o bashdefault -o default HHIISSTTOORRYY - When the --oo hhiissttoorryy option to the sseett builtin is enabled, the shell + When the --oo hhiissttoorryy option to the sseett builtin is enabled, the shell provides access to the _c_o_m_m_a_n_d _h_i_s_t_o_r_y, the list of commands previously - typed. The value of the HHIISSTTSSIIZZEE variable is used as the number of + typed. The value of the HHIISSTTSSIIZZEE variable is used as the number of commands to save in a history list. The text of the last HHIISSTTSSIIZZEE com- - mands (default 500) is saved. The shell stores each command in the - history list prior to parameter and variable expansion (see EEXXPPAANNSSIIOONN - above) but after history expansion is performed, subject to the values + mands (default 500) is saved. The shell stores each command in the + history list prior to parameter and variable expansion (see EEXXPPAANNSSIIOONN + above) but after history expansion is performed, subject to the values of the shell variables HHIISSTTIIGGNNOORREE and HHIISSTTCCOONNTTRROOLL. On startup, the history is initialized from the file named by the vari- - able HHIISSTTFFIILLEE (default _~_/_._b_a_s_h___h_i_s_t_o_r_y). The file named by the value - of HHIISSTTFFIILLEE is truncated, if necessary, to contain no more than the - number of lines specified by the value of HHIISSTTFFIILLEESSIIZZEE. If HHIISSTTFFIILLEE-- - SSIIZZEE is unset, or set to null, a non-numeric value, or a numeric value - less than zero, the history file is not truncated. When the history - file is read, lines beginning with the history comment character fol- + able HHIISSTTFFIILLEE (default _~_/_._b_a_s_h___h_i_s_t_o_r_y). The file named by the value + of HHIISSTTFFIILLEE is truncated, if necessary, to contain no more than the + number of lines specified by the value of HHIISSTTFFIILLEESSIIZZEE. If HHIISSTTFFIILLEE-- + SSIIZZEE is unset, or set to null, a non-numeric value, or a numeric value + less than zero, the history file is not truncated. When the history + file is read, lines beginning with the history comment character fol- lowed immediately by a digit are interpreted as timestamps for the fol- lowing history line. These timestamps are optionally displayed depend- - ing on the value of the HHIISSTTTTIIMMEEFFOORRMMAATT variable. When a shell with - history enabled exits, the last $$HHIISSTTSSIIZZEE lines are copied from the - history list to $$HHIISSTTFFIILLEE. If the hhiissttaappppeenndd shell option is enabled - (see the description of sshhoopptt under SSHHEELLLL BBUUIILLTTIINN CCOOMMMMAANNDDSS below), the - lines are appended to the history file, otherwise the history file is - overwritten. If HHIISSTTFFIILLEE is unset or null, or if the history file is - unwritable, the history is not saved. If the HHIISSTTTTIIMMEEFFOORRMMAATT variable - is set, time stamps are written to the history file, marked with the - history comment character, so they may be preserved across shell ses- - sions. This uses the history comment character to distinguish time- + ing on the value of the HHIISSTTTTIIMMEEFFOORRMMAATT variable. When a shell with + history enabled exits, the last $$HHIISSTTSSIIZZEE lines are copied from the + history list to $$HHIISSTTFFIILLEE. If the hhiissttaappppeenndd shell option is enabled + (see the description of sshhoopptt under SSHHEELLLL BBUUIILLTTIINN CCOOMMMMAANNDDSS below), the + lines are appended to the history file, otherwise the history file is + overwritten. If HHIISSTTFFIILLEE is unset or null, or if the history file is + unwritable, the history is not saved. If the HHIISSTTTTIIMMEEFFOORRMMAATT variable + is set, time stamps are written to the history file, marked with the + history comment character, so they may be preserved across shell ses- + sions. This uses the history comment character to distinguish time- stamps from other history lines. After saving the history, the history file is truncated to contain no more than HHIISSTTFFIILLEESSIIZZEE lines. If HHIISSTT-- - FFIILLEESSIIZZEE is unset, or set to null, a non-numeric value, or a numeric + FFIILLEESSIIZZEE is unset, or set to null, a non-numeric value, or a numeric value less than zero, the history file is not truncated. - The builtin command ffcc (see SSHHEELLLL BBUUIILLTTIINN CCOOMMMMAANNDDSS below) may be used + The builtin command ffcc (see SSHHEELLLL BBUUIILLTTIINN CCOOMMMMAANNDDSS below) may be used to list or edit and re-execute a portion of the history list. The hhiiss-- - ttoorryy builtin may be used to display or modify the history list and ma- - nipulate the history file. When using command-line editing, search - commands are available in each editing mode that provide access to the + ttoorryy builtin may be used to display or modify the history list and ma- + nipulate the history file. When using command-line editing, search + commands are available in each editing mode that provide access to the history list. - The shell allows control over which commands are saved on the history - list. The HHIISSTTCCOONNTTRROOLL and HHIISSTTIIGGNNOORREE variables are used to cause the + The shell allows control over which commands are saved on the history + list. The HHIISSTTCCOONNTTRROOLL and HHIISSTTIIGGNNOORREE variables are used to cause the shell to save only a subset of the commands entered. The ccmmddhhiisstt 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 lliitthhiisstt shell option - causes the shell to save the command with embedded newlines instead of + 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 lliitthhiisstt shell option + causes the shell to save the command with embedded newlines instead of semicolons. See the description of the sshhoopptt builtin below under SSHHEELLLL - BBUUIILLTTIINN CCOOMMMMAANNDDSS for information on setting and unsetting shell op- + BBUUIILLTTIINN CCOOMMMMAANNDDSS for information on setting and unsetting shell op- tions. HHIISSTTOORRYY EEXXPPAANNSSIIOONN - The shell supports a history expansion feature that is similar to the - history expansion in ccsshh. This section describes what syntax features - are available. This feature is enabled by default for interactive + The shell supports a history expansion feature that is similar to the + history expansion in ccsshh. This section describes what syntax features + are available. This feature is enabled by default for interactive shells, and can be disabled using the ++HH option to the sseett builtin com- mand (see SSHHEELLLL BBUUIILLTTIINN CCOOMMMMAANNDDSS below). Non-interactive shells do not perform history expansion by default. History expansions introduce words from the history list into the input - stream, making it easy to repeat commands, insert the arguments to a + 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. - History expansion is performed immediately after a complete line is - read, before the shell breaks it into words, and is performed on each - line individually without taking quoting on previous lines into ac- - count. 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 _e_v_e_n_t, and the portions of + History expansion is performed immediately after a complete line is + read, before the shell breaks it into words, and is performed on each + line individually without taking quoting on previous lines into ac- + count. 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 _e_v_e_n_t, and the portions of that line that are acted upon are _w_o_r_d_s. The line is broken into words - in the same fashion as when reading input, so that several _m_e_t_a_c_h_a_r_a_c_- - _t_e_r-separated words surrounded by quotes are considered one word. The - _e_v_e_n_t _d_e_s_i_g_n_a_t_o_r selects the event, the optional _w_o_r_d _d_e_s_i_g_n_a_t_o_r se- - lects words from the event, and various optional _m_o_d_i_f_i_e_r_s are avail- + in the same fashion as when reading input, so that several _m_e_t_a_c_h_a_r_a_c_- + _t_e_r-separated words surrounded by quotes are considered one word. The + _e_v_e_n_t _d_e_s_i_g_n_a_t_o_r selects the event, the optional _w_o_r_d _d_e_s_i_g_n_a_t_o_r se- + lects words from the event, and various optional _m_o_d_i_f_i_e_r_s are avail- able to manipulate the selected words. - History expansions are introduced by the appearance of the history ex- - pansion character, which is !! by default. History expansions may ap- + History expansions are introduced by the appearance of the history ex- + pansion character, which is !! by default. History expansions may ap- pear anywhere in the input, but do not nest. - Only backslash (\\) and single quotes can quote the history expansion - character, but the history expansion character is also treated as + Only backslash (\\) and single quotes can quote the history expansion + character, but the history expansion character is also treated as quoted if it immediately precedes the closing double quote in a double- quoted string. - Several characters inhibit history expansion if found immediately fol- - lowing the history expansion character, even if it is unquoted: space, - tab, newline, carriage return, ==, and the other shell metacharacters + Several characters inhibit history expansion if found immediately fol- + lowing the history expansion character, even if it is unquoted: space, + tab, newline, carriage return, ==, and the other shell metacharacters defined above. There is a special abbreviation for substitution, active when the _q_u_i_c_k - _s_u_b_s_t_i_t_u_t_i_o_n character (described above under hhiissttcchhaarrss) is the first + _s_u_b_s_t_i_t_u_t_i_o_n character (described above under hhiissttcchhaarrss) is the first character on the line. It selects the previous history entry, using an - event designator equivalent to !!!!, and substitutes one string for an- - other in that line. It is described below under EEvveenntt DDeessiiggnnaattoorrss. + event designator equivalent to !!!!, and substitutes one string for an- + other in that line. It is described below under EEvveenntt DDeessiiggnnaattoorrss. This is the only history expansion that does not begin with the history expansion character. - Several shell options settable with the sshhoopptt builtin may be used to - tailor the behavior of history expansion. If the hhiissttvveerriiffyy shell op- - tion is enabled (see the description of the sshhoopptt builtin below), and - rreeaaddlliinnee is being used, history substitutions are not immediately - passed to the shell parser. Instead, the expanded line is reloaded + Several shell options settable with the sshhoopptt builtin may be used to + tailor the behavior of history expansion. If the hhiissttvveerriiffyy shell op- + tion is enabled (see the description of the sshhoopptt builtin below), and + rreeaaddlliinnee is being used, history substitutions are not immediately + passed to the shell parser. Instead, the expanded line is reloaded into the rreeaaddlliinnee editing buffer for further modification. If rreeaaddlliinnee - is being used, and the hhiissttrreeeeddiitt shell option is enabled, a failed - history substitution will be reloaded into the rreeaaddlliinnee editing buffer - for correction. The --pp option to the hhiissttoorryy builtin command may be - used to see what a history expansion will do before using it. The --ss + is being used, and the hhiissttrreeeeddiitt shell option is enabled, a failed + history substitution will be reloaded into the rreeaaddlliinnee editing buffer + for correction. The --pp option to the hhiissttoorryy builtin command may be + used to see what a history expansion will do before using it. The --ss option to the hhiissttoorryy builtin may be used to add commands to the end of - the history list without actually executing them, so that they are + the history list without actually executing them, so that they are available for subsequent recall. - The shell allows control of the various characters used by the history + The shell allows control of the various characters used by the history expansion mechanism (see the description of hhiissttcchhaarrss above under SShheellll - VVaarriiaabblleess). The shell uses the history comment character to mark his- + VVaarriiaabblleess). The shell uses the history comment character to mark his- tory timestamps when writing the history file. EEvveenntt DDeessiiggnnaattoorrss - An event designator is a reference to a command line entry in the his- - tory list. The event designator consists of the portion of the word + An event designator is a reference to a command line entry in the his- + tory list. The event designator consists of the portion of the word beginning with the history expansion character and ending with the word designator if present, or the end of the word. Unless the reference is - absolute, events are relative to the current position in the history + absolute, events are relative to the current position in the history list. - !! Start a history substitution, except when followed by a bbllaannkk, - newline, carriage return, = or ( (when the eexxttgglloobb shell option + !! Start a history substitution, except when followed by a bbllaannkk, + newline, carriage return, = or ( (when the eexxttgglloobb shell option is enabled using the sshhoopptt builtin). !!_n Refer to command line _n. !!--_n Refer to the current command minus _n. !!!! Refer to the previous command. This is a synonym for "!-1". !!_s_t_r_i_n_g - Refer to the most recent command preceding the current position + Refer to the most recent command preceding the current position in the history list starting with _s_t_r_i_n_g. !!??_s_t_r_i_n_g[[??]] - Refer to the most recent command preceding the current position - in the history list containing _s_t_r_i_n_g. The trailing ?? may be - omitted if _s_t_r_i_n_g is followed immediately by a newline. If - _s_t_r_i_n_g is missing, the string from the most recent search is + Refer to the most recent command preceding the current position + in the history list containing _s_t_r_i_n_g. The trailing ?? may be + omitted if _s_t_r_i_n_g is followed immediately by a newline. If + _s_t_r_i_n_g is missing, the string from the most recent search is used; it is an error if there is no previous search string. ^^_s_t_r_i_n_g_1^^_s_t_r_i_n_g_2^^ - Quick substitution. Repeat the previous command, replacing - _s_t_r_i_n_g_1 with _s_t_r_i_n_g_2. Equivalent to "!!:s^_s_t_r_i_n_g_1^_s_t_r_i_n_g_2^" + Quick substitution. Repeat the previous command, replacing + _s_t_r_i_n_g_1 with _s_t_r_i_n_g_2. Equivalent to "!!:s^_s_t_r_i_n_g_1^_s_t_r_i_n_g_2^" (see MMooddiiffiieerrss below). !!## The entire command line typed so far. WWoorrdd DDeessiiggnnaattoorrss - Word designators are used to select desired words from the event. A :: - separates the event specification from the word designator. It may be - omitted if the word designator begins with a ^^, $$, **, --, or %%. Words - are numbered from the beginning of the line, with the first word being - denoted by 0 (zero). Words are inserted into the current line sepa- + Word designators are used to select desired words from the event. A :: + separates the event specification from the word designator. It may be + omitted if the word designator begins with a ^^, $$, **, --, or %%. Words + are numbered from the beginning of the line, with the first word being + denoted by 0 (zero). Words are inserted into the current line sepa- rated by single spaces. 00 ((zzeerroo)) The zeroth word. For the shell, this is the command word. _n The _nth word. ^^ The first argument. That is, word 1. - $$ The last word. This is usually the last argument, but will ex- + $$ The last word. This is usually the last argument, but will ex- pand to the zeroth word if there is only one word in the line. - %% The first word matched by the most recent "?_s_t_r_i_n_g?'" search, - if the search string begins with a character that is part of a + %% The first word matched by the most recent "?_s_t_r_i_n_g?'" search, + if the search string begins with a character that is part of a word. _x--_y A range of words; "-_y" abbreviates "0-_y". - ** All of the words but the zeroth. This is a synonym for "_1_-_$". - It is not an error to use ** if there is just one word in the + ** All of the words but the zeroth. This is a synonym for "_1_-_$". + It is not an error to use ** if there is just one word in the event; the empty string is returned in that case. xx** Abbreviates _x_-_$. xx-- Abbreviates _x_-_$ like xx**, but omits the last word. If xx is miss- ing, it defaults to 0. - If a word designator is supplied without an event specification, the + If a word designator is supplied without an event specification, the previous command is used as the event. MMooddiiffiieerrss - After the optional word designator, there may appear a sequence of one + After the optional word designator, there may appear a sequence of one or more of the following modifiers, each preceded by a ":". These mod- ify, or edit, the word or words selected from the history event. @@ -4566,24 +4571,24 @@ HHIISSTTOORRYY EEXXPPAANNSSIIOONN ee Remove all but the trailing suffix. pp Print the new command but do not execute it. qq Quote the substituted words, escaping further substitutions. - xx Quote the substituted words as with qq, but break into words at - bbllaannkkss and newlines. The qq and xx modifiers are mutually exclu- + xx Quote the substituted words as with qq, but break into words at + bbllaannkkss and newlines. The qq and xx modifiers are mutually exclu- sive; the last one supplied is used. ss//_o_l_d//_n_e_w// - Substitute _n_e_w for the first occurrence of _o_l_d in the event + Substitute _n_e_w for the first occurrence of _o_l_d in the event line. Any character may be used as the delimiter in place of /. - The final delimiter is optional if it is the last character of + The final delimiter is optional if it is the last character of the event line. The delimiter may be quoted in _o_l_d and _n_e_w with a single backslash. If & appears in _n_e_w, it is replaced by _o_l_d. - A single backslash will quote the &. If _o_l_d is null, it is set - to the last _o_l_d substituted, or, if no previous history substi- - tutions took place, the last _s_t_r_i_n_g in a !!??_s_t_r_i_n_g[[??]] search. + A single backslash will quote the &. If _o_l_d is null, it is set + to the last _o_l_d substituted, or, if no previous history substi- + tutions took place, the last _s_t_r_i_n_g in a !!??_s_t_r_i_n_g[[??]] search. If _n_e_w is null, each matching _o_l_d is deleted. && Repeat the previous substitution. gg Cause changes to be applied over the entire event line. This is - used in conjunction with "::ss" (e.g., "::ggss//_o_l_d//_n_e_w//") or "::&&". - If used with "::ss", any delimiter can be used in place of /, and - the final delimiter is optional if it is the last character of + used in conjunction with "::ss" (e.g., "::ggss//_o_l_d//_n_e_w//") or "::&&". + If used with "::ss", 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 aa may be used as a synonym for gg. GG Apply the following "ss" or "&&" modifier once to each word in the event line. @@ -4592,39 +4597,42 @@ SSHHEELLLL BBUUIILLTTIINN CCOOMMMMAANNDDSS Unless otherwise noted, each builtin command documented in this section as accepting options preceded by -- accepts ---- to signify the end of the options. The ::, ttrruuee, ffaallssee, and tteesstt/[[ builtins do not accept options - and do not treat ---- specially. The eexxiitt, llooggoouutt, rreettuurrnn, bbrreeaakk, ccoonn-- - ttiinnuuee, lleett, and sshhiifftt builtins accept and process arguments beginning - with -- without requiring ----. Other builtins that accept arguments but - are not specified as accepting options interpret arguments beginning - with -- as invalid options and require ---- to prevent this interpreta- + and do not treat ---- specially. The eexxiitt, llooggoouutt, rreettuurrnn, bbrreeaakk, ccoonn-- + ttiinnuuee, lleett, and sshhiifftt builtins accept and process arguments beginning + with -- without requiring ----. Other builtins that accept arguments but + are not specified as accepting options interpret arguments beginning + with -- as invalid options and require ---- to prevent this interpreta- tion. :: [_a_r_g_u_m_e_n_t_s] - No effect; the command does nothing beyond expanding _a_r_g_u_m_e_n_t_s + No effect; the command does nothing beyond expanding _a_r_g_u_m_e_n_t_s and performing any specified redirections. The return status is zero. - .. _f_i_l_e_n_a_m_e [_a_r_g_u_m_e_n_t_s] - ssoouurrccee _f_i_l_e_n_a_m_e [_a_r_g_u_m_e_n_t_s] - Read and execute commands from _f_i_l_e_n_a_m_e in the current shell en- - vironment and return the exit status of the last command exe- - cuted from _f_i_l_e_n_a_m_e. If _f_i_l_e_n_a_m_e does not contain a slash, - filenames in PPAATTHH are used to find the directory containing - _f_i_l_e_n_a_m_e, but _f_i_l_e_n_a_m_e does not need to be executable. The file - searched for in PPAATTHH need not be executable. When bbaasshh is not - in _p_o_s_i_x _m_o_d_e, it searches the current directory if no file is - found in PPAATTHH. If the ssoouurrcceeppaatthh option to the sshhoopptt builtin - command is turned off, the PPAATTHH is not searched. If any _a_r_g_u_- - _m_e_n_t_s are supplied, they become the positional parameters when - _f_i_l_e_n_a_m_e is executed. Otherwise the positional parameters are - unchanged. If the --TT option is enabled, .. inherits any trap on - DDEEBBUUGG; if it is not, any DDEEBBUUGG trap string is saved and restored - around the call to .., and .. unsets the DDEEBBUUGG trap while it exe- - cutes. If --TT is not set, and the sourced file changes the DDEEBBUUGG - trap, the new value is retained when .. completes. The return - status is the status of the last command exited within the - script (0 if no commands are executed), and false if _f_i_l_e_n_a_m_e is - not found or cannot be read. + .. [--pp _p_a_t_h] _f_i_l_e_n_a_m_e [_a_r_g_u_m_e_n_t_s] + ssoouurrccee [--pp _p_a_t_h] _f_i_l_e_n_a_m_e [_a_r_g_u_m_e_n_t_s] + The .. command (ssoouurrccee) reads and execute commands from _f_i_l_e_n_a_m_e + in the current shell environment and returns the exit status of + the last command executed from _f_i_l_e_n_a_m_e. If _f_i_l_e_n_a_m_e does not + contain a slash, .. searchs for it. If the --pp option is sup- + plied, .. treats _p_a_t_h as a colon-separated list of directories + in which to find _f_i_l_e_n_a_m_e; otherwise, .. uses the entries in + PPAATTHH to find the directory containing _f_i_l_e_n_a_m_e. _f_i_l_e_n_a_m_e does + not need to be executable. When bbaasshh is not in _p_o_s_i_x _m_o_d_e, it + searches the current directory if no file is found in PPAATTHH, but + does not search the current directory if --pp is supplied. If the + ssoouurrcceeppaatthh option to the sshhoopptt builtin command is turned off, .. + does not search PPAATTHH. If any _a_r_g_u_m_e_n_t_s are supplied, they be- + come the positional parameters when _f_i_l_e_n_a_m_e is executed. Oth- + erwise the positional parameters are unchanged. If the --TT op- + tion is enabled, .. inherits any trap on DDEEBBUUGG; if it is not, any + DDEEBBUUGG trap string is saved and restored around the call to .., + and .. unsets the DDEEBBUUGG trap while it executes. If --TT is not + set, and the sourced file changes the DDEEBBUUGG trap, the new value + is retained when .. completes. The return status is the status + of the last command exited within the script (0 if no commands + are executed), and false if _f_i_l_e_n_a_m_e is not found or cannot be + read. aalliiaass [--pp] [_n_a_m_e[=_v_a_l_u_e] ...] AAlliiaass with no arguments or with the --pp option prints the list of @@ -6306,43 +6314,44 @@ SSHHEELLLL BBUUIILLTTIINN CCOOMMMMAANNDDSS ssoouurrcceeppaatthh If set, the .. (ssoouurrccee) builtin uses the value of PPAATTHH to find the directory containing the file supplied as an - argument. This option is enabled by default. + argument when the --pp option is not supplied. This op- + tion is enabled by default. vvaarrrreeddiirr__cclloossee - If set, the shell automatically closes file descriptors - assigned using the _{_v_a_r_n_a_m_e_} redirection syntax (see + If set, the shell automatically closes file descriptors + assigned using the _{_v_a_r_n_a_m_e_} redirection syntax (see RREEDDIIRREECCTTIIOONN above) instead of leaving them open when the command completes. xxppgg__eecchhoo - If set, the eecchhoo builtin expands backslash-escape se- - quences by default. If the ppoossiixx shell option is also + If set, the eecchhoo builtin expands backslash-escape se- + quences by default. If the ppoossiixx shell option is also enabled, eecchhoo does not interpret any options. ssuussppeenndd [--ff] - Suspend the execution of this shell until it receives a SSIIGGCCOONNTT - signal. A login shell, or a shell without job control enabled, - cannot be suspended; the --ff option can be used to override this - and force the suspension. The return status is 0 unless the - shell is a login shell or job control is not enabled and --ff is + Suspend the execution of this shell until it receives a SSIIGGCCOONNTT + signal. A login shell, or a shell without job control enabled, + cannot be suspended; the --ff option can be used to override this + and force the suspension. The return status is 0 unless the + shell is a login shell or job control is not enabled and --ff is not supplied. tteesstt _e_x_p_r [[ _e_x_p_r ]] Return a status of 0 (true) or 1 (false) depending on the evalu- - ation of the conditional expression _e_x_p_r. Each operator and - operand must be a separate argument. Expressions are composed - of the primaries described above under CCOONNDDIITTIIOONNAALL EEXXPPRREESSSSIIOONNSS. - tteesstt does not accept any options, nor does it accept and ignore + ation of the conditional expression _e_x_p_r. Each operator and + operand must be a separate argument. Expressions are composed + of the primaries described above under CCOONNDDIITTIIOONNAALL EEXXPPRREESSSSIIOONNSS. + tteesstt does not accept any options, nor does it accept and ignore an argument of ---- as signifying the end of options. - Expressions may be combined using the following operators, - listed in decreasing order of precedence. The evaluation de- - pends on the number of arguments; see below. Operator prece- + Expressions may be combined using the following operators, + listed in decreasing order of precedence. The evaluation de- + pends on the number of arguments; see below. Operator prece- dence is used when there are five or more arguments. !! _e_x_p_r True if _e_x_p_r is false. (( _e_x_p_r )) - Returns the value of _e_x_p_r. This may be used to override + Returns the value of _e_x_p_r. This may be used to override the normal precedence of operators. _e_x_p_r_1 -aa _e_x_p_r_2 True if both _e_x_p_r_1 and _e_x_p_r_2 are true. @@ -6359,161 +6368,161 @@ SSHHEELLLL BBUUIILLTTIINN CCOOMMMMAANNDDSS null. 2 arguments If the first argument is !!, the expression is true if and - only if the second argument is null. If the first argu- - ment is one of the unary conditional operators listed - above under CCOONNDDIITTIIOONNAALL EEXXPPRREESSSSIIOONNSS, the expression is + only if the second argument is null. If the first argu- + ment is one of the unary conditional operators listed + above under CCOONNDDIITTIIOONNAALL EEXXPPRREESSSSIIOONNSS, 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. 3 arguments The following conditions are applied in the order listed. - If the second argument is one of the binary conditional + If the second argument is one of the binary conditional operators listed above under CCOONNDDIITTIIOONNAALL EEXXPPRREESSSSIIOONNSS, the result of the expression is the result of the binary test - using the first and third arguments as operands. The --aa - and --oo operators are considered binary operators when - there are three arguments. If the first argument is !!, - the value is the negation of the two-argument test using + using the first and third arguments as operands. The --aa + and --oo operators are considered binary operators when + there are three arguments. If the first argument is !!, + the value is the negation of the two-argument test using the second and third arguments. If the first argument is exactly (( and the third argument is exactly )), the result - is the one-argument test of the second argument. Other- + is the one-argument test of the second argument. Other- wise, the expression is false. 4 arguments The following conditions are applied in the order listed. If the first argument is !!, the result is the negation of - the three-argument expression composed of the remaining - arguments. the two-argument test using the second and - third arguments. If the first argument is exactly (( and - the fourth argument is exactly )), the result is the two- - argument test of the second and third arguments. Other- + the three-argument expression composed of the remaining + arguments. the two-argument test using the second and + third arguments. If the first argument is exactly (( and + the fourth argument is exactly )), the result is the two- + argument test of the second and third arguments. Other- wise, the expression is parsed and evaluated according to precedence using the rules listed above. 5 or more arguments - The expression is parsed and evaluated according to + The expression is parsed and evaluated according to precedence using the rules listed above. When the shell is in _p_o_s_i_x _m_o_d_e, or if the expression is part of the [[[[ command, the << and >> operators sort using the current lo- - cale. If the shell is not in _p_o_s_i_x _m_o_d_e, the tteesstt and [[ com- + cale. If the shell is not in _p_o_s_i_x _m_o_d_e, the tteesstt and [[ com- mands sort lexicographically using ASCII ordering. - ttiimmeess Print the accumulated user and system times for the shell and + ttiimmeess Print the accumulated user and system times for the shell and for processes run from the shell. The return status is 0. ttrraapp [--llpp] [[_a_c_t_i_o_n] _s_i_g_s_p_e_c ...] The _a_c_t_i_o_n is a command that is read and executed when the shell receives signal(s) _s_i_g_s_p_e_c. If _a_c_t_i_o_n is absent (and there is a - single _s_i_g_s_p_e_c) or --, each specified signal is reset to its - original disposition (the value it had upon entrance to the - shell). If _a_c_t_i_o_n is the null string the signal specified by - each _s_i_g_s_p_e_c is ignored by the shell and by the commands it in- + single _s_i_g_s_p_e_c) or --, each specified signal is reset to its + original disposition (the value it had upon entrance to the + shell). If _a_c_t_i_o_n is the null string the signal specified by + each _s_i_g_s_p_e_c is ignored by the shell and by the commands it in- vokes. - If no arguments are supplied, ttrraapp displays the actions associ- + If no arguments are supplied, ttrraapp displays the actions associ- ated with each trapped signal as a set of ttrraapp commands that can - be reused as shell input to restore the current signal disposi- - tions. If --pp is given, and _a_c_t_i_o_n is not present, then ttrraapp - displays the actions associated with each _s_i_g_s_p_e_c or, if none + be reused as shell input to restore the current signal disposi- + tions. If --pp is given, and _a_c_t_i_o_n is not present, then ttrraapp + displays the actions associated with each _s_i_g_s_p_e_c or, if none are supplied, for all trapped signals, as a set of ttrraapp commands - that can be reused as shell input to restore the current signal - dispositions. The --PP option behaves similarly, but displays - only the actions associated with each _s_i_g_s_p_e_c argument. --PP re- - quires at least one _s_i_g_s_p_e_c argument. The --PP or --pp options to - ttrraapp may be used in a subshell environment (e.g., command sub- - stitution) and, as long as they are used before ttrraapp is used to - change a signal's handling, will display the state of its par- + that can be reused as shell input to restore the current signal + dispositions. The --PP option behaves similarly, but displays + only the actions associated with each _s_i_g_s_p_e_c argument. --PP re- + quires at least one _s_i_g_s_p_e_c argument. The --PP or --pp options to + ttrraapp may be used in a subshell environment (e.g., command sub- + stitution) and, as long as they are used before ttrraapp is used to + change a signal's handling, will display the state of its par- ent's traps. - The --ll option causes ttrraapp to print a list of signal names and - their corresponding numbers. Each _s_i_g_s_p_e_c is either a signal - name defined in <_s_i_g_n_a_l_._h>, or a signal number. Signal names + The --ll option causes ttrraapp to print a list of signal names and + their corresponding numbers. Each _s_i_g_s_p_e_c is either a signal + name defined in <_s_i_g_n_a_l_._h>, or a signal number. Signal names are case insensitive and the SSIIGG prefix is optional. - If a _s_i_g_s_p_e_c is EEXXIITT (0) the command _a_c_t_i_o_n is executed on exit - from the shell. If a _s_i_g_s_p_e_c is DDEEBBUUGG, the command _a_c_t_i_o_n is + If a _s_i_g_s_p_e_c is EEXXIITT (0) the command _a_c_t_i_o_n is executed on exit + from the shell. If a _s_i_g_s_p_e_c is DDEEBBUUGG, the command _a_c_t_i_o_n is executed before every _s_i_m_p_l_e _c_o_m_m_a_n_d, _f_o_r command, _c_a_s_e command, - _s_e_l_e_c_t command, (( arithmetic command, [[ conditional command, + _s_e_l_e_c_t command, (( arithmetic command, [[ conditional command, arithmetic _f_o_r command, and before the first command executes in - a shell function (see SSHHEELLLL GGRRAAMMMMAARR above). Refer to the de- - scription of the eexxttddeebbuugg option to the sshhoopptt builtin for de- - tails of its effect on the DDEEBBUUGG trap. If a _s_i_g_s_p_e_c is RREETTUURRNN, - the command _a_c_t_i_o_n is executed each time a shell function or a - script executed with the .. or ssoouurrccee builtins finishes execut- + a shell function (see SSHHEELLLL GGRRAAMMMMAARR above). Refer to the de- + scription of the eexxttddeebbuugg option to the sshhoopptt builtin for de- + tails of its effect on the DDEEBBUUGG trap. If a _s_i_g_s_p_e_c is RREETTUURRNN, + the command _a_c_t_i_o_n is executed each time a shell function or a + script executed with the .. or ssoouurrccee builtins finishes execut- ing. - If a _s_i_g_s_p_e_c is EERRRR, the command _a_c_t_i_o_n is executed whenever a + If a _s_i_g_s_p_e_c is EERRRR, the command _a_c_t_i_o_n is executed whenever a pipeline (which may consist of a single simple command), a list, or a compound command returns a non-zero exit status, subject to - the following conditions. The EERRRR trap is not executed if the + the following conditions. The EERRRR trap is not executed if the failed command is part of the command list immediately following - a wwhhiillee or uunnttiill keyword, part of the test in an _i_f statement, + a wwhhiillee or uunnttiill keyword, part of the test in an _i_f statement, part of a command executed in a &&&& or |||| list except the command - following the final &&&& or ||||, any command in a pipeline but the - last, or if the command's return value is being inverted using + following the final &&&& or ||||, any command in a pipeline but the + last, or if the command's return value is being inverted using !!. These are the same conditions obeyed by the eerrrreexxiitt (--ee) op- tion. When the shell is not interactive, signals ignored upon entry to the shell cannot be trapped or reset. Interactive shells permit trapping signals ignored on entry. Trapped signals that are not - being ignored are reset to their original values in a subshell - or subshell environment when one is created. The return status + being ignored are reset to their original values in a subshell + or subshell environment when one is created. The return status is false if any _s_i_g_s_p_e_c is invalid; otherwise ttrraapp returns true. ttrruuee Does nothing, returns a 0 status. ttyyppee [--aaffttppPP] _n_a_m_e [_n_a_m_e ...] - With no options, indicate how each _n_a_m_e would be interpreted if + With no options, indicate how each _n_a_m_e would be interpreted if used as a command name. If the --tt option is used, ttyyppee prints a - string which is one of _a_l_i_a_s, _k_e_y_w_o_r_d, _f_u_n_c_t_i_o_n, _b_u_i_l_t_i_n, or - _f_i_l_e if _n_a_m_e is an alias, shell reserved word, function, - builtin, or executable disk file, respectively. If the _n_a_m_e is - not found, then nothing is printed, and ttyyppee returns a non-zero - exit status. If the --pp option is used, ttyyppee either returns the - name of the executable file that would be found by searching - $$PPAATTHH if _n_a_m_e were specified as a command name, or nothing if - "type -t name" would not return _f_i_l_e. The --PP option forces a - PPAATTHH search for each _n_a_m_e, even if "type -t name" would not re- - turn _f_i_l_e. If a command is hashed, --pp and --PP print the hashed - value, which is not necessarily the file that appears first in - PPAATTHH. If the --aa option is used, ttyyppee prints all of the places - that contain a command named _n_a_m_e. This includes aliases, re- - served words, functions, and builtins, but the path search op- + string which is one of _a_l_i_a_s, _k_e_y_w_o_r_d, _f_u_n_c_t_i_o_n, _b_u_i_l_t_i_n, or + _f_i_l_e if _n_a_m_e is an alias, shell reserved word, function, + builtin, or executable disk file, respectively. If the _n_a_m_e is + not found, then nothing is printed, and ttyyppee returns a non-zero + exit status. If the --pp option is used, ttyyppee either returns the + name of the executable file that would be found by searching + $$PPAATTHH if _n_a_m_e were specified as a command name, or nothing if + "type -t name" would not return _f_i_l_e. The --PP option forces a + PPAATTHH search for each _n_a_m_e, even if "type -t name" would not re- + turn _f_i_l_e. If a command is hashed, --pp and --PP print the hashed + value, which is not necessarily the file that appears first in + PPAATTHH. If the --aa option is used, ttyyppee prints all of the places + that contain a command named _n_a_m_e. This includes aliases, re- + served words, functions, and builtins, but the path search op- tions (--pp and --PP) can be supplied to restrict the output to exe- - cutable files. ttyyppee does not consult the table of hashed com- + cutable files. ttyyppee does not consult the table of hashed com- mands when using --aa with --pp, and only performs a PPAATTHH search for - _n_a_m_e. The --ff option suppresses shell function lookup, as with - the ccoommmmaanndd builtin. ttyyppee returns true if all of the arguments + _n_a_m_e. The --ff option suppresses shell function lookup, as with + the ccoommmmaanndd builtin. ttyyppee returns true if all of the arguments are found, false if any are not found. uulliimmiitt [--HHSS] --aa uulliimmiitt [--HHSS] [--bbccddeeffiikkllmmnnppqqrrssttuuvvxxPPRRTT [_l_i_m_i_t]] - Provides control over the resources available to the shell and - to processes started by it, on systems that allow such control. + Provides control over the resources available to the shell and + to processes started by it, on systems that allow such control. The --HH and --SS options specify that the hard or soft limit is set - for the given resource. A hard limit cannot be increased by a - non-root user once it is set; a soft limit may be increased up - to the value of the hard limit. If neither --HH nor --SS is speci- + for the given resource. A hard limit cannot be increased by a + non-root user once it is set; a soft limit may be increased up + to the value of the hard limit. If neither --HH nor --SS is speci- fied, both the soft and hard limits are set. The value of _l_i_m_i_t can be a number in the unit specified for the resource or one of the special values hhaarrdd, ssoofftt, or uunnlliimmiitteedd, which stand for the - current hard limit, the current soft limit, and no limit, re- - spectively. If _l_i_m_i_t is omitted, the current value of the soft + current hard limit, the current soft limit, and no limit, re- + spectively. If _l_i_m_i_t is omitted, the current value of the soft limit of the resource is printed, unless the --HH option is given. - When more than one resource is specified, the limit name and - unit, if appropriate, are printed before the value. Other op- + When more than one resource is specified, the limit name and + unit, if appropriate, are printed before the value. Other op- tions are interpreted as follows: --aa All current limits are reported; no limits are set --bb The maximum socket buffer size --cc The maximum size of core files created --dd The maximum size of a process's data segment --ee The maximum scheduling priority ("nice"). - --ff The maximum size of files written by the shell and its + --ff The maximum size of files written by the shell and its children --ii The maximum number of pending signals --kk The maximum number of kqueues that may be allocated --ll The maximum size that may be locked into memory - --mm The maximum resident set size (many systems do not honor + --mm The maximum resident set size (many systems do not honor this limit) --nn The maximum number of open file descriptors (most systems do not allow this value to be set) @@ -6522,134 +6531,134 @@ SSHHEELLLL BBUUIILLTTIINN CCOOMMMMAANNDDSS --rr The maximum real-time scheduling priority --ss The maximum stack size --tt The maximum amount of cpu time in seconds - --uu The maximum number of processes available to a single + --uu The maximum number of processes available to a single user - --vv The maximum amount of virtual memory available to the + --vv The maximum amount of virtual memory available to the shell and, on some systems, to its children --xx The maximum number of file locks --PP The maximum number of pseudoterminals - --RR The maximum time a real-time process can run before + --RR The maximum time a real-time process can run before blocking, in microseconds --TT The maximum number of threads - If _l_i_m_i_t is given, and the --aa option is not used, _l_i_m_i_t is the - new value of the specified resource. If no option is given, - then --ff is assumed. Values are in 1024-byte increments, except - for --tt, which is in seconds; --RR, which is in microseconds; --pp, - which is in units of 512-byte blocks; --PP, --TT, --bb, --kk, --nn, and - --uu, which are unscaled values; and, when in posix mode, --cc and - --ff, which are in 512-byte increments. The return status is 0 - unless an invalid option or argument is supplied, or an error + If _l_i_m_i_t is given, and the --aa option is not used, _l_i_m_i_t is the + new value of the specified resource. If no option is given, + then --ff is assumed. Values are in 1024-byte increments, except + for --tt, which is in seconds; --RR, which is in microseconds; --pp, + which is in units of 512-byte blocks; --PP, --TT, --bb, --kk, --nn, and + --uu, which are unscaled values; and, when in posix mode, --cc and + --ff, which are in 512-byte increments. The return status is 0 + unless an invalid option or argument is supplied, or an error occurs while setting a new limit. uummaasskk [--pp] [--SS] [_m_o_d_e] The user file-creation mask is set to _m_o_d_e. If _m_o_d_e 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 - _c_h_m_o_d(1). If _m_o_d_e is omitted, the current value of the mask is - printed. The --SS option causes the mask to be printed in sym- - bolic form; the default output is an octal number. If the --pp + a digit, it is interpreted as an octal number; otherwise it is + interpreted as a symbolic mode mask similar to that accepted by + _c_h_m_o_d(1). If _m_o_d_e is omitted, the current value of the mask is + printed. The --SS option causes the mask to be printed in sym- + bolic form; the default output is an octal number. If the --pp option is supplied, and _m_o_d_e 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 _m_o_d_e argument was supplied, + was successfully changed or if no _m_o_d_e argument was supplied, and false otherwise. uunnaalliiaass [-aa] [_n_a_m_e ...] - Remove each _n_a_m_e from the list of defined aliases. If --aa is - supplied, all alias definitions are removed. The return value + Remove each _n_a_m_e from the list of defined aliases. If --aa is + supplied, all alias definitions are removed. The return value is true unless a supplied _n_a_m_e is not a defined alias. uunnsseett [-ffvv] [-nn] [_n_a_m_e ...] - For each _n_a_m_e, remove the corresponding variable or function. + For each _n_a_m_e, remove the corresponding variable or function. If the --vv option is given, each _n_a_m_e refers to a shell variable, - and that variable is removed. Read-only variables may not be - unset. If --ff is specified, each _n_a_m_e refers to a shell func- - tion, and the function definition is removed. If the --nn option - is supplied, and _n_a_m_e is a variable with the _n_a_m_e_r_e_f attribute, - _n_a_m_e will be unset rather than the variable it references. --nn - has no effect if the --ff option is supplied. If no options are - supplied, each _n_a_m_e refers to a variable; if there is no vari- - able by that name, a function with that name, if any, is unset. - Each unset variable or function is removed from the environment - passed to subsequent commands. If any of BBAASSHH__AALLIIAASSEESS, + and that variable is removed. Read-only variables may not be + unset. If --ff is specified, each _n_a_m_e refers to a shell func- + tion, and the function definition is removed. If the --nn option + is supplied, and _n_a_m_e is a variable with the _n_a_m_e_r_e_f attribute, + _n_a_m_e will be unset rather than the variable it references. --nn + has no effect if the --ff option is supplied. If no options are + supplied, each _n_a_m_e refers to a variable; if there is no vari- + able by that name, a function with that name, if any, is unset. + Each unset variable or function is removed from the environment + passed to subsequent commands. If any of BBAASSHH__AALLIIAASSEESS, BBAASSHH__AARRGGVV00, BBAASSHH__CCMMDDSS, BBAASSHH__CCOOMMMMAANNDD, BBAASSHH__SSUUBBSSHHEELLLL, BBAASSHHPPIIDD, - CCOOMMPP__WWOORRDDBBRREEAAKKSS, DDIIRRSSTTAACCKK, EEPPOOCCHHRREEAALLTTIIMMEE, EEPPOOCCHHSSEECCOONNDDSS, FFUUNNCC-- - NNAAMMEE, GGRROOUUPPSS, HHIISSTTCCMMDD, LLIINNEENNOO, RRAANNDDOOMM, SSEECCOONNDDSS, or SSRRAANNDDOOMM are + CCOOMMPP__WWOORRDDBBRREEAAKKSS, DDIIRRSSTTAACCKK, EEPPOOCCHHRREEAALLTTIIMMEE, EEPPOOCCHHSSEECCOONNDDSS, FFUUNNCC-- + NNAAMMEE, GGRROOUUPPSS, HHIISSTTCCMMDD, LLIINNEENNOO, RRAANNDDOOMM, SSEECCOONNDDSS, or SSRRAANNDDOOMM are unset, they lose their special properties, even if they are sub- sequently reset. The exit status is true unless a _n_a_m_e is read- only or may not be unset. wwaaiitt [--ffnn] [--pp _v_a_r_n_a_m_e] [_i_d ...] Wait for each specified child process and return its termination - status. Each _i_d 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_d is not given, wwaaiitt waits for all running - background jobs and the last-executed process substitution, if + status. Each _i_d 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_d is not given, wwaaiitt waits for all running + background jobs and the last-executed process substitution, if its process id is the same as $$!!, and the return status is zero. - If the --nn option is supplied, wwaaiitt waits for a single job from + If the --nn option is supplied, wwaaiitt waits for a single job from the list of _i_ds or, if no _i_ds are supplied, any job, to complete - and returns its exit status. If none of the supplied arguments + and returns its exit status. If none of the supplied arguments is a child of the shell, or if no arguments are supplied and the - shell has no unwaited-for children, the exit status is 127. If - the --pp option is supplied, the process or job identifier of the - job for which the exit status is returned is assigned to the - variable _v_a_r_n_a_m_e named by the option argument. The variable - will be unset initially, before any assignment. This is useful - only when the --nn option is supplied. Supplying the --ff option, - when job control is enabled, forces wwaaiitt to wait for _i_d to ter- + shell has no unwaited-for children, the exit status is 127. If + the --pp option is supplied, the process or job identifier of the + job for which the exit status is returned is assigned to the + variable _v_a_r_n_a_m_e named by the option argument. The variable + will be unset initially, before any assignment. This is useful + only when the --nn option is supplied. Supplying the --ff option, + when job control is enabled, forces wwaaiitt to wait for _i_d to ter- minate before returning its status, instead of returning when it - changes status. If _i_d specifies a non-existent process or job, - the return status is 127. If wwaaiitt is interrupted by a signal, - the return status will be greater than 128, as described under - SSIIGGNNAALLSS above. Otherwise, the return status is the exit status + changes status. If _i_d specifies a non-existent process or job, + the return status is 127. If wwaaiitt is interrupted by a signal, + the return status will be greater than 128, as described under + SSIIGGNNAALLSS above. Otherwise, the return status is the exit status of the last process or job waited for. SSHHEELLLL CCOOMMPPAATTIIBBIILLIITTYY MMOODDEE - Bash-4.0 introduced the concept of a _s_h_e_l_l _c_o_m_p_a_t_i_b_i_l_i_t_y _l_e_v_e_l, speci- + Bash-4.0 introduced the concept of a _s_h_e_l_l _c_o_m_p_a_t_i_b_i_l_i_t_y _l_e_v_e_l, speci- fied as a set of options to the shopt builtin (ccoommppaatt3311, ccoommppaatt3322, ccoomm-- - ppaatt4400, ccoommppaatt4411, and so on). There is only one current compatibility + ppaatt4400, ccoommppaatt4411, and so on). There is only one current compatibility level -- each option is mutually exclusive. The compatibility level is - intended to allow users to select behavior from previous versions that - is incompatible with newer versions while they migrate scripts to use - current features and behavior. It's intended to be a temporary solu- + intended to allow users to select behavior from previous versions that + is incompatible with newer versions while they migrate scripts to use + current features and behavior. It's intended to be a temporary solu- tion. - This section does not mention behavior that is standard for a particu- - lar version (e.g., setting ccoommppaatt3322 means that quoting the rhs of the - regexp matching operator quotes special regexp characters in the word, + This section does not mention behavior that is standard for a particu- + lar version (e.g., setting ccoommppaatt3322 means that quoting the rhs of the + regexp matching operator quotes special regexp characters in the word, which is default behavior in bash-3.2 and subsequent versions). - If a user enables, say, ccoommppaatt3322, it may affect the behavior of other - compatibility levels up to and including the current compatibility - level. The idea is that each compatibility level controls behavior - that changed in that version of bbaasshh, but that behavior may have been - present in earlier versions. For instance, the change to use locale- - based comparisons with the [[[[ command came in bash-4.1, and earlier + If a user enables, say, ccoommppaatt3322, it may affect the behavior of other + compatibility levels up to and including the current compatibility + level. The idea is that each compatibility level controls behavior + that changed in that version of bbaasshh, but that behavior may have been + present in earlier versions. For instance, the change to use locale- + based comparisons with the [[[[ command came in bash-4.1, and earlier versions used ASCII-based comparisons, so enabling ccoommppaatt3322 will enable - ASCII-based comparisons as well. That granularity may not be suffi- - cient for all uses, and as a result users should employ compatibility - levels carefully. Read the documentation for a particular feature to + ASCII-based comparisons as well. That granularity may not be suffi- + cient for all uses, and as a result users should employ compatibility + levels carefully. Read the documentation for a particular feature to find out the current behavior. - Bash-4.3 introduced a new shell variable: BBAASSHH__CCOOMMPPAATT. The value as- + Bash-4.3 introduced a new shell variable: BBAASSHH__CCOOMMPPAATT. The value as- signed to this variable (a decimal version number like 4.2, or an inte- - ger corresponding to the ccoommppaatt_N_N option, like 42) determines the com- + ger corresponding to the ccoommppaatt_N_N option, like 42) determines the com- patibility level. - Starting with bash-4.4, bbaasshh has begun deprecating older compatibility - levels. Eventually, the options will be removed in favor of BBAASSHH__CCOOMM-- + Starting with bash-4.4, bbaasshh has begun deprecating older compatibility + levels. Eventually, the options will be removed in favor of BBAASSHH__CCOOMM-- PPAATT. - Bash-5.0 was the final version for which there will be an individual + Bash-5.0 was the final version for which there will be an individual shopt option for the previous version. Users should control the compat- ibility level with BBAASSHH__CCOOMMPPAATT. - The following table describes the behavior changes controlled by each + The following table describes the behavior changes controlled by each compatibility level setting. The ccoommppaatt_N_N tag is used as shorthand for setting the compatibility level to _N_N using one of the following mecha- - nisms. For versions prior to bash-5.0, the compatibility level may be - set using the corresponding ccoommppaatt_N_N shopt option. For bash-4.3 and - later versions, the BBAASSHH__CCOOMMPPAATT variable is preferred, and it is re- + nisms. For versions prior to bash-5.0, the compatibility level may be + set using the corresponding ccoommppaatt_N_N shopt option. For bash-4.3 and + later versions, the BBAASSHH__CCOOMMPPAATT variable is preferred, and it is re- quired for bash-5.1 and later versions. ccoommppaatt3311 @@ -6657,172 +6666,172 @@ SSHHEELLLL CCOOMMPPAATTIIBBIILLIITTYY MMOODDEE ator (=~) has no special effect ccoommppaatt3322 - +o the << and >> operators to the [[[[ command do not consider + +o the << and >> operators to the [[[[ command do not consider the current locale when comparing strings; they use ASCII ordering. ccoommppaatt4400 - +o the << and >> operators to the [[[[ command do not consider + +o the << and >> operators to the [[[[ command do not consider the current locale when comparing strings; they use ASCII ordering. BBaasshh versions prior to bash-4.1 use ASCII col- - lation and _s_t_r_c_m_p(3); bash-4.1 and later use the current + lation and _s_t_r_c_m_p(3); bash-4.1 and later use the current locale's collation sequence and _s_t_r_c_o_l_l(3). ccoommppaatt4411 - +o in _p_o_s_i_x mode, ttiimmee may be followed by options and still + +o in _p_o_s_i_x mode, ttiimmee may be followed by options and still be recognized as a reserved word (this is POSIX interpre- tation 267) +o in _p_o_s_i_x mode, the parser requires that an even number of - single quotes occur in the _w_o_r_d portion of a double- - quoted parameter expansion and treats them specially, so - that characters within the single quotes are considered + single quotes occur in the _w_o_r_d portion of a double- + quoted parameter expansion and treats them specially, so + that characters within the single quotes are considered quoted (this is POSIX interpretation 221) ccoommppaatt4422 +o the replacement string in double-quoted pattern substitu- - tion does not undergo quote removal, as it does in ver- + tion does not undergo quote removal, as it does in ver- sions after bash-4.2 - +o in posix mode, single quotes are considered special when - expanding the _w_o_r_d portion of a double-quoted parameter - expansion and can be used to quote a closing brace or - other special character (this is part of POSIX interpre- - tation 221); in later versions, single quotes are not + +o in posix mode, single quotes are considered special when + expanding the _w_o_r_d portion of a double-quoted parameter + expansion and can be used to quote a closing brace or + other special character (this is part of POSIX interpre- + tation 221); in later versions, single quotes are not special within double-quoted word expansions ccoommppaatt4433 - +o the shell does not print a warning message if an attempt - is made to use a quoted compound assignment as an argu- - ment to declare (e.g., declare -a foo='(1 2)'). Later + +o the shell does not print a warning message if an attempt + is made to use a quoted compound assignment as an argu- + ment to declare (e.g., declare -a foo='(1 2)'). Later versions warn that this usage is deprecated - +o word expansion errors are considered non-fatal errors - that cause the current command to fail, even in posix - mode (the default behavior is to make them fatal errors + +o word expansion errors are considered non-fatal errors + that cause the current command to fail, even in posix + mode (the default behavior is to make them fatal errors that cause the shell to exit) - +o when executing a shell function, the loop state + +o when executing a shell function, the loop state (while/until/etc.) is not reset, so bbrreeaakk or ccoonnttiinnuuee in that function will break or continue loops in the calling - context. Bash-4.4 and later reset the loop state to pre- + context. Bash-4.4 and later reset the loop state to pre- vent this ccoommppaatt4444 - +o the shell sets up the values used by BBAASSHH__AARRGGVV and - BBAASSHH__AARRGGCC so they can expand to the shell's positional + +o the shell sets up the values used by BBAASSHH__AARRGGVV and + BBAASSHH__AARRGGCC so they can expand to the shell's positional parameters even if extended debugging mode is not enabled - +o a subshell inherits loops from its parent context, so - bbrreeaakk or ccoonnttiinnuuee will cause the subshell to exit. - Bash-5.0 and later reset the loop state to prevent the + +o a subshell inherits loops from its parent context, so + bbrreeaakk or ccoonnttiinnuuee will cause the subshell to exit. + Bash-5.0 and later reset the loop state to prevent the exit - +o variable assignments preceding builtins like eexxppoorrtt and + +o variable assignments preceding builtins like eexxppoorrtt and rreeaaddoonnllyy that set attributes continue to affect variables with the same name in the calling environment even if the shell is not in posix mode ccoommppaatt5500 - +o Bash-5.1 changed the way $$RRAANNDDOOMM is generated to intro- + +o Bash-5.1 changed the way $$RRAANNDDOOMM is generated to intro- duce slightly more randomness. If the shell compatibility - level is set to 50 or lower, it reverts to the method - from bash-5.0 and previous versions, so seeding the ran- - dom number generator by assigning a value to RRAANNDDOOMM will + level is set to 50 or lower, it reverts to the method + from bash-5.0 and previous versions, so seeding the ran- + dom number generator by assigning a value to RRAANNDDOOMM will produce the same sequence as in bash-5.0 - +o If the command hash table is empty, bash versions prior - to bash-5.1 printed an informational message to that ef- - fect, even when producing output that can be reused as - input. Bash-5.1 suppresses that message when the --ll op- + +o If the command hash table is empty, bash versions prior + to bash-5.1 printed an informational message to that ef- + fect, even when producing output that can be reused as + input. Bash-5.1 suppresses that message when the --ll op- tion is supplied. ccoommppaatt5511 - +o The uunnsseett builtin treats attempts to unset array sub- - scripts @@ and ** differently depending on whether the ar- - ray is indexed or associative, and differently than in + +o The uunnsseett builtin treats attempts to unset array sub- + scripts @@ and ** differently depending on whether the ar- + ray is indexed or associative, and differently than in previous versions. +o arithmetic commands ( ((((...)))) ) and the expressions in an arithmetic for statement can be expanded more than once - +o expressions used as arguments to arithmetic operators in + +o expressions used as arguments to arithmetic operators in the [[[[ conditional command can be expanded more than once - +o the expressions in substring parameter brace expansion + +o the expressions in substring parameter brace expansion can be expanded more than once +o the expressions in the $$((((...)))) word expansion can be ex- panded more than once - +o arithmetic expressions used as indexed array subscripts + +o arithmetic expressions used as indexed array subscripts can be expanded more than once - +o tteesstt --vv, when given an argument of AA[[@@]], where AA is an + +o tteesstt --vv, when given an argument of AA[[@@]], where AA is an existing associative array, will return true if the array - has any set elements. Bash-5.2 will look for and report + has any set elements. Bash-5.2 will look for and report on a key named @@. +o the ${_p_a_r_a_m_e_t_e_r[[::]]==_v_a_l_u_e} word expansion will return - _v_a_l_u_e, before any variable-specific transformations have + _v_a_l_u_e, before any variable-specific transformations have been performed (e.g., converting to lowercase). Bash-5.2 will return the final value assigned to the variable. - +o Parsing command substitutions will behave as if extended + +o Parsing command substitutions will behave as if extended globbing (see the description of the sshhoopptt builtin above) - is enabled, so that parsing a command substitution con- + is enabled, so that parsing a command substitution con- taining an extglob pattern (say, as part of a shell func- - tion) will not fail. This assumes the intent is to en- - able extglob before the command is executed and word ex- - pansions are performed. It will fail at word expansion - time if extglob hasn't been enabled by the time the com- + tion) will not fail. This assumes the intent is to en- + able extglob before the command is executed and word ex- + pansions are performed. It will fail at word expansion + time if extglob hasn't been enabled by the time the com- mand is executed. ccoommppaatt5522 - +o The tteesstt builtin uses its historical algorithm to parse - parenthesized subexpressions when given five or more ar- + +o The tteesstt builtin uses its historical algorithm to parse + parenthesized subexpressions when given five or more ar- guments. - +o If the --pp or --PP option is supplied to the bbiinndd builtin, + +o If the --pp or --PP option is supplied to the bbiinndd builtin, bbiinndd treats any arguments remaining after option process- - ing as bindable command names, and displays any key se- - quences bound to those commands, instead of treating the + ing as bindable command names, and displays any key se- + quences bound to those commands, instead of treating the arguments as key sequences to bind. RREESSTTRRIICCTTEEDD SSHHEELLLL If bbaasshh is started with the name rrbbaasshh, or the --rr 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 bbaasshh with the exception that the following are + 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 bbaasshh with the exception that the following are disallowed or not performed: +o changing directories with ccdd - +o setting or unsetting the values of SSHHEELLLL, PPAATTHH, HHIISSTTFFIILLEE, EENNVV, + +o setting or unsetting the values of SSHHEELLLL, PPAATTHH, HHIISSTTFFIILLEE, EENNVV, or BBAASSHH__EENNVV +o specifying command names containing // - +o specifying a filename containing a // as an argument to the .. + +o specifying a filename containing a // as an argument to the .. builtin command - +o specifying a filename containing a slash as an argument to the + +o specifying a filename containing a slash as an argument to the hhiissttoorryy builtin command - +o specifying a filename containing a slash as an argument to the + +o specifying a filename containing a slash as an argument to the --pp option to the hhaasshh builtin command - +o importing function definitions from the shell environment at + +o importing function definitions from the shell environment at startup - +o parsing the value of SSHHEELLLLOOPPTTSS from the shell environment at + +o parsing the value of SSHHEELLLLOOPPTTSS from the shell environment at startup - +o redirecting output using the >, >|, <>, >&, &>, and >> redirec- + +o redirecting output using the >, >|, <>, >&, &>, and >> redirec- tion operators +o using the eexxeecc builtin command to replace the shell with another command - +o adding or deleting builtin commands with the --ff and --dd options + +o adding or deleting builtin commands with the --ff and --dd options to the eennaabbllee builtin command - +o using the eennaabbllee builtin command to enable disabled shell + +o using the eennaabbllee builtin command to enable disabled shell builtins +o specifying the --pp option to the ccoommmmaanndd builtin command - +o turning off restricted mode with sseett ++rr or sshhoopptt --uu rree-- + +o turning off restricted mode with sseett ++rr or sshhoopptt --uu rree-- ssttrriicctteedd__sshheellll. These restrictions are enforced after any startup files are read. When a command that is found to be a shell script is executed (see CCOOMM-- - MMAANNDD EEXXEECCUUTTIIOONN above), rrbbaasshh turns off any restrictions in the shell + MMAANNDD EEXXEECCUUTTIIOONN above), rrbbaasshh turns off any restrictions in the shell spawned to execute the script. SSEEEE AALLSSOO @@ -6847,10 +6856,10 @@ FFIILLEESS _~_/_._b_a_s_h_r_c The individual per-interactive-shell startup file _~_/_._b_a_s_h___l_o_g_o_u_t - The individual login shell cleanup file, executed when a login + The individual login shell cleanup file, executed when a login shell exits _~_/_._b_a_s_h___h_i_s_t_o_r_y - The default value of HHIISSTTFFIILLEE, the file in which bash saves the + The default value of HHIISSTTFFIILLEE, the file in which bash saves the command history _~_/_._i_n_p_u_t_r_c Individual _r_e_a_d_l_i_n_e initialization file @@ -6864,15 +6873,15 @@ AAUUTTHHOORRSS BBUUGG RREEPPOORRTTSS If you find a bug in bbaasshh, 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 bbaasshh. The latest version is always available from + make sure that it really is a bug, and that it appears in the latest + version of bbaasshh. The latest version is always available from _f_t_p_:_/_/_f_t_p_._g_n_u_._o_r_g_/_p_u_b_/_g_n_u_/_b_a_s_h_/ and _h_t_t_p_:_/_/_g_i_t_._s_a_v_a_n_- _n_a_h_._g_n_u_._o_r_g_/_c_g_i_t_/_b_a_s_h_._g_i_t_/_s_n_a_p_s_h_o_t_/_b_a_s_h_-_m_a_s_t_e_r_._t_a_r_._g_z. - Once you have determined that a bug actually exists, use the _b_a_s_h_b_u_g - command to submit a bug report. If you have a fix, you are encouraged + Once you have determined that a bug actually exists, use the _b_a_s_h_b_u_g + command to submit a bug report. If you have a fix, you are encouraged to mail that as well! You may send suggestions and "philosophical" bug - reports to _b_u_g_-_b_a_s_h_@_g_n_u_._o_r_g or post them to the Usenet newsgroup + reports to _b_u_g_-_b_a_s_h_@_g_n_u_._o_r_g or post them to the Usenet newsgroup ggnnuu..bbaasshh..bbuugg. ALL bug reports should include: @@ -6883,7 +6892,7 @@ BBUUGG RREEPPOORRTTSS A description of the bug behaviour A short script or "recipe" which exercises the bug - _b_a_s_h_b_u_g inserts the first three items automatically into the template + _b_a_s_h_b_u_g inserts the first three items automatically into the template it provides for filing a bug report. Comments and bug reports concerning this manual page should be directed @@ -6900,15 +6909,15 @@ BBUUGGSS Shell builtin commands and functions are not stoppable/restartable. 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, or to start the command in the background and immediately bring + 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, or to start the command in the background and immediately bring it into the foreground. Array variables may not (yet) be exported. There may be only one active coprocess at a time. -GNU Bash 5.3 2024 April 23 _B_A_S_H(1) +GNU Bash 5.3 2024 June 12 _B_A_S_H(1) diff --git a/doc/bash.1 b/doc/bash.1 index b5f156db..7a91649b 100644 --- a/doc/bash.1 +++ b/doc/bash.1 @@ -5,14 +5,14 @@ .\" Case Western Reserve University .\" chet.ramey@case.edu .\" -.\" Last Change: Sat May 11 12:44:30 EDT 2024 +.\" Last Change: Wed Jun 12 10:31:44 PDT 2024 .\" .\" bash_builtins, strip all but Built-Ins section .\" avoid a warning about an undefined register .\" .if !rzY .nr zY 0 .if \n(zZ=1 .ig zZ .if \n(zY=1 .ig zY -.TH BASH 1 "2024 May 11" "GNU Bash 5.3" +.TH BASH 1 "2024 June 12" "GNU Bash 5.3" .\" .ie \n(.g \{\ .ds ' \(aq @@ -8054,44 +8054,40 @@ and performing any specified redirections. The return status is zero. .TP -\fB\&.\| \fP \fIfilename\fP [\fIarguments\fP] +\fB\&.\| \fP [\fB\-p\fP \fIpath\fP] \fIfilename\fP [\fIarguments\fP] .PD 0 .TP -\fBsource\fP \fIfilename\fP [\fIarguments\fP] +\fBsource\fP [\fB\-p\fP \fIpath\fP] \fIfilename\fP [\fIarguments\fP] .PD -Read and execute commands from +The \fB\&.\| \fP command (\fBsource\fP) reads and execute commands from .I filename -in the current -shell environment and return the exit status of the last command -executed from +in the current shell environment and returns the exit status of the +last command executed from .IR filename . -If -.I filename -does not contain a slash, filenames in -.SM -.B PATH -are used to find the directory containing -.IR filename , -but \fIfilename\fP does not need to be executable. -The file searched for in +If \fIfilename\fP does not contain a slash, \fB\&.\| \fP searchs for it. +If the \fB\-p\fP option is supplied, \fB\&.\| \fP treats \fIpath\fP +as a colon-separated list of directories in which to find \fIfilename\fP; +otherwise, \fB\&.\| \fP uses the entries in .SM .B PATH -need not be executable. +to find the directory containing +.IR filename . +\fIfilename\fP does not need to be executable. When \fBbash\fP is not in \fIposix mode\fP, it searches the current directory if no file is found in .SM -.BR PATH . +.BR PATH , +but does not search the current directory if \fB\-p\fP is supplied. If the .B sourcepath option to the .B shopt -builtin command is turned off, the +builtin command is turned off, \fB\&.\| \fP does not search .SM -.B PATH -is not searched. +.BR PATH . If any \fIarguments\fP are supplied, they become the positional -parameters when \fIfilename\fP is executed. Otherwise the positional -parameters are unchanged. +parameters when \fIfilename\fP is executed. +Otherwise the positional parameters are unchanged. If the \fB\-T\fP option is enabled, \fB.\fP inherits any trap on \fBDEBUG\fP; if it is not, any \fBDEBUG\fP trap string is saved and restored around the call to \fB.\fP, and \fB.\fP unsets the @@ -11202,7 +11198,8 @@ If set, the \fB.\fP (\fBsource\fP) builtin uses the value of .SM .B PATH -to find the directory containing the file supplied as an argument. +to find the directory containing the file supplied as an argument when +the \fB\-p\fP option is not supplied. This option is enabled by default. .TP 8 .B varredir_close diff --git a/doc/bash.info b/doc/bash.info index 1314958a..ab227dc3 100644 --- a/doc/bash.info +++ b/doc/bash.info @@ -1,9 +1,9 @@ This is bash.info, produced by makeinfo version 7.1 from bashref.texi. This text is a brief description of the features that are present in the -Bash shell (version 5.3, 23 April 2024). +Bash shell (version 5.3, 12 June 2024). - This is Edition 5.3, last updated 23 April 2024, of ‘The GNU Bash + This is Edition 5.3, last updated 12 June 2024, of ‘The GNU Bash Reference Manual’, for ‘Bash’, Version 5.3. Copyright © 1988-2023 Free Software Foundation, Inc. @@ -26,10 +26,10 @@ Bash Features ************* This text is a brief description of the features that are present in the -Bash shell (version 5.3, 23 April 2024). The Bash home page is +Bash shell (version 5.3, 12 June 2024). The Bash home page is . - This is Edition 5.3, last updated 23 April 2024, of ‘The GNU Bash + This is Edition 5.3, last updated 12 June 2024, of ‘The GNU Bash Reference Manual’, for ‘Bash’, Version 5.3. Bash contains features that appear in other popular shells, and some @@ -991,9 +991,8 @@ File: bash.info, Node: Conditional Constructs, Next: Command Grouping, Prev: and filename expansion. The shell performs tilde expansion, parameter and variable expansion, arithmetic expansion, command substitution, process substitution, and quote removal on those - words (the expansions that would occur if the words were enclosed - in double quotes). Conditional operators such as ‘-f’ must be - unquoted to be recognized as primaries. + words. Conditional operators such as ‘-f’ must be unquoted to be + recognized as primaries. When used with ‘[[’, the ‘<’ and ‘>’ operators sort lexicographically using the current locale. @@ -3280,24 +3279,28 @@ standard. The return status is zero. ‘. (a period)’ - . FILENAME [ARGUMENTS] + . [-p PATH] FILENAME [ARGUMENTS] Read and execute commands from the FILENAME argument in the current - shell context. If FILENAME does not contain a slash, the ‘PATH’ - variable is used to find FILENAME, but FILENAME does not need to be - executable. When Bash is not in POSIX mode, it searches the - current directory if FILENAME is not found in ‘$PATH’. If any - ARGUMENTS are supplied, they become the positional parameters when - FILENAME is executed. Otherwise the positional parameters are - unchanged. If the ‘-T’ option is enabled, ‘.’ inherits any trap on - ‘DEBUG’; if it is not, any ‘DEBUG’ trap string is saved and - restored around the call to ‘.’, and ‘.’ unsets the ‘DEBUG’ trap - while it executes. If ‘-T’ is not set, and the sourced file - changes the ‘DEBUG’ trap, the new value is retained when ‘.’ - completes. The return status is the exit status of the last - command executed, or zero if no commands are executed. If FILENAME - is not found, or cannot be read, the return status is non-zero. - This builtin is equivalent to ‘source’. + shell context. If FILENAME does not contain a slash, ‘.’ searches + for it. If ‘-p’ is supplied, ‘.’ treats PATH as a colon-separated + list of directories in which to find FILENAME; otherwise, ‘.’ uses + the directories in ‘PATH’ to find FILENAME. FILENAME does not need + to be executable. When Bash is not in POSIX mode, it searches the + current directory if FILENAME is not found in ‘$PATH’, but does not + search the current directory if ‘-p’ is supplied. If the + ‘sourcepath’ option (*note The Shopt Builtin::) is turned off ‘.’ + does not search ‘PATH’. If any ARGUMENTS are supplied, they become + the positional parameters when FILENAME is executed. Otherwise the + positional parameters are unchanged. If the ‘-T’ option is + enabled, ‘.’ inherits any trap on ‘DEBUG’; if it is not, any + ‘DEBUG’ trap string is saved and restored around the call to ‘.’, + and ‘.’ unsets the ‘DEBUG’ trap while it executes. If ‘-T’ is not + set, and the sourced file changes the ‘DEBUG’ trap, the new value + is retained when ‘.’ completes. The return status is the exit + status of the last command executed, or zero if no commands are + executed. If FILENAME is not found, or cannot be read, the return + status is non-zero. This builtin is equivalent to ‘source’. ‘break’ break [N] @@ -4396,7 +4399,7 @@ standard. A synonym for ‘mapfile’. ‘source’ - source FILENAME + source [-p PATH] FILENAME [ARGUMENTS] A synonym for ‘.’ (*note Bourne Shell Builtins::). @@ -5223,8 +5226,9 @@ This builtin allows you to change additional shell optional behavior. ‘sourcepath’ If set, the ‘.’ (‘source’) builtin uses the value of ‘PATH’ to - find the directory containing the file supplied as an - argument. This option is enabled by default. + find the directory containing the file supplied as an argument + when the ‘-p’ option is not supplied. This option is enabled + by default. ‘varredir_close’ If set, the shell automatically closes file descriptors @@ -5729,7 +5733,7 @@ Variables::). A sort specifier of ‘nosort’ disables sorting completely; the results are returned in the order they are read from the file - system,. + system, and any leading ‘-’ is ignored. If the sort specifier is missing, it defaults to NAME, so a value of ‘+’ is equivalent to the null string, and a value of ‘-’ sorts @@ -9096,10 +9100,12 @@ File: bash.info, Node: Commands For Moving, Next: Commands For History, Up: B ------------------------- ‘beginning-of-line (C-a)’ - Move to the start of the current line. + Move to the start of the current line. This may also be bound to + the Home key on some keyboards. ‘end-of-line (C-e)’ - Move to the end of the line. + Move to the end of the line. This may also be bound to the End key + on some keyboards. ‘forward-char (C-f)’ Move forward a character. @@ -9200,16 +9206,24 @@ File: bash.info, Node: Commands For History, Next: Commands For Text, Prev: C a string supplied by the user. The search string may match anywhere in a history line. +‘history-search-backward ()’ + Search backward through the history for the string of characters + between the start of the current line and the point. The search + string must match at the beginning of a history line. This is a + non-incremental search. By default, this command is unbound, but + may be bound to the Page Down key on some keyboards. + ‘history-search-forward ()’ Search forward through the history for the string of characters between the start of the current line and the point. The search string must match at the beginning of a history line. This is a - non-incremental search. By default, this command is unbound. + non-incremental search. By default, this command is unbound, but + may be bound to the Page Up key on some keyboards. -‘history-search-backward ()’ +‘history-substring-search-backward ()’ Search backward through the history for the string of characters between the start of the current line and the point. The search - string must match at the beginning of a history line. This is a + string may match anywhere in a history line. This is a non-incremental search. By default, this command is unbound. ‘history-substring-search-forward ()’ @@ -9218,12 +9232,6 @@ File: bash.info, Node: Commands For History, Next: Commands For Text, Prev: C string may match anywhere in a history line. This is a non-incremental search. By default, this command is unbound. -‘history-substring-search-backward ()’ - Search backward through the history for the string of characters - between the start of the current line and the point. The search - string may match anywhere in a history line. This is a - non-incremental search. By default, this command is unbound. - ‘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 N, @@ -9346,7 +9354,8 @@ File: bash.info, Node: Commands For Text, Next: Commands For Killing, Prev: C Characters bound to ‘backward-delete-char’ replace the character before point with a space. - By default, this command is unbound. + By default, this command is unbound, but may be bound to the Insert + key on some keyboards.  File: bash.info, Node: Commands For Killing, Next: Numeric Arguments, Prev: Commands For Text, Up: Bindable Readline Commands @@ -12213,17 +12222,17 @@ D.1 Index of Shell Builtin Commands * .: Bourne Shell Builtins. (line 17) * [: Bourne Shell Builtins. - (line 285) + (line 289) * alias: Bash Builtins. (line 11) * bg: Job Control Builtins. (line 7) * bind: Bash Builtins. (line 21) * break: Bourne Shell Builtins. - (line 37) + (line 41) * builtin: Bash Builtins. (line 124) * caller: Bash Builtins. (line 133) * cd: Bourne Shell Builtins. - (line 45) + (line 49) * command: Bash Builtins. (line 150) * compgen: Programmable Completion Builtins. (line 12) @@ -12232,7 +12241,7 @@ D.1 Index of Shell Builtin Commands * compopt: Programmable Completion Builtins. (line 248) * continue: Bourne Shell Builtins. - (line 90) + (line 94) * declare: Bash Builtins. (line 170) * dirs: Directory Stack Builtins. (line 7) @@ -12241,23 +12250,23 @@ D.1 Index of Shell Builtin Commands * echo: Bash Builtins. (line 273) * enable: Bash Builtins. (line 322) * eval: Bourne Shell Builtins. - (line 99) + (line 103) * exec: Bourne Shell Builtins. - (line 107) + (line 111) * exit: Bourne Shell Builtins. - (line 125) + (line 129) * export: Bourne Shell Builtins. - (line 132) + (line 136) * false: Bourne Shell Builtins. - (line 148) + (line 152) * fc: Bash History Builtins. (line 10) * fg: Job Control Builtins. (line 17) * getopts: Bourne Shell Builtins. - (line 153) + (line 157) * hash: Bourne Shell Builtins. - (line 197) + (line 201) * help: Bash Builtins. (line 360) * history: Bash History Builtins. (line 46) @@ -12275,36 +12284,36 @@ D.1 Index of Shell Builtin Commands * pushd: Directory Stack Builtins. (line 69) * pwd: Bourne Shell Builtins. - (line 222) + (line 226) * read: Bash Builtins. (line 523) * readarray: Bash Builtins. (line 629) * readonly: Bourne Shell Builtins. - (line 232) + (line 236) * return: Bourne Shell Builtins. - (line 251) + (line 255) * set: The Set Builtin. (line 11) * shift: Bourne Shell Builtins. - (line 272) + (line 276) * shopt: The Shopt Builtin. (line 9) * source: Bash Builtins. (line 638) * suspend: Job Control Builtins. (line 116) * test: Bourne Shell Builtins. - (line 285) + (line 289) * times: Bourne Shell Builtins. - (line 387) + (line 391) * trap: Bourne Shell Builtins. - (line 393) + (line 397) * true: Bourne Shell Builtins. - (line 455) + (line 459) * type: Bash Builtins. (line 643) * typeset: Bash Builtins. (line 681) * ulimit: Bash Builtins. (line 687) * umask: Bourne Shell Builtins. - (line 460) + (line 464) * unalias: Bash Builtins. (line 793) * unset: Bourne Shell Builtins. - (line 478) + (line 482) * wait: Job Control Builtins. (line 76) @@ -12611,13 +12620,13 @@ D.4 Function Index (line 6) * alias-expand-line (): Miscellaneous Commands. (line 133) -* backward-char (C-b): Commands For Moving. (line 15) +* backward-char (C-b): Commands For Moving. (line 17) * backward-delete-char (Rubout): Commands For Text. (line 17) * backward-kill-line (C-x Rubout): Commands For Killing. (line 11) * backward-kill-word (M-): Commands For Killing. (line 28) -* backward-word (M-b): Commands For Moving. (line 22) +* backward-word (M-b): Commands For Moving. (line 24) * beginning-of-history (M-<): Commands For History. (line 20) * beginning-of-line (C-a): Commands For Moving. (line 6) @@ -12628,8 +12637,8 @@ D.4 Function Index (line 42) * character-search-backward (M-C-]): Miscellaneous Commands. (line 47) -* clear-display (M-C-l): Commands For Moving. (line 48) -* clear-screen (C-l): Commands For Moving. (line 53) +* clear-display (M-C-l): Commands For Moving. (line 50) +* clear-screen (C-l): Commands For Moving. (line 55) * complete (): Commands For Completion. (line 6) * complete-command (M-!): Commands For Completion. @@ -12677,18 +12686,18 @@ D.4 Function Index * end-of-file (usually C-d): Commands For Text. (line 6) * end-of-history (M->): Commands For History. (line 23) -* end-of-line (C-e): Commands For Moving. (line 9) +* end-of-line (C-e): Commands For Moving. (line 10) * exchange-point-and-mark (C-x C-x): Miscellaneous Commands. (line 37) * execute-named-command (M-x): Miscellaneous Commands. (line 147) * fetch-history (): Commands For History. - (line 103) + (line 105) * forward-backward-delete-char (): Commands For Text. (line 21) -* forward-char (C-f): Commands For Moving. (line 12) +* forward-char (C-f): Commands For Moving. (line 14) * forward-search-history (C-s): Commands For History. (line 33) -* forward-word (M-f): Commands For Moving. (line 18) +* forward-word (M-f): Commands For Moving. (line 20) * glob-complete-word (M-g): Miscellaneous Commands. (line 98) * glob-expand-word (C-x *): Miscellaneous Commands. @@ -12700,13 +12709,13 @@ D.4 Function Index * history-expand-line (M-^): Miscellaneous Commands. (line 126) * history-search-backward (): Commands For History. - (line 57) -* history-search-forward (): Commands For History. (line 51) +* history-search-forward (): Commands For History. + (line 58) * history-substring-search-backward (): Commands For History. - (line 69) + (line 65) * history-substring-search-forward (): Commands For History. - (line 63) + (line 71) * insert-comment (M-#): Miscellaneous Commands. (line 61) * insert-completions (M-*): Commands For Completion. @@ -12729,13 +12738,13 @@ D.4 Function Index (line 38) * next-history (C-n): Commands For History. (line 17) -* next-screen-line (): Commands For Moving. (line 41) +* next-screen-line (): Commands For Moving. (line 43) * non-incremental-forward-search-history (M-n): Commands For History. (line 45) * non-incremental-reverse-search-history (M-p): Commands For History. (line 39) * operate-and-get-next (C-o): Commands For History. - (line 96) + (line 98) * overwrite-mode (): Commands For Text. (line 77) * possible-command-completions (C-x !): Commands For Completion. (line 86) @@ -12753,12 +12762,12 @@ D.4 Function Index (line 19) * previous-history (C-p): Commands For History. (line 13) -* previous-screen-line (): Commands For Moving. (line 34) +* previous-screen-line (): Commands For Moving. (line 36) * print-last-kbd-macro (): Keyboard Macros. (line 17) * quoted-insert (C-q or C-v): Commands For Text. (line 26) * re-read-init-file (C-x C-r): Miscellaneous Commands. (line 6) -* redraw-current-line (): Commands For Moving. (line 57) +* redraw-current-line (): Commands For Moving. (line 59) * reverse-search-history (C-r): Commands For History. (line 27) * revert-line (M-r): Miscellaneous Commands. @@ -12768,10 +12777,10 @@ D.4 Function Index (line 33) * shell-backward-kill-word (): Commands For Killing. (line 37) -* shell-backward-word (M-C-b): Commands For Moving. (line 30) +* shell-backward-word (M-C-b): Commands For Moving. (line 32) * shell-expand-line (M-C-e): Miscellaneous Commands. (line 119) -* shell-forward-word (M-C-f): Commands For Moving. (line 26) +* shell-forward-word (M-C-f): Commands For Moving. (line 28) * shell-kill-word (M-C-d): Commands For Killing. (line 32) * shell-transpose-words (M-C-t): Commands For Text. (line 58) @@ -12797,9 +12806,9 @@ D.4 Function Index * yank (C-y): Commands For Killing. (line 72) * yank-last-arg (M-. or M-_): Commands For History. - (line 84) + (line 86) * yank-nth-arg (M-C-y): Commands For History. - (line 75) + (line 77) * yank-pop (M-y): Commands For Killing. (line 75) @@ -12980,138 +12989,138 @@ D.5 Concept Index  Tag Table: -Node: Top895 -Node: Introduction2830 -Node: What is Bash?3043 -Node: What is a shell?4184 -Node: Definitions6763 -Node: Basic Shell Features9939 -Node: Shell Syntax11159 -Node: Shell Operation12186 -Node: Quoting13484 -Node: Escape Character14797 -Node: Single Quotes15295 -Node: Double Quotes15644 -Node: ANSI-C Quoting16987 -Node: Locale Translation18372 -Node: Creating Internationalized Scripts19716 -Node: Comments23914 -Node: Shell Commands24549 -Node: Reserved Words25488 -Node: Simple Commands26353 -Node: Pipelines27012 -Node: Lists30075 -Node: Compound Commands31947 -Node: Looping Constructs32956 -Node: Conditional Constructs35500 -Node: Command Grouping50404 -Node: Coprocesses51891 -Node: GNU Parallel54587 -Node: Shell Functions55505 -Node: Shell Parameters63611 -Node: Positional Parameters68144 -Node: Special Parameters69079 -Node: Shell Expansions72385 -Node: Brace Expansion74574 -Node: Tilde Expansion77237 -Node: Shell Parameter Expansion80003 -Node: Command Substitution99110 -Node: Arithmetic Expansion102643 -Node: Process Substitution103608 -Node: Word Splitting104745 -Node: Filename Expansion106886 -Node: Pattern Matching109982 -Node: Quote Removal115215 -Node: Redirections115519 -Node: Executing Commands125328 -Node: Simple Command Expansion125995 -Node: Command Search and Execution128106 -Node: Command Execution Environment130514 -Node: Environment133823 -Node: Exit Status135527 -Node: Signals137312 -Node: Shell Scripts140926 -Node: Shell Builtin Commands144018 -Node: Bourne Shell Builtins146129 -Node: Bash Builtins170533 -Node: Modifying Shell Behavior205492 -Node: The Set Builtin205834 -Node: The Shopt Builtin217349 -Node: Special Builtins234085 -Node: Shell Variables235074 -Node: Bourne Shell Variables235508 -Node: Bash Variables237701 -Node: Bash Features274283 -Node: Invoking Bash275297 -Node: Bash Startup Files281696 -Node: Interactive Shells287008 -Node: What is an Interactive Shell?287416 -Node: Is this Shell Interactive?288082 -Node: Interactive Shell Behavior288906 -Node: Bash Conditional Expressions292660 -Node: Shell Arithmetic297834 -Node: Aliases300916 -Node: Arrays303871 -Node: The Directory Stack310670 -Node: Directory Stack Builtins311467 -Node: Controlling the Prompt315916 -Node: The Restricted Shell319054 -Node: Bash POSIX Mode321841 -Node: Shell Compatibility Mode339352 -Node: Job Control348371 -Node: Job Control Basics348828 -Node: Job Control Builtins354002 -Node: Job Control Variables359962 -Node: Command Line Editing361139 -Node: Introduction and Notation362843 -Node: Readline Interaction364487 -Node: Readline Bare Essentials365675 -Node: Readline Movement Commands367493 -Node: Readline Killing Commands368490 -Node: Readline Arguments370468 -Node: Searching371525 -Node: Readline Init File373754 -Node: Readline Init File Syntax375036 -Node: Conditional Init Constructs399974 -Node: Sample Init File404339 -Node: Bindable Readline Commands407460 -Node: Commands For Moving408685 -Node: Commands For History410785 -Node: Commands For Text415868 -Node: Commands For Killing419943 -Node: Numeric Arguments422744 -Node: Commands For Completion423896 -Node: Keyboard Macros428212 -Node: Miscellaneous Commands428913 -Node: Readline vi Mode435567 -Node: Programmable Completion436519 -Node: Programmable Completion Builtins444476 -Node: A Programmable Completion Example456042 -Node: Using History Interactively461387 -Node: Bash History Facilities462068 -Node: Bash History Builtins465180 -Node: History Interaction470423 -Node: Event Designators474748 -Node: Word Designators476331 -Node: Modifiers478317 -Node: Installing Bash480226 -Node: Basic Installation481360 -Node: Compilers and Options485239 -Node: Compiling For Multiple Architectures485989 -Node: Installation Names487738 -Node: Specifying the System Type489972 -Node: Sharing Defaults490718 -Node: Operation Controls491432 -Node: Optional Features492451 -Node: Reporting Bugs504253 -Node: Major Differences From The Bourne Shell505602 -Node: GNU Free Documentation License525337 -Node: Indexes550514 -Node: Builtin Index550965 -Node: Reserved Word Index558063 -Node: Variable Index560508 -Node: Function Index577639 -Node: Concept Index591495 +Node: Top893 +Node: Introduction2826 +Node: What is Bash?3039 +Node: What is a shell?4180 +Node: Definitions6759 +Node: Basic Shell Features9935 +Node: Shell Syntax11155 +Node: Shell Operation12182 +Node: Quoting13480 +Node: Escape Character14793 +Node: Single Quotes15291 +Node: Double Quotes15640 +Node: ANSI-C Quoting16983 +Node: Locale Translation18368 +Node: Creating Internationalized Scripts19712 +Node: Comments23910 +Node: Shell Commands24545 +Node: Reserved Words25484 +Node: Simple Commands26349 +Node: Pipelines27008 +Node: Lists30071 +Node: Compound Commands31943 +Node: Looping Constructs32952 +Node: Conditional Constructs35496 +Node: Command Grouping50317 +Node: Coprocesses51804 +Node: GNU Parallel54500 +Node: Shell Functions55418 +Node: Shell Parameters63524 +Node: Positional Parameters68057 +Node: Special Parameters68992 +Node: Shell Expansions72298 +Node: Brace Expansion74487 +Node: Tilde Expansion77150 +Node: Shell Parameter Expansion79916 +Node: Command Substitution99023 +Node: Arithmetic Expansion102556 +Node: Process Substitution103521 +Node: Word Splitting104658 +Node: Filename Expansion106799 +Node: Pattern Matching109895 +Node: Quote Removal115128 +Node: Redirections115432 +Node: Executing Commands125241 +Node: Simple Command Expansion125908 +Node: Command Search and Execution128019 +Node: Command Execution Environment130427 +Node: Environment133736 +Node: Exit Status135440 +Node: Signals137225 +Node: Shell Scripts140839 +Node: Shell Builtin Commands143931 +Node: Bourne Shell Builtins146042 +Node: Bash Builtins170812 +Node: Modifying Shell Behavior205793 +Node: The Set Builtin206135 +Node: The Shopt Builtin217650 +Node: Special Builtins234437 +Node: Shell Variables235426 +Node: Bourne Shell Variables235860 +Node: Bash Variables238053 +Node: Bash Features274670 +Node: Invoking Bash275684 +Node: Bash Startup Files282083 +Node: Interactive Shells287395 +Node: What is an Interactive Shell?287803 +Node: Is this Shell Interactive?288469 +Node: Interactive Shell Behavior289293 +Node: Bash Conditional Expressions293047 +Node: Shell Arithmetic298221 +Node: Aliases301303 +Node: Arrays304258 +Node: The Directory Stack311057 +Node: Directory Stack Builtins311854 +Node: Controlling the Prompt316303 +Node: The Restricted Shell319441 +Node: Bash POSIX Mode322228 +Node: Shell Compatibility Mode339739 +Node: Job Control348758 +Node: Job Control Basics349215 +Node: Job Control Builtins354389 +Node: Job Control Variables360349 +Node: Command Line Editing361526 +Node: Introduction and Notation363230 +Node: Readline Interaction364874 +Node: Readline Bare Essentials366062 +Node: Readline Movement Commands367880 +Node: Readline Killing Commands368877 +Node: Readline Arguments370855 +Node: Searching371912 +Node: Readline Init File374141 +Node: Readline Init File Syntax375423 +Node: Conditional Init Constructs400361 +Node: Sample Init File404726 +Node: Bindable Readline Commands407847 +Node: Commands For Moving409072 +Node: Commands For History411299 +Node: Commands For Text416504 +Node: Commands For Killing420638 +Node: Numeric Arguments423439 +Node: Commands For Completion424591 +Node: Keyboard Macros428907 +Node: Miscellaneous Commands429608 +Node: Readline vi Mode436262 +Node: Programmable Completion437214 +Node: Programmable Completion Builtins445171 +Node: A Programmable Completion Example456737 +Node: Using History Interactively462082 +Node: Bash History Facilities462763 +Node: Bash History Builtins465875 +Node: History Interaction471118 +Node: Event Designators475443 +Node: Word Designators477026 +Node: Modifiers479012 +Node: Installing Bash480921 +Node: Basic Installation482055 +Node: Compilers and Options485934 +Node: Compiling For Multiple Architectures486684 +Node: Installation Names488433 +Node: Specifying the System Type490667 +Node: Sharing Defaults491413 +Node: Operation Controls492127 +Node: Optional Features493146 +Node: Reporting Bugs504948 +Node: Major Differences From The Bourne Shell506297 +Node: GNU Free Documentation License526032 +Node: Indexes551209 +Node: Builtin Index551660 +Node: Reserved Word Index558758 +Node: Variable Index561203 +Node: Function Index578334 +Node: Concept Index592190  End Tag Table diff --git a/doc/bash.pdf b/doc/bash.pdf index 234b5991..9b8c80c2 100644 Binary files a/doc/bash.pdf and b/doc/bash.pdf differ diff --git a/doc/bashref.info b/doc/bashref.info index e547d3cd..fac093c7 100644 --- a/doc/bashref.info +++ b/doc/bashref.info @@ -2,9 +2,9 @@ This is bashref.info, produced by makeinfo version 7.1 from bashref.texi. This text is a brief description of the features that are present in the -Bash shell (version 5.3, 23 April 2024). +Bash shell (version 5.3, 12 June 2024). - This is Edition 5.3, last updated 23 April 2024, of ‘The GNU Bash + This is Edition 5.3, last updated 12 June 2024, of ‘The GNU Bash Reference Manual’, for ‘Bash’, Version 5.3. Copyright © 1988-2023 Free Software Foundation, Inc. @@ -27,10 +27,10 @@ Bash Features ************* This text is a brief description of the features that are present in the -Bash shell (version 5.3, 23 April 2024). The Bash home page is +Bash shell (version 5.3, 12 June 2024). The Bash home page is . - This is Edition 5.3, last updated 23 April 2024, of ‘The GNU Bash + This is Edition 5.3, last updated 12 June 2024, of ‘The GNU Bash Reference Manual’, for ‘Bash’, Version 5.3. Bash contains features that appear in other popular shells, and some @@ -992,9 +992,8 @@ File: bashref.info, Node: Conditional Constructs, Next: Command Grouping, Pre and filename expansion. The shell performs tilde expansion, parameter and variable expansion, arithmetic expansion, command substitution, process substitution, and quote removal on those - words (the expansions that would occur if the words were enclosed - in double quotes). Conditional operators such as ‘-f’ must be - unquoted to be recognized as primaries. + words. Conditional operators such as ‘-f’ must be unquoted to be + recognized as primaries. When used with ‘[[’, the ‘<’ and ‘>’ operators sort lexicographically using the current locale. @@ -3281,24 +3280,28 @@ standard. The return status is zero. ‘. (a period)’ - . FILENAME [ARGUMENTS] + . [-p PATH] FILENAME [ARGUMENTS] Read and execute commands from the FILENAME argument in the current - shell context. If FILENAME does not contain a slash, the ‘PATH’ - variable is used to find FILENAME, but FILENAME does not need to be - executable. When Bash is not in POSIX mode, it searches the - current directory if FILENAME is not found in ‘$PATH’. If any - ARGUMENTS are supplied, they become the positional parameters when - FILENAME is executed. Otherwise the positional parameters are - unchanged. If the ‘-T’ option is enabled, ‘.’ inherits any trap on - ‘DEBUG’; if it is not, any ‘DEBUG’ trap string is saved and - restored around the call to ‘.’, and ‘.’ unsets the ‘DEBUG’ trap - while it executes. If ‘-T’ is not set, and the sourced file - changes the ‘DEBUG’ trap, the new value is retained when ‘.’ - completes. The return status is the exit status of the last - command executed, or zero if no commands are executed. If FILENAME - is not found, or cannot be read, the return status is non-zero. - This builtin is equivalent to ‘source’. + shell context. If FILENAME does not contain a slash, ‘.’ searches + for it. If ‘-p’ is supplied, ‘.’ treats PATH as a colon-separated + list of directories in which to find FILENAME; otherwise, ‘.’ uses + the directories in ‘PATH’ to find FILENAME. FILENAME does not need + to be executable. When Bash is not in POSIX mode, it searches the + current directory if FILENAME is not found in ‘$PATH’, but does not + search the current directory if ‘-p’ is supplied. If the + ‘sourcepath’ option (*note The Shopt Builtin::) is turned off ‘.’ + does not search ‘PATH’. If any ARGUMENTS are supplied, they become + the positional parameters when FILENAME is executed. Otherwise the + positional parameters are unchanged. If the ‘-T’ option is + enabled, ‘.’ inherits any trap on ‘DEBUG’; if it is not, any + ‘DEBUG’ trap string is saved and restored around the call to ‘.’, + and ‘.’ unsets the ‘DEBUG’ trap while it executes. If ‘-T’ is not + set, and the sourced file changes the ‘DEBUG’ trap, the new value + is retained when ‘.’ completes. The return status is the exit + status of the last command executed, or zero if no commands are + executed. If FILENAME is not found, or cannot be read, the return + status is non-zero. This builtin is equivalent to ‘source’. ‘break’ break [N] @@ -4397,7 +4400,7 @@ standard. A synonym for ‘mapfile’. ‘source’ - source FILENAME + source [-p PATH] FILENAME [ARGUMENTS] A synonym for ‘.’ (*note Bourne Shell Builtins::). @@ -5224,8 +5227,9 @@ This builtin allows you to change additional shell optional behavior. ‘sourcepath’ If set, the ‘.’ (‘source’) builtin uses the value of ‘PATH’ to - find the directory containing the file supplied as an - argument. This option is enabled by default. + find the directory containing the file supplied as an argument + when the ‘-p’ option is not supplied. This option is enabled + by default. ‘varredir_close’ If set, the shell automatically closes file descriptors @@ -5730,7 +5734,7 @@ Variables::). A sort specifier of ‘nosort’ disables sorting completely; the results are returned in the order they are read from the file - system,. + system, and any leading ‘-’ is ignored. If the sort specifier is missing, it defaults to NAME, so a value of ‘+’ is equivalent to the null string, and a value of ‘-’ sorts @@ -9097,10 +9101,12 @@ File: bashref.info, Node: Commands For Moving, Next: Commands For History, Up ------------------------- ‘beginning-of-line (C-a)’ - Move to the start of the current line. + Move to the start of the current line. This may also be bound to + the Home key on some keyboards. ‘end-of-line (C-e)’ - Move to the end of the line. + Move to the end of the line. This may also be bound to the End key + on some keyboards. ‘forward-char (C-f)’ Move forward a character. @@ -9201,16 +9207,24 @@ File: bashref.info, Node: Commands For History, Next: Commands For Text, Prev a string supplied by the user. The search string may match anywhere in a history line. +‘history-search-backward ()’ + Search backward through the history for the string of characters + between the start of the current line and the point. The search + string must match at the beginning of a history line. This is a + non-incremental search. By default, this command is unbound, but + may be bound to the Page Down key on some keyboards. + ‘history-search-forward ()’ Search forward through the history for the string of characters between the start of the current line and the point. The search string must match at the beginning of a history line. This is a - non-incremental search. By default, this command is unbound. + non-incremental search. By default, this command is unbound, but + may be bound to the Page Up key on some keyboards. -‘history-search-backward ()’ +‘history-substring-search-backward ()’ Search backward through the history for the string of characters between the start of the current line and the point. The search - string must match at the beginning of a history line. This is a + string may match anywhere in a history line. This is a non-incremental search. By default, this command is unbound. ‘history-substring-search-forward ()’ @@ -9219,12 +9233,6 @@ File: bashref.info, Node: Commands For History, Next: Commands For Text, Prev string may match anywhere in a history line. This is a non-incremental search. By default, this command is unbound. -‘history-substring-search-backward ()’ - Search backward through the history for the string of characters - between the start of the current line and the point. The search - string may match anywhere in a history line. This is a - non-incremental search. By default, this command is unbound. - ‘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 N, @@ -9347,7 +9355,8 @@ File: bashref.info, Node: Commands For Text, Next: Commands For Killing, Prev Characters bound to ‘backward-delete-char’ replace the character before point with a space. - By default, this command is unbound. + By default, this command is unbound, but may be bound to the Insert + key on some keyboards.  File: bashref.info, Node: Commands For Killing, Next: Numeric Arguments, Prev: Commands For Text, Up: Bindable Readline Commands @@ -12214,17 +12223,17 @@ D.1 Index of Shell Builtin Commands * .: Bourne Shell Builtins. (line 17) * [: Bourne Shell Builtins. - (line 285) + (line 289) * alias: Bash Builtins. (line 11) * bg: Job Control Builtins. (line 7) * bind: Bash Builtins. (line 21) * break: Bourne Shell Builtins. - (line 37) + (line 41) * builtin: Bash Builtins. (line 124) * caller: Bash Builtins. (line 133) * cd: Bourne Shell Builtins. - (line 45) + (line 49) * command: Bash Builtins. (line 150) * compgen: Programmable Completion Builtins. (line 12) @@ -12233,7 +12242,7 @@ D.1 Index of Shell Builtin Commands * compopt: Programmable Completion Builtins. (line 248) * continue: Bourne Shell Builtins. - (line 90) + (line 94) * declare: Bash Builtins. (line 170) * dirs: Directory Stack Builtins. (line 7) @@ -12242,23 +12251,23 @@ D.1 Index of Shell Builtin Commands * echo: Bash Builtins. (line 273) * enable: Bash Builtins. (line 322) * eval: Bourne Shell Builtins. - (line 99) + (line 103) * exec: Bourne Shell Builtins. - (line 107) + (line 111) * exit: Bourne Shell Builtins. - (line 125) + (line 129) * export: Bourne Shell Builtins. - (line 132) + (line 136) * false: Bourne Shell Builtins. - (line 148) + (line 152) * fc: Bash History Builtins. (line 10) * fg: Job Control Builtins. (line 17) * getopts: Bourne Shell Builtins. - (line 153) + (line 157) * hash: Bourne Shell Builtins. - (line 197) + (line 201) * help: Bash Builtins. (line 360) * history: Bash History Builtins. (line 46) @@ -12276,36 +12285,36 @@ D.1 Index of Shell Builtin Commands * pushd: Directory Stack Builtins. (line 69) * pwd: Bourne Shell Builtins. - (line 222) + (line 226) * read: Bash Builtins. (line 523) * readarray: Bash Builtins. (line 629) * readonly: Bourne Shell Builtins. - (line 232) + (line 236) * return: Bourne Shell Builtins. - (line 251) + (line 255) * set: The Set Builtin. (line 11) * shift: Bourne Shell Builtins. - (line 272) + (line 276) * shopt: The Shopt Builtin. (line 9) * source: Bash Builtins. (line 638) * suspend: Job Control Builtins. (line 116) * test: Bourne Shell Builtins. - (line 285) + (line 289) * times: Bourne Shell Builtins. - (line 387) + (line 391) * trap: Bourne Shell Builtins. - (line 393) + (line 397) * true: Bourne Shell Builtins. - (line 455) + (line 459) * type: Bash Builtins. (line 643) * typeset: Bash Builtins. (line 681) * ulimit: Bash Builtins. (line 687) * umask: Bourne Shell Builtins. - (line 460) + (line 464) * unalias: Bash Builtins. (line 793) * unset: Bourne Shell Builtins. - (line 478) + (line 482) * wait: Job Control Builtins. (line 76) @@ -12612,13 +12621,13 @@ D.4 Function Index (line 6) * alias-expand-line (): Miscellaneous Commands. (line 133) -* backward-char (C-b): Commands For Moving. (line 15) +* backward-char (C-b): Commands For Moving. (line 17) * backward-delete-char (Rubout): Commands For Text. (line 17) * backward-kill-line (C-x Rubout): Commands For Killing. (line 11) * backward-kill-word (M-): Commands For Killing. (line 28) -* backward-word (M-b): Commands For Moving. (line 22) +* backward-word (M-b): Commands For Moving. (line 24) * beginning-of-history (M-<): Commands For History. (line 20) * beginning-of-line (C-a): Commands For Moving. (line 6) @@ -12629,8 +12638,8 @@ D.4 Function Index (line 42) * character-search-backward (M-C-]): Miscellaneous Commands. (line 47) -* clear-display (M-C-l): Commands For Moving. (line 48) -* clear-screen (C-l): Commands For Moving. (line 53) +* clear-display (M-C-l): Commands For Moving. (line 50) +* clear-screen (C-l): Commands For Moving. (line 55) * complete (): Commands For Completion. (line 6) * complete-command (M-!): Commands For Completion. @@ -12678,18 +12687,18 @@ D.4 Function Index * end-of-file (usually C-d): Commands For Text. (line 6) * end-of-history (M->): Commands For History. (line 23) -* end-of-line (C-e): Commands For Moving. (line 9) +* end-of-line (C-e): Commands For Moving. (line 10) * exchange-point-and-mark (C-x C-x): Miscellaneous Commands. (line 37) * execute-named-command (M-x): Miscellaneous Commands. (line 147) * fetch-history (): Commands For History. - (line 103) + (line 105) * forward-backward-delete-char (): Commands For Text. (line 21) -* forward-char (C-f): Commands For Moving. (line 12) +* forward-char (C-f): Commands For Moving. (line 14) * forward-search-history (C-s): Commands For History. (line 33) -* forward-word (M-f): Commands For Moving. (line 18) +* forward-word (M-f): Commands For Moving. (line 20) * glob-complete-word (M-g): Miscellaneous Commands. (line 98) * glob-expand-word (C-x *): Miscellaneous Commands. @@ -12701,13 +12710,13 @@ D.4 Function Index * history-expand-line (M-^): Miscellaneous Commands. (line 126) * history-search-backward (): Commands For History. - (line 57) -* history-search-forward (): Commands For History. (line 51) +* history-search-forward (): Commands For History. + (line 58) * history-substring-search-backward (): Commands For History. - (line 69) + (line 65) * history-substring-search-forward (): Commands For History. - (line 63) + (line 71) * insert-comment (M-#): Miscellaneous Commands. (line 61) * insert-completions (M-*): Commands For Completion. @@ -12730,13 +12739,13 @@ D.4 Function Index (line 38) * next-history (C-n): Commands For History. (line 17) -* next-screen-line (): Commands For Moving. (line 41) +* next-screen-line (): Commands For Moving. (line 43) * non-incremental-forward-search-history (M-n): Commands For History. (line 45) * non-incremental-reverse-search-history (M-p): Commands For History. (line 39) * operate-and-get-next (C-o): Commands For History. - (line 96) + (line 98) * overwrite-mode (): Commands For Text. (line 77) * possible-command-completions (C-x !): Commands For Completion. (line 86) @@ -12754,12 +12763,12 @@ D.4 Function Index (line 19) * previous-history (C-p): Commands For History. (line 13) -* previous-screen-line (): Commands For Moving. (line 34) +* previous-screen-line (): Commands For Moving. (line 36) * print-last-kbd-macro (): Keyboard Macros. (line 17) * quoted-insert (C-q or C-v): Commands For Text. (line 26) * re-read-init-file (C-x C-r): Miscellaneous Commands. (line 6) -* redraw-current-line (): Commands For Moving. (line 57) +* redraw-current-line (): Commands For Moving. (line 59) * reverse-search-history (C-r): Commands For History. (line 27) * revert-line (M-r): Miscellaneous Commands. @@ -12769,10 +12778,10 @@ D.4 Function Index (line 33) * shell-backward-kill-word (): Commands For Killing. (line 37) -* shell-backward-word (M-C-b): Commands For Moving. (line 30) +* shell-backward-word (M-C-b): Commands For Moving. (line 32) * shell-expand-line (M-C-e): Miscellaneous Commands. (line 119) -* shell-forward-word (M-C-f): Commands For Moving. (line 26) +* shell-forward-word (M-C-f): Commands For Moving. (line 28) * shell-kill-word (M-C-d): Commands For Killing. (line 32) * shell-transpose-words (M-C-t): Commands For Text. (line 58) @@ -12798,9 +12807,9 @@ D.4 Function Index * yank (C-y): Commands For Killing. (line 72) * yank-last-arg (M-. or M-_): Commands For History. - (line 84) + (line 86) * yank-nth-arg (M-C-y): Commands For History. - (line 75) + (line 77) * yank-pop (M-y): Commands For Killing. (line 75) @@ -12981,138 +12990,138 @@ D.5 Concept Index  Tag Table: -Node: Top898 -Node: Introduction2836 -Node: What is Bash?3052 -Node: What is a shell?4196 -Node: Definitions6778 -Node: Basic Shell Features9957 -Node: Shell Syntax11180 -Node: Shell Operation12210 -Node: Quoting13511 -Node: Escape Character14827 -Node: Single Quotes15328 -Node: Double Quotes15680 -Node: ANSI-C Quoting17026 -Node: Locale Translation18414 -Node: Creating Internationalized Scripts19761 -Node: Comments23962 -Node: Shell Commands24600 -Node: Reserved Words25542 -Node: Simple Commands26410 -Node: Pipelines27072 -Node: Lists30138 -Node: Compound Commands32013 -Node: Looping Constructs33025 -Node: Conditional Constructs35572 -Node: Command Grouping50479 -Node: Coprocesses51969 -Node: GNU Parallel54668 -Node: Shell Functions55589 -Node: Shell Parameters63698 -Node: Positional Parameters68234 -Node: Special Parameters69172 -Node: Shell Expansions72481 -Node: Brace Expansion74673 -Node: Tilde Expansion77339 -Node: Shell Parameter Expansion80108 -Node: Command Substitution99218 -Node: Arithmetic Expansion102754 -Node: Process Substitution103722 -Node: Word Splitting104862 -Node: Filename Expansion107006 -Node: Pattern Matching110105 -Node: Quote Removal115341 -Node: Redirections115648 -Node: Executing Commands125460 -Node: Simple Command Expansion126130 -Node: Command Search and Execution128244 -Node: Command Execution Environment130655 -Node: Environment133967 -Node: Exit Status135674 -Node: Signals137462 -Node: Shell Scripts141079 -Node: Shell Builtin Commands144174 -Node: Bourne Shell Builtins146288 -Node: Bash Builtins170695 -Node: Modifying Shell Behavior205657 -Node: The Set Builtin206002 -Node: The Shopt Builtin217520 -Node: Special Builtins234259 -Node: Shell Variables235251 -Node: Bourne Shell Variables235688 -Node: Bash Variables237884 -Node: Bash Features274469 -Node: Invoking Bash275486 -Node: Bash Startup Files281888 -Node: Interactive Shells287203 -Node: What is an Interactive Shell?287614 -Node: Is this Shell Interactive?288283 -Node: Interactive Shell Behavior289110 -Node: Bash Conditional Expressions292867 -Node: Shell Arithmetic298044 -Node: Aliases301129 -Node: Arrays304087 -Node: The Directory Stack310889 -Node: Directory Stack Builtins311689 -Node: Controlling the Prompt316141 -Node: The Restricted Shell319282 -Node: Bash POSIX Mode322072 -Node: Shell Compatibility Mode339586 -Node: Job Control348608 -Node: Job Control Basics349068 -Node: Job Control Builtins354245 -Node: Job Control Variables360208 -Node: Command Line Editing361388 -Node: Introduction and Notation363095 -Node: Readline Interaction364742 -Node: Readline Bare Essentials365933 -Node: Readline Movement Commands367754 -Node: Readline Killing Commands368754 -Node: Readline Arguments370735 -Node: Searching371795 -Node: Readline Init File374027 -Node: Readline Init File Syntax375312 -Node: Conditional Init Constructs400253 -Node: Sample Init File404621 -Node: Bindable Readline Commands407745 -Node: Commands For Moving408973 -Node: Commands For History411076 -Node: Commands For Text416162 -Node: Commands For Killing420240 -Node: Numeric Arguments423044 -Node: Commands For Completion424199 -Node: Keyboard Macros428518 -Node: Miscellaneous Commands429222 -Node: Readline vi Mode435879 -Node: Programmable Completion436834 -Node: Programmable Completion Builtins444794 -Node: A Programmable Completion Example456363 -Node: Using History Interactively461711 -Node: Bash History Facilities462395 -Node: Bash History Builtins465510 -Node: History Interaction470756 -Node: Event Designators475084 -Node: Word Designators476670 -Node: Modifiers478659 -Node: Installing Bash480571 -Node: Basic Installation481708 -Node: Compilers and Options485590 -Node: Compiling For Multiple Architectures486343 -Node: Installation Names488095 -Node: Specifying the System Type490332 -Node: Sharing Defaults491081 -Node: Operation Controls491798 -Node: Optional Features492820 -Node: Reporting Bugs504625 -Node: Major Differences From The Bourne Shell505977 -Node: GNU Free Documentation License525715 -Node: Indexes550895 -Node: Builtin Index551349 -Node: Reserved Word Index558450 -Node: Variable Index560898 -Node: Function Index578032 -Node: Concept Index591891 +Node: Top896 +Node: Introduction2832 +Node: What is Bash?3048 +Node: What is a shell?4192 +Node: Definitions6774 +Node: Basic Shell Features9953 +Node: Shell Syntax11176 +Node: Shell Operation12206 +Node: Quoting13507 +Node: Escape Character14823 +Node: Single Quotes15324 +Node: Double Quotes15676 +Node: ANSI-C Quoting17022 +Node: Locale Translation18410 +Node: Creating Internationalized Scripts19757 +Node: Comments23958 +Node: Shell Commands24596 +Node: Reserved Words25538 +Node: Simple Commands26406 +Node: Pipelines27068 +Node: Lists30134 +Node: Compound Commands32009 +Node: Looping Constructs33021 +Node: Conditional Constructs35568 +Node: Command Grouping50392 +Node: Coprocesses51882 +Node: GNU Parallel54581 +Node: Shell Functions55502 +Node: Shell Parameters63611 +Node: Positional Parameters68147 +Node: Special Parameters69085 +Node: Shell Expansions72394 +Node: Brace Expansion74586 +Node: Tilde Expansion77252 +Node: Shell Parameter Expansion80021 +Node: Command Substitution99131 +Node: Arithmetic Expansion102667 +Node: Process Substitution103635 +Node: Word Splitting104775 +Node: Filename Expansion106919 +Node: Pattern Matching110018 +Node: Quote Removal115254 +Node: Redirections115561 +Node: Executing Commands125373 +Node: Simple Command Expansion126043 +Node: Command Search and Execution128157 +Node: Command Execution Environment130568 +Node: Environment133880 +Node: Exit Status135587 +Node: Signals137375 +Node: Shell Scripts140992 +Node: Shell Builtin Commands144087 +Node: Bourne Shell Builtins146201 +Node: Bash Builtins170974 +Node: Modifying Shell Behavior205958 +Node: The Set Builtin206303 +Node: The Shopt Builtin217821 +Node: Special Builtins234611 +Node: Shell Variables235603 +Node: Bourne Shell Variables236040 +Node: Bash Variables238236 +Node: Bash Features274856 +Node: Invoking Bash275873 +Node: Bash Startup Files282275 +Node: Interactive Shells287590 +Node: What is an Interactive Shell?288001 +Node: Is this Shell Interactive?288670 +Node: Interactive Shell Behavior289497 +Node: Bash Conditional Expressions293254 +Node: Shell Arithmetic298431 +Node: Aliases301516 +Node: Arrays304474 +Node: The Directory Stack311276 +Node: Directory Stack Builtins312076 +Node: Controlling the Prompt316528 +Node: The Restricted Shell319669 +Node: Bash POSIX Mode322459 +Node: Shell Compatibility Mode339973 +Node: Job Control348995 +Node: Job Control Basics349455 +Node: Job Control Builtins354632 +Node: Job Control Variables360595 +Node: Command Line Editing361775 +Node: Introduction and Notation363482 +Node: Readline Interaction365129 +Node: Readline Bare Essentials366320 +Node: Readline Movement Commands368141 +Node: Readline Killing Commands369141 +Node: Readline Arguments371122 +Node: Searching372182 +Node: Readline Init File374414 +Node: Readline Init File Syntax375699 +Node: Conditional Init Constructs400640 +Node: Sample Init File405008 +Node: Bindable Readline Commands408132 +Node: Commands For Moving409360 +Node: Commands For History411590 +Node: Commands For Text416798 +Node: Commands For Killing420935 +Node: Numeric Arguments423739 +Node: Commands For Completion424894 +Node: Keyboard Macros429213 +Node: Miscellaneous Commands429917 +Node: Readline vi Mode436574 +Node: Programmable Completion437529 +Node: Programmable Completion Builtins445489 +Node: A Programmable Completion Example457058 +Node: Using History Interactively462406 +Node: Bash History Facilities463090 +Node: Bash History Builtins466205 +Node: History Interaction471451 +Node: Event Designators475779 +Node: Word Designators477365 +Node: Modifiers479354 +Node: Installing Bash481266 +Node: Basic Installation482403 +Node: Compilers and Options486285 +Node: Compiling For Multiple Architectures487038 +Node: Installation Names488790 +Node: Specifying the System Type491027 +Node: Sharing Defaults491776 +Node: Operation Controls492493 +Node: Optional Features493515 +Node: Reporting Bugs505320 +Node: Major Differences From The Bourne Shell506672 +Node: GNU Free Documentation License526410 +Node: Indexes551590 +Node: Builtin Index552044 +Node: Reserved Word Index559145 +Node: Variable Index561593 +Node: Function Index578727 +Node: Concept Index592586  End Tag Table diff --git a/doc/bashref.texi b/doc/bashref.texi index 5af3c06b..60ca415f 100644 --- a/doc/bashref.texi +++ b/doc/bashref.texi @@ -3858,18 +3858,24 @@ The return status is zero. @item . @r{(a period)} @btindex . @example -. @var{filename} [@var{arguments}] +. [-p @var{path}] @var{filename} [@var{arguments}] @end example Read and execute commands from the @var{filename} argument in the -current shell context. If @var{filename} does not contain a slash, -the @env{PATH} variable is used to find @var{filename}, -but @var{filename} does not need to be executable. +current shell context. +If @var{filename} does not contain a slash, @code{.} searches for it. +If @option{-p} is supplied, @code{.} treats @var{path} +as a colon-separated list of directories in which to find @var{filename}; +otherwise, @code{.} uses the directories in @env{PATH} to find @var{filename}. +@var{filename} does not need to be executable. When Bash is not in @sc{posix} mode, it searches the current directory -if @var{filename} is not found in @env{$PATH}. +if @var{filename} is not found in @env{$PATH}, +but does not search the current directory if @option{-p} is supplied. +If the @code{sourcepath} option (@pxref{The Shopt Builtin}) is turned off +@code{.} does not search @env{PATH}. If any @var{arguments} are supplied, they become the positional -parameters when @var{filename} is executed. Otherwise the positional -parameters are unchanged. +parameters when @var{filename} is executed. +Otherwise the positional parameters are unchanged. If the @option{-T} option is enabled, @code{.} inherits any trap on @code{DEBUG}; if it is not, any @code{DEBUG} trap string is saved and restored around the call to @code{.}, and @code{.} unsets the @@ -5231,7 +5237,7 @@ A synonym for @code{mapfile}. @item source @btindex source @example -source @var{filename} +source [-p @var{path}] @var{filename} [@var{arguments}] @end example A synonym for @code{.} (@pxref{Bourne Shell Builtins}). @@ -6120,7 +6126,8 @@ number of positional parameters. @item sourcepath If set, the @code{.} (@code{source}) builtin uses the value of @env{PATH} -to find the directory containing the file supplied as an argument. +to find the directory containing the file supplied as an argument +when the @option{-p} option is not supplied. This option is enabled by default. @item varredir_close diff --git a/doc/builtins.0 b/doc/builtins.0 index c9f779bd..a37b11a0 100644 --- a/doc/builtins.0 +++ b/doc/builtins.0 @@ -25,45 +25,48 @@ BBAASSHH BBUUIILLTTIINN CCOOMMMMAANNDDSS and performing any specified redirections. The return status is zero. - .. _f_i_l_e_n_a_m_e [_a_r_g_u_m_e_n_t_s] - ssoouurrccee _f_i_l_e_n_a_m_e [_a_r_g_u_m_e_n_t_s] - Read and execute commands from _f_i_l_e_n_a_m_e in the current shell en- - vironment and return the exit status of the last command exe- - cuted from _f_i_l_e_n_a_m_e. If _f_i_l_e_n_a_m_e does not contain a slash, - filenames in PPAATTHH are used to find the directory containing - _f_i_l_e_n_a_m_e, but _f_i_l_e_n_a_m_e does not need to be executable. The file - searched for in PPAATTHH need not be executable. When bbaasshh is not - in _p_o_s_i_x _m_o_d_e, it searches the current directory if no file is - found in PPAATTHH. If the ssoouurrcceeppaatthh option to the sshhoopptt builtin - command is turned off, the PPAATTHH is not searched. If any _a_r_g_u_- - _m_e_n_t_s are supplied, they become the positional parameters when - _f_i_l_e_n_a_m_e is executed. Otherwise the positional parameters are - unchanged. If the --TT option is enabled, .. inherits any trap on - DDEEBBUUGG; if it is not, any DDEEBBUUGG trap string is saved and restored - around the call to .., and .. unsets the DDEEBBUUGG trap while it exe- - cutes. If --TT is not set, and the sourced file changes the DDEEBBUUGG - trap, the new value is retained when .. completes. The return - status is the status of the last command exited within the - script (0 if no commands are executed), and false if _f_i_l_e_n_a_m_e is - not found or cannot be read. + .. [--pp _p_a_t_h] _f_i_l_e_n_a_m_e [_a_r_g_u_m_e_n_t_s] + ssoouurrccee [--pp _p_a_t_h] _f_i_l_e_n_a_m_e [_a_r_g_u_m_e_n_t_s] + The .. command (ssoouurrccee) reads and execute commands from _f_i_l_e_n_a_m_e + in the current shell environment and returns the exit status of + the last command executed from _f_i_l_e_n_a_m_e. If _f_i_l_e_n_a_m_e does not + contain a slash, .. searchs for it. If the --pp option is sup- + plied, .. treats _p_a_t_h as a colon-separated list of directories + in which to find _f_i_l_e_n_a_m_e; otherwise, .. uses the entries in + PPAATTHH to find the directory containing _f_i_l_e_n_a_m_e. _f_i_l_e_n_a_m_e does + not need to be executable. When bbaasshh is not in _p_o_s_i_x _m_o_d_e, it + searches the current directory if no file is found in PPAATTHH, but + does not search the current directory if --pp is supplied. If the + ssoouurrcceeppaatthh option to the sshhoopptt builtin command is turned off, .. + does not search PPAATTHH. If any _a_r_g_u_m_e_n_t_s are supplied, they be- + come the positional parameters when _f_i_l_e_n_a_m_e is executed. Oth- + erwise the positional parameters are unchanged. If the --TT op- + tion is enabled, .. inherits any trap on DDEEBBUUGG; if it is not, any + DDEEBBUUGG trap string is saved and restored around the call to .., + and .. unsets the DDEEBBUUGG trap while it executes. If --TT is not + set, and the sourced file changes the DDEEBBUUGG trap, the new value + is retained when .. completes. The return status is the status + of the last command exited within the script (0 if no commands + are executed), and false if _f_i_l_e_n_a_m_e is not found or cannot be + read. aalliiaass [--pp] [_n_a_m_e[=_v_a_l_u_e] ...] AAlliiaass with no arguments or with the --pp option prints the list of - aliases in the form aalliiaass _n_a_m_e=_v_a_l_u_e on standard output. When - arguments are supplied, an alias is defined for each _n_a_m_e whose - _v_a_l_u_e is given. A trailing space in _v_a_l_u_e causes the next word + aliases in the form aalliiaass _n_a_m_e=_v_a_l_u_e on standard output. When + arguments are supplied, an alias is defined for each _n_a_m_e whose + _v_a_l_u_e is given. A trailing space in _v_a_l_u_e causes the next word to be checked for alias substitution when the alias is expanded. - For each _n_a_m_e in the argument list for which no _v_a_l_u_e is sup- - plied, the name and value of the alias is printed. AAlliiaass re- - turns true unless a _n_a_m_e is given for which no alias has been + For each _n_a_m_e in the argument list for which no _v_a_l_u_e is sup- + plied, the name and value of the alias is printed. AAlliiaass re- + turns true unless a _n_a_m_e is given for which no alias has been defined. bbgg [_j_o_b_s_p_e_c ...] - Resume each suspended job _j_o_b_s_p_e_c in the background, as if it + Resume each suspended job _j_o_b_s_p_e_c in the background, as if it had been started with &&. If _j_o_b_s_p_e_c is not present, the shell's - notion of the _c_u_r_r_e_n_t _j_o_b is used. bbgg _j_o_b_s_p_e_c returns 0 unless - run when job control is disabled or, when run with job control - enabled, any specified _j_o_b_s_p_e_c was not found or was started + notion of the _c_u_r_r_e_n_t _j_o_b is used. bbgg _j_o_b_s_p_e_c returns 0 unless + run when job control is disabled or, when run with job control + enabled, any specified _j_o_b_s_p_e_c was not found or was started without job control. bbiinndd [--mm _k_e_y_m_a_p] [--llssvvSSVVXX] @@ -74,38 +77,38 @@ BBAASSHH BBUUIILLTTIINN CCOOMMMMAANNDDSS bbiinndd [--mm _k_e_y_m_a_p] --pp|--PP [_r_e_a_d_l_i_n_e_-_c_o_m_m_a_n_d] bbiinndd [--mm _k_e_y_m_a_p] _k_e_y_s_e_q:_r_e_a_d_l_i_n_e_-_c_o_m_m_a_n_d bbiinndd _r_e_a_d_l_i_n_e_-_c_o_m_m_a_n_d_-_l_i_n_e - Display current rreeaaddlliinnee key and function bindings, bind a key - sequence to a rreeaaddlliinnee function or macro, or set a rreeaaddlliinnee + Display current rreeaaddlliinnee key and function bindings, bind a key + sequence to a rreeaaddlliinnee function or macro, or set a rreeaaddlliinnee variable. Each non-option argument is a command as it would ap- - pear in a rreeaaddlliinnee initialization file such as _._i_n_p_u_t_r_c, but - each binding or command must be passed as a separate argument; - e.g., \C-x\C-r: re-read-init-file. In the following descrip- - tions, output available to be re-read is formatted as commands - that would appear in a rreeaaddlliinnee initialization file or that - would be supplied as individual arguments to a bbiinndd command. + pear in a rreeaaddlliinnee initialization file such as _._i_n_p_u_t_r_c, but + each binding or command must be passed as a separate argument; + e.g., \C-x\C-r: re-read-init-file. In the following descrip- + tions, output available to be re-read is formatted as commands + that would appear in a rreeaaddlliinnee initialization file or that + would be supplied as individual arguments to a bbiinndd command. Options, if supplied, have the following meanings: --mm _k_e_y_m_a_p Use _k_e_y_m_a_p as the keymap to be affected by the subsequent bindings. Acceptable _k_e_y_m_a_p names are _e_m_a_c_s_, _e_m_a_c_s_-_s_t_a_n_- - _d_a_r_d_, _e_m_a_c_s_-_m_e_t_a_, _e_m_a_c_s_-_c_t_l_x_, _v_i_, _v_i_-_m_o_v_e_, _v_i_-_c_o_m_m_a_n_d, - and _v_i_-_i_n_s_e_r_t. _v_i is equivalent to _v_i_-_c_o_m_m_a_n_d (_v_i_-_m_o_v_e - is also a synonym); _e_m_a_c_s is equivalent to _e_m_a_c_s_-_s_t_a_n_- + _d_a_r_d_, _e_m_a_c_s_-_m_e_t_a_, _e_m_a_c_s_-_c_t_l_x_, _v_i_, _v_i_-_m_o_v_e_, _v_i_-_c_o_m_m_a_n_d, + and _v_i_-_i_n_s_e_r_t. _v_i is equivalent to _v_i_-_c_o_m_m_a_n_d (_v_i_-_m_o_v_e + is also a synonym); _e_m_a_c_s is equivalent to _e_m_a_c_s_-_s_t_a_n_- _d_a_r_d. --ll List the names of all rreeaaddlliinnee functions. - --pp Display rreeaaddlliinnee function names and bindings in such a - way that they can be re-read. If arguments remain after - option processing, bbiinndd treats them as readline command + --pp Display rreeaaddlliinnee function names and bindings in such a + way that they can be re-read. If arguments remain after + option processing, bbiinndd treats them as readline command names and restricts output to those names. - --PP List current rreeaaddlliinnee function names and bindings. If - arguments remain after option processing, bbiinndd treats - them as readline command names and restricts output to + --PP List current rreeaaddlliinnee function names and bindings. If + arguments remain after option processing, bbiinndd treats + them as readline command names and restricts output to those names. - --ss Display rreeaaddlliinnee key sequences bound to macros and the - strings they output in such a way that they can be re- + --ss Display rreeaaddlliinnee key sequences bound to macros and the + strings they output in such a way that they can be re- read. - --SS Display rreeaaddlliinnee key sequences bound to macros and the + --SS Display rreeaaddlliinnee key sequences bound to macros and the strings they output. - --vv Display rreeaaddlliinnee variable names and values in such a way + --vv Display rreeaaddlliinnee variable names and values in such a way that they can be re-read. --VV List current rreeaaddlliinnee variable names and values. --ff _f_i_l_e_n_a_m_e @@ -119,200 +122,200 @@ BBAASSHH BBUUIILLTTIINN CCOOMMMMAANNDDSS --xx _k_e_y_s_e_q[[:: ]]_s_h_e_l_l_-_c_o_m_m_a_n_d Cause _s_h_e_l_l_-_c_o_m_m_a_n_d to be executed whenever _k_e_y_s_e_q is en- tered. The separator between _k_e_y_s_e_q and _s_h_e_l_l_-_c_o_m_m_a_n_d is - either whitespace or a colon optionally followed by - whitespace. If the separator is whitespace, _s_h_e_l_l_-_c_o_m_- - _m_a_n_d must be enclosed in double quotes and rreeaaddlliinnee ex- - pands any of its special backslash-escapes in _s_h_e_l_l_-_c_o_m_- - _m_a_n_d before saving it. If the separator is a colon, any - enclosing double quotes are optional, and rreeaaddlliinnee does - not expand the command string before saving it. Since - the entire key binding expression must be a single argu- - ment, it should be enclosed in quotes. When _s_h_e_l_l_-_c_o_m_- - _m_a_n_d is executed, the shell sets the RREEAADDLLIINNEE__LLIINNEE vari- - able to the contents of the rreeaaddlliinnee line buffer and the + either whitespace or a colon optionally followed by + whitespace. If the separator is whitespace, _s_h_e_l_l_-_c_o_m_- + _m_a_n_d must be enclosed in double quotes and rreeaaddlliinnee ex- + pands any of its special backslash-escapes in _s_h_e_l_l_-_c_o_m_- + _m_a_n_d before saving it. If the separator is a colon, any + enclosing double quotes are optional, and rreeaaddlliinnee does + not expand the command string before saving it. Since + the entire key binding expression must be a single argu- + ment, it should be enclosed in quotes. When _s_h_e_l_l_-_c_o_m_- + _m_a_n_d is executed, the shell sets the RREEAADDLLIINNEE__LLIINNEE vari- + able to the contents of the rreeaaddlliinnee line buffer and the RREEAADDLLIINNEE__PPOOIINNTT and RREEAADDLLIINNEE__MMAARRKK variables to the current - location of the insertion point and the saved insertion - point (the mark), respectively. The shell assigns any - numeric argument the user supplied to the RREEAADDLLIINNEE__AARRGGUU-- - MMEENNTT variable. If there was no argument, that variable + location of the insertion point and the saved insertion + point (the mark), respectively. The shell assigns any + numeric argument the user supplied to the RREEAADDLLIINNEE__AARRGGUU-- + MMEENNTT variable. If there was no argument, that variable is not set. If the executed command changes the value of - any of RREEAADDLLIINNEE__LLIINNEE, RREEAADDLLIINNEE__PPOOIINNTT, or RREEAADDLLIINNEE__MMAARRKK, + any of RREEAADDLLIINNEE__LLIINNEE, RREEAADDLLIINNEE__PPOOIINNTT, or RREEAADDLLIINNEE__MMAARRKK, those new values will be reflected in the editing state. - --XX List all key sequences bound to shell commands and the + --XX List all key sequences bound to shell commands and the associated commands in a format that can be reused as in- put. - The return value is 0 unless an unrecognized option is given or + The return value is 0 unless an unrecognized option is given or an error occurred. bbrreeaakk [_n] - Exit from within a ffoorr, wwhhiillee, uunnttiill, or sseelleecctt loop. If _n is - specified, break _n levels. _n must be >= 1. If _n is greater - than the number of enclosing loops, all enclosing loops are ex- - ited. The return value is 0 unless _n is not greater than or + Exit from within a ffoorr, wwhhiillee, uunnttiill, or sseelleecctt loop. If _n is + specified, break _n levels. _n must be >= 1. If _n is greater + than the number of enclosing loops, all enclosing loops are ex- + ited. The return value is 0 unless _n is not greater than or equal to 1. bbuuiillttiinn _s_h_e_l_l_-_b_u_i_l_t_i_n [_a_r_g_u_m_e_n_t_s] - Execute the specified shell builtin, passing it _a_r_g_u_m_e_n_t_s, and + Execute the specified shell builtin, passing it _a_r_g_u_m_e_n_t_s, and return its exit status. This is useful when defining a function - whose name is the same as a shell builtin, retaining the func- + whose name is the same as a shell builtin, retaining the func- tionality of the builtin within the function. The ccdd builtin is - commonly redefined this way. The return status is false if + commonly redefined this way. The return status is false if _s_h_e_l_l_-_b_u_i_l_t_i_n is not a shell builtin command. ccaalllleerr [_e_x_p_r] Returns the context of any active subroutine call (a shell func- tion or a script executed with the .. or ssoouurrccee builtins). With- out _e_x_p_r, ccaalllleerr displays the line number and source filename of - the current subroutine call. If a non-negative integer is sup- + the current subroutine call. If a non-negative integer is sup- plied as _e_x_p_r, ccaalllleerr 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 sub- - routine call or _e_x_p_r does not correspond to a valid position in + 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 sub- + routine call or _e_x_p_r does not correspond to a valid position in the call stack. ccdd [--LL|[--PP [--ee]]] [-@] [_d_i_r] - Change the current directory to _d_i_r. if _d_i_r is not supplied, - the value of the HHOOMMEE shell variable is the default. The vari- + Change the current directory to _d_i_r. if _d_i_r is not supplied, + the value of the HHOOMMEE shell variable is the default. The vari- able CCDDPPAATTHH defines the search path for the directory containing - _d_i_r: the shell searches each directory name in CCDDPPAATTHH for _d_i_r. - Alternative directory names in CCDDPPAATTHH are separated by a colon + _d_i_r: the shell searches each directory name in CCDDPPAATTHH for _d_i_r. + Alternative directory names in CCDDPPAATTHH are separated by a colon (:). A null directory name in CCDDPPAATTHH is the same as the current - directory, i.e., If _d_i_r begins with a slash (/), then CCDDPPAATTHH is + directory, i.e., If _d_i_r begins with a slash (/), then CCDDPPAATTHH is not used. The --PP option causes ccdd to use the physical directory - structure by resolving symbolic links while traversing _d_i_r and + structure by resolving symbolic links while traversing _d_i_r and before processing instances of _._. in _d_i_r (see also the --PP option to the sseett builtin command); the --LL option forces symbolic links - to be followed by resolving the link after processing instances + to be followed by resolving the link after processing instances of _._. in _d_i_r. If _._. appears in _d_i_r, it is processed by removing - the immediately previous pathname component from _d_i_r, back to a - slash or the beginning of _d_i_r. If the --ee option is supplied - with --PP, and the current working directory cannot be success- - fully determined after a successful directory change, ccdd will - return an unsuccessful status. On systems that support it, the - --@@ option presents the extended attributes associated with a - file as a directory. An argument of -- is converted to $$OOLLDDPPWWDD + the immediately previous pathname component from _d_i_r, back to a + slash or the beginning of _d_i_r. If the --ee option is supplied + with --PP, and the current working directory cannot be success- + fully determined after a successful directory change, ccdd will + return an unsuccessful status. On systems that support it, the + --@@ option presents the extended attributes associated with a + file as a directory. An argument of -- is converted to $$OOLLDDPPWWDD before the directory change is attempted. If a non-empty direc- - tory name from CCDDPPAATTHH is used, or if -- is the first argument, + tory name from CCDDPPAATTHH is used, or if -- is the first argument, and the directory change is successful, the absolute pathname of the new working directory is written to the standard output. If the directory change is successful, ccdd sets the value of the PPWWDD - environment variable to the new directory name, and sets the - OOLLDDPPWWDD environment variable to the value of the current working - directory before the change. The return value is true if the + environment variable to the new directory name, and sets the + OOLLDDPPWWDD environment variable to the value of the current working + directory before the change. The return value is true if the directory was successfully changed; false otherwise. ccoommmmaanndd [--ppVVvv] _c_o_m_m_a_n_d [_a_r_g ...] - Run _c_o_m_m_a_n_d with _a_r_g_s suppressing the normal shell function + Run _c_o_m_m_a_n_d with _a_r_g_s suppressing the normal shell function lookup. Only builtin commands or commands found in the PPAATTHH are - executed. If the --pp option is given, the search for _c_o_m_m_a_n_d is - performed using a default value for PPAATTHH that is guaranteed to - find all of the standard utilities. If either the --VV or --vv op- - tion is supplied, a description of _c_o_m_m_a_n_d is printed. The --vv - option causes a single word indicating the command or filename + executed. If the --pp option is given, the search for _c_o_m_m_a_n_d is + performed using a default value for PPAATTHH that is guaranteed to + find all of the standard utilities. If either the --VV or --vv op- + tion is supplied, a description of _c_o_m_m_a_n_d is printed. The --vv + option causes a single word indicating the command or filename used to invoke _c_o_m_m_a_n_d to be displayed; the --VV option produces a - more verbose description. If the --VV or --vv option is supplied, - the exit status is 0 if _c_o_m_m_a_n_d was found, and 1 if not. If + more verbose description. If the --VV or --vv option is supplied, + the exit status is 0 if _c_o_m_m_a_n_d was found, and 1 if not. If neither option is supplied and an error occurred or _c_o_m_m_a_n_d can- - not be found, the exit status is 127. Otherwise, the exit sta- + not be found, the exit status is 127. Otherwise, the exit sta- tus of the ccoommmmaanndd builtin is the exit status of _c_o_m_m_a_n_d. ccoommppggeenn [--VV _v_a_r_n_a_m_e] [_o_p_t_i_o_n] [_w_o_r_d] - Generate possible completion matches for _w_o_r_d according to the - _o_p_t_i_o_ns, which may be any option accepted by the ccoommpplleettee + Generate possible completion matches for _w_o_r_d according to the + _o_p_t_i_o_ns, which may be any option accepted by the ccoommpplleettee builtin with the exceptions of --pp, --rr, --DD, --EE, and --II, and write - the matches to the standard output. If the --VV option is sup- + the matches to the standard output. If the --VV option is sup- plied, ccoommppggeenn stores the generated completions into the indexed - array variable _v_a_r_n_a_m_e instead of writing them to the standard - output. When using the --FF or --CC options, the various shell - variables set by the programmable completion facilities, while + array variable _v_a_r_n_a_m_e instead of writing them to the standard + output. When using the --FF or --CC options, the various shell + variables set by the programmable completion facilities, while available, will not have useful values. The matches will be generated in the same way as if the program- mable completion code had generated them directly from a comple- - tion specification with the same flags. If _w_o_r_d is specified, + tion specification with the same flags. If _w_o_r_d is specified, only those completions matching _w_o_r_d will be displayed. - The return value is true unless an invalid option is supplied, + The return value is true unless an invalid option is supplied, or no matches were generated. ccoommpplleettee [--aabbccddeeffggjjkkssuuvv] [--oo _c_o_m_p_-_o_p_t_i_o_n] [--DDEEII] [--AA _a_c_t_i_o_n] [--GG _g_l_o_b_p_a_t] [--WW _w_o_r_d_l_i_s_t] [--FF _f_u_n_c_t_i_o_n] [--CC _c_o_m_m_a_n_d] [--XX _f_i_l_t_e_r_p_a_t] [--PP _p_r_e_f_i_x] [--SS _s_u_f_f_i_x] _n_a_m_e [_n_a_m_e ...] ccoommpplleettee --pprr [--DDEEII] [_n_a_m_e ...] - Specify how arguments to each _n_a_m_e should be completed. If the - --pp option is supplied, or if no options or _n_a_m_es are supplied, + Specify how arguments to each _n_a_m_e should be completed. If the + --pp option is supplied, or if no options or _n_a_m_es are supplied, existing completion specifications are printed in a way that al- - lows them to be reused as input. The --rr option removes a com- - pletion specification for each _n_a_m_e, or, if no _n_a_m_es are sup- - plied, all completion specifications. The --DD option indicates + lows them to be reused as input. The --rr option removes a com- + pletion specification for each _n_a_m_e, or, if no _n_a_m_es are sup- + plied, all completion specifications. The --DD option indicates that other supplied options and actions should apply to the com- - mand completion; that is, completion attempted on a command for - which no completion has previously been defined. The --EE option - indicates that other supplied options and actions should apply - to command completion; that is, completion attempted on a blank - line. The --II option indicates that other supplied options and + mand completion; that is, completion attempted on a command for + which no completion has previously been defined. The --EE option + indicates that other supplied options and actions should apply + to command completion; that is, completion attempted on a blank + line. The --II option indicates that other supplied options and actions should apply to completion on the initial non-assignment - word on the line, or after a command delimiter such as ;; or ||, - which is usually command name completion. If multiple options - are supplied, the --DD option takes precedence over --EE, and both - take precedence over --II. If any of --DD, --EE, or --II are supplied, + word on the line, or after a command delimiter such as ;; or ||, + which is usually command name completion. If multiple options + are supplied, the --DD option takes precedence over --EE, and both + take precedence over --II. If any of --DD, --EE, or --II are supplied, any other _n_a_m_e arguments are ignored; these completions only ap- ply to the case specified by the option. - The process of applying these completion specifications when + The process of applying these completion specifications when word completion is attempted is described in _b_a_s_h(1). - Other options, if specified, have the following meanings. The - arguments to the --GG, --WW, and --XX options (and, if necessary, the - --PP and --SS options) should be quoted to protect them from expan- + Other options, if specified, have the following meanings. The + arguments to the --GG, --WW, and --XX options (and, if necessary, the + --PP and --SS options) should be quoted to protect them from expan- sion before the ccoommpplleettee builtin is invoked. --oo _c_o_m_p_-_o_p_t_i_o_n - The _c_o_m_p_-_o_p_t_i_o_n controls several aspects of the comp- - spec's behavior beyond the simple generation of comple- + The _c_o_m_p_-_o_p_t_i_o_n controls several aspects of the comp- + spec's behavior beyond the simple generation of comple- tions. _c_o_m_p_-_o_p_t_i_o_n may be one of: bbaasshhddeeffaauulltt Perform the rest of the default bbaasshh completions if the compspec generates no matches. - ddeeffaauulltt Use readline's default filename completion if + ddeeffaauulltt Use readline's default filename completion if the compspec generates no matches. ddiirrnnaammeess - Perform directory name completion if the comp- + Perform directory name completion if the comp- spec generates no matches. ffiilleennaammeess - Tell readline that the compspec generates file- - names, so it can perform any filename-specific - processing (like adding a slash to directory - names, quoting special characters, or suppress- - ing trailing spaces). Intended to be used with + Tell readline that the compspec generates file- + names, so it can perform any filename-specific + processing (like adding a slash to directory + names, quoting special characters, or suppress- + ing trailing spaces). Intended to be used with shell functions. ffuullllqquuoottee - Tell readline to quote all the completed words + Tell readline to quote all the completed words even if they are not filenames. - nnooqquuoottee Tell readline not to quote the completed words - if they are filenames (quoting filenames is the + nnooqquuoottee Tell readline not to quote the completed words + if they are filenames (quoting filenames is the default). - nnoossoorrtt Tell readline not to sort the list of possible + nnoossoorrtt Tell readline not to sort the list of possible completions alphabetically. - nnoossppaaccee Tell readline not to append a space (the de- - fault) to words completed at the end of the + nnoossppaaccee Tell readline not to append a space (the de- + fault) to words completed at the end of the line. pplluussddiirrss - After any matches defined by the compspec are + After any matches defined by the compspec are generated, directory name completion is at- tempted and any matches are added to the results of the other actions. --AA _a_c_t_i_o_n - The _a_c_t_i_o_n may be one of the following to generate a + The _a_c_t_i_o_n may be one of the following to generate a list of possible completions: aalliiaass Alias names. May also be specified as --aa. aarrrraayyvvaarr Array variable names. bbiinnddiinngg RReeaaddlliinnee key binding names. - bbuuiillttiinn Names of shell builtin commands. May also be + bbuuiillttiinn Names of shell builtin commands. May also be specified as --bb. ccoommmmaanndd Command names. May also be specified as --cc. ddiirreeccttoorryy @@ -320,7 +323,7 @@ BBAASSHH BBUUIILLTTIINN CCOOMMMMAANNDDSS ddiissaabblleedd Names of disabled shell builtins. eennaabblleedd Names of enabled shell builtins. - eexxppoorrtt Names of exported shell variables. May also be + eexxppoorrtt Names of exported shell variables. May also be specified as --ee. ffiillee File names. May also be specified as --ff. ffuunnccttiioonn @@ -329,17 +332,17 @@ BBAASSHH BBUUIILLTTIINN CCOOMMMMAANNDDSS hheellppttooppiicc Help topics as accepted by the hheellpp builtin. hhoossttnnaammee - Hostnames, as taken from the file specified by + Hostnames, as taken from the file specified by the HHOOSSTTFFIILLEE shell variable. - jjoobb Job names, if job control is active. May also + jjoobb Job names, if job control is active. May also be specified as --jj. - kkeeyywwoorrdd Shell reserved words. May also be specified as + kkeeyywwoorrdd Shell reserved words. May also be specified as --kk. rruunnnniinngg Names of running jobs, if job control is active. sseerrvviiccee Service names. May also be specified as --ss. - sseettoopptt Valid arguments for the --oo option to the sseett + sseettoopptt Valid arguments for the --oo option to the sseett builtin. - sshhoopptt Shell option names as accepted by the sshhoopptt + sshhoopptt Shell option names as accepted by the sshhoopptt builtin. ssiiggnnaall Signal names. ssttooppppeedd Names of stopped jobs, if job control is active. @@ -348,197 +351,197 @@ BBAASSHH BBUUIILLTTIINN CCOOMMMMAANNDDSS Names of all shell variables. May also be spec- ified as --vv. --CC _c_o_m_m_a_n_d - _c_o_m_m_a_n_d is executed in a subshell environment, and its - output is used as the possible completions. Arguments + _c_o_m_m_a_n_d is executed in a subshell environment, and its + output is used as the possible completions. Arguments are passed as with the --FF option. --FF _f_u_n_c_t_i_o_n - The shell function _f_u_n_c_t_i_o_n is executed in the current - shell environment. When the function is executed, the + The shell function _f_u_n_c_t_i_o_n is executed in the current + shell environment. When the function is executed, the first argument ($$11) is the name of the command whose ar- guments are being completed, the second argument ($$22) is the word being completed, and the third argument ($$33) is - the word preceding the word being completed on the cur- - rent command line. When it finishes, the possible com- - pletions are retrieved from the value of the CCOOMMPPRREEPPLLYY + the word preceding the word being completed on the cur- + rent command line. When it finishes, the possible com- + pletions are retrieved from the value of the CCOOMMPPRREEPPLLYY array variable. --GG _g_l_o_b_p_a_t - The pathname expansion pattern _g_l_o_b_p_a_t is expanded to + The pathname expansion pattern _g_l_o_b_p_a_t is expanded to generate the possible completions. --PP _p_r_e_f_i_x - _p_r_e_f_i_x is added at the beginning of each possible com- + _p_r_e_f_i_x is added at the beginning of each possible com- pletion after all other options have been applied. --SS _s_u_f_f_i_x _s_u_f_f_i_x is appended to each possible completion after all other options have been applied. --WW _w_o_r_d_l_i_s_t - The _w_o_r_d_l_i_s_t is split using the characters in the IIFFSS - special variable as delimiters, and each resultant word - is expanded. Shell quoting is honored within _w_o_r_d_l_i_s_t, + The _w_o_r_d_l_i_s_t is split using the characters in the IIFFSS + special variable as delimiters, and each resultant word + is expanded. Shell quoting is honored within _w_o_r_d_l_i_s_t, in order to provide a mechanism for the words to contain - shell metacharacters or characters in the value of IIFFSS. - The possible completions are the members of the resul- + shell metacharacters or characters in the value of IIFFSS. + The possible completions are the members of the resul- tant list which match the word being completed. --XX _f_i_l_t_e_r_p_a_t - _f_i_l_t_e_r_p_a_t is a pattern as used for pathname expansion. + _f_i_l_t_e_r_p_a_t is a pattern as used for pathname expansion. It is applied to the list of possible completions gener- - ated by the preceding options and arguments, and each - completion matching _f_i_l_t_e_r_p_a_t is removed from the list. - A leading !! in _f_i_l_t_e_r_p_a_t negates the pattern; in this + ated by the preceding options and arguments, and each + completion matching _f_i_l_t_e_r_p_a_t is removed from the list. + A leading !! in _f_i_l_t_e_r_p_a_t negates the pattern; in this case, any completion not matching _f_i_l_t_e_r_p_a_t is removed. - The return value is true unless an invalid option is supplied, + The return value is true unless an invalid option is supplied, an option other than --pp, --rr, --DD, --EE, or --II is supplied without a - _n_a_m_e argument, an attempt is made to remove a completion speci- + _n_a_m_e argument, an attempt is made to remove a completion speci- fication for a _n_a_m_e for which no specification exists, or an er- ror occurs adding a completion specification. ccoommppoopptt [--oo _o_p_t_i_o_n] [--DDEEII] [++oo _o_p_t_i_o_n] [_n_a_m_e] - Modify completion options for each _n_a_m_e according to the _o_p_- + Modify completion options for each _n_a_m_e according to the _o_p_- _t_i_o_ns, or for the currently-executing completion if no _n_a_m_es are - supplied. If no _o_p_t_i_o_ns are given, display the completion op- - tions for each _n_a_m_e or the current completion. The possible - values of _o_p_t_i_o_n are those valid for the ccoommpplleettee builtin de- - scribed above. The --DD option indicates that other supplied op- - tions should apply to the command completion; that is, comple- - tion attempted on a command for which no completion has previ- + supplied. If no _o_p_t_i_o_ns are given, display the completion op- + tions for each _n_a_m_e or the current completion. The possible + values of _o_p_t_i_o_n are those valid for the ccoommpplleettee builtin de- + scribed above. The --DD option indicates that other supplied op- + tions should apply to the command completion; that is, comple- + tion attempted on a command for which no completion has previ- ously been defined. The --EE option indicates that other supplied - options should apply to command completion; that is, completion - attempted on a blank line. The --II option indicates that other - supplied options should apply to completion on the initial non- - assignment word on the line, or after a command delimiter such + options should apply to command completion; that is, completion + attempted on a blank line. The --II option indicates that other + supplied options should apply to completion on the initial non- + assignment word on the line, or after a command delimiter such as ;; or ||, which is usually command name completion. - The return value is true unless an invalid option is supplied, + The return value is true unless an invalid option is supplied, an attempt is made to modify the options for a _n_a_m_e for which no completion specification exists, or an output error occurs. ccoonnttiinnuuee [_n] Resume the next iteration of the enclosing ffoorr, wwhhiillee, uunnttiill, or - sseelleecctt loop. If _n is specified, resume at the _nth enclosing - loop. _n must be >= 1. If _n is greater than the number of en- - closing loops, the shell resumes the last enclosing loop (the - loop). The return value is 0 unless _n is not greater than or + sseelleecctt loop. If _n is specified, resume at the _nth enclosing + loop. _n must be >= 1. If _n is greater than the number of en- + closing loops, the shell resumes the last enclosing loop (the + loop). The return value is 0 unless _n is not greater than or equal to 1. ddeeccllaarree [--aaAAffFFggiiIIllnnrrttuuxx] [--pp] [_n_a_m_e[=_v_a_l_u_e] ...] ttyyppeesseett [--aaAAffFFggiiIIllnnrrttuuxx] [--pp] [_n_a_m_e[=_v_a_l_u_e] ...] - Declare variables and/or give them attributes. If no _n_a_m_es are - given then display the values of variables. The --pp option will + Declare variables and/or give them attributes. If no _n_a_m_es are + given then display the values of variables. The --pp option will display the attributes and values of each _n_a_m_e. When --pp is used - with _n_a_m_e arguments, additional options, other than --ff and --FF, - are ignored. When --pp is supplied without _n_a_m_e arguments, it - will display the attributes and values of all variables having + with _n_a_m_e arguments, additional options, other than --ff and --FF, + are ignored. When --pp is supplied without _n_a_m_e arguments, it + will display the attributes and values of all variables having the attributes specified by the additional options. If no other - options are supplied with --pp, ddeeccllaarree will display the attrib- - utes and values of all shell variables. The --ff option will re- - strict the display to shell functions. The --FF option inhibits - the display of function definitions; only the function name and + options are supplied with --pp, ddeeccllaarree will display the attrib- + utes and values of all shell variables. The --ff option will re- + strict the display to shell functions. The --FF option inhibits + the display of function definitions; only the function name and attributes are printed. If the eexxttddeebbuugg shell option is enabled - using sshhoopptt, the source file name and line number where each - _n_a_m_e is defined are displayed as well. The --FF option implies + using sshhoopptt, the source file name and line number where each + _n_a_m_e is defined are displayed as well. The --FF option implies --ff. The --gg option forces variables to be created or modified at the global scope, even when ddeeccllaarree is executed in a shell func- - tion. It is ignored in all other cases. The --II option causes - local variables to inherit the attributes (except the _n_a_m_e_r_e_f + tion. It is ignored in all other cases. The --II option causes + local variables to inherit the attributes (except the _n_a_m_e_r_e_f attribute) and value of any existing variable with the same _n_a_m_e - at a surrounding scope. If there is no existing variable, the + at a surrounding scope. If there is no existing variable, the local variable is initially unset. The following options can be - used to restrict output to variables with the specified at- + used to restrict output to variables with the specified at- tribute or to give variables attributes: - --aa Each _n_a_m_e is an indexed array variable (see AArrrraayyss in + --aa Each _n_a_m_e is an indexed array variable (see AArrrraayyss in _b_a_s_h(1)). --AA Each _n_a_m_e is an associative array variable (see AArrrraayyss in _b_a_s_h(1)). --ff Use function names only. --ii The variable is treated as an integer; arithmetic evalua- - tion (see AARRIITTHHMMEETTIICC EEVVAALLUUAATTIIOONN in _b_a_s_h(1)) is performed + tion (see AARRIITTHHMMEETTIICC EEVVAALLUUAATTIIOONN in _b_a_s_h(1)) is performed when the variable is assigned a value. - --ll When the variable is assigned a value, all upper-case - characters are converted to lower-case. The upper-case + --ll When the variable is assigned a value, all upper-case + characters are converted to lower-case. The upper-case attribute is disabled. - --nn Give each _n_a_m_e the _n_a_m_e_r_e_f attribute, making it a name - reference to another variable. That other variable is - defined by the value of _n_a_m_e. All references, assign- - ments, and attribute modifications to _n_a_m_e, except those - using or changing the --nn attribute itself, are performed - on the variable referenced by _n_a_m_e's value. The nameref + --nn Give each _n_a_m_e the _n_a_m_e_r_e_f attribute, making it a name + reference to another variable. That other variable is + defined by the value of _n_a_m_e. All references, assign- + ments, and attribute modifications to _n_a_m_e, except those + using or changing the --nn attribute itself, are performed + on the variable referenced by _n_a_m_e's value. The nameref attribute cannot be applied to array variables. --rr Make _n_a_m_es readonly. These names cannot then be assigned values by subsequent assignment statements or unset. --tt Give each _n_a_m_e the _t_r_a_c_e attribute. Traced functions in- - herit the DDEEBBUUGG and RREETTUURRNN traps from the calling shell. + herit the DDEEBBUUGG and RREETTUURRNN traps from the calling shell. The trace attribute has no special meaning for variables. - --uu When the variable is assigned a value, all lower-case - characters are converted to upper-case. The lower-case + --uu When the variable is assigned a value, all lower-case + characters are converted to upper-case. The lower-case attribute is disabled. - --xx Mark _n_a_m_es for export to subsequent commands via the en- + --xx Mark _n_a_m_es for export to subsequent commands via the en- vironment. - Using instead of turns off the attribute instead, with the ex- - ceptions that ++aa and ++AA may not be used to destroy array vari- - ables and ++rr will not remove the readonly attribute. When used + Using instead of turns off the attribute instead, with the ex- + ceptions that ++aa and ++AA may not be used to destroy array vari- + ables and ++rr will not remove the readonly attribute. When used in a function, ddeeccllaarree and ttyyppeesseett make each _n_a_m_e local, as with the llooccaall command, unless the --gg option is supplied. If a vari- - able name is followed by =_v_a_l_u_e, the value of the variable is - set to _v_a_l_u_e. When using --aa or --AA and the compound assignment - syntax to create array variables, additional attributes do not + able name is followed by =_v_a_l_u_e, the value of the variable is + set to _v_a_l_u_e. When using --aa or --AA and the compound assignment + syntax to create array variables, additional attributes do not take effect until subsequent assignments. The return value is 0 - unless an invalid option is encountered, an attempt is made to - define a function using an attempt is made to assign a value to - a readonly variable, an attempt is made to assign a value to an + unless an invalid option is encountered, an attempt is made to + define a function using 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 - AArrrraayyss in _b_a_s_h(1)), one of the _n_a_m_e_s is not a valid shell vari- - able 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- + AArrrraayyss in _b_a_s_h(1)), one of the _n_a_m_e_s is not a valid shell vari- + able 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 --ff. ddiirrss [[--ccllppvv]] [[++_n]] [[--_n]] - Without options, displays the list of currently remembered di- - rectories. The default display is on a single line with direc- - tory names separated by spaces. Directories are added to the - list with the ppuusshhdd command; the ppooppdd command removes entries + Without options, displays the list of currently remembered di- + rectories. The default display is on a single line with direc- + tory names separated by spaces. Directories are added to the + list with the ppuusshhdd command; the ppooppdd command removes entries from the list. The current directory is always the first direc- tory in the stack. - --cc Clears the directory stack by deleting all of the en- + --cc Clears the directory stack by deleting all of the en- tries. - --ll Produces a listing using full pathnames; the default + --ll Produces a listing using full pathnames; the default listing format uses a tilde to denote the home directory. --pp Print the directory stack with one entry per line. - --vv Print the directory stack with one entry per line, pre- + --vv Print the directory stack with one entry per line, pre- fixing each entry with its index in the stack. ++_n Displays the _nth entry counting from the left of the list shown by ddiirrss when invoked without options, starting with zero. - --_n Displays the _nth entry counting from the right of the + --_n Displays the _nth entry counting from the right of the list shown by ddiirrss when invoked without options, starting with zero. - The return value is 0 unless an invalid option is supplied or _n + The return value is 0 unless an invalid option is supplied or _n indexes beyond the end of the directory stack. ddiissoowwnn [--aarr] [--hh] [_j_o_b_s_p_e_c ... | _p_i_d ... ] - Without options, remove each _j_o_b_s_p_e_c from the table of active - jobs. If _j_o_b_s_p_e_c is not present, and neither the --aa nor the --rr - option is supplied, the _c_u_r_r_e_n_t _j_o_b is used. If the --hh option - is given, each _j_o_b_s_p_e_c is not removed from the table, but is - marked so that SSIIGGHHUUPP is not sent to the job if the shell re- + Without options, remove each _j_o_b_s_p_e_c from the table of active + jobs. If _j_o_b_s_p_e_c is not present, and neither the --aa nor the --rr + option is supplied, the _c_u_r_r_e_n_t _j_o_b is used. If the --hh option + is given, each _j_o_b_s_p_e_c is not removed from the table, but is + marked so that SSIIGGHHUUPP is not sent to the job if the shell re- ceives a SSIIGGHHUUPP. If no _j_o_b_s_p_e_c is supplied, the --aa option means - to remove or mark all jobs; the --rr option without a _j_o_b_s_p_e_c ar- + to remove or mark all jobs; the --rr option without a _j_o_b_s_p_e_c ar- gument restricts operation to running jobs. The return value is 0 unless a _j_o_b_s_p_e_c does not specify a valid job. eecchhoo [--nneeEE] [_a_r_g ...] - Output the _a_r_gs, separated by spaces, followed by a newline. - The return status is 0 unless a write error occurs. If --nn is + Output the _a_r_gs, separated by spaces, followed by a newline. + The return status is 0 unless a write error occurs. If --nn is specified, the trailing newline is suppressed. If the --ee option - is given, interpretation of the following backslash-escaped - characters is enabled. The --EE option disables the interpreta- - tion of these escape characters, even on systems where they are - interpreted by default. The xxppgg__eecchhoo shell option may be used - to dynamically determine whether or not eecchhoo interprets any op- + is given, interpretation of the following backslash-escaped + characters is enabled. The --EE option disables the interpreta- + tion of these escape characters, even on systems where they are + interpreted by default. The xxppgg__eecchhoo shell option may be used + to dynamically determine whether or not eecchhoo interprets any op- tions and expands these escape characters by default. eecchhoo does - not interpret ---- to mean the end of options. eecchhoo interprets + not interpret ---- to mean the end of options. eecchhoo interprets the following escape sequences: \\aa alert (bell) \\bb backspace @@ -551,207 +554,207 @@ BBAASSHH BBUUIILLTTIINN CCOOMMMMAANNDDSS \\tt horizontal tab \\vv vertical tab \\\\ backslash - \\00_n_n_n the eight-bit character whose value is the octal value + \\00_n_n_n the eight-bit character whose value is the octal value _n_n_n (zero to three octal digits) - \\xx_H_H the eight-bit character whose value is the hexadecimal + \\xx_H_H the eight-bit character whose value is the hexadecimal value _H_H (one or two hex digits) - \\uu_H_H_H_H the Unicode (ISO/IEC 10646) character whose value is the + \\uu_H_H_H_H the Unicode (ISO/IEC 10646) character whose value is the hexadecimal value _H_H_H_H (one to four hex digits) \\UU_H_H_H_H_H_H_H_H - the Unicode (ISO/IEC 10646) character whose value is the + the Unicode (ISO/IEC 10646) character whose value is the hexadecimal value _H_H_H_H_H_H_H_H (one to eight hex digits) eennaabbllee [--aa] [--ddnnppss] [--ff _f_i_l_e_n_a_m_e] [_n_a_m_e ...] - Enable and disable builtin shell commands. Disabling a builtin + 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 --nn is used, each _n_a_m_e is disabled; otherwise, _n_a_m_e_s are en- - abled. For example, to use the tteesstt binary found via the PPAATTHH + to be executed without specifying a full pathname, even though + the shell normally searches for builtins before disk commands. + If --nn is used, each _n_a_m_e is disabled; otherwise, _n_a_m_e_s are en- + abled. For example, to use the tteesstt binary found via the PPAATTHH instead of the shell builtin version, run The --ff option means to - load the new builtin command _n_a_m_e from shared object _f_i_l_e_n_a_m_e, - on systems that support dynamic loading. BBaasshh will use the - value of the BBAASSHH__LLOOAADDAABBLLEESS__PPAATTHH variable as a colon-separated + load the new builtin command _n_a_m_e from shared object _f_i_l_e_n_a_m_e, + on systems that support dynamic loading. BBaasshh will use the + value of the BBAASSHH__LLOOAADDAABBLLEESS__PPAATTHH variable as a colon-separated list of directories in which to search for _f_i_l_e_n_a_m_e, if _f_i_l_e_n_a_m_e - does not contain a slash. The default is system-dependent, and - may include to force a search of the current directory. The --dd - option will delete a builtin previously loaded with --ff. If no - _n_a_m_e arguments are given, or if the --pp option is supplied, a - list of shell builtins is printed. With no other option argu- - ments, the list consists of all enabled shell builtins. If --nn - is supplied, only disabled builtins are printed. If --aa is sup- - plied, the list printed includes all builtins, with an indica- - tion of whether or not each is enabled. If --ss is supplied, the - output is restricted to the POSIX _s_p_e_c_i_a_l builtins. If no op- - tions are supplied and a _n_a_m_e is not a shell builtin, eennaabbllee + does not contain a slash. The default is system-dependent, and + may include to force a search of the current directory. The --dd + option will delete a builtin previously loaded with --ff. If no + _n_a_m_e arguments are given, or if the --pp option is supplied, a + list of shell builtins is printed. With no other option argu- + ments, the list consists of all enabled shell builtins. If --nn + is supplied, only disabled builtins are printed. If --aa is sup- + plied, the list printed includes all builtins, with an indica- + tion of whether or not each is enabled. If --ss is supplied, the + output is restricted to the POSIX _s_p_e_c_i_a_l builtins. If no op- + tions are supplied and a _n_a_m_e is not a shell builtin, eennaabbllee will attempt to load _n_a_m_e from a shared object named _n_a_m_e, as if - the command were The return value is 0 unless a _n_a_m_e is not a - shell builtin or there is an error loading a new builtin from a + the command were The return value is 0 unless a _n_a_m_e is not a + shell builtin or there is an error loading a new builtin from a shared object. eevvaall [_a_r_g ...] - The _a_r_gs are read and concatenated together into a single com- - mand. This command is then read and executed by the shell, and - its exit status is returned as the value of eevvaall. If there are + The _a_r_gs are read and concatenated together into a single com- + mand. This command is then read and executed by the shell, and + its exit status is returned as the value of eevvaall. If there are no _a_r_g_s, or only null arguments, eevvaall returns 0. eexxeecc [--ccll] [--aa _n_a_m_e] [_c_o_m_m_a_n_d [_a_r_g_u_m_e_n_t_s]] - If _c_o_m_m_a_n_d is specified, it replaces the shell. No new process - is created. The _a_r_g_u_m_e_n_t_s become the arguments to _c_o_m_m_a_n_d. If + If _c_o_m_m_a_n_d is specified, it replaces the shell. No new process + is created. The _a_r_g_u_m_e_n_t_s become the arguments to _c_o_m_m_a_n_d. If the --ll option is supplied, the shell places a dash at the begin- ning of the zeroth argument passed to _c_o_m_m_a_n_d. This is what _l_o_- - _g_i_n(1) does. The --cc option causes _c_o_m_m_a_n_d to be executed with - an empty environment. If --aa is supplied, the shell passes _n_a_m_e + _g_i_n(1) does. The --cc option causes _c_o_m_m_a_n_d to be executed with + an empty environment. If --aa is supplied, the shell passes _n_a_m_e as the zeroth argument to the executed command. If _c_o_m_m_a_n_d can- - not be executed for some reason, a non-interactive shell exits, - unless the eexxeeccffaaiill shell option is enabled. In that case, it - returns failure. An interactive shell returns failure if the - file cannot be executed. A subshell exits unconditionally if - eexxeecc fails. If _c_o_m_m_a_n_d is not specified, any redirections take - effect in the current shell, and the return status is 0. If + not be executed for some reason, a non-interactive shell exits, + unless the eexxeeccffaaiill shell option is enabled. In that case, it + returns failure. An interactive shell returns failure if the + file cannot be executed. A subshell exits unconditionally if + eexxeecc fails. If _c_o_m_m_a_n_d 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. eexxiitt [_n] - Cause the shell to exit with a status of _n. If _n is omitted, + Cause the shell to exit with a status of _n. If _n is omitted, the exit status is that of the last command executed. A trap on EEXXIITT is executed before the shell terminates. eexxppoorrtt [--ffnn] [_n_a_m_e[=_w_o_r_d]] ... eexxppoorrtt --pp - The supplied _n_a_m_e_s are marked for automatic export to the envi- - ronment of subsequently executed commands. If the --ff option is - given, the _n_a_m_e_s refer to functions. If no _n_a_m_e_s are given, or - if the --pp option is supplied, a list of names of all exported - variables is printed. The --nn option causes the export property + The supplied _n_a_m_e_s are marked for automatic export to the envi- + ronment of subsequently executed commands. If the --ff option is + given, the _n_a_m_e_s refer to functions. If no _n_a_m_e_s are given, or + if the --pp option is supplied, a list of names of all exported + variables is printed. The --nn option causes the export property to be removed from each _n_a_m_e. If a variable name is followed by =_w_o_r_d, the value of the variable is set to _w_o_r_d. eexxppoorrtt returns an exit status of 0 unless an invalid option is encountered, one - of the _n_a_m_e_s is not a valid shell variable name, or --ff is sup- + of the _n_a_m_e_s is not a valid shell variable name, or --ff is sup- plied with a _n_a_m_e that is not a function. ffaallssee Does nothing, returns a non-zero status. ffcc [--ee _e_n_a_m_e] [--llnnrr] [_f_i_r_s_t] [_l_a_s_t] ffcc --ss [_p_a_t=_r_e_p] [_c_m_d] - The first form selects a range of commands from _f_i_r_s_t to _l_a_s_t - from the history list and displays or edits and re-executes - them. _F_i_r_s_t and _l_a_s_t 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). When listing, a - _f_i_r_s_t or _l_a_s_t of 0 is equivalent to -1 and -0 is equivalent to - the current command (usually the ffcc command); otherwise 0 is - equivalent to -1 and -0 is invalid. If _l_a_s_t is not specified, + The first form selects a range of commands from _f_i_r_s_t to _l_a_s_t + from the history list and displays or edits and re-executes + them. _F_i_r_s_t and _l_a_s_t 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). When listing, a + _f_i_r_s_t or _l_a_s_t of 0 is equivalent to -1 and -0 is equivalent to + the current command (usually the ffcc command); otherwise 0 is + equivalent to -1 and -0 is invalid. If _l_a_s_t is not specified, it is set to the current command for listing (so that prints the last 10 commands) and to _f_i_r_s_t otherwise. If _f_i_r_s_t is not spec- ified, it is set to the previous command for editing and -16 for listing. - The --nn option suppresses the command numbers when listing. The - --rr option reverses the order of the commands. If the --ll option - is given, the commands are listed on standard output. Other- - wise, the editor given by _e_n_a_m_e is invoked on a file containing - those commands. If _e_n_a_m_e is not given, the value of the FFCCEEDDIITT - variable is used, and the value of EEDDIITTOORR if FFCCEEDDIITT is not set. - If neither variable is set, _v_i is used. When editing is com- + The --nn option suppresses the command numbers when listing. The + --rr option reverses the order of the commands. If the --ll option + is given, the commands are listed on standard output. Other- + wise, the editor given by _e_n_a_m_e is invoked on a file containing + those commands. If _e_n_a_m_e is not given, the value of the FFCCEEDDIITT + variable is used, and the value of EEDDIITTOORR if FFCCEEDDIITT is not set. + If neither variable is set, _v_i is used. When editing is com- plete, the edited commands are echoed and executed. - In the second form, _c_o_m_m_a_n_d is re-executed after each instance - of _p_a_t is replaced by _r_e_p. _C_o_m_m_a_n_d is interpreted the same as - _f_i_r_s_t above. A useful alias to use with this is so that typing - runs the last command beginning with and typing re-executes the + In the second form, _c_o_m_m_a_n_d is re-executed after each instance + of _p_a_t is replaced by _r_e_p. _C_o_m_m_a_n_d is interpreted the same as + _f_i_r_s_t above. A useful alias to use with this is so that typing + runs the last command beginning with and typing re-executes the last command. - If the first form is used, the return value is 0 unless an in- - valid option is encountered or _f_i_r_s_t or _l_a_s_t specify history - lines out of range. If the --ee option is supplied, the return + If the first form is used, the return value is 0 unless an in- + valid option is encountered or _f_i_r_s_t or _l_a_s_t specify history + lines out of range. If the --ee 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-exe- - cuted, unless _c_m_d does not specify a valid history line, in + form is used, the return status is that of the command re-exe- + cuted, unless _c_m_d does not specify a valid history line, in which case ffcc returns failure. ffgg [_j_o_b_s_p_e_c] - Resume _j_o_b_s_p_e_c in the foreground, and make it the current job. + Resume _j_o_b_s_p_e_c in the foreground, and make it the current job. If _j_o_b_s_p_e_c is not present, the shell's notion of the _c_u_r_r_e_n_t _j_o_b - is used. The return value is that of the command placed into - the foreground, or failure if run when job control is disabled + 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 _j_o_b_s_p_e_c does not spec- - ify a valid job or _j_o_b_s_p_e_c specifies a job that was started + ify a valid job or _j_o_b_s_p_e_c specifies a job that was started without job control. ggeettooppttss _o_p_t_s_t_r_i_n_g _n_a_m_e [_a_r_g ...] - ggeettooppttss is used by shell procedures to parse positional parame- - ters. _o_p_t_s_t_r_i_n_g contains the option characters to be recog- - nized; if a character is followed by a colon, the option is ex- + ggeettooppttss is used by shell procedures to parse positional parame- + ters. _o_p_t_s_t_r_i_n_g contains the option characters to be recog- + nized; if a character is followed by a colon, the option is ex- pected 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, ggeettooppttss - places the next option in the shell variable _n_a_m_e, initializing + white space. The colon and question mark characters may not be + used as option characters. Each time it is invoked, ggeettooppttss + places the next option in the shell variable _n_a_m_e, initializing _n_a_m_e if it does not exist, and the index of the next argument to be processed into the variable OOPPTTIINNDD. OOPPTTIINNDD is initialized to 1 each time the shell or a shell script is invoked. When an op- tion requires an argument, ggeettooppttss places that argument into the variable OOPPTTAARRGG. The shell does not reset OOPPTTIINNDD automatically; - it must be manually reset between multiple calls to ggeettooppttss - within the same shell invocation if a new set of parameters is + it must be manually reset between multiple calls to ggeettooppttss + within the same shell invocation if a new set of parameters is to be used. When the end of options is encountered, ggeettooppttss exits with a re- turn value greater than zero. OOPPTTIINNDD is set to the index of the first non-option argument, and _n_a_m_e is set to ?. - ggeettooppttss normally parses the positional parameters, but if more - arguments are supplied as _a_r_g values, ggeettooppttss parses those in- + ggeettooppttss normally parses the positional parameters, but if more + arguments are supplied as _a_r_g values, ggeettooppttss parses those in- stead. - ggeettooppttss can report errors in two ways. If the first character - of _o_p_t_s_t_r_i_n_g is a colon, _s_i_l_e_n_t error reporting is used. In - normal operation, diagnostic messages are printed when invalid - options or missing option arguments are encountered. If the - variable OOPPTTEERRRR is set to 0, no error messages will be dis- + ggeettooppttss can report errors in two ways. If the first character + of _o_p_t_s_t_r_i_n_g is a colon, _s_i_l_e_n_t error reporting is used. In + normal operation, diagnostic messages are printed when invalid + options or missing option arguments are encountered. If the + variable OOPPTTEERRRR is set to 0, no error messages will be dis- played, even if the first character of _o_p_t_s_t_r_i_n_g is not a colon. If ggeettooppttss detects an invalid option, it places ? into _n_a_m_e and, - if not silent, prints an error message and unsets OOPPTTAARRGG. If - ggeettooppttss is silent, it assigns the option character found to OOPP-- + if not silent, prints an error message and unsets OOPPTTAARRGG. If + ggeettooppttss is silent, it assigns the option character found to OOPP-- TTAARRGG and does not print a diagnostic message. - If a required argument is not found, and ggeettooppttss is not silent, + If a required argument is not found, and ggeettooppttss is not silent, it sets the value of _n_a_m_e to a question mark (??), unsets OOPPTTAARRGG, - and prints a diagnostic message. If ggeettooppttss is silent, it sets - the value of _n_a_m_e to a colon (::) and sets OOPPTTAARRGG to the option + and prints a diagnostic message. If ggeettooppttss is silent, it sets + the value of _n_a_m_e to a colon (::) and sets OOPPTTAARRGG to the option character found. - ggeettooppttss returns true if an option, specified or unspecified, is + ggeettooppttss returns true if an option, specified or unspecified, is found. It returns false if the end of options is encountered or an error occurs. hhaasshh [--llrr] [--pp _f_i_l_e_n_a_m_e] [--ddtt] [_n_a_m_e] Each time hhaasshh is invoked, the full pathname of the command _n_a_m_e - is determined by searching the directories in $$PPAATTHH and remem- + is determined by searching the directories in $$PPAATTHH and remem- bered. Any previously-remembered pathname is discarded. If the - --pp option is supplied, hhaasshh uses _f_i_l_e_n_a_m_e as the full filename - of the command. The --rr option causes the shell to forget all - remembered locations. Assigning to the PPAATTHH variable also - clears all hashed filenames. The --dd option causes the shell to - forget the remembered location of each _n_a_m_e. If the --tt option + --pp option is supplied, hhaasshh uses _f_i_l_e_n_a_m_e as the full filename + of the command. The --rr option causes the shell to forget all + remembered locations. Assigning to the PPAATTHH variable also + clears all hashed filenames. The --dd option causes the shell to + forget the remembered location of each _n_a_m_e. If the --tt option is supplied, the full pathname to which each _n_a_m_e corresponds is - printed. If multiple _n_a_m_e arguments are supplied with --tt, the - _n_a_m_e is printed before the hashed full pathname. The --ll option - causes output to be displayed in a format that may be reused as - input. If no arguments are given, or if only --ll is supplied, - information about remembered commands is printed. The --tt, --dd, - and --pp options (the options that act on the _n_a_m_e arguments) are - mutually exclusive. Only one will be active. If more than one + printed. If multiple _n_a_m_e arguments are supplied with --tt, the + _n_a_m_e is printed before the hashed full pathname. The --ll option + causes output to be displayed in a format that may be reused as + input. If no arguments are given, or if only --ll is supplied, + information about remembered commands is printed. The --tt, --dd, + and --pp options (the options that act on the _n_a_m_e arguments) are + mutually exclusive. Only one will be active. If more than one is supplied, --tt has higher priority than --pp, and both are higher - priority than --dd. The return status is true unless a _n_a_m_e is + priority than --dd. The return status is true unless a _n_a_m_e is not found or an invalid option is supplied. hheellpp [--ddmmss] [_p_a_t_t_e_r_n] - Display helpful information about builtin commands. If _p_a_t_t_e_r_n - is specified, hheellpp gives detailed help on all commands matching - _p_a_t_t_e_r_n; otherwise help for all the builtins and shell control + Display helpful information about builtin commands. If _p_a_t_t_e_r_n + is specified, hheellpp gives detailed help on all commands matching + _p_a_t_t_e_r_n; otherwise help for all the builtins and shell control structures is printed. --dd Display a short description of each _p_a_t_t_e_r_n --mm Display the description of each _p_a_t_t_e_r_n in a manpage-like @@ -769,55 +772,55 @@ BBAASSHH BBUUIILLTTIINN CCOOMMMMAANNDDSS hhiissttoorryy --ss _a_r_g [_a_r_g ...] With no options, display the command history list with line num- bers. Lines listed with a ** have been modified. An argument of - _n lists only the last _n lines. If the shell variable HHIISSTTTTIIMMEE-- - FFOORRMMAATT is set and not null, it is used as a format string for - _s_t_r_f_t_i_m_e(3) to display the time stamp associated with each dis- - played history entry. No intervening blank is printed between - the formatted time stamp and the history line. If _f_i_l_e_n_a_m_e is - supplied, it is used as the name of the history file; if not, - the value of HHIISSTTFFIILLEE is used. If _f_i_l_e_n_a_m_e is not supplied and - HHIISSTTFFIILLEE is unset or null, the --aa,, --nn,, --rr,, and --ww options have + _n lists only the last _n lines. If the shell variable HHIISSTTTTIIMMEE-- + FFOORRMMAATT is set and not null, it is used as a format string for + _s_t_r_f_t_i_m_e(3) to display the time stamp associated with each dis- + played history entry. No intervening blank is printed between + the formatted time stamp and the history line. If _f_i_l_e_n_a_m_e is + supplied, it is used as the name of the history file; if not, + the value of HHIISSTTFFIILLEE is used. If _f_i_l_e_n_a_m_e is not supplied and + HHIISSTTFFIILLEE is unset or null, the --aa,, --nn,, --rr,, and --ww options have no effect. Options, if supplied, have the following meanings: --cc Clear the history list by deleting all the entries. --dd _o_f_f_s_e_t - Delete the history entry at position _o_f_f_s_e_t. If _o_f_f_s_e_t + Delete the history entry at position _o_f_f_s_e_t. If _o_f_f_s_e_t is negative, it is interpreted as relative to one greater than the last history position, so negative indices count - back from the end of the history, and an index of -1 + back from the end of the history, and an index of -1 refers to the current hhiissttoorryy --dd command. --dd _s_t_a_r_t-_e_n_d - Delete the range of history entries between positions - _s_t_a_r_t and _e_n_d, inclusive. Positive and negative values + Delete the range of history entries between positions + _s_t_a_r_t and _e_n_d, inclusive. Positive and negative values for _s_t_a_r_t and _e_n_d are interpreted as described above. - --aa Append the history lines to the history file. These are - history lines entered since the beginning of the current - bbaasshh session, but not already appended to the history + --aa Append the history lines to the history file. These are + history lines entered since the beginning of the current + bbaasshh session, but not already appended to the history file. - --nn Read the history lines not already read from the history - file into the current history list. These are lines ap- - pended to the history file since the beginning of the + --nn Read the history lines not already read from the history + file into the current history list. These are lines ap- + pended to the history file since the beginning of the current bbaasshh session. - --rr Read the contents of the history file and append them to + --rr Read the contents of the history file and append them to the current history list. --ww Write the current history list to the history file, over- writing the history file's contents. - --pp Perform history substitution on the following _a_r_g_s and - display the result on the standard output. Does not - store the results in the history list. Each _a_r_g must be + --pp Perform history substitution on the following _a_r_g_s and + display the result on the standard output. Does not + store the results in the history list. Each _a_r_g must be quoted to disable normal history expansion. - --ss Store the _a_r_g_s in the history list as a single entry. - The last command in the history list is removed before + --ss Store the _a_r_g_s in the history list as a single entry. + The last command in the history list is removed before the _a_r_g_s are added. - If the HHIISSTTTTIIMMEEFFOORRMMAATT variable is set, the time stamp informa- - tion associated with each history entry is written to the his- - tory file, marked with the history comment character. When the - history file is read, lines beginning with the history comment - character followed immediately by a digit are interpreted as + If the HHIISSTTTTIIMMEEFFOORRMMAATT variable is set, the time stamp informa- + tion associated with each history entry is written to the his- + tory file, marked with the history comment character. When the + history file is read, lines beginning with the history comment + character followed immediately by a digit are interpreted as timestamps for the following history entry. The return value is 0 unless an invalid option is encountered, an error occurs while - reading or writing the history file, an invalid _o_f_f_s_e_t or range - is supplied as an argument to --dd, or the history expansion sup- + reading or writing the history file, an invalid _o_f_f_s_e_t or range + is supplied as an argument to --dd, or the history expansion sup- plied as an argument to --pp fails. jjoobbss [--llnnpprrss] [ _j_o_b_s_p_e_c ... ] @@ -825,15 +828,15 @@ BBAASSHH BBUUIILLTTIINN CCOOMMMMAANNDDSS The first form lists the active jobs. The options have the fol- lowing meanings: --ll List process IDs in addition to the normal information. - --nn Display information only about jobs that have changed + --nn Display information only about jobs that have changed status since the user was last notified of their status. - --pp List only the process ID of the job's process group + --pp List only the process ID of the job's process group leader. --rr Display only running jobs. --ss Display only stopped jobs. - If _j_o_b_s_p_e_c is given, output is restricted to information about - that job. The return status is 0 unless an invalid option is + If _j_o_b_s_p_e_c is given, output is restricted to information about + that job. The return status is 0 unless an invalid option is encountered or an invalid _j_o_b_s_p_e_c is supplied. If the --xx option is supplied, jjoobbss replaces any _j_o_b_s_p_e_c found in @@ -842,40 +845,40 @@ BBAASSHH BBUUIILLTTIINN CCOOMMMMAANNDDSS kkiillll [--ss _s_i_g_s_p_e_c | --nn _s_i_g_n_u_m | --_s_i_g_s_p_e_c] [_p_i_d | _j_o_b_s_p_e_c] ... kkiillll --ll|--LL [_s_i_g_s_p_e_c | _e_x_i_t___s_t_a_t_u_s] - Send the signal named by _s_i_g_s_p_e_c or _s_i_g_n_u_m to the processes - named by _p_i_d or _j_o_b_s_p_e_c. _s_i_g_s_p_e_c is either a case-insensitive - signal name such as SSIIGGKKIILLLL (with or without the SSIIGG prefix) or - a signal number; _s_i_g_n_u_m is a signal number. If _s_i_g_s_p_e_c is not - present, then SSIIGGTTEERRMM is assumed. An argument of --ll lists the - signal names. If any arguments are supplied when --ll is given, - the names of the signals corresponding to the arguments are + Send the signal named by _s_i_g_s_p_e_c or _s_i_g_n_u_m to the processes + named by _p_i_d or _j_o_b_s_p_e_c. _s_i_g_s_p_e_c is either a case-insensitive + signal name such as SSIIGGKKIILLLL (with or without the SSIIGG prefix) or + a signal number; _s_i_g_n_u_m is a signal number. If _s_i_g_s_p_e_c is not + present, then SSIIGGTTEERRMM is assumed. An argument of --ll lists the + signal names. If any arguments are supplied when --ll is given, + the names of the signals corresponding to the arguments are listed, and the return status is 0. The _e_x_i_t___s_t_a_t_u_s argument to - --ll is a number specifying either a signal number or the exit - status of a process terminated by a signal. The --LL option is - equivalent to --ll. kkiillll returns true if at least one signal was + --ll is a number specifying either a signal number or the exit + status of a process terminated by a signal. The --LL option is + equivalent to --ll. kkiillll returns true if at least one signal was successfully sent, or false if an error occurs or an invalid op- tion is encountered. lleett _a_r_g [_a_r_g ...] Each _a_r_g is an arithmetic expression to be evaluated (see AARRIITTHH-- - MMEETTIICC EEVVAALLUUAATTIIOONN in _b_a_s_h(1)). If the last _a_r_g evaluates to 0, + MMEETTIICC EEVVAALLUUAATTIIOONN in _b_a_s_h(1)). If the last _a_r_g evaluates to 0, lleett returns 1; 0 is returned otherwise. llooccaall [_o_p_t_i_o_n] [_n_a_m_e[=_v_a_l_u_e] ... | - ] - For each argument, a local variable named _n_a_m_e is created, and - assigned _v_a_l_u_e. The _o_p_t_i_o_n can be any of the options accepted + For each argument, a local variable named _n_a_m_e is created, and + assigned _v_a_l_u_e. The _o_p_t_i_o_n can be any of the options accepted by ddeeccllaarree. When llooccaall is used within a function, it causes the - variable _n_a_m_e to have a visible scope restricted to that func- - tion and its children. If _n_a_m_e is -, the set of shell options - is made local to the function in which llooccaall is invoked: shell - options changed using the sseett builtin inside the function after + variable _n_a_m_e to have a visible scope restricted to that func- + tion and its children. If _n_a_m_e is -, the set of shell options + is made local to the function in which llooccaall is invoked: shell + options changed using the sseett builtin inside the function after the call to llooccaall are restored to their original values when the function returns. The restore is effected as if a series of sseett - commands were executed to restore the values that were in place - before the function. With no operands, llooccaall writes a list of - local variables to the standard output. It is an error to use + commands were executed to restore the values that were in place + before the function. With no operands, llooccaall writes a list of + local variables to the standard output. It is an error to use llooccaall when not within a function. The return status is 0 unless - llooccaall is used outside a function, an invalid _n_a_m_e is supplied, + llooccaall is used outside a function, an invalid _n_a_m_e is supplied, or _n_a_m_e is a readonly variable. llooggoouutt Exit a login shell. @@ -884,225 +887,225 @@ BBAASSHH BBUUIILLTTIINN CCOOMMMMAANNDDSS _c_a_l_l_b_a_c_k] [--cc _q_u_a_n_t_u_m] [_a_r_r_a_y] rreeaaddaarrrraayy [--dd _d_e_l_i_m] [--nn _c_o_u_n_t] [--OO _o_r_i_g_i_n] [--ss _c_o_u_n_t] [--tt] [--uu _f_d] [--CC _c_a_l_l_b_a_c_k] [--cc _q_u_a_n_t_u_m] [_a_r_r_a_y] - Read lines from the standard input into the indexed array vari- - able _a_r_r_a_y, or from file descriptor _f_d if the --uu option is sup- - plied. The variable MMAAPPFFIILLEE is the default _a_r_r_a_y. Options, if + Read lines from the standard input into the indexed array vari- + able _a_r_r_a_y, or from file descriptor _f_d if the --uu option is sup- + plied. The variable MMAAPPFFIILLEE is the default _a_r_r_a_y. Options, if supplied, have the following meanings: - --dd The first character of _d_e_l_i_m is used to terminate each - input line, rather than newline. If _d_e_l_i_m is the empty + --dd The first character of _d_e_l_i_m is used to terminate each + input line, rather than newline. If _d_e_l_i_m is the empty string, mmaappffiillee will terminate a line when it reads a NUL character. - --nn Copy at most _c_o_u_n_t lines. If _c_o_u_n_t is 0, all lines are + --nn Copy at most _c_o_u_n_t lines. If _c_o_u_n_t is 0, all lines are copied. - --OO Begin assigning to _a_r_r_a_y at index _o_r_i_g_i_n. The default + --OO Begin assigning to _a_r_r_a_y at index _o_r_i_g_i_n. The default index is 0. --ss Discard the first _c_o_u_n_t lines read. - --tt Remove a trailing _d_e_l_i_m (default newline) from each line + --tt Remove a trailing _d_e_l_i_m (default newline) from each line read. - --uu Read lines from file descriptor _f_d instead of the stan- + --uu Read lines from file descriptor _f_d instead of the stan- dard input. - --CC Evaluate _c_a_l_l_b_a_c_k each time _q_u_a_n_t_u_m lines are read. The + --CC Evaluate _c_a_l_l_b_a_c_k each time _q_u_a_n_t_u_m lines are read. The --cc option specifies _q_u_a_n_t_u_m. - --cc Specify the number of lines read between each call to + --cc Specify the number of lines read between each call to _c_a_l_l_b_a_c_k. - If --CC is specified without --cc, the default quantum is 5000. + If --CC is specified without --cc, the default quantum is 5000. When _c_a_l_l_b_a_c_k is evaluated, it is supplied the index of the next array element to be assigned and the line to be assigned to that - element as additional arguments. _c_a_l_l_b_a_c_k is evaluated after + element as additional arguments. _c_a_l_l_b_a_c_k is evaluated after the line is read but before the array element is assigned. - If not supplied with an explicit origin, mmaappffiillee will clear _a_r_- + If not supplied with an explicit origin, mmaappffiillee will clear _a_r_- _r_a_y before assigning to it. - mmaappffiillee returns successfully unless an invalid option or option - argument is supplied, _a_r_r_a_y is invalid or unassignable, or if + mmaappffiillee returns successfully unless an invalid option or option + argument is supplied, _a_r_r_a_y is invalid or unassignable, or if _a_r_r_a_y is not an indexed array. ppooppdd [-nn] [+_n] [-_n] Removes entries from the directory stack. The elements are num- - bered from 0 starting at the first directory listed by ddiirrss. - With no arguments, ppooppdd removes the top directory from the + bered from 0 starting at the first directory listed by ddiirrss. + With no arguments, ppooppdd removes the top directory from the stack, and changes to the new top directory. Arguments, if sup- plied, have the following meanings: - --nn Suppresses the normal change of directory when removing + --nn Suppresses the normal change of directory when removing directories from the stack, so that only the stack is ma- nipulated. - ++_n Removes the _nth entry counting from the left of the list - shown by ddiirrss, starting with zero, from the stack. For + ++_n Removes the _nth entry counting from the left of the list + shown by ddiirrss, starting with zero, from the stack. For example: removes the first directory, the second. --_n Removes the _nth entry counting from the right of the list - shown by ddiirrss, starting with zero. For example: removes + shown by ddiirrss, starting with zero. For example: removes the last directory, the next to last. - If the top element of the directory stack is modified, and the - _-_n option was not supplied, ppooppdd uses the ccdd builtin to change + If the top element of the directory stack is modified, and the + _-_n option was not supplied, ppooppdd uses the ccdd builtin to change to the directory at the top of the stack. If the ccdd fails, ppooppdd returns a non-zero value. - Otherwise, ppooppdd returns false if an invalid option is encoun- + Otherwise, ppooppdd returns false if an invalid option is encoun- tered, the directory stack is empty, or a non-existent directory stack entry is specified. - If the ppooppdd command is successful, bash runs ddiirrss to show the - final contents of the directory stack, and the return status is + If the ppooppdd command is successful, bash runs ddiirrss to show the + final contents of the directory stack, and the return status is 0. pprriinnttff [--vv _v_a_r] _f_o_r_m_a_t [_a_r_g_u_m_e_n_t_s] - Write the formatted _a_r_g_u_m_e_n_t_s to the standard output under the - control of the _f_o_r_m_a_t. The --vv option causes the output to be - assigned to the variable _v_a_r rather than being printed to the + Write the formatted _a_r_g_u_m_e_n_t_s to the standard output under the + control of the _f_o_r_m_a_t. The --vv option causes the output to be + assigned to the variable _v_a_r rather than being printed to the standard output. - The _f_o_r_m_a_t 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 _a_r_g_u_m_e_n_t. In + The _f_o_r_m_a_t 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 _a_r_g_u_m_e_n_t. In addition to the standard _p_r_i_n_t_f(3) format characters ccssnnddiioouuxxXXee-- EEffFFggGGaaAA, pprriinnttff interprets the following additional format spec- ifiers: %%bb causes pprriinnttff to expand backslash escape sequences in the corresponding _a_r_g_u_m_e_n_t in the same way as eecchhoo --ee. - %%qq causes pprriinnttff to output the corresponding _a_r_g_u_m_e_n_t in a - format that can be reused as shell input. %%qq and %%QQ use - the $$ quoting style if any characters in the argument - string require it, and backslash quoting otherwise. If - the format string uses the _p_r_i_n_t_f alternate form, these + %%qq causes pprriinnttff to output the corresponding _a_r_g_u_m_e_n_t in a + format that can be reused as shell input. %%qq and %%QQ use + the $$ quoting style if any characters in the argument + string require it, and backslash quoting otherwise. If + the format string uses the _p_r_i_n_t_f alternate form, these two formats quote the argument string using single quotes. - %%QQ like %%qq, but applies any supplied precision to the _a_r_g_u_- + %%QQ like %%qq, but applies any supplied precision to the _a_r_g_u_- _m_e_n_t before quoting it. %%((_d_a_t_e_f_m_t))TT - causes pprriinnttff to output the date-time string resulting - from using _d_a_t_e_f_m_t as a format string for _s_t_r_f_t_i_m_e(3). + causes pprriinnttff to output the date-time string resulting + from using _d_a_t_e_f_m_t as a format string for _s_t_r_f_t_i_m_e(3). The corresponding _a_r_g_u_m_e_n_t is an integer representing the - number of seconds since the epoch. Two special argument - values may be used: -1 represents the current time, and - -2 represents the time the shell was invoked. If no ar- + number of seconds since the epoch. Two special argument + values may be used: -1 represents the current time, and + -2 represents the time the shell was invoked. If no ar- gument is specified, conversion behaves as if -1 had been - given. This is an exception to the usual pprriinnttff behav- + given. This is an exception to the usual pprriinnttff behav- ior. The %b, %q, and %T format specifiers all use the field width and precision arguments from the format specification and write that - many bytes from (or use that wide a field for) the expanded ar- - gument, which usually contains more characters than the origi- + many bytes from (or use that wide a field for) the expanded ar- + gument, which usually contains more characters than the origi- nal. The %n format specifier accepts a corresponding argument that is treated as a shell variable name. - The %s and %c format specifiers accept an l (long) modifier, + The %s and %c format specifiers accept an l (long) modifier, which forces them to convert the argument string to a wide-char- acter string and apply any supplied field width and precision in terms of characters, not bytes. - Arguments to non-string format specifiers are treated as C con- + Arguments to non-string format specifiers are treated as C con- stants, except that a leading plus or minus sign is allowed, and - if the leading character is a single or double quote, the value + if the leading character is a single or double quote, the value is the ASCII value of the following character. - The _f_o_r_m_a_t is reused as necessary to consume all of the _a_r_g_u_- + The _f_o_r_m_a_t is reused as necessary to consume all of the _a_r_g_u_- _m_e_n_t_s. If the _f_o_r_m_a_t requires more _a_r_g_u_m_e_n_t_s 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 if an invalid option is sup- + 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 if an invalid option is sup- plied or a write or assignment error occurs. ppuusshhdd [--nn] [+_n] [-_n] ppuusshhdd [--nn] [_d_i_r] - 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, ppuusshhdd exchanges the top two ele- - ments of the directory stack. Arguments, if supplied, have the + 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, ppuusshhdd exchanges the top two ele- + ments of the directory stack. Arguments, if supplied, have the following meanings: - --nn Suppresses the normal change of directory when rotating - or adding directories to the stack, so that only the + --nn Suppresses the normal change of directory when rotating + or adding directories to the stack, so that only the stack is manipulated. - ++_n Rotates the stack so that the _nth directory (counting - from the left of the list shown by ddiirrss, starting with + ++_n Rotates the stack so that the _nth directory (counting + from the left of the list shown by ddiirrss, starting with zero) is at the top. - --_n Rotates the stack so that the _nth directory (counting - from the right of the list shown by ddiirrss, starting with + --_n Rotates the stack so that the _nth directory (counting + from the right of the list shown by ddiirrss, starting with zero) is at the top. _d_i_r Adds _d_i_r to the directory stack at the top After the stack has been modified, if the --nn option was not sup- - plied, ppuusshhdd uses the ccdd builtin to change to the directory at + plied, ppuusshhdd uses the ccdd builtin to change to the directory at the top of the stack. If the ccdd fails, ppuusshhdd returns a non-zero value. - Otherwise, if no arguments are supplied, ppuusshhdd returns 0 unless - the directory stack is empty. When rotating the directory - stack, ppuusshhdd returns 0 unless the directory stack is empty or a + Otherwise, if no arguments are supplied, ppuusshhdd returns 0 unless + the directory stack is empty. When rotating the directory + stack, ppuusshhdd returns 0 unless the directory stack is empty or a non-existent directory stack element is specified. - If the ppuusshhdd command is successful, bash runs ddiirrss to show the + If the ppuusshhdd command is successful, bash runs ddiirrss to show the final contents of the directory stack. ppwwdd [--LLPP] - Print the absolute pathname of the current working directory. + Print the absolute pathname of the current working directory. The pathname printed contains no symbolic links if the --PP option is supplied or the --oo pphhyyssiiccaall option to the sseett builtin command - is enabled. If the --LL option is used, the pathname printed may - contain symbolic links. The return status is 0 unless an error + is enabled. If the --LL 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 in- valid option is supplied. rreeaadd [--EEeerrss] [--aa _a_n_a_m_e] [--dd _d_e_l_i_m] [--ii _t_e_x_t] [--nn _n_c_h_a_r_s] [--NN _n_c_h_a_r_s] [--pp _p_r_o_m_p_t] [--tt _t_i_m_e_o_u_t] [--uu _f_d] [_n_a_m_e ...] - One line is read from the standard input, or from the file de- + One line is read from the standard input, or from the file de- scriptor _f_d supplied as an argument to the --uu option, split into - words as described in _b_a_s_h (1) under WWoorrdd SSpplliittttiinngg, and the + words as described in _b_a_s_h (1) under WWoorrdd SSpplliittttiinngg, and the first word is assigned to the first _n_a_m_e, the second word to the second _n_a_m_e, and so on. If there are more words than names, the remaining words and their intervening delimiters are assigned to - the last _n_a_m_e. If there are fewer words read from the input - stream than names, the remaining names are assigned empty val- - ues. The characters in IIFFSS are used to split the line into - words using the same rules the shell uses for expansion (de- - scribed in _b_a_s_h (1) under WWoorrdd SSpplliittttiinngg). The backslash char- + the last _n_a_m_e. If there are fewer words read from the input + stream than names, the remaining names are assigned empty val- + ues. The characters in IIFFSS are used to split the line into + words using the same rules the shell uses for expansion (de- + scribed in _b_a_s_h (1) under WWoorrdd SSpplliittttiinngg). The backslash char- acter (\\) may be used to remove any special meaning for the next character read and for line continuation. Options, if supplied, have the following meanings: --aa _a_n_a_m_e The words are assigned to sequential indices of the array variable _a_n_a_m_e, starting at 0. _a_n_a_m_e is unset before any - new values are assigned. Other _n_a_m_e arguments are ig- + new values are assigned. Other _n_a_m_e arguments are ig- nored. --dd _d_e_l_i_m The first character of _d_e_l_i_m is used to terminate the in- - put line, rather than newline. If _d_e_l_i_m is the empty - string, rreeaadd will terminate a line when it reads a NUL + put line, rather than newline. If _d_e_l_i_m is the empty + string, rreeaadd will terminate a line when it reads a NUL character. - --ee If the standard input is coming from a terminal, rreeaadd - uses rreeaaddlliinnee (see RREEAADDLLIINNEE in _b_a_s_h(1)) to obtain the - line. Readline uses the current (or default, if line - editing was not previously active) editing settings, but + --ee If the standard input is coming from a terminal, rreeaadd + uses rreeaaddlliinnee (see RREEAADDLLIINNEE in _b_a_s_h(1)) to obtain the + line. Readline uses the current (or default, if line + editing was not previously active) editing settings, but uses readline's default filename completion. - --EE If the standard input is coming from a terminal, rreeaadd - uses rreeaaddlliinnee (see RREEAADDLLIINNEE in _b_a_s_h(1)) to obtain the - line. Readline uses the current (or default, if line - editing was not previously active) editing settings, but - uses bash's default completion, including programmable + --EE If the standard input is coming from a terminal, rreeaadd + uses rreeaaddlliinnee (see RREEAADDLLIINNEE in _b_a_s_h(1)) to obtain the + line. Readline uses the current (or default, if line + editing was not previously active) editing settings, but + uses bash's default completion, including programmable completion. --ii _t_e_x_t - If rreeaaddlliinnee is being used to read the line, _t_e_x_t is + If rreeaaddlliinnee is being used to read the line, _t_e_x_t is placed into the editing buffer before editing begins. --nn _n_c_h_a_r_s - rreeaadd returns after reading _n_c_h_a_r_s characters rather than + rreeaadd returns after reading _n_c_h_a_r_s characters rather than waiting for a complete line of input, but honors a delim- - iter if fewer than _n_c_h_a_r_s characters are read before the + iter if fewer than _n_c_h_a_r_s characters are read before the delimiter. --NN _n_c_h_a_r_s - rreeaadd returns after reading exactly _n_c_h_a_r_s characters - rather than waiting for a complete line of input, unless - EOF is encountered or rreeaadd times out. Delimiter charac- - ters encountered in the input are not treated specially - and do not cause rreeaadd to return until _n_c_h_a_r_s characters - are read. The result is not split on the characters in - IIFFSS; the intent is that the variable is assigned exactly + rreeaadd returns after reading exactly _n_c_h_a_r_s characters + rather than waiting for a complete line of input, unless + EOF is encountered or rreeaadd times out. Delimiter charac- + ters encountered in the input are not treated specially + and do not cause rreeaadd to return until _n_c_h_a_r_s characters + are read. The result is not split on the characters in + IIFFSS; the intent is that the variable is assigned exactly the characters read (with the exception of backslash; see the --rr option below). --pp _p_r_o_m_p_t @@ -1110,137 +1113,137 @@ BBAASSHH BBUUIILLTTIINN CCOOMMMMAANNDDSS line, before attempting to read any input. The prompt is displayed only if input is coming from a terminal. --rr Backslash does not act as an escape character. The back- - slash is considered to be part of the line. In particu- - lar, a backslash-newline pair may not then be used as a + slash is considered to be part of the line. In particu- + lar, a backslash-newline pair may not then be used as a line continuation. --ss Silent mode. If input is coming from a terminal, charac- ters are not echoed. --tt _t_i_m_e_o_u_t - Cause rreeaadd to time out and return failure if a complete - line of input (or a specified number of characters) is - not read within _t_i_m_e_o_u_t seconds. _t_i_m_e_o_u_t may be a deci- - mal number with a fractional portion following the deci- - mal point. This option is only effective if rreeaadd is - reading input from a terminal, pipe, or other special - file; it has no effect when reading from regular files. + Cause rreeaadd to time out and return failure if a complete + line of input (or a specified number of characters) is + not read within _t_i_m_e_o_u_t seconds. _t_i_m_e_o_u_t may be a deci- + mal number with a fractional portion following the deci- + mal point. This option is only effective if rreeaadd is + reading input from a terminal, pipe, or other special + file; it has no effect when reading from regular files. If rreeaadd times out, rreeaadd saves any partial input read into - the specified variable _n_a_m_e. If _t_i_m_e_o_u_t is 0, rreeaadd re- - turns immediately, without trying to read any data. The - exit status is 0 if input is available on the specified - file descriptor, or the read will return EOF, non-zero - otherwise. The exit status is greater than 128 if the + the specified variable _n_a_m_e. If _t_i_m_e_o_u_t is 0, rreeaadd re- + turns immediately, without trying to read any data. The + exit status is 0 if input is available on the specified + file descriptor, or the read will return EOF, non-zero + otherwise. The exit status is greater than 128 if the timeout is exceeded. --uu _f_d Read input from file descriptor _f_d. - Other than the case where _d_e_l_i_m is the empty string, rreeaadd ig- + Other than the case where _d_e_l_i_m is the empty string, rreeaadd ig- nores any NUL characters in the input. - If no _n_a_m_e_s are supplied, the line read, without the ending de- - limiter but otherwise unmodified, is assigned to the variable - RREEPPLLYY. The exit status is zero, unless end-of-file is encoun- - tered, rreeaadd times out (in which case the status is greater than - 128), a variable assignment error (such as assigning to a read- + If no _n_a_m_e_s are supplied, the line read, without the ending de- + limiter but otherwise unmodified, is assigned to the variable + RREEPPLLYY. The exit status is zero, unless end-of-file is encoun- + tered, rreeaadd times out (in which case the status is greater than + 128), a variable assignment error (such as assigning to a read- only variable) occurs, or an invalid file descriptor is supplied as the argument to --uu. rreeaaddoonnllyy [--aaAAff] [--pp] [_n_a_m_e[=_w_o_r_d] ...] - The given _n_a_m_e_s are marked readonly; the values of these _n_a_m_e_s - may not be changed by subsequent assignment. If the --ff option - is supplied, the functions corresponding to the _n_a_m_e_s are so - marked. The --aa option restricts the variables to indexed ar- - rays; the --AA option restricts the variables to associative ar- + The given _n_a_m_e_s are marked readonly; the values of these _n_a_m_e_s + may not be changed by subsequent assignment. If the --ff option + is supplied, the functions corresponding to the _n_a_m_e_s are so + marked. The --aa option restricts the variables to indexed ar- + rays; the --AA option restricts the variables to associative ar- rays. If both options are supplied, --AA takes precedence. If no - _n_a_m_e arguments are given, or if the --pp option is supplied, a + _n_a_m_e arguments are given, or if the --pp option is supplied, a list of all readonly names is printed. The other options may be - used to restrict the output to a subset of the set of readonly - names. The --pp option causes output to be displayed in a format - that may be reused as input. If a variable name is followed by - =_w_o_r_d, the value of the variable is set to _w_o_r_d. The return - status is 0 unless an invalid option is encountered, one of the + used to restrict the output to a subset of the set of readonly + names. The --pp option causes output to be displayed in a format + that may be reused as input. If a variable name is followed by + =_w_o_r_d, the value of the variable is set to _w_o_r_d. The return + status is 0 unless an invalid option is encountered, one of the _n_a_m_e_s is not a valid shell variable name, or --ff is supplied with a _n_a_m_e that is not a function. rreettuurrnn [_n] - Causes a function to stop executing and return the value speci- - fied by _n to its caller. If _n is omitted, the return status is - that of the last command executed in the function body. If rree-- + Causes a function to stop executing and return the value speci- + fied by _n to its caller. If _n is omitted, the return status is + that of the last command executed in the function body. If rree-- ttuurrnn is executed by a trap handler, the last command used to de- - termine the status is the last command executed before the trap - handler. If rreettuurrnn is executed during a DDEEBBUUGG trap, the last - command used to determine the status is the last command exe- - cuted by the trap handler before rreettuurrnn was invoked. If rreettuurrnn - is used outside a function, but during execution of a script by - the .. (ssoouurrccee) command, it causes the shell to stop executing - that script and return either _n or the exit status of the last - command executed within the script as the exit status of the + termine the status is the last command executed before the trap + handler. If rreettuurrnn is executed during a DDEEBBUUGG trap, the last + command used to determine the status is the last command exe- + cuted by the trap handler before rreettuurrnn was invoked. If rreettuurrnn + is used outside a function, but during execution of a script by + the .. (ssoouurrccee) command, it causes the shell to stop executing + that script and return either _n or the exit status of the last + command executed within the script as the exit status of the script. If _n is supplied, the return value is its least signif- - icant 8 bits. The return status is non-zero if rreettuurrnn is sup- - plied a non-numeric argument, or is used outside a function and - not during execution of a script by .. or ssoouurrccee. Any command + icant 8 bits. The return status is non-zero if rreettuurrnn is sup- + plied a non-numeric argument, or is used outside a function and + not during execution of a script by .. or ssoouurrccee. Any command associated with the RREETTUURRNN trap is executed before execution re- sumes after the function or script. sseett [--aabbeeffhhkkmmnnppttuuvvxxBBCCEEHHPPTT] [--oo _o_p_t_i_o_n_-_n_a_m_e] [----] [--] [_a_r_g ...] sseett [++aabbeeffhhkkmmnnppttuuvvxxBBCCEEHHPPTT] [++oo _o_p_t_i_o_n_-_n_a_m_e] [----] [--] [_a_r_g ...] sseett --oo - sseett ++oo Without options, display the name and value of each shell vari- - able in a format that can be reused as input for setting or re- + sseett ++oo Without options, display the name and value of each shell vari- + able in a format that can be reused as input for setting or re- setting the currently-set variables. Read-only variables cannot - be reset. In _p_o_s_i_x _m_o_d_e, only shell variables are listed. The - output is sorted according to the current locale. When options - are specified, they set or unset shell attributes. Any argu- - ments remaining after option processing are treated as values + be reset. In _p_o_s_i_x _m_o_d_e, only shell variables are listed. The + output is sorted according to the current locale. When options + are specified, they set or unset shell attributes. Any argu- + ments remaining after option processing are treated as values for the positional parameters and are assigned, in order, to $$11, - $$22, ..., $$_n. Options, if specified, have the following mean- + $$22, ..., $$_n. Options, if specified, have the following mean- ings: --aa Each variable or function that is created or modified is - given the export attribute and marked for export to the + given the export attribute and marked for export to the environment of subsequent commands. - --bb Report the status of terminated background jobs immedi- + --bb Report the status of terminated background jobs immedi- ately, rather than before the next primary prompt. This is effective only when job control is enabled. - --ee Exit immediately if a _p_i_p_e_l_i_n_e (which may consist of a - single _s_i_m_p_l_e _c_o_m_m_a_n_d), a _l_i_s_t, or a _c_o_m_p_o_u_n_d _c_o_m_m_a_n_d - (see SSHHEELLLL GGRRAAMMMMAARR in _b_a_s_h(1)), exits with a non-zero - status. The shell does not exit if the command that - fails is part of the command list immediately following + --ee Exit immediately if a _p_i_p_e_l_i_n_e (which may consist of a + single _s_i_m_p_l_e _c_o_m_m_a_n_d), a _l_i_s_t, or a _c_o_m_p_o_u_n_d _c_o_m_m_a_n_d + (see SSHHEELLLL GGRRAAMMMMAARR in _b_a_s_h(1)), 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 wwhhiillee or uunnttiill keyword, part of the test following the - iiff or eelliiff reserved words, part of any command executed - in a &&&& or |||| list except the command following the fi- + iiff or eelliiff reserved words, part of any command executed + in a &&&& or |||| list except the command following the fi- nal &&&& or ||||, any command in a pipeline but the last, or - if the command's return value is being inverted with !!. - If a compound command other than a subshell returns a - non-zero status because a command failed while --ee was - being ignored, the shell does not exit. A trap on EERRRR, + if the command's return value is being inverted with !!. + If a compound command other than a subshell returns a + non-zero status because a command failed while --ee was + being ignored, the shell does not exit. A trap on EERRRR, if set, is executed before the shell exits. This option applies to the shell environment and each subshell envi- ronment separately (see CCOOMMMMAANNDD EEXXEECCUUTTIIOONN EENNVVIIRROONNMMEENNTT in _b_a_s_h(1)), and may cause subshells to exit before execut- ing all the commands in the subshell. - If a compound command or shell function executes in a - context where --ee is being ignored, none of the commands - executed within the compound command or function body - will be affected by the --ee setting, even if --ee is set - and a command returns a failure status. If a compound - command or shell function sets --ee while executing in a - context where --ee is ignored, that setting will not have - any effect until the compound command or the command + If a compound command or shell function executes in a + context where --ee is being ignored, none of the commands + executed within the compound command or function body + will be affected by the --ee setting, even if --ee is set + and a command returns a failure status. If a compound + command or shell function sets --ee while executing in a + context where --ee is ignored, that setting will not have + any effect until the compound command or the command containing the function call completes. --ff Disable pathname expansion. - --hh Remember the location of commands as they are looked up + --hh Remember the location of commands as they are looked up for execution. This is enabled by default. - --kk All arguments in the form of assignment statements are - placed in the environment for a command, not just those + --kk All arguments in the form of assignment statements are + placed in the environment for a command, not just those that precede the command name. - --mm Monitor mode. Job control is enabled. This option is - on by default for interactive shells on systems that - support it (see JJOOBB CCOONNTTRROOLL in _b_a_s_h(1)). All processes - run in a separate process group. When a background job - completes, the shell prints a line containing its exit + --mm Monitor mode. Job control is enabled. This option is + on by default for interactive shells on systems that + support it (see JJOOBB CCOONNTTRROOLL in _b_a_s_h(1)). All processes + run in a separate process group. When a background job + completes, the shell prints a line containing its exit status. --nn Read commands but do not execute them. This may be used - to check a shell script for syntax errors. This is ig- + to check a shell script for syntax errors. This is ig- nored by interactive shells. --oo _o_p_t_i_o_n_-_n_a_m_e The _o_p_t_i_o_n_-_n_a_m_e can be one of the following: @@ -1248,10 +1251,10 @@ BBAASSHH BBUUIILLTTIINN CCOOMMMMAANNDDSS Same as --aa. bbrraacceeeexxppaanndd Same as --BB. - eemmaaccss Use an emacs-style command line editing inter- + eemmaaccss Use an emacs-style command line editing inter- face. This is enabled by default when the shell is interactive, unless the shell is started with - the ----nnooeeddiittiinngg option. This also affects the + the ----nnooeeddiittiinngg option. This also affects the editing interface used for rreeaadd --ee. eerrrreexxiitt Same as --ee. eerrrrttrraaccee @@ -1261,11 +1264,11 @@ BBAASSHH BBUUIILLTTIINN CCOOMMMMAANNDDSS hhaasshhaallll Same as --hh. hhiisstteexxppaanndd Same as --HH. - hhiissttoorryy Enable command history, as described in _b_a_s_h(1) - under HHIISSTTOORRYY. This option is on by default in + hhiissttoorryy Enable command history, as described in _b_a_s_h(1) + under HHIISSTTOORRYY. This option is on by default in interactive shells. iiggnnoorreeeeooff - The effect is as if the shell command had been + The effect is as if the shell command had been executed (see SShheellll VVaarriiaabblleess in _b_a_s_h(1)). kkeeyywwoorrdd Same as --kk. mmoonniittoorr Same as --mm. @@ -1280,178 +1283,178 @@ BBAASSHH BBUUIILLTTIINN CCOOMMMMAANNDDSS pphhyyssiiccaall Same as --PP. ppiippeeffaaiill - If set, the return value of a pipeline is the - value of the last (rightmost) command to exit - with a non-zero status, or zero if all commands - in the pipeline exit successfully. This option + If set, the return value of a pipeline is the + value of the last (rightmost) command to exit + with a non-zero status, or zero if all commands + in the pipeline exit successfully. This option is disabled by default. - ppoossiixx Change the behavior of bbaasshh where the default - operation differs from the POSIX standard to - match the standard (_p_o_s_i_x _m_o_d_e). See SSEEEE AALLSSOO - in _b_a_s_h(1) for a reference to a document that + ppoossiixx Change the behavior of bbaasshh where the default + operation differs from the POSIX standard to + match the standard (_p_o_s_i_x _m_o_d_e). See SSEEEE AALLSSOO + in _b_a_s_h(1) for a reference to a document that details how posix mode affects bash's behavior. pprriivviilleeggeedd Same as --pp. vveerrbboossee Same as --vv. - vvii Use a vi-style command line editing interface. + vvii Use a vi-style command line editing interface. This also affects the editing interface used for rreeaadd --ee. xxttrraaccee Same as --xx. - If --oo is supplied with no _o_p_t_i_o_n_-_n_a_m_e, sseett prints the - current shell option settings. If ++oo is supplied with - no _o_p_t_i_o_n_-_n_a_m_e, sseett prints a series of sseett commands to - recreate the current option settings on the standard + If --oo is supplied with no _o_p_t_i_o_n_-_n_a_m_e, sseett prints the + current shell option settings. If ++oo is supplied with + no _o_p_t_i_o_n_-_n_a_m_e, sseett prints a series of sseett commands to + recreate the current option settings on the standard output. - --pp Turn on _p_r_i_v_i_l_e_g_e_d mode. In this mode, the $$EENNVV and - $$BBAASSHH__EENNVV files are not processed, shell functions are - not inherited from the environment, and the SSHHEELLLLOOPPTTSS, - BBAASSHHOOPPTTSS, CCDDPPAATTHH, and GGLLOOBBIIGGNNOORREE variables, if they ap- - pear in the environment, are ignored. If the shell is - started with the effective user (group) id not equal to - the real user (group) id, and the --pp option is not sup- + --pp Turn on _p_r_i_v_i_l_e_g_e_d mode. In this mode, the $$EENNVV and + $$BBAASSHH__EENNVV files are not processed, shell functions are + not inherited from the environment, and the SSHHEELLLLOOPPTTSS, + BBAASSHHOOPPTTSS, CCDDPPAATTHH, and GGLLOOBBIIGGNNOORREE variables, if they ap- + pear in the environment, are ignored. If the shell is + started with the effective user (group) id not equal to + the real user (group) id, and the --pp option is not sup- plied, these actions are taken and the effective user id - is set to the real user id. If the --pp option is sup- - plied at startup, the effective user id is not reset. - Turning this option off causes the effective user and + is set to the real user id. If the --pp option is sup- + plied 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. --rr Enable restricted shell mode. This option cannot be un- set once it has been set. --tt Exit after reading and executing one command. --uu Treat unset variables and parameters other than the spe- - cial parameters and or array variables subscripted with - or as an error when performing parameter expansion. If - expansion is attempted on an unset variable or parame- - ter, the shell prints an error message, and, if not in- + cial parameters and or array variables subscripted with + or as an error when performing parameter expansion. If + expansion is attempted on an unset variable or parame- + ter, the shell prints an error message, and, if not in- teractive, exits with a non-zero status. --vv Print shell input lines as they are read. - --xx After expanding each _s_i_m_p_l_e _c_o_m_m_a_n_d, ffoorr command, ccaassee + --xx After expanding each _s_i_m_p_l_e _c_o_m_m_a_n_d, ffoorr command, ccaassee command, sseelleecctt command, or arithmetic ffoorr command, dis- - play the expanded value of PPSS44, followed by the command - and its expanded arguments or associated word list, to + play the expanded value of PPSS44, followed by the command + and its expanded arguments or associated word list, to standard error. - --BB The shell performs brace expansion (see BBrraaccee EExxppaannssiioonn + --BB The shell performs brace expansion (see BBrraaccee EExxppaannssiioonn in _b_a_s_h(1)). This is on by default. - --CC If set, bbaasshh does not overwrite an existing file with - the >>, >>&&, and <<>> redirection operators. This may be + --CC If set, bbaasshh does not overwrite an existing file with + the >>, >>&&, and <<>> redirection operators. This may be overridden when creating output files by using the redi- rection operator >>|| instead of >>. --EE If set, any trap on EERRRR is inherited by shell functions, - command substitutions, and commands executed in a sub- - shell environment. The EERRRR trap is normally not inher- + command substitutions, and commands executed in a sub- + shell environment. The EERRRR trap is normally not inher- ited in such cases. --HH Enable !! style history substitution. This option is on by default when the shell is interactive. - --PP If set, the shell does not resolve symbolic links when - executing commands such as ccdd that change the current + --PP If set, the shell does not resolve symbolic links when + executing commands such as ccdd that change the current working directory. It uses the physical directory structure instead. By default, bbaasshh follows the logical - chain of directories when performing commands which + chain of directories when performing commands which change the current directory. - --TT If set, any traps on DDEEBBUUGG and RREETTUURRNN are inherited by + --TT If set, any traps on DDEEBBUUGG and RREETTUURRNN are inherited by shell functions, command substitutions, and commands ex- - ecuted in a subshell environment. The DDEEBBUUGG and RREETTUURRNN + ecuted in a subshell environment. The DDEEBBUUGG and RREETTUURRNN traps are normally not inherited in such cases. - ---- If no arguments follow this option, then the positional + ---- If no arguments follow this option, then the positional parameters are unset. Otherwise, the positional parame- - ters are set to the _a_r_gs, even if some of them begin + ters are set to the _a_r_gs, even if some of them begin with a --. - -- Signal the end of options, cause all remaining _a_r_gs to + -- Signal the end of options, cause all remaining _a_r_gs to be assigned to the positional parameters. The --xx and --vv options are turned off. If there are no _a_r_gs, the posi- tional parameters remain unchanged. - The options are off by default unless otherwise noted. Using + - rather than - causes these options to be turned off. The op- + The options are off by default unless otherwise noted. Using + + rather than - causes these options to be turned off. The op- tions can also be specified as arguments to an invocation of the - shell. The current set of options may be found in $$--. The re- - turn status is always true unless an invalid option is encoun- + shell. The current set of options may be found in $$--. The re- + turn status is always true unless an invalid option is encoun- tered. sshhiifftt [_n] - The positional parameters from _n+1 ... are renamed to $$11 ........ - Parameters represented by the numbers $$## down to $$##-_n+1 are un- - set. _n must be a non-negative number less than or equal to $$##. - If _n is 0, no parameters are changed. If _n is not given, it is - assumed to be 1. If _n is greater than $$##, the positional para- - meters are not changed. The return status is greater than zero + The positional parameters from _n+1 ... are renamed to $$11 ........ + Parameters represented by the numbers $$## down to $$##-_n+1 are un- + set. _n must be a non-negative number less than or equal to $$##. + If _n is 0, no parameters are changed. If _n is not given, it is + assumed to be 1. If _n is greater than $$##, the positional para- + meters are not changed. The return status is greater than zero if _n is greater than $$## or less than zero; otherwise 0. sshhoopptt [--ppqqssuu] [--oo] [_o_p_t_n_a_m_e ...] - Toggle the values of settings controlling optional shell behav- - ior. The settings can be either those listed below, or, if the + Toggle the values of settings controlling optional shell behav- + ior. The settings can be either those listed below, or, if the --oo option is used, those available with the --oo option to the sseett builtin command. With no options, or with the --pp option, a list - of all settable options is displayed, with an indication of + of all settable options is displayed, with an indication of whether or not each is set; if _o_p_t_n_a_m_e_s are supplied, the output - is restricted to those options. The --pp option causes output to - be displayed in a form that may be reused as input. Other op- + is restricted to those options. The --pp option causes output to + be displayed in a form that may be reused as input. Other op- tions have the following meanings: --ss Enable (set) each _o_p_t_n_a_m_e. --uu Disable (unset) each _o_p_t_n_a_m_e. - --qq Suppresses normal output (quiet mode); the return status + --qq Suppresses normal output (quiet mode); the return status indicates whether the _o_p_t_n_a_m_e is set or unset. If multi- - ple _o_p_t_n_a_m_e arguments are given with --qq, the return sta- - tus is zero if all _o_p_t_n_a_m_e_s are enabled; non-zero other- + ple _o_p_t_n_a_m_e arguments are given with --qq, the return sta- + tus is zero if all _o_p_t_n_a_m_e_s are enabled; non-zero other- wise. - --oo Restricts the values of _o_p_t_n_a_m_e to be those defined for + --oo Restricts the values of _o_p_t_n_a_m_e to be those defined for the --oo option to the sseett builtin. - If either --ss or --uu is used with no _o_p_t_n_a_m_e arguments, sshhoopptt - shows only those options which are set or unset, respectively. - Unless otherwise noted, the sshhoopptt options are disabled (unset) + If either --ss or --uu is used with no _o_p_t_n_a_m_e arguments, sshhoopptt + shows only those options which are set or unset, respectively. + Unless otherwise noted, the sshhoopptt options are disabled (unset) by default. - The return status when listing options is zero if all _o_p_t_n_a_m_e_s - are enabled, non-zero otherwise. When setting or unsetting op- - tions, the return status is zero unless an _o_p_t_n_a_m_e is not a + The return status when listing options is zero if all _o_p_t_n_a_m_e_s + are enabled, non-zero otherwise. When setting or unsetting op- + tions, the return status is zero unless an _o_p_t_n_a_m_e is not a valid shell option. The list of sshhoopptt options is: aarrrraayy__eexxppaanndd__oonnccee - If set, the shell suppresses multiple evaluation of as- + If set, the shell suppresses multiple evaluation of as- sociative and indexed array subscripts during arithmetic expression evaluation, while executing builtins that can - perform variable assignments, and while executing + perform variable assignments, and while executing builtins that perform array dereferencing. aassssoocc__eexxppaanndd__oonnccee Deprecated; a synonym for aarrrraayy__eexxppaanndd__oonnccee. - aauuttooccdd If set, a command name that is the name of a directory - is executed as if it were the argument to the ccdd com- + aauuttooccdd If set, a command name that is the name of a directory + is executed as if it were the argument to the ccdd com- mand. This option is only used by interactive shells. ccddaabbllee__vvaarrss - If set, an argument to the ccdd builtin command that is - not a directory is assumed to be the name of a variable + If set, an argument to the ccdd builtin command that is + not a directory is assumed to be the name of a variable whose value is the directory to change to. ccddssppeellll If set, minor errors in the spelling of a directory com- - ponent in a ccdd command will be corrected. The errors + ponent in a ccdd command will be corrected. The errors checked for are transposed characters, a missing charac- - ter, and one character too many. If a correction is - found, the corrected filename is printed, and the com- - mand proceeds. This option is only used by interactive + ter, and one character too many. If a correction is + found, the corrected filename is printed, and the com- + mand proceeds. This option is only used by interactive shells. cchheecckkhhaasshh If set, bbaasshh checks that a command found in the hash ta- - ble exists before trying to execute it. If a hashed - command no longer exists, a normal path search is per- + ble exists before trying to execute it. If a hashed + command no longer exists, a normal path search is per- formed. cchheecckkjjoobbss If set, bbaasshh lists the status of any stopped and running - jobs before exiting an interactive shell. If any jobs + jobs before exiting an interactive shell. If any jobs are running, this causes the exit to be deferred until a - second exit is attempted without an intervening command - (see JJOOBB CCOONNTTRROOLL in _b_a_s_h(1)). The shell always post- + second exit is attempted without an intervening command + (see JJOOBB CCOONNTTRROOLL in _b_a_s_h(1)). The shell always post- pones exiting if any jobs are stopped. cchheecckkwwiinnssiizzee - If set, bbaasshh checks the window size after each external - (non-builtin) command and, if necessary, updates the - values of LLIINNEESS and CCOOLLUUMMNNSS. This option is enabled by + If set, bbaasshh checks the window size after each external + (non-builtin) command and, if necessary, updates the + values of LLIINNEESS and CCOOLLUUMMNNSS. This option is enabled by default. - ccmmddhhiisstt If set, bbaasshh attempts to save all lines of a multiple- - line command in the same history entry. This allows - easy re-editing of multi-line commands. This option is - enabled by default, but only has an effect if command - history is enabled, as described in _b_a_s_h(1) under HHIISS-- + ccmmddhhiisstt If set, bbaasshh attempts to save all lines of a multiple- + line command in the same history entry. This allows + easy re-editing of multi-line commands. This option is + enabled by default, but only has an effect if command + history is enabled, as described in _b_a_s_h(1) under HHIISS-- TTOORRYY. ccoommppaatt3311 ccoommppaatt3322 @@ -1461,121 +1464,121 @@ BBAASSHH BBUUIILLTTIINN CCOOMMMMAANNDDSS ccoommppaatt4433 ccoommppaatt4444 ccoommppaatt5500 - These control aspects of the shell's compatibility mode + These control aspects of the shell's compatibility mode (see SSHHEELLLL CCOOMMPPAATTIIBBIILLIITTYY MMOODDEE in _b_a_s_h(1)). ccoommpplleettee__ffuullllqquuoottee - If set, bbaasshh quotes all shell metacharacters in file- - names and directory names when performing completion. + If set, bbaasshh quotes all shell metacharacters in file- + names and directory names when performing completion. If not set, bbaasshh removes metacharacters such as the dol- - lar sign from the set of characters that will be quoted - in completed filenames when these metacharacters appear - in shell variable references in words to be completed. - This means that dollar signs in variable names that ex- - pand to directories will not be quoted; however, any - dollar signs appearing in filenames will not be quoted, - either. This is active only when bash is using back- - slashes to quote completed filenames. This variable is - set by default, which is the default bash behavior in + lar sign from the set of characters that will be quoted + in completed filenames when these metacharacters appear + in shell variable references in words to be completed. + This means that dollar signs in variable names that ex- + pand to directories will not be quoted; however, any + dollar signs appearing in filenames will not be quoted, + either. This is active only when bash is using back- + slashes to quote completed filenames. This variable is + set by default, which is the default bash behavior in versions through 4.2. ddiirreexxppaanndd - If set, bbaasshh replaces directory names with the results - of word expansion when performing filename completion. + If set, bbaasshh replaces directory names with the results + of word expansion when performing filename completion. This changes the contents of the readline editing - buffer. If not set, bbaasshh attempts to preserve what the + buffer. If not set, bbaasshh attempts to preserve what the user typed. ddiirrssppeellll - If set, bbaasshh attempts spelling correction on directory - names during word completion if the directory name ini- + If set, bbaasshh attempts spelling correction on directory + names during word completion if the directory name ini- tially supplied does not exist. - ddoottgglloobb If set, bbaasshh includes filenames beginning with a in the - results of pathname expansion. The filenames and must + ddoottgglloobb If set, bbaasshh includes filenames beginning with a in the + results of pathname expansion. The filenames and must always be matched explicitly, even if ddoottgglloobb is set. eexxeeccffaaiill If set, a non-interactive shell will not exit if it can- - not execute the file specified as an argument to the - eexxeecc builtin command. An interactive shell does not + not execute the file specified as an argument to the + eexxeecc builtin command. An interactive shell does not exit if eexxeecc fails. eexxppaanndd__aalliiaasseess If set, aliases are expanded as described in _b_a_s_h(1) un- - der AALLIIAASSEESS. This option is enabled by default for in- + der AALLIIAASSEESS. This option is enabled by default for in- teractive shells. eexxttddeebbuugg - If set at shell invocation, or in a shell startup file, + If set at shell invocation, or in a shell startup file, arrange to execute the debugger profile before the shell - starts, identical to the ----ddeebbuuggggeerr option. If set af- - ter invocation, behavior intended for use by debuggers + starts, identical to the ----ddeebbuuggggeerr option. If set af- + ter invocation, behavior intended for use by debuggers is enabled: 11.. The --FF option to the ddeeccllaarree builtin displays the source file name and line number corresponding to each function name supplied as an argument. - 22.. If the command run by the DDEEBBUUGG trap returns a - non-zero value, the next command is skipped and + 22.. If the command run by the DDEEBBUUGG trap returns a + non-zero value, the next command is skipped and not executed. - 33.. If the command run by the DDEEBBUUGG trap returns a - value of 2, and the shell is executing in a sub- - routine (a shell function or a shell script exe- - cuted by the .. or ssoouurrccee builtins), the shell + 33.. If the command run by the DDEEBBUUGG trap returns a + value of 2, and the shell is executing in a sub- + routine (a shell function or a shell script exe- + cuted by the .. or ssoouurrccee builtins), the shell simulates a call to rreettuurrnn. - 44.. BBAASSHH__AARRGGCC and BBAASSHH__AARRGGVV are updated as described + 44.. BBAASSHH__AARRGGCC and BBAASSHH__AARRGGVV are updated as described in their descriptions in _b_a_s_h(1)). - 55.. Function tracing is enabled: command substitu- + 55.. Function tracing is enabled: command substitu- tion, shell functions, and subshells invoked with (( _c_o_m_m_a_n_d )) inherit the DDEEBBUUGG and RREETTUURRNN traps. - 66.. Error tracing is enabled: command substitution, - shell functions, and subshells invoked with (( + 66.. Error tracing is enabled: command substitution, + shell functions, and subshells invoked with (( _c_o_m_m_a_n_d )) inherit the EERRRR trap. eexxttgglloobb If set, the extended pattern matching features described in _b_a_s_h(1) under PPaatthhnnaammee EExxppaannssiioonn are enabled. eexxttqquuoottee - If set, $$_s_t_r_i_n_g and $$_s_t_r_i_n_g quoting is performed within + If set, $$_s_t_r_i_n_g and $$_s_t_r_i_n_g quoting is performed within $${{_p_a_r_a_m_e_t_e_r}} expansions enclosed in double quotes. This option is enabled by default. ffaaiillgglloobb - If set, patterns which fail to match filenames during + If set, patterns which fail to match filenames during pathname expansion result in an expansion error. ffoorrccee__ffiiggnnoorree - If set, the suffixes specified by the FFIIGGNNOORREE shell - variable cause words to be ignored when performing word + If set, the suffixes specified by the FFIIGGNNOORREE shell + variable cause words to be ignored when performing word completion even if the ignored words are the only possi- - ble completions. See SSHHEELLLL VVAARRIIAABBLLEESS in _b_a_s_h(1) for a - description of FFIIGGNNOORREE. This option is enabled by de- + ble completions. See SSHHEELLLL VVAARRIIAABBLLEESS in _b_a_s_h(1) for a + description of FFIIGGNNOORREE. This option is enabled by de- fault. gglloobbaasscciiiirraannggeess - If set, range expressions used in pattern matching - bracket expressions (see PPaatttteerrnn MMaattcchhiinngg in _b_a_s_h(1)) + If set, range expressions used in pattern matching + bracket expressions (see PPaatttteerrnn MMaattcchhiinngg in _b_a_s_h(1)) behave as if in the traditional C locale when performing - comparisons. That is, the current locale's collating - sequence is not taken into account, so bb will not col- - late between AA and BB, and upper-case and lower-case + comparisons. That is, the current locale's collating + sequence is not taken into account, so bb will not col- + late between AA and BB, and upper-case and lower-case ASCII characters will collate together. gglloobbsskkiippddoottss - If set, pathname expansion will never match the file- - names and even if the pattern begins with a This option + If set, pathname expansion will never match the file- + names and even if the pattern begins with a This option is enabled by default. gglloobbssttaarr If set, the pattern **** used in a pathname expansion con- - text will match all files and zero or more directories - and subdirectories. If the pattern is followed by a //, + text will match all files and zero or more directories + and subdirectories. If the pattern is followed by a //, only directories and subdirectories match. ggnnuu__eerrrrffmmtt @@ -1583,25 +1586,25 @@ BBAASSHH BBUUIILLTTIINN CCOOMMMMAANNDDSS GNU error message format. hhiissttaappppeenndd - If set, the history list is appended to the file named + If set, the history list is appended to the file named by the value of the HHIISSTTFFIILLEE variable when the shell ex- its, rather than overwriting the file. hhiissttrreeeeddiitt - If set, and rreeaaddlliinnee is being used, a user is given the + If set, and rreeaaddlliinnee is being used, a user is given the opportunity to re-edit a failed history substitution. hhiissttvveerriiffyy - If set, and rreeaaddlliinnee is being used, the results of his- - tory substitution are not immediately passed to the - shell parser. Instead, the resulting line is loaded + If set, and rreeaaddlliinnee is being used, the results of his- + tory substitution are not immediately passed to the + shell parser. Instead, the resulting line is loaded into the rreeaaddlliinnee editing buffer, allowing further modi- fication. hhoossttccoommpplleettee If set, and rreeaaddlliinnee is being used, bbaasshh will attempt to - perform hostname completion when a word containing a @@ - is being completed (see CCoommpplleettiinngg under RREEAADDLLIINNEE in + perform hostname completion when a word containing a @@ + is being completed (see CCoommpplleettiinngg under RREEAADDLLIINNEE in _b_a_s_h(1)). This is enabled by default. hhuuppoonneexxiitt @@ -1609,23 +1612,23 @@ BBAASSHH BBUUIILLTTIINN CCOOMMMMAANNDDSS active login shell exits. iinnhheerriitt__eerrrreexxiitt - If set, command substitution inherits the value of the - eerrrreexxiitt option, instead of unsetting it in the subshell - environment. This option is enabled when _p_o_s_i_x _m_o_d_e is + If set, command substitution inherits the value of the + eerrrreexxiitt option, instead of unsetting it in the subshell + environment. This option is enabled when _p_o_s_i_x _m_o_d_e is enabled. iinntteerraaccttiivvee__ccoommmmeennttss If set, allow a word beginning with ## to cause that word - and all remaining characters on that line to be ignored + and all remaining characters on that line to be ignored in an interactive shell (see CCOOMMMMEENNTTSS in _b_a_s_h(1)). This option is enabled by default. llaassttppiippee - If set, and job control is not active, the shell runs + If set, and job control is not active, the shell runs the last command of a pipeline not executed in the back- ground in the current shell environment. - lliitthhiisstt If set, and the ccmmddhhiisstt option is enabled, multi-line + lliitthhiisstt If set, and the ccmmddhhiisstt option is enabled, multi-line commands are saved to the history with embedded newlines rather than using semicolon separators where possible. @@ -1636,89 +1639,90 @@ BBAASSHH BBUUIILLTTIINN CCOOMMMMAANNDDSS tribute is not inherited. llooccaallvvaarr__uunnsseett - If set, calling uunnsseett on local variables in previous - function scopes marks them so subsequent lookups find - them unset until that function returns. This is identi- - cal to the behavior of unsetting local variables at the + If set, calling uunnsseett on local variables in previous + function scopes marks them so subsequent lookups find + them unset until that function returns. This is identi- + cal to the behavior of unsetting local variables at the current function scope. llooggiinn__sshheellll - The shell sets this option if it is started as a login + The shell sets this option if it is started as a login shell (see IINNVVOOCCAATTIIOONN in _b_a_s_h(1)). The value may not be changed. mmaaiillwwaarrnn - If set, and a file that bbaasshh is checking for mail has - been accessed since the last time it was checked, bbaasshh + If set, and a file that bbaasshh is checking for mail has + been accessed since the last time it was checked, bbaasshh displays the message nnoo__eemmppttyy__ccmmdd__ccoommpplleettiioonn - If set, and rreeaaddlliinnee is being used, bbaasshh will not at- - tempt to search the PPAATTHH for possible completions when + If set, and rreeaaddlliinnee is being used, bbaasshh will not at- + tempt to search the PPAATTHH for possible completions when completion is attempted on an empty line. nnooccaasseegglloobb - If set, bbaasshh matches filenames in a case-insensitive + If set, bbaasshh matches filenames in a case-insensitive fashion when performing pathname expansion (see PPaatthhnnaammee EExxppaannssiioonn in _b_a_s_h(1)). nnooccaasseemmaattcchh - If set, bbaasshh matches patterns in a case-insensitive + If set, bbaasshh matches patterns in a case-insensitive fashion when performing matching while executing ccaassee or [[[[ conditional commands, when performing pattern substi- - tution word expansions, or when filtering possible com- + tution word expansions, or when filtering possible com- pletions as part of programmable completion. nnooeexxppaanndd__ttrraannssllaattiioonn - If set, bbaasshh encloses the translated results of $$... - quoting in single quotes instead of double quotes. If + If set, bbaasshh encloses the translated results of $$... + quoting in single quotes instead of double quotes. If the string is not translated, this has no effect. nnuullllgglloobb If set, pathname expansion patterns which match no files - (see PPaatthhnnaammee EExxppaannssiioonn in _b_a_s_h(1)) expand to nothing + (see PPaatthhnnaammee EExxppaannssiioonn in _b_a_s_h(1)) expand to nothing and are removed, rather than expanding to themselves. ppaattssuubb__rreeppllaacceemmeenntt If set, bbaasshh expands occurrences of && in the replacement - string of pattern substitution to the text matched by - the pattern, as described under PPaarraammeetteerr EExxppaannssiioonn in + string of pattern substitution to the text matched by + the pattern, as described under PPaarraammeetteerr EExxppaannssiioonn in _b_a_s_h(1). This option is enabled by default. pprrooggccoommpp If set, the programmable completion facilities (see PPrroo-- - ggrraammmmaabbllee CCoommpplleettiioonn in _b_a_s_h(1)) are enabled. This op- + ggrraammmmaabbllee CCoommpplleettiioonn in _b_a_s_h(1)) are enabled. This op- tion is enabled by default. pprrooggccoommpp__aalliiaass - If set, and programmable completion is enabled, bbaasshh - treats a command name that doesn't have any completions - as a possible alias and attempts alias expansion. If it - has an alias, bbaasshh attempts programmable completion us- + If set, and programmable completion is enabled, bbaasshh + treats a command name that doesn't have any completions + as a possible alias and attempts alias expansion. If it + has an alias, bbaasshh attempts programmable completion us- ing the command word resulting from the expanded alias. pprroommppttvvaarrss If set, prompt strings undergo parameter expansion, com- - mand substitution, arithmetic expansion, and quote re- - moval after being expanded as described in PPRROOMMPPTTIINNGG in + mand substitution, arithmetic expansion, and quote re- + moval after being expanded as described in PPRROOMMPPTTIINNGG in _b_a_s_h(1). This option is enabled by default. rreessttrriicctteedd__sshheellll - The shell sets this option if it is started in re- - stricted mode (see RREESSTTRRIICCTTEEDD SSHHEELLLL in _b_a_s_h(1)). The - value may not be changed. This is not reset when the - startup files are executed, allowing the startup files + The shell sets this option if it is started in re- + stricted mode (see RREESSTTRRIICCTTEEDD SSHHEELLLL in _b_a_s_h(1)). 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. sshhiifftt__vveerrbboossee - If set, the sshhiifftt builtin prints an error message when + If set, the sshhiifftt builtin prints an error message when the shift count exceeds the number of positional parame- ters. ssoouurrcceeppaatthh If set, the .. (ssoouurrccee) builtin uses the value of PPAATTHH to - find the directory containing the file supplied as an - argument. This option is enabled by default. + find the directory containing the file supplied as an + argument when the --pp option is not supplied. This op- + tion is enabled by default. vvaarrrreeddiirr__cclloossee If set, the shell automatically closes file descriptors diff --git a/doc/version.texi b/doc/version.texi index eab39f3f..a4c26ca4 100644 --- a/doc/version.texi +++ b/doc/version.texi @@ -2,10 +2,10 @@ Copyright (C) 1988-2024 Free Software Foundation, Inc. @end ignore -@set LASTCHANGE Tue Apr 23 15:08:20 EDT 2024 +@set LASTCHANGE Wed Jun 12 10:34:52 PDT 2024 @set EDITION 5.3 @set VERSION 5.3 -@set UPDATED 23 April 2024 -@set UPDATED-MONTH April 2024 +@set UPDATED 12 June 2024 +@set UPDATED-MONTH June 2024 diff --git a/parse.y b/parse.y index eb83af4c..6aaf49aa 100644 --- a/parse.y +++ b/parse.y @@ -5041,6 +5041,8 @@ cond_term (void) } else parser_error (lineno, _("expected `)'")); + if (cond_token == WORD) + dispose_word (yylval.word); COND_RETURN_ERROR (); } term = make_cond_node (COND_EXPR, (WORD_DESC *)NULL, term, (COND_COM *)NULL); @@ -6642,7 +6644,7 @@ error_token_from_token (int tok) t = (char *)NULL; /* This stuff is dicy and needs closer inspection */ - switch (current_token) + switch (tok) { case WORD: case ASSIGNMENT_WORD: diff --git a/tests/builtins.right b/tests/builtins.right index e2fc4f94..4abc96a1 100644 --- a/tests/builtins.right +++ b/tests/builtins.right @@ -139,6 +139,19 @@ abc def ghi ok +./source8.sub: line 36: improbable-filename: No such file or directory +./source8.sub: line 37: improbable-filename: No such file or directory +an improbable filename +an improbable filename +an improbable filename +an improbable filename +file in the current directory +./source8.sub: line 51: .: cwd-filename: file not found +file in the current directory +bash: line 1: .: cwd-filename: file not found +bash: line 1: .: cwd-filename: file not found +file in the current directory +file in the current directory AVAR foo foo @@ -149,11 +162,11 @@ AVAR foo declare -x foo="" declare -x FOO="\$\$" -./builtins.tests: line 239: declare: FOO: not found +./builtins.tests: line 242: declare: FOO: not found declare -x FOO="\$\$" ok ok -./builtins.tests: line 271: kill: 4096: invalid signal specification +./builtins.tests: line 274: kill: 4096: invalid signal specification 1 a\n\n\nb a @@ -332,7 +345,7 @@ A star (*) next to a name means that the command is disabled. ! PIPELINE history [-c] [-d offset] [n] or hist> job_spec [&] if COMMANDS; then COMMANDS; [ elif C> (( expression )) jobs [-lnprs] [jobspec ...] or jobs > - . filename [arguments] kill [-s sigspec | -n signum | -sigs> + . [-p path] filename [arguments] kill [-s sigspec | -n signum | -sigs> : let arg [arg ...] [ arg... ] local [option] name[=value] ... [[ expression ]] logout [n] @@ -349,7 +362,7 @@ A star (*) next to a name means that the command is disabled. complete [-abcdefgjksuv] [-pr] [-DEI]> set [-abefhkmnptuvxBCEHPT] [-o optio> compopt [-o|+o option] [-DEI] [name .> shift [n] continue [n] shopt [-pqsu] [-o] [optname ...] - coproc [NAME] command [redirections] source filename [arguments] + coproc [NAME] command [redirections] source [-p path] filename [argument> declare [-aAfFgiIlnrtux] [name[=value> suspend [-f] dirs [-clpv] [+N] [-N] test [expr] disown [-h] [-ar] [jobspec ... | pid > time [-p] pipeline @@ -425,7 +438,7 @@ A star (*) next to a name means that the command is disabled. ! PIPELINE history [-c] [-d offset] [n] or hist> job_spec [&] if COMMANDS; then COMMANDS; [ elif C> (( expression )) jobs [-lnprs] [jobspec ...] or jobs > - . filename [arguments] kill [-s sigspec | -n signum | -sigs> + . [-p path] filename [arguments] kill [-s sigspec | -n signum | -sigs> : let arg [arg ...] [ arg... ] local [option] name[=value] ... [[ expression ]] logout [n] @@ -442,7 +455,7 @@ A star (*) next to a name means that the command is disabled. complete [-abcdefgjksuv] [-pr] [-DEI]> set [-abefhkmnptuvxBCEHPT] [-o optio> compopt [-o|+o option] [-DEI] [name .> shift [n] continue [n] shopt [-pqsu] [-o] [optname ...] - coproc [NAME] command [redirections] source filename [arguments] + coproc [NAME] command [redirections] source [-p path] filename [argument> declare [-aAfFgiIlnrtux] [name[=value> suspend [-f] dirs [-clpv] [+N] [-N] test [expr] disown [-h] [-ar] [jobspec ... | pid > time [-p] pipeline @@ -489,5 +502,5 @@ popd: usage: popd [-n] [+N | -N] ./builtins12.sub: line 36: popd: +8: directory stack index out of range /tmp / / -./builtins.tests: line 322: exit: status: numeric argument required +./builtins.tests: line 325: exit: status: numeric argument required after non-numeric arg to exit: 2 diff --git a/tests/builtins.tests b/tests/builtins.tests index 60ec6bbc..1d6d9a4b 100644 --- a/tests/builtins.tests +++ b/tests/builtins.tests @@ -208,6 +208,9 @@ ${THIS_SH} ./source6.sub # test bugs with source called from multiline aliases and other contexts ${THIS_SH} ./source7.sub +# test source/. -p path +${THIS_SH} ./source8.sub + # in posix mode, assignment statements preceding special builtins are # reflected in the shell environment. `.' and `eval' need special-case # code. diff --git a/tests/cond.right b/tests/cond.right index 4f90a7a7..01859347 100644 --- a/tests/cond.right +++ b/tests/cond.right @@ -157,7 +157,7 @@ bash: -c: line 1: unexpected token `EOF', expected `)' bash: -c: line 2: syntax error: unexpected end of file bash: -c: line 1: unexpected EOF while looking for `]]' bash: -c: line 2: syntax error: unexpected end of file -bash: -c: line 1: syntax error in conditional expression +bash: -c: line 1: syntax error in conditional expression: unexpected token `]' bash: -c: line 1: syntax error near `]' bash: -c: line 1: `[[ ( -t X ) ]' bash: -c: line 1: unexpected argument `&' to conditional unary operator @@ -178,7 +178,7 @@ bash: -c: line 1: `[[ 4 > & ]]' bash: -c: line 1: unexpected token `&' in conditional command bash: -c: line 1: syntax error near `&' bash: -c: line 1: `[[ & ]]' -bash: -c: line 1: conditional binary operator expected +bash: -c: line 1: unexpected token `7', conditional binary operator expected bash: -c: line 1: syntax error near `7' bash: -c: line 1: `[[ -Q 7 ]]' bash: -c: line 1: unexpected argument `<' to conditional unary operator diff --git a/tests/errors.right b/tests/errors.right index 9b760de3..9442541f 100644 --- a/tests/errors.right +++ b/tests/errors.right @@ -81,11 +81,11 @@ bash: line 1: PWD: readonly variable bash: line 1: OLDPWD: readonly variable 1 ./errors.tests: line 236: .: filename argument required -.: usage: . filename [arguments] +.: usage: . [-p path] filename [arguments] ./errors.tests: line 237: source: filename argument required -source: usage: source filename [arguments] +source: usage: source [-p path] filename [arguments] ./errors.tests: line 240: .: -i: invalid option -.: usage: . filename [arguments] +.: usage: . [-p path] filename [arguments] ./errors.tests: line 243: set: -q: invalid option set: usage: set [-abefhkmnptuvxBCEHPT] [-o option-name] [--] [-] [arg ...] ./errors.tests: line 246: enable: sh: not a shell builtin @@ -141,7 +141,7 @@ set: usage: set [-abefhkmnptuvxBCEHPT] [-o option-name] [--] [-] [arg ...] ./errors.tests: line 348: xx: readonly variable 1 ./errors1.sub: line 14: .: -i: invalid option -.: usage: . filename [arguments] +.: usage: . [-p path] filename [arguments] ./errors1.sub: line 22: shift: -4: shift count out of range ./errors1.sub: line 23: shift: -4: shift count out of range ./errors1.sub: line 27: break: -1: loop count out of range @@ -255,7 +255,7 @@ ok 6 ./errors8.sub: line 16: /notthere: No such file or directory ok 7 ./errors8.sub: line 17: .: -x: invalid option -.: usage: . filename [arguments] +.: usage: . [-p path] filename [arguments] ok 8 DEBUG ./errors9.sub: line 6: [[: ++: arithmetic syntax error: operand expected (error token is "+") diff --git a/tests/source8.sub b/tests/source8.sub new file mode 100644 index 00000000..fcb6636a --- /dev/null +++ b/tests/source8.sub @@ -0,0 +1,62 @@ +# This program 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 3 of the License, or +# (at your option) any later version. +# +# This program 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 this program. If not, see . +# + +# test various uses of source -p + +: ${THIS_SH:=./bash} +PATH=/bin:/usr/bin:/sbin:/usr/sbin + +: ${TMPDIR:=/var/tmp} +export SDIR=${TMPDIR}/source-$$ +mkdir -p $SDIR || { echo "$SDIR: cannot create" >&2; exit 1; } + +FN=${SDIR}/improbable-filename + +cat >$FN << EOF +echo an improbable filename +EOF +cat >cwd-filename <