summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChet Ramey <chet.ramey@case.edu>2019-09-03 10:54:55 -0400
committerChet Ramey <chet.ramey@case.edu>2019-09-03 10:54:55 -0400
commit969496e53b34c2439a0125d09957c62d51159ed5 (patch)
tree5e366ce0d82ba4e193c93f19e8da03b6624fec91
parent2dc823ee9663f2a011677aa95bfb5d183360d81f (diff)
downloadbash-969496e53b34c2439a0125d09957c62d51159ed5.tar.gz
commit bash-20190830 snapshot
-rw-r--r--CWRU/CWRU.chlog48
-rw-r--r--bashhist.c26
-rw-r--r--builtins/evalstring.c2
-rw-r--r--builtins/set.def2
-rwxr-xr-xconfigure4
-rw-r--r--configure.ac4
-rw-r--r--lib/readline/complete.c17
-rw-r--r--lib/readline/terminal.c23
-rw-r--r--patchlevel.h2
-rw-r--r--shell.c80
-rw-r--r--support/copyright-script13
l---------support/copyright-script~1
-rwxr-xr-xtests/RUN-ONE-TEST2
-rw-r--r--tests/alias.right2
-rw-r--r--tests/alias.tests13
-rw-r--r--tests/alias1.sub13
-rw-r--r--tests/alias2.sub13
-rw-r--r--tests/alias3.sub1
-rw-r--r--tests/alias4.sub13
-rw-r--r--tests/alias5.sub13
-rw-r--r--tests/appendop.right2
-rw-r--r--tests/appendop.tests13
-rw-r--r--tests/appendop1.sub13
-rw-r--r--tests/appendop2.sub13
-rw-r--r--tests/arith-for.tests13
-rw-r--r--tests/arith.right68
-rw-r--r--tests/arith.tests13
-rw-r--r--tests/arith1.sub13
-rw-r--r--tests/arith2.sub13
-rw-r--r--tests/arith3.sub13
-rw-r--r--tests/arith5.sub13
-rw-r--r--tests/arith6.sub13
-rw-r--r--tests/arith8.sub13
-rw-r--r--tests/array.right92
-rw-r--r--tests/array.tests13
-rw-r--r--tests/array10.sub13
-rw-r--r--tests/array11.sub13
-rw-r--r--tests/array12.sub13
-rw-r--r--tests/array13.sub1
-rw-r--r--tests/array14.sub13
-rw-r--r--tests/array15.sub13
-rw-r--r--tests/array16.sub13
-rw-r--r--tests/array17.sub13
-rw-r--r--tests/array18.sub13
-rw-r--r--tests/array19.sub13
-rw-r--r--tests/array20.sub13
-rw-r--r--tests/array21.sub13
-rw-r--r--tests/array22.sub13
-rw-r--r--tests/array23.sub13
-rw-r--r--tests/array24.sub13
-rw-r--r--tests/array25.sub13
-rw-r--r--tests/array26.sub13
-rw-r--r--tests/array27.sub13
-rw-r--r--tests/array4.sub13
-rw-r--r--tests/array5.sub13
-rw-r--r--tests/array6.sub13
-rw-r--r--tests/array8.sub13
-rw-r--r--tests/array9.sub13
-rw-r--r--tests/assoc.right36
-rw-r--r--tests/assoc.tests13
-rw-r--r--tests/assoc1.sub13
-rw-r--r--tests/assoc10.sub13
-rw-r--r--tests/assoc2.sub13
-rw-r--r--tests/assoc3.sub13
-rw-r--r--tests/assoc4.sub13
-rw-r--r--tests/assoc5.sub13
-rw-r--r--tests/assoc6.sub13
-rw-r--r--tests/assoc7.sub13
-rw-r--r--tests/assoc9.sub13
-rw-r--r--tests/attr.right16
-rw-r--r--tests/attr.tests13
-rw-r--r--tests/attr1.sub13
-rw-r--r--tests/attr2.sub13
-rw-r--r--tests/braces.tests13
-rw-r--r--tests/builtins.right14
-rw-r--r--tests/builtins.tests13
-rw-r--r--tests/builtins4.sub13
-rw-r--r--tests/builtins5.sub13
-rw-r--r--tests/builtins6.sub13
-rw-r--r--tests/case.right2
-rw-r--r--tests/case.tests13
-rw-r--r--tests/case1.sub13
-rw-r--r--tests/case2.sub13
-rw-r--r--tests/case3.sub14
-rw-r--r--tests/case4.sub13
-rw-r--r--tests/casemod.tests13
-rw-r--r--tests/comsub-posix.tests13
-rw-r--r--tests/comsub-posix2.sub13
-rw-r--r--tests/comsub-posix3.sub13
-rw-r--r--tests/comsub.right2
-rw-r--r--tests/comsub.tests13
-rw-r--r--tests/comsub1.sub13
-rw-r--r--tests/comsub3.sub13
-rw-r--r--tests/comsub4.sub13
-rw-r--r--tests/cond-regexp1.sub13
-rw-r--r--tests/cond-regexp2.sub13
-rw-r--r--tests/cond-regexp3.sub13
-rw-r--r--tests/cond.right2
-rw-r--r--[-rwxr-xr-x]tests/cond.tests13
-rw-r--r--tests/coproc.tests13
-rw-r--r--tests/cprint.tests13
-rw-r--r--tests/dbg-support.right614
-rw-r--r--tests/dbg-support.sub13
-rw-r--r--[-rwxr-xr-x]tests/dbg-support.tests22
-rw-r--r--tests/dbg-support2.right10
-rw-r--r--[-rwxr-xr-x]tests/dbg-support2.tests19
-rw-r--r--tests/dbg-support3.sub13
-rw-r--r--tests/dollar-at-star1.sub13
-rw-r--r--tests/dollar-at-star2.sub13
-rw-r--r--tests/dollar-at-star3.sub13
-rw-r--r--tests/dollar-at-star4.sub13
-rw-r--r--tests/dollar-at-star5.sub13
-rw-r--r--tests/dollar-at-star6.sub13
-rw-r--r--tests/dollar-at-star7.sub13
-rw-r--r--tests/dollar-at-star9.sub13
-rw-r--r--tests/dollar-at1.sub13
-rw-r--r--tests/dollar-at2.sub13
-rw-r--r--tests/dollar-at5.sub13
-rw-r--r--tests/dollar-at6.sub13
-rw-r--r--tests/dollar-at7.sub13
-rw-r--r--tests/dollar-star1.sub13
-rw-r--r--tests/dollar-star10.sub13
-rw-r--r--tests/dollar-star2.sub13
-rw-r--r--tests/dollar-star3.sub13
-rw-r--r--tests/dollar-star5.sub13
-rw-r--r--tests/dollar-star6.sub13
-rw-r--r--tests/dollar-star7.sub13
-rw-r--r--tests/dollar-star8.sub13
-rw-r--r--tests/dollar-star9.sub13
-rw-r--r--tests/dstack.right26
-rw-r--r--tests/dstack.tests13
-rw-r--r--tests/dstack2.tests13
-rw-r--r--tests/dynvar.tests13
-rw-r--r--tests/errors.right236
-rw-r--r--tests/errors.tests13
-rw-r--r--tests/errors1.sub13
-rw-r--r--tests/errors4.sub13
-rw-r--r--tests/errors6.sub13
-rw-r--r--tests/errors7.sub13
-rw-r--r--tests/exec10.sub13
-rw-r--r--tests/exec12.sub13
-rw-r--r--tests/exec13.sub13
-rw-r--r--tests/exec6.sub13
-rw-r--r--tests/exec7.sub13
-rw-r--r--tests/exec9.sub13
-rw-r--r--tests/exp.right2
-rw-r--r--tests/exp.tests13
-rw-r--r--tests/exp1.sub13
-rw-r--r--tests/exp10.sub13
-rw-r--r--tests/exp11.sub13
-rw-r--r--tests/exp12.sub13
-rw-r--r--tests/exp5.sub13
-rw-r--r--tests/exp6.sub13
-rw-r--r--tests/exp7.sub13
-rw-r--r--tests/exp8.sub13
-rw-r--r--tests/exp9.sub13
-rw-r--r--tests/exportfunc.right14
-rw-r--r--tests/exportfunc.tests13
-rw-r--r--tests/exportfunc1.sub13
-rw-r--r--tests/exportfunc2.sub13
-rw-r--r--tests/exportfunc3.sub13
-rw-r--r--tests/extglob.tests13
-rw-r--r--tests/extglob1.sub13
-rw-r--r--tests/extglob1a.sub13
-rw-r--r--[-rwxr-xr-x]tests/extglob2.tests13
-rw-r--r--tests/extglob3.sub13
-rw-r--r--tests/extglob3.tests13
-rw-r--r--tests/extglob4.sub13
-rw-r--r--tests/extglob5.sub13
-rw-r--r--tests/func.right6
-rw-r--r--tests/func.tests13
-rw-r--r--tests/func1.sub13
-rw-r--r--tests/func2.sub13
-rw-r--r--tests/func3.sub13
-rw-r--r--tests/func4.sub13
-rw-r--r--tests/getopts.right6
-rw-r--r--tests/getopts.tests13
-rw-r--r--tests/getopts1.sub13
-rw-r--r--tests/getopts10.sub13
-rw-r--r--tests/getopts2.sub13
-rw-r--r--tests/getopts3.sub13
-rw-r--r--tests/getopts4.sub13
-rw-r--r--tests/getopts5.sub13
-rw-r--r--tests/getopts6.sub13
-rw-r--r--tests/getopts7.sub13
-rw-r--r--tests/getopts9.sub13
-rw-r--r--tests/glob.right2
-rw-r--r--tests/glob.tests13
-rw-r--r--tests/glob1.sub13
-rw-r--r--tests/glob2.sub13
-rw-r--r--tests/glob3.sub13
-rw-r--r--tests/glob4.sub13
-rw-r--r--tests/glob5.sub13
-rw-r--r--tests/glob6.sub13
-rw-r--r--tests/globstar.tests13
-rw-r--r--tests/globstar1.sub13
-rw-r--r--tests/globstar2.sub13
-rw-r--r--tests/globstar3.sub13
-rw-r--r--tests/heredoc.right14
-rw-r--r--tests/heredoc.tests13
-rw-r--r--tests/heredoc1.sub13
-rw-r--r--tests/heredoc3.sub13
-rw-r--r--tests/heredoc5.sub13
-rw-r--r--tests/herestr.tests13
-rw-r--r--tests/histexp.right4
-rw-r--r--tests/histexp.tests13
-rw-r--r--tests/histexp1.sub13
-rw-r--r--tests/histexp3.sub13
-rw-r--r--tests/histexp4.sub13
-rw-r--r--tests/histexp5.sub13
-rw-r--r--tests/histexp6.sub13
-rw-r--r--tests/history.right20
-rw-r--r--tests/history.tests13
-rw-r--r--tests/history1.sub13
-rw-r--r--tests/history3.sub13
-rw-r--r--tests/ifs-posix.tests13
-rw-r--r--tests/ifs.tests13
-rw-r--r--tests/intl.tests13
-rw-r--r--tests/intl3.sub13
-rw-r--r--tests/invert.tests13
-rw-r--r--tests/iquote.tests13
-rw-r--r--tests/iquote1.sub13
-rw-r--r--tests/jobs.right30
-rw-r--r--tests/jobs.tests13
-rw-r--r--tests/jobs1.sub13
-rw-r--r--tests/jobs3.sub15
-rw-r--r--tests/jobs4.sub13
-rw-r--r--tests/lastpipe.tests13
-rw-r--r--tests/lastpipe2.sub13
-rw-r--r--tests/mapfile.tests13
-rw-r--r--tests/more-exp.right16
-rw-r--r--tests/more-exp.tests13
-rw-r--r--tests/nameref.right290
-rw-r--r--tests/nameref.tests13
-rw-r--r--tests/nameref10.sub13
-rw-r--r--tests/nameref11.sub13
-rw-r--r--tests/nameref12.sub13
-rw-r--r--tests/nameref13.sub13
-rw-r--r--tests/nameref14.sub13
-rw-r--r--tests/nameref15.sub13
-rw-r--r--tests/nameref16.sub13
-rw-r--r--tests/nameref17.sub13
-rw-r--r--tests/nameref18.sub13
-rw-r--r--tests/nameref19.sub13
-rw-r--r--tests/nameref20.sub13
-rw-r--r--tests/nameref21.sub13
-rw-r--r--tests/nameref3.sub13
-rw-r--r--tests/nameref4.sub13
-rw-r--r--tests/nameref5.sub13
-rw-r--r--tests/nameref6.sub13
-rw-r--r--tests/nameref7.sub13
-rw-r--r--tests/nameref8.sub13
-rw-r--r--tests/new-exp.right40
-rw-r--r--tests/new-exp.tests13
-rw-r--r--tests/new-exp1.sub13
-rw-r--r--tests/new-exp10.sub13
-rw-r--r--tests/new-exp11.sub13
-rw-r--r--tests/new-exp12.sub14
-rw-r--r--tests/new-exp2.sub13
-rw-r--r--tests/new-exp3.sub13
-rw-r--r--tests/new-exp4.sub14
-rw-r--r--tests/new-exp5.sub13
-rw-r--r--tests/new-exp6.sub13
-rw-r--r--tests/new-exp8.sub13
-rw-r--r--tests/new-exp9.sub13
-rw-r--r--tests/nquote.tests13
-rw-r--r--tests/nquote1.tests13
-rw-r--r--tests/nquote2.sub13
-rw-r--r--tests/nquote2.tests13
-rw-r--r--tests/nquote3.tests13
-rw-r--r--tests/nquote4.tests13
-rw-r--r--tests/nquote5.tests13
-rw-r--r--tests/posix2.right8
-rw-r--r--tests/posix2.tests15
-rw-r--r--tests/posix2syntax.sub13
-rw-r--r--tests/posixexp.right4
-rw-r--r--tests/posixexp.tests13
-rw-r--r--tests/posixexp1.sub13
-rw-r--r--tests/posixexp2.sub13
-rw-r--r--tests/posixexp2.tests13
-rw-r--r--tests/posixexp3.sub13
-rw-r--r--tests/posixexp4.sub13
-rw-r--r--tests/posixexp5.sub13
-rw-r--r--tests/posixexp6.sub13
-rw-r--r--tests/posixpat.tests13
-rw-r--r--tests/posixpipe.tests13
-rw-r--r--tests/printf.right26
-rw-r--r--tests/printf.tests13
-rw-r--r--tests/printf1.sub13
-rw-r--r--tests/printf3.sub13
-rw-r--r--tests/printf4.sub13
-rw-r--r--tests/procsub.tests13
-rw-r--r--tests/quote.tests13
-rw-r--r--tests/quote1.sub13
-rw-r--r--tests/quote2.sub13
-rw-r--r--tests/quote3.sub13
-rw-r--r--tests/quote4.sub13
-rw-r--r--tests/read.right4
-rw-r--r--tests/read.tests13
-rw-r--r--tests/read1.sub13
-rw-r--r--tests/read2.sub13
-rw-r--r--tests/read3.sub13
-rw-r--r--tests/read5.sub13
-rw-r--r--tests/redir.right27
-rw-r--r--tests/redir.tests13
-rw-r--r--tests/redir10.sub14
-rw-r--r--tests/redir11.sub13
-rw-r--r--tests/redir3.sub13
-rw-r--r--tests/redir4.sub13
-rw-r--r--tests/redir5.sub13
-rw-r--r--tests/redir7.sub13
-rw-r--r--tests/redir8.sub13
-rw-r--r--tests/redir9.sub13
-rw-r--r--tests/rhs-exp.tests13
-rw-r--r--tests/rhs-exp1.sub13
-rw-r--r--tests/rsh.right34
-rw-r--r--tests/rsh.tests13
-rw-r--r--tests/rsh1.sub13
-rw-r--r--tests/rsh2.sub13
-rw-r--r--tests/run-all14
-rw-r--r--tests/run-dbg-support2
-rw-r--r--tests/run-dbg-support27
-rw-r--r--tests/run-gprof15
-rw-r--r--tests/run-minimal14
-rw-r--r--tests/set-e.tests13
-rw-r--r--tests/set-e1.sub13
-rw-r--r--[-rwxr-xr-x]tests/set-x.tests15
-rw-r--r--tests/set-x1.sub13
-rw-r--r--tests/shopt.right6
-rw-r--r--tests/shopt.tests13
-rw-r--r--tests/source5.sub13
-rw-r--r--tests/source6.sub13
-rw-r--r--tests/source7.sub13
-rw-r--r--tests/strip.tests13
-rw-r--r--tests/test.right34
-rw-r--r--tests/test.tests13
-rw-r--r--tests/test1.sub13
-rw-r--r--tests/tilde.tests13
-rw-r--r--tests/tilde2.tests13
-rw-r--r--tests/time.tests13
-rw-r--r--tests/trap.right24
-rw-r--r--tests/trap.tests13
-rwxr-xr-xtests/trap2.sub13
-rw-r--r--tests/trap4.sub13
-rw-r--r--tests/trap5.sub13
-rw-r--r--tests/trap6.sub13
-rw-r--r--tests/type.right10
-rw-r--r--tests/type.tests13
-rw-r--r--tests/type2.sub13
-rw-r--r--tests/type3.sub13
-rw-r--r--tests/type4.sub13
-rw-r--r--tests/unicode1.sub13
-rw-r--r--tests/unicode2.sub13
-rw-r--r--tests/varenv.right48
-rw-r--r--tests/varenv.tests13
-rw-r--r--tests/varenv1.sub13
-rw-r--r--tests/varenv10.sub16
-rw-r--r--tests/varenv11.sub13
-rw-r--r--tests/varenv12.sub13
-rw-r--r--tests/varenv13.sub13
-rw-r--r--tests/varenv14.sub13
-rw-r--r--tests/varenv15.sub13
-rw-r--r--tests/varenv16.sub13
-rw-r--r--tests/varenv2.sub13
-rw-r--r--tests/varenv3.sub14
-rw-r--r--tests/varenv4.sub13
-rw-r--r--tests/varenv5.sub13
-rw-r--r--tests/varenv6.sub13
-rw-r--r--tests/varenv7.sub13
-rw-r--r--tests/varenv9.sub13
-rw-r--r--tests/vredir.right4
-rw-r--r--tests/vredir.tests13
-rw-r--r--tests/vredir1.sub13
-rw-r--r--tests/vredir2.sub13
-rw-r--r--tests/vredir4.sub13
-rw-r--r--tests/vredir5.sub13
-rw-r--r--tests/vredir7.sub13
377 files changed, 5272 insertions, 977 deletions
diff --git a/CWRU/CWRU.chlog b/CWRU/CWRU.chlog
index e0b26a13..489b87d9 100644
--- a/CWRU/CWRU.chlog
+++ b/CWRU/CWRU.chlog
@@ -6475,3 +6475,51 @@ variables.c
incarnation and tests based on a report to Debian BTS from
Thorsten Glaser <tg@mirbsd.de>
+ 8/26
+ ----
+shell.c,bashhist.c
+ - __P -> PARAMS
+
+shell.c
+ - set_option_defaults,reset_option_defaults: before calling
+ list_minus_o_options at invocation, call set_option_defaults to
+ set the options that are initialized to -1 to either 1 or 0, as
+ appropriate; then call reset_option_defaults to set them back to -1
+ after list_minus_o_options returns
+ - init_interactive: if enable_history_list == -1, set it to 1, then
+ set remember_on_history to enable_history_list. Fixes bug reported
+ by Alex Kerzner <alex.j.kerzner@gmail.com>
+ - init_noninteractive: if enable_history_list == -1, set it to 0, let
+ bash_history_reinit take care of setting remember_on_history
+ - init_interactive_script: if enable_history_list == -1, set it to 1,
+ then set remember_on_history to enable_history_list
+
+bashhist.c
+ - enable_history_list: initialize to -1 to note when it gets changed
+ by -o history or +o history at invocation
+
+ 8/28
+ ----
+lib/readline/terminal.c
+ - TGETENT_SUCCESS, TGETFLAG_SUCCESS: defines to represent successful
+ returns from tgetent and tgetflag, since HPUX manages to get them
+ wrong. New patch from Osipov, Michael <michael.osipov@siemens.com>
+ - TGETFLAG: new define, make sure tgetflag returns TGETENT_SUCCESS
+ - _rl_init_terminal_io: use TGETENT_SUCCESS and TGETFLAG
+
+configure.ac
+ - hpux: make sure to define TGETFLAG_BROKEN
+
+ 8/30
+ ----
+tests
+ - add copyright notices to all scripts longer than 15 lines at the
+ request of the FSF
+
+ 9/1
+ ---
+lib/readline/complete.c
+ - _rl_complete_internal: move logic that checks whether the last
+ completion attempt failed and the current attempt returned a single
+ match and insert the single completion here. A better implementation
+ of Richard Stallman's suggestion of 2/23.
diff --git a/bashhist.c b/bashhist.c
index 9ca29e53..dee98caa 100644
--- a/bashhist.c
+++ b/bashhist.c
@@ -68,10 +68,10 @@ extern int rl_done, rl_dispatching; /* should really include readline.h */
extern int errno;
#endif
-static int histignore_item_func __P((struct ign *));
-static int check_history_control __P((char *));
-static void hc_erasedups __P((char *));
-static void really_add_history __P((char *));
+static int histignore_item_func PARAMS((struct ign *));
+static int check_history_control PARAMS((char *));
+static void hc_erasedups PARAMS((char *));
+static void really_add_history PARAMS((char *));
static struct ignorevar histignore =
{
@@ -89,7 +89,7 @@ static struct ignorevar histignore =
list. This is different than the user-controlled behaviour; this
becomes zero when we read lines from a file, for example. */
int remember_on_history = 0;
-int enable_history_list = 0; /* value for `set -o history' */
+int enable_history_list = -1; /* value for `set -o history' */
/* The number of lines that Bash has added to this history session. The
difference between the number of the top element in the history list
@@ -193,17 +193,17 @@ int hist_verify;
int dont_save_function_defs;
#if defined (BANG_HISTORY)
-static int bash_history_inhibit_expansion __P((char *, int));
+static int bash_history_inhibit_expansion PARAMS((char *, int));
#endif
#if defined (READLINE)
-static void re_edit __P((char *));
+static void re_edit PARAMS((char *));
#endif
-static int history_expansion_p __P((char *));
-static int shell_comment __P((char *));
-static int should_expand __P((char *));
-static HIST_ENTRY *last_history_entry __P((void));
-static char *expand_histignore_pattern __P((char *));
-static int history_should_ignore __P((char *));
+static int history_expansion_p PARAMS((char *));
+static int shell_comment PARAMS((char *));
+static int should_expand PARAMS((char *));
+static HIST_ENTRY *last_history_entry PARAMS((void));
+static char *expand_histignore_pattern PARAMS((char *));
+static int history_should_ignore PARAMS((char *));
#if defined (BANG_HISTORY)
/* Is the history expansion starting at string[i] one that should not
diff --git a/builtins/evalstring.c b/builtins/evalstring.c
index 667ee5cc..5b4000f5 100644
--- a/builtins/evalstring.c
+++ b/builtins/evalstring.c
@@ -440,6 +440,8 @@ parse_and_execute (string, from_file, flags)
}
#endif /* ONESHOT */
+itrace("evalstring: command->type == %d but string = `%s'", command->type, bash_input.location.string);
+
/* See if this is a candidate for $( <file ). */
if (startup_state == 2 &&
(subshell_environment & SUBSHELL_COMSUB) &&
diff --git a/builtins/set.def b/builtins/set.def
index 29703999..cc948332 100644
--- a/builtins/set.def
+++ b/builtins/set.def
@@ -646,7 +646,7 @@ reset_shell_options ()
#endif
#if defined (HISTORY)
dont_save_function_defs = 0;
- remember_on_history = enable_history_list = 1;
+ remember_on_history = enable_history_list = 1; /* XXX */
#endif
}
diff --git a/configure b/configure
index 930cba07..088118ba 100755
--- a/configure
+++ b/configure
@@ -20263,8 +20263,8 @@ sysv4*) $as_echo "#define SVR4 1" >>confdefs.h
;;
sysv5*) $as_echo "#define SVR5 1" >>confdefs.h
;;
-hpux9*) LOCAL_CFLAGS="-DHPUX9 -DHPUX -DTGETENT_BROKEN" ;;
-hpux*) LOCAL_CFLAGS="-DHPUX -DTGETENT_BROKEN" ;;
+hpux9*) LOCAL_CFLAGS="-DHPUX9 -DHPUX -DTGETENT_BROKEN -DTGETFLAG_BROKEN" ;;
+hpux*) LOCAL_CFLAGS="-DHPUX -DTGETENT_BROKEN -DTGETFLAG_BROKEN" ;;
dgux*) LOCAL_CFLAGS=-D_DGUX_SOURCE; LOCAL_LIBS=-ldgc ;;
isc*) LOCAL_CFLAGS=-Disc386 ;;
rhapsody*) LOCAL_CFLAGS=-DRHAPSODY ;;
diff --git a/configure.ac b/configure.ac
index 84de396b..a15b4171 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1132,8 +1132,8 @@ sysv4.2*) AC_DEFINE(SVR4_2)
AC_DEFINE(SVR4) ;;
sysv4*) AC_DEFINE(SVR4) ;;
sysv5*) AC_DEFINE(SVR5) ;;
-hpux9*) LOCAL_CFLAGS="-DHPUX9 -DHPUX -DTGETENT_BROKEN" ;;
-hpux*) LOCAL_CFLAGS="-DHPUX -DTGETENT_BROKEN" ;;
+hpux9*) LOCAL_CFLAGS="-DHPUX9 -DHPUX -DTGETENT_BROKEN -DTGETFLAG_BROKEN" ;;
+hpux*) LOCAL_CFLAGS="-DHPUX -DTGETENT_BROKEN -DTGETFLAG_BROKEN" ;;
dgux*) LOCAL_CFLAGS=-D_DGUX_SOURCE; LOCAL_LIBS=-ldgc ;;
isc*) LOCAL_CFLAGS=-Disc386 ;;
rhapsody*) LOCAL_CFLAGS=-DRHAPSODY ;;
diff --git a/lib/readline/complete.c b/lib/readline/complete.c
index 7da8ee98..bd82ab9f 100644
--- a/lib/readline/complete.c
+++ b/lib/readline/complete.c
@@ -429,7 +429,11 @@ rl_complete (int ignore, int invoking_key)
if (rl_inhibit_completion)
return (_rl_insert_char (ignore, invoking_key));
+#if 0
else if (rl_last_func == rl_complete && completion_changed_buffer == 0 && last_completion_failed == 0)
+#else
+ else if (rl_last_func == rl_complete && completion_changed_buffer == 0)
+#endif
return (rl_complete_internal ('?'));
else if (_rl_complete_show_all)
return (rl_complete_internal ('!'));
@@ -1987,10 +1991,12 @@ rl_complete_internal (int what_to_do)
int start, end, delimiter, found_quote, i, nontrivial_lcd;
char *text, *saved_line_buffer;
char quote_char;
- int tlen, mlen;
+ int tlen, mlen, saved_last_completion_failed;
RL_SETSTATE(RL_STATE_COMPLETING);
+ saved_last_completion_failed = last_completion_failed;
+
set_completion_defaults (what_to_do);
saved_line_buffer = rl_line_buffer ? savestring (rl_line_buffer) : (char *)NULL;
@@ -2104,6 +2110,15 @@ rl_complete_internal (int what_to_do)
break;
case '?':
+ /* Let's try to insert a single match here if the last completion failed
+ but this attempt returned a single match. */
+ if (saved_last_completion_failed && matches[0] && *matches[0] && matches[1] == 0)
+ {
+ insert_match (matches[0], start, matches[1] ? MULT_MATCH : SINGLE_MATCH, &quote_char);
+ append_to_match (matches[0], delimiter, quote_char, nontrivial_lcd);
+ break;
+ }
+
if (rl_completion_display_matches_hook == 0)
{
_rl_sigcleanup = _rl_complete_sigcleanup;
diff --git a/lib/readline/terminal.c b/lib/readline/terminal.c
index fa004382..86299f54 100644
--- a/lib/readline/terminal.c
+++ b/lib/readline/terminal.c
@@ -177,6 +177,19 @@ static char *_rl_term_kI;
static char *_rl_term_vs; /* very visible */
static char *_rl_term_ve; /* normal */
+/* It's not clear how HPUX is so broken here. */
+#ifdef TGETENT_BROKEN
+# define TGETENT_SUCCESS 0
+#else
+# define TGETENT_SUCCESS 1
+#endif
+#ifdef TGETFLAG_BROKEN
+# define TGETFLAG_SUCCESS 0
+#else
+# define TGETFLAG_SUCCESS 1
+#endif
+#define TGETFLAG(cap) (tgetflag (cap) == TGETFLAG_SUCCESS)
+
static void bind_termcap_arrow_keys PARAMS((Keymap));
/* Variables that hold the screen dimensions, used by the display code. */
@@ -483,11 +496,7 @@ _rl_init_terminal_io (const char *terminal_name)
tgetent_ret = tgetent (term_buffer, term);
}
-#ifdef TGETENT_BROKEN
- if (tgetent_ret < 0)
-#else
- if (tgetent_ret <= 0)
-#endif
+ if (tgetent_ret != TGETENT_SUCCESS)
{
FREE (term_string_buffer);
FREE (term_buffer);
@@ -548,7 +557,7 @@ _rl_init_terminal_io (const char *terminal_name)
if (!_rl_term_cr)
_rl_term_cr = "\r";
- _rl_term_autowrap = tgetflag ("am") && tgetflag ("xn");
+ _rl_term_autowrap = TGETFLAG ("am") && TGETFLAG ("xn");
/* Allow calling application to set default height and width, using
rl_set_screen_size */
@@ -563,7 +572,7 @@ _rl_init_terminal_io (const char *terminal_name)
/* Check to see if this terminal has a meta key and clear the capability
variables if there is none. */
- term_has_meta = tgetflag ("km") != 0;
+ term_has_meta = TGETFLAG ("km");
if (term_has_meta == 0)
_rl_term_mm = _rl_term_mo = (char *)NULL;
#endif /* !__MSDOS__ */
diff --git a/patchlevel.h b/patchlevel.h
index 8002af70..772676c8 100644
--- a/patchlevel.h
+++ b/patchlevel.h
@@ -25,6 +25,6 @@
regexp `^#define[ ]*PATCHLEVEL', since that's what support/mkversion.sh
looks for to find the patch level (for the sccs version string). */
-#define PATCHLEVEL 10
+#define PATCHLEVEL 11
#endif /* _PATCHLEVEL_H_ */
diff --git a/shell.c b/shell.c
index 9e3a906a..daa68304 100644
--- a/shell.c
+++ b/shell.c
@@ -1,6 +1,6 @@
/* shell.c -- GNU's idea of the POSIX shell specification. */
-/* Copyright (C) 1987-2017 Free Software Foundation, Inc.
+/* Copyright (C) 1987-2019 Free Software Foundation, Inc.
This file is part of GNU Bash, the Bourne Again SHell.
@@ -303,35 +303,38 @@ static FILE *default_input;
static STRING_INT_ALIST *shopt_alist;
static int shopt_ind = 0, shopt_len = 0;
-static int parse_long_options __P((char **, int, int));
-static int parse_shell_options __P((char **, int, int));
-static int bind_args __P((char **, int, int, int));
+static int parse_long_options PARAMS((char **, int, int));
+static int parse_shell_options PARAMS((char **, int, int));
+static int bind_args PARAMS((char **, int, int, int));
-static void start_debugger __P((void));
+static void start_debugger PARAMS((void));
-static void add_shopt_to_alist __P((char *, int));
-static void run_shopt_alist __P((void));
+static void add_shopt_to_alist PARAMS((char *, int));
+static void run_shopt_alist PARAMS((void));
-static void execute_env_file __P((char *));
-static void run_startup_files __P((void));
-static int open_shell_script __P((char *));
-static void set_bash_input __P((void));
-static int run_one_command __P((char *));
+static void execute_env_file PARAMS((char *));
+static void run_startup_files PARAMS((void));
+static int open_shell_script PARAMS((char *));
+static void set_bash_input PARAMS((void));
+static int run_one_command PARAMS((char *));
#if defined (WORDEXP_OPTION)
-static int run_wordexp __P((char *));
+static int run_wordexp PARAMS((char *));
#endif
-static int uidget __P((void));
+static int uidget PARAMS((void));
-static void init_interactive __P((void));
-static void init_noninteractive __P((void));
-static void init_interactive_script __P((void));
+static void set_option_defaults PARAMS((void));
+static void reset_option_defaults PARAMS((void));
-static void set_shell_name __P((char *));
-static void shell_initialize __P((void));
-static void shell_reinitialize __P((void));
+static void init_interactive PARAMS((void));
+static void init_noninteractive PARAMS((void));
+static void init_interactive_script PARAMS((void));
-static void show_shell_usage __P((FILE *, int));
+static void set_shell_name PARAMS((char *));
+static void shell_initialize PARAMS((void));
+static void shell_reinitialize PARAMS((void));
+
+static void show_shell_usage PARAMS((FILE *, int));
#ifdef __CYGWIN__
static void
@@ -907,7 +910,9 @@ parse_shell_options (argv, arg_start, arg_end)
o_option = argv[next_arg];
if (o_option == 0)
{
+ set_option_defaults ();
list_minus_o_opts (-1, (on_or_off == '-') ? 0 : 1);
+ reset_option_defaults ();
break;
}
if (set_minus_o_option (on_or_off, o_option) != EXECUTION_SUCCESS)
@@ -1778,13 +1783,36 @@ set_shell_name (argv0)
shell_name = PROGRAM;
}
+/* Some options are initialized to -1 so we have a way to determine whether
+ they were set on the command line. This is an issue when listing the option
+ values at invocation (`bash -o'), so we set the defaults here and reset
+ them after the call to list_minus_o_options (). */
+/* XXX - could also do this for histexp_flag, jobs_m_flag */
+static void
+set_option_defaults ()
+{
+#if defined (HISTORY)
+ enable_history_list = 0;
+#endif
+}
+
+static void
+reset_option_defaults ()
+{
+#if defined (HISTORY)
+ enable_history_list = -1;
+#endif
+}
+
static void
init_interactive ()
{
expand_aliases = interactive_shell = startup_state = 1;
interactive = 1;
#if defined (HISTORY)
- remember_on_history = enable_history_list = 1; /* XXX */
+ if (enable_history_list == -1)
+ enable_history_list = 1; /* set default */
+ remember_on_history = enable_history_list;
# if defined (BANG_HISTORY)
histexp_flag = history_expansion; /* XXX */
# endif
@@ -1795,6 +1823,8 @@ static void
init_noninteractive ()
{
#if defined (HISTORY)
+ if (enable_history_list == -1) /* set default */
+ enable_history_list = 0;
bash_history_reinit (0);
#endif /* HISTORY */
interactive_shell = startup_state = interactive = 0;
@@ -1810,10 +1840,14 @@ init_noninteractive ()
static void
init_interactive_script ()
{
+#if defined (HISTORY)
+ if (enable_history_list == -1)
+ enable_history_list = 1;
+#endif
init_noninteractive ();
expand_aliases = interactive_shell = startup_state = 1;
#if defined (HISTORY)
- remember_on_history = enable_history_list = 1; /* XXX */
+ remember_on_history = enable_history_list; /* XXX */
#endif
}
diff --git a/support/copyright-script b/support/copyright-script
new file mode 100644
index 00000000..e9f3fab0
--- /dev/null
+++ b/support/copyright-script
@@ -0,0 +1,13 @@
+# 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 <http://www.gnu.org/licenses/>.
+#
diff --git a/support/copyright-script~ b/support/copyright-script~
new file mode 120000
index 00000000..9efbefcb
--- /dev/null
+++ b/support/copyright-script~
@@ -0,0 +1 @@
+copyright-makefile \ No newline at end of file
diff --git a/tests/RUN-ONE-TEST b/tests/RUN-ONE-TEST
index c8bef8dd..0b063810 100755
--- a/tests/RUN-ONE-TEST
+++ b/tests/RUN-ONE-TEST
@@ -1,4 +1,4 @@
-BUILD_DIR=/usr/local/build/bash/bash-current
+BUILD_DIR=/usr/local/build/chet/bash/bash-current
THIS_SH=$BUILD_DIR/bash
PATH=$PATH:$BUILD_DIR
diff --git a/tests/alias.right b/tests/alias.right
index b588a72e..9e33036b 100644
--- a/tests/alias.right
+++ b/tests/alias.right
@@ -1,6 +1,6 @@
alias: 0
alias: 0
-./alias.tests: line 25: qfoo: command not found
+./alias.tests: line 38: qfoo: command not found
quux
bar
value
diff --git a/tests/alias.tests b/tests/alias.tests
index cc59a0f5..0280c16d 100644
--- a/tests/alias.tests
+++ b/tests/alias.tests
@@ -1,3 +1,16 @@
+# 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 <http://www.gnu.org/licenses/>.
+#
# place holder for future alias testing
shopt -s expand_aliases
diff --git a/tests/alias1.sub b/tests/alias1.sub
index ed030312..9a90b2e2 100644
--- a/tests/alias1.sub
+++ b/tests/alias1.sub
@@ -1,3 +1,16 @@
+# 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 <http://www.gnu.org/licenses/>.
+#
shopt -s expand_aliases
alias foo=echo
diff --git a/tests/alias2.sub b/tests/alias2.sub
index 76044485..e35fb76f 100644
--- a/tests/alias2.sub
+++ b/tests/alias2.sub
@@ -1,3 +1,16 @@
+# 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 <http://www.gnu.org/licenses/>.
+#
THIS=alias2
FN=$TMPDIR/$THIS.script
diff --git a/tests/alias3.sub b/tests/alias3.sub
index bb94268a..304e9261 100644
--- a/tests/alias3.sub
+++ b/tests/alias3.sub
@@ -1,4 +1,3 @@
-#!/bin/bash
shopt -s expand_aliases
alias foo='oneword'
foo_word='foo'
diff --git a/tests/alias4.sub b/tests/alias4.sub
index a82f151f..0864a3c4 100644
--- a/tests/alias4.sub
+++ b/tests/alias4.sub
@@ -1,3 +1,16 @@
+# 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 <http://www.gnu.org/licenses/>.
+#
shopt -s expand_aliases
# from an austin-group report
diff --git a/tests/alias5.sub b/tests/alias5.sub
index b7341349..7f8e86d5 100644
--- a/tests/alias5.sub
+++ b/tests/alias5.sub
@@ -1,3 +1,16 @@
+# 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 <http://www.gnu.org/licenses/>.
+#
# -c commands ending with multi-line aliases; post-bash-5.0
: ${THIS_SH:=./bash}
diff --git a/tests/appendop.right b/tests/appendop.right
index f9609f84..dcb60b0b 100644
--- a/tests/appendop.right
+++ b/tests/appendop.right
@@ -15,7 +15,7 @@
4
9
16
-./appendop.tests: line 84: x: readonly variable
+./appendop.tests: line 97: x: readonly variable
declare -A foo=([two]="baz" [three]="quux" [one]="bar" )
declare -A foo=([two]="baz" [0]="zero" [three]="quux" [one]="bar" )
declare -A foo=([two]="baz" [0]="zero" [three]="quux" [four]="four" [one]="bar" )
diff --git a/tests/appendop.tests b/tests/appendop.tests
index e4e52c2f..61b38fc7 100644
--- a/tests/appendop.tests
+++ b/tests/appendop.tests
@@ -1,3 +1,16 @@
+# 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 <http://www.gnu.org/licenses/>.
+#
# basic cases
a=1
a+=4
diff --git a/tests/appendop1.sub b/tests/appendop1.sub
index 7101d0cc..60e70140 100644
--- a/tests/appendop1.sub
+++ b/tests/appendop1.sub
@@ -1,3 +1,16 @@
+# 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 <http://www.gnu.org/licenses/>.
+#
typeset -A foo=([one]=bar [two]=baz [three]=quux)
typeset -p foo
diff --git a/tests/appendop2.sub b/tests/appendop2.sub
index 4225ba3f..e497beb3 100644
--- a/tests/appendop2.sub
+++ b/tests/appendop2.sub
@@ -1,3 +1,16 @@
+# 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 <http://www.gnu.org/licenses/>.
+#
POSIXLY_CORRECT=1
x=2
x+=5 eval printf '"$x "'
diff --git a/tests/arith-for.tests b/tests/arith-for.tests
index 33f4bd66..db913da5 100644
--- a/tests/arith-for.tests
+++ b/tests/arith-for.tests
@@ -1,3 +1,16 @@
+# 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 <http://www.gnu.org/licenses/>.
+#
fx()
{
i=0
diff --git a/tests/arith.right b/tests/arith.right
index 2c3d172a..38941e1e 100644
--- a/tests/arith.right
+++ b/tests/arith.right
@@ -60,7 +60,7 @@
1,i+=2
30
1,j+=2
-./arith.tests: line 114: 1 ? 20 : x+=2: attempted assignment to non-variable (error token is "+=2")
+./arith.tests: line 127: 1 ? 20 : x+=2: attempted assignment to non-variable (error token is "+=2")
20
6
6,5,3
@@ -80,16 +80,16 @@
36
62
63
-./arith.tests: line 149: 3425#56: invalid arithmetic base (error token is "3425#56")
+./arith.tests: line 162: 3425#56: invalid arithmetic base (error token is "3425#56")
0
-./arith.tests: line 155: 7 = 43 : attempted assignment to non-variable (error token is "= 43 ")
-./arith.tests: line 156: 2#44: value too great for base (error token is "2#44")
-./arith.tests: line 157: 44 / 0 : division by 0 (error token is "0 ")
-./arith.tests: line 158: let: jv += $iv: syntax error: operand expected (error token is "$iv")
-./arith.tests: line 159: jv += $iv : syntax error: operand expected (error token is "$iv ")
-./arith.tests: line 160: let: rv = 7 + (43 * 6: missing `)' (error token is "6")
-./arith.tests: line 164: 0#4: invalid number (error token is "0#4")
-./arith.tests: line 165: 2#110#11: invalid number (error token is "2#110#11")
+./arith.tests: line 168: 7 = 43 : attempted assignment to non-variable (error token is "= 43 ")
+./arith.tests: line 169: 2#44: value too great for base (error token is "2#44")
+./arith.tests: line 170: 44 / 0 : division by 0 (error token is "0 ")
+./arith.tests: line 171: let: jv += $iv: syntax error: operand expected (error token is "$iv")
+./arith.tests: line 172: jv += $iv : syntax error: operand expected (error token is "$iv ")
+./arith.tests: line 173: let: rv = 7 + (43 * 6: missing `)' (error token is "6")
+./arith.tests: line 177: 0#4: invalid number (error token is "0#4")
+./arith.tests: line 178: 2#110#11: invalid number (error token is "2#110#11")
abc
def
ghi
@@ -97,15 +97,15 @@ ok
6
1
0
-./arith.tests: line 183: 4 + : syntax error: operand expected (error token is "+ ")
+./arith.tests: line 196: 4 + : syntax error: operand expected (error token is "+ ")
16
-./arith.tests: line 188: 4 ? : 3 + 5 : expression expected (error token is ": 3 + 5 ")
-./arith.tests: line 189: 1 ? 20 : `:' expected for conditional expression (error token is "20 ")
-./arith.tests: line 190: 4 ? 20 : : expression expected (error token is ": ")
+./arith.tests: line 201: 4 ? : 3 + 5 : expression expected (error token is ": 3 + 5 ")
+./arith.tests: line 202: 1 ? 20 : `:' expected for conditional expression (error token is "20 ")
+./arith.tests: line 203: 4 ? 20 : : expression expected (error token is ": ")
9
-./arith.tests: line 196: 0 && B=42 : attempted assignment to non-variable (error token is "=42 ")
+./arith.tests: line 209: 0 && B=42 : attempted assignment to non-variable (error token is "=42 ")
9
-./arith.tests: line 199: 1 || B=88 : attempted assignment to non-variable (error token is "=88 ")
+./arith.tests: line 212: 1 || B=88 : attempted assignment to non-variable (error token is "=88 ")
9
0
9
@@ -131,11 +131,11 @@ ok
4
4
7
-./arith.tests: line 247: 7-- : syntax error: operand expected (error token is "- ")
-./arith.tests: line 249: --x=7 : attempted assignment to non-variable (error token is "=7 ")
-./arith.tests: line 250: ++x=7 : attempted assignment to non-variable (error token is "=7 ")
-./arith.tests: line 252: x++=7 : attempted assignment to non-variable (error token is "=7 ")
-./arith.tests: line 253: x--=7 : attempted assignment to non-variable (error token is "=7 ")
+./arith.tests: line 260: 7-- : syntax error: operand expected (error token is "- ")
+./arith.tests: line 262: --x=7 : attempted assignment to non-variable (error token is "=7 ")
+./arith.tests: line 263: ++x=7 : attempted assignment to non-variable (error token is "=7 ")
+./arith.tests: line 265: x++=7 : attempted assignment to non-variable (error token is "=7 ")
+./arith.tests: line 266: x--=7 : attempted assignment to non-variable (error token is "=7 ")
4
7
-7
@@ -143,10 +143,10 @@ ok
7
2
2
-./arith1.sub: line 2: 4-- : syntax error: operand expected (error token is "- ")
-./arith1.sub: line 3: 4++ : syntax error: operand expected (error token is "+ ")
-./arith1.sub: line 4: 4 -- : syntax error: operand expected (error token is "- ")
-./arith1.sub: line 5: 4 ++ : syntax error: operand expected (error token is "+ ")
+./arith1.sub: line 15: 4-- : syntax error: operand expected (error token is "- ")
+./arith1.sub: line 16: 4++ : syntax error: operand expected (error token is "+ ")
+./arith1.sub: line 17: 4 -- : syntax error: operand expected (error token is "- ")
+./arith1.sub: line 18: 4 ++ : syntax error: operand expected (error token is "+ ")
1
2
1
@@ -161,10 +161,10 @@ ok
2
-2
1
-./arith1.sub: line 35: ((: ++ : syntax error: operand expected (error token is "+ ")
+./arith1.sub: line 48: ((: ++ : syntax error: operand expected (error token is "+ ")
7
7
-./arith1.sub: line 38: ((: -- : syntax error: operand expected (error token is "- ")
+./arith1.sub: line 51: ((: -- : syntax error: operand expected (error token is "- ")
7
7
7
@@ -183,10 +183,10 @@ ok
1
4
0
-./arith2.sub: line 33: ((: -- : syntax error: operand expected (error token is "- ")
+./arith2.sub: line 46: ((: -- : syntax error: operand expected (error token is "- ")
-7
-7
-./arith2.sub: line 37: ((: ++ : syntax error: operand expected (error token is "+ ")
+./arith2.sub: line 50: ((: ++ : syntax error: operand expected (error token is "+ ")
7
7
-7
@@ -250,14 +250,14 @@ efg
0
0
8 12
-./arith.tests: line 297: ((: x=9 y=41 : syntax error in expression (error token is "y=41 ")
-./arith.tests: line 301: a b: syntax error in expression (error token is "b")
-./arith.tests: line 302: ((: a b: syntax error in expression (error token is "b")
+./arith.tests: line 310: ((: x=9 y=41 : syntax error in expression (error token is "y=41 ")
+./arith.tests: line 314: a b: syntax error in expression (error token is "b")
+./arith.tests: line 315: ((: a b: syntax error in expression (error token is "b")
42
42
42
42
42
42
-./arith.tests: line 314: 'foo' : syntax error: operand expected (error token is "'foo' ")
-./arith.tests: line 318: b[c]d: syntax error in expression (error token is "d")
+./arith.tests: line 327: 'foo' : syntax error: operand expected (error token is "'foo' ")
+./arith.tests: line 331: b[c]d: syntax error in expression (error token is "d")
diff --git a/tests/arith.tests b/tests/arith.tests
index bc9490e9..606de39d 100644
--- a/tests/arith.tests
+++ b/tests/arith.tests
@@ -1,3 +1,16 @@
+# 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 <http://www.gnu.org/licenses/>.
+#
set +o posix
declare -i iv jv
diff --git a/tests/arith1.sub b/tests/arith1.sub
index 43cae806..3168fcbf 100644
--- a/tests/arith1.sub
+++ b/tests/arith1.sub
@@ -1,3 +1,16 @@
+# 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 <http://www.gnu.org/licenses/>.
+#
# test of redone post-increment and post-decrement code
echo $(( 4-- ))
echo $(( 4++ ))
diff --git a/tests/arith2.sub b/tests/arith2.sub
index 7eac9523..5475012b 100644
--- a/tests/arith2.sub
+++ b/tests/arith2.sub
@@ -1,3 +1,16 @@
+# 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 <http://www.gnu.org/licenses/>.
+#
echo $(( --7 ))
echo $(( ++7 ))
echo $(( -- 7 ))
diff --git a/tests/arith3.sub b/tests/arith3.sub
index ce541635..b4b18258 100644
--- a/tests/arith3.sub
+++ b/tests/arith3.sub
@@ -1,3 +1,16 @@
+# 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 <http://www.gnu.org/licenses/>.
+#
# this depends on the sequence of random numbers from the internal LCRNG
RANDOM=42
(( dice[RANDOM%6+1 + RANDOM%6+1]++ ))
diff --git a/tests/arith5.sub b/tests/arith5.sub
index c8fdb5a9..26ae600b 100644
--- a/tests/arith5.sub
+++ b/tests/arith5.sub
@@ -1,3 +1,16 @@
+# 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 <http://www.gnu.org/licenses/>.
+#
intmax_max=$((2**63 - 1))
intmax_min1=$((2**63))
intmax_min2=$((-2**63))
diff --git a/tests/arith6.sub b/tests/arith6.sub
index 630e917e..dec8fd03 100644
--- a/tests/arith6.sub
+++ b/tests/arith6.sub
@@ -1,3 +1,16 @@
+# 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 <http://www.gnu.org/licenses/>.
+#
function reorder
{
(( x[1] < x && (x=x[1], x[1]=$x) ))
diff --git a/tests/arith8.sub b/tests/arith8.sub
index 1ab0895e..e6f1b0d9 100644
--- a/tests/arith8.sub
+++ b/tests/arith8.sub
@@ -1,3 +1,16 @@
+# 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 <http://www.gnu.org/licenses/>.
+#
# problems with evaluation of wrong terms in conditional expressions through
# bash-4.4
diff --git a/tests/array.right b/tests/array.right
index ce0a7d55..a115377b 100644
--- a/tests/array.right
+++ b/tests/array.right
@@ -1,6 +1,6 @@
-./array.tests: line 15: syntax error near unexpected token `&'
-./array.tests: line 15: `test=(first & second)'
+./array.tests: line 28: syntax error near unexpected token `&'
+./array.tests: line 28: `test=(first & second)'
1
abcde
abcde
@@ -26,7 +26,7 @@ hello world
11
3
bdef hello world test expression test 2
-./array.tests: line 79: readonly: `a[5]': not a valid identifier
+./array.tests: line 92: readonly: `a[5]': not a valid identifier
declare -ar a=([1]="" [2]="bdef" [5]="hello world" [6]="test expression" [15]="test 2")
declare -ar c
declare -ar a=([1]="" [2]="bdef" [5]="hello world" [6]="test expression" [15]="test 2")
@@ -46,17 +46,17 @@ declare -ar c
declare -a d=([1]="" [2]="bdef" [5]="hello world" [6]="test" [9]="ninth element")
declare -a e=([0]="test")
declare -a f=([0]="" [1]="bdef" [2]="hello world" [3]="test" [4]="ninth element")
-./array.tests: line 103: a: readonly variable
-./array.tests: line 105: b[]: bad array subscript
-./array.tests: line 106: b[*]: bad array subscript
+./array.tests: line 116: a: readonly variable
+./array.tests: line 118: b[]: bad array subscript
+./array.tests: line 119: b[*]: bad array subscript
this
-./array.tests: line 109: c[-2]: bad array subscript
-./array.tests: line 110: c: bad array subscript
+./array.tests: line 122: c[-2]: bad array subscript
+./array.tests: line 123: c: bad array subscript
-./array.tests: line 112: d[7]: cannot assign list to array member
-./array.tests: line 114: []=abcde: bad array subscript
-./array.tests: line 114: [*]=last: cannot assign to non-numeric index
-./array.tests: line 114: [-65]=negative: bad array subscript
+./array.tests: line 125: d[7]: cannot assign list to array member
+./array.tests: line 127: []=abcde: bad array subscript
+./array.tests: line 127: [*]=last: cannot assign to non-numeric index
+./array.tests: line 127: [-65]=negative: bad array subscript
declare -a BASH_ARGC=()
declare -a BASH_ARGV=()
declare -a BASH_LINENO=([0]="0")
@@ -68,8 +68,8 @@ declare -a b=([0]="this" [1]="is" [2]="a" [3]="test" [4]="" [5]="/etc/passwd")
declare -ar c
declare -a d=([1]="test test")
declare -a f=([0]="" [1]="bdef" [2]="hello world" [3]="test" [4]="ninth element")
-./array.tests: line 122: unset: ps1: not an array variable
-./array.tests: line 126: declare: c: cannot destroy array variables in this way
+./array.tests: line 135: unset: ps1: not an array variable
+./array.tests: line 139: declare: c: cannot destroy array variables in this way
this of
this is a test of read using arrays
this test
@@ -127,7 +127,7 @@ grep [ 123 ] *
6 7 9 5
length = 3
value = new1 new2 new3
-./array.tests: line 242: narray: unbound variable
+./array.tests: line 255: narray: unbound variable
./array1.sub: line 1: syntax error near unexpected token `('
./array1.sub: line 1: `printf "%s\n" -a a=(a 'b c')'
./array2.sub: line 1: declare: `[]=asdf': not a valid identifier
@@ -154,10 +154,10 @@ for case if then else
12 14 16 18 20
4414758999202
aaa bbb
-./array.tests: line 292: syntax error near unexpected token `<>'
-./array.tests: line 292: `metas=( <> < > ! )'
-./array.tests: line 293: syntax error near unexpected token `<>'
-./array.tests: line 293: `metas=( [1]=<> [2]=< [3]=> [4]=! )'
+./array.tests: line 305: syntax error near unexpected token `<>'
+./array.tests: line 305: `metas=( <> < > ! )'
+./array.tests: line 306: syntax error near unexpected token `<>'
+./array.tests: line 306: `metas=( [1]=<> [2]=< [3]=> [4]=! )'
abc 3
case 4
abc case if then else 5
@@ -367,7 +367,7 @@ function function
declare -a x=([0]="0" [1]="1" [2]="2" [3]="3" [4]="4" [5]="5")
declare -a x=([0]="0" [1]="1" [2]="2" [3]="3" [4]="4")
declare -a x=([0]="0" [1]="1" [2]="2" [4]="4")
-./array14.sub: line 11: unset: [-10]: bad array subscript
+./array14.sub: line 24: unset: [-10]: bad array subscript
declare -a x=([0]="0" [1]="1" [2]="2" [3]="3" [4]="4")
declare -a x=([0]="0" [1]="1" [2]="2" [3]="3" [4]="4" [5]="five")
declare -a x=([0]="0" [1]="1" [2]="2" [3]="3" [4]="4" [5]="5")
@@ -395,7 +395,7 @@ qux: unset array element 0: ok
0
0
1
-./array17.sub: line 30: ~: syntax error: operand expected (error token is "~")
+./array17.sub: line 43: ~: syntax error: operand expected (error token is "~")
0
0
3
@@ -410,7 +410,7 @@ one
one
two
two
-./array17.sub: line 76: ~ : syntax error: operand expected (error token is "~ ")
+./array17.sub: line 89: ~ : syntax error: operand expected (error token is "~ ")
1
argv[1] = <>
argv[2] = <>
@@ -442,9 +442,9 @@ declare -a foo=([0]="[0]=bar")
declare -a foo=([0]="[0]=bar")
declare -- a="(1 2 3)"
declare -a a=([0]="1" [1]="2" [2]="3")
-./array19.sub: line 46: a: 1: must use subscript when assigning associative array
-./array19.sub: line 46: a: 2: must use subscript when assigning associative array
-./array19.sub: line 46: a: 3: must use subscript when assigning associative array
+./array19.sub: line 59: a: 1: must use subscript when assigning associative array
+./array19.sub: line 59: a: 2: must use subscript when assigning associative array
+./array19.sub: line 59: a: 3: must use subscript when assigning associative array
declare -A a=()
declare -- a="([0]=a [1]=b)"
declare -a a=([0]="a" [1]="b")
@@ -452,7 +452,7 @@ declare -A a=([1]="b" [0]="a" )
declare -a var=([0]="[\$(echo" [1]="total" [2]="0)]=1" [3]="[2]=2]")
declare -a var=([0]="[\$(echo total 0)]=1 [2]=2]")
declare -a var=([0]="[\$(echo" [1]="total" [2]="0)]=1" [3]="[2]=2]")
-./array19.sub: line 81: total 0: syntax error in expression (error token is "0")
+./array19.sub: line 94: total 0: syntax error in expression (error token is "0")
declare -a var=()
declare -al foo=([0]="abcde" [1]="two" [2]="three")
declare -al foo=([0]="abcde")
@@ -460,7 +460,7 @@ declare -al ar=([0]="one" [1]="two" [2]="three")
declare -a a=([2]="foo")
declare -a a=([2]="foo")
declare -a a=([1]="(var)" [2]="foo")
-./array19.sub: line 120: warning: a[1]=(var): quoted compound array assignment deprecated
+./array19.sub: line 133: warning: a[1]=(var): quoted compound array assignment deprecated
declare -a a=([1]="(var)")
declare -a a=([0]="1" [1]="2" [2]="(1 2 3)")
declare -a a=([0]="1" [1]="2" [2]="(1 2 3)")
@@ -477,10 +477,10 @@ declare -a b=([0]="/scratch/bash")
declare -a c=([0]="1" [1]="2")
declare -a d=([0]="a" [1]="b")
declare -a e=([0]="Darwin")
-./array19.sub: line 166: c: 1: must use subscript when assigning associative array
-./array19.sub: line 166: c: 2: must use subscript when assigning associative array
-./array19.sub: line 166: d: $a: must use subscript when assigning associative array
-./array19.sub: line 166: e: $(echo Darwin): must use subscript when assigning associative array
+./array19.sub: line 179: c: 1: must use subscript when assigning associative array
+./array19.sub: line 179: c: 2: must use subscript when assigning associative array
+./array19.sub: line 179: d: $a: must use subscript when assigning associative array
+./array19.sub: line 179: e: $(echo Darwin): must use subscript when assigning associative array
declare -A a=([0]="a b" )
declare -A b=([0]="/scratch/bash" )
declare -A c=()
@@ -499,8 +499,8 @@ x b c
declare -a a=([1]="2" [2]="3" [3]="4")
abcd
unset
-./array21.sub: line 17: typeset: a: not found
-./array21.sub: line 20: typeset: A: not found
+./array21.sub: line 30: typeset: a: not found
+./array21.sub: line 33: typeset: A: not found
declare -a a=()
declare -A A=()
declare -a foo=([0]="1" [1]="(4 5 6)" [2]="3")
@@ -525,16 +525,16 @@ p3
argv[1] = <y>
<X> <X> <X> <X>
<X> <X> <X> <X>
-./array23.sub: line 9: $( echo >&2 foo ) : syntax error: operand expected (error token is "$( echo >&2 foo ) ")
-./array23.sub: line 10: $( echo >&2 foo ) : syntax error: operand expected (error token is "$( echo >&2 foo ) ")
+./array23.sub: line 22: $( echo >&2 foo ) : syntax error: operand expected (error token is "$( echo >&2 foo ) ")
+./array23.sub: line 23: $( echo >&2 foo ) : syntax error: operand expected (error token is "$( echo >&2 foo ) ")
foo
0
foo
foo
foo
6
-./array23.sub: line 21: $( echo >&2 foo ): syntax error: operand expected (error token is "$( echo >&2 foo )")
-./array23.sub: line 22: $( echo >&2 foo ): syntax error: operand expected (error token is "$( echo >&2 foo )")
+./array23.sub: line 34: $( echo >&2 foo ): syntax error: operand expected (error token is "$( echo >&2 foo )")
+./array23.sub: line 35: $( echo >&2 foo ): syntax error: operand expected (error token is "$( echo >&2 foo )")
0
0
0
@@ -588,7 +588,7 @@ jkl
1. indexed:
reference:
1. 0
-./array25.sub: line 11: ' ': syntax error: operand expected (error token is "' '")
+./array25.sub: line 24: ' ': syntax error: operand expected (error token is "' '")
3. 0
4. 0
5. 0
@@ -750,17 +750,17 @@ argv[1] = <b>
argv[2] = <a>
argv[1] = <b+a>
7
-./array27.sub: line 11: a[]]=7 : syntax error: invalid arithmetic operator (error token is "]=7 ")
+./array27.sub: line 24: a[]]=7 : syntax error: invalid arithmetic operator (error token is "]=7 ")
declare -A A=([$'\t']="2" [" "]="2" )
-./array27.sub: line 23: ((: A[]]=2 : syntax error: invalid arithmetic operator (error token is "]=2 ")
+./array27.sub: line 36: ((: A[]]=2 : syntax error: invalid arithmetic operator (error token is "]=2 ")
declare -A A=([$'\t']="2" ["*"]="2" [" "]="2" ["@"]="2" )
-./array27.sub: line 32: A[]]: bad array subscript
+./array27.sub: line 45: A[]]: bad array subscript
declare -A A=([$'\t']="X" ["*"]="X" [" "]="X" ["@"]="X" )
-./array27.sub: line 40: A[]]: bad array subscript
+./array27.sub: line 53: A[]]: bad array subscript
declare -A A=([$'\t']="X" ["*"]="X" [" "]="X" ["@"]="X" )
-./array27.sub: line 48: declare: `A[]]=X': not a valid identifier
+./array27.sub: line 61: declare: `A[]]=X': not a valid identifier
declare -A A=(["*"]="X" ["@"]="X" )
-./array27.sub: line 56: declare: `A[]]=X': not a valid identifier
-./array27.sub: line 56: A[*]: bad array subscript
-./array27.sub: line 56: A[@]: bad array subscript
+./array27.sub: line 69: declare: `A[]]=X': not a valid identifier
+./array27.sub: line 69: A[*]: bad array subscript
+./array27.sub: line 69: A[@]: bad array subscript
declare -A A
diff --git a/tests/array.tests b/tests/array.tests
index afd3df51..7308eee7 100644
--- a/tests/array.tests
+++ b/tests/array.tests
@@ -1,3 +1,16 @@
+# 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 <http://www.gnu.org/licenses/>.
+#
# this is needed so that the bad assignments (b[]=bcde, for example) do not
# cause fatal shell errors when in posix mode
set +o posix
diff --git a/tests/array10.sub b/tests/array10.sub
index 6d5a94c9..71824804 100644
--- a/tests/array10.sub
+++ b/tests/array10.sub
@@ -1,3 +1,16 @@
+# 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 <http://www.gnu.org/licenses/>.
+#
days=({Mon,Tues,Wednes,Thurs,Fri,Satur,Sun}day)
echo ${days[@]}
diff --git a/tests/array11.sub b/tests/array11.sub
index c4f8cad4..5961902a 100644
--- a/tests/array11.sub
+++ b/tests/array11.sub
@@ -1,3 +1,16 @@
+# 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 <http://www.gnu.org/licenses/>.
+#
# problems with associative array keys with ] and unbalanced [ ]
# fixed after bash-4.2
diff --git a/tests/array12.sub b/tests/array12.sub
index 65711385..fbf5eeb0 100644
--- a/tests/array12.sub
+++ b/tests/array12.sub
@@ -1,3 +1,16 @@
+# 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 <http://www.gnu.org/licenses/>.
+#
# problems with fix for posix interp 217 introduced in bash-4.2
declare -ax array
diff --git a/tests/array13.sub b/tests/array13.sub
index 736f210c..635cb977 100644
--- a/tests/array13.sub
+++ b/tests/array13.sub
@@ -1,4 +1,3 @@
-#!/bin/bash
func1(){
declare -g variable='function'
diff --git a/tests/array14.sub b/tests/array14.sub
index 7715169c..57a455a6 100644
--- a/tests/array14.sub
+++ b/tests/array14.sub
@@ -1,3 +1,16 @@
+# 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 <http://www.gnu.org/licenses/>.
+#
# start at a test suite for negative indexed array subscripts -- post bash-4.2
x=( 0 1 2 3 4 5)
declare -p x
diff --git a/tests/array15.sub b/tests/array15.sub
index b056ccbb..47796b95 100644
--- a/tests/array15.sub
+++ b/tests/array15.sub
@@ -1,3 +1,16 @@
+# 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 <http://www.gnu.org/licenses/>.
+#
# fixes for make_internal_declare not handling integer attribute for arrays
declare -ai -g foo=(1 2 xx 3)
echo "${foo[@]}"
diff --git a/tests/array16.sub b/tests/array16.sub
index 10024bc1..b82dbca2 100644
--- a/tests/array16.sub
+++ b/tests/array16.sub
@@ -1,3 +1,16 @@
+# 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 <http://www.gnu.org/licenses/>.
+#
foo[0]=a
foo[1]=b
diff --git a/tests/array17.sub b/tests/array17.sub
index 302dc039..dd0c0f69 100644
--- a/tests/array17.sub
+++ b/tests/array17.sub
@@ -1,3 +1,16 @@
+# 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 <http://www.gnu.org/licenses/>.
+#
# this shows the expansions an array subscript undergoes before being run
# through the arithmetic evaluator
diff --git a/tests/array18.sub b/tests/array18.sub
index 675b194e..95030812 100644
--- a/tests/array18.sub
+++ b/tests/array18.sub
@@ -1,3 +1,16 @@
+# 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 <http://www.gnu.org/licenses/>.
+#
# arrays referenced using @ subscript and positional parameters should behave
# the same way
diff --git a/tests/array19.sub b/tests/array19.sub
index adfad82a..61e93865 100644
--- a/tests/array19.sub
+++ b/tests/array19.sub
@@ -1,3 +1,16 @@
+# 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 <http://www.gnu.org/licenses/>.
+#
# tests for changes to declare and assignment statement arguments post-bash-4.3
unset foo l a b
diff --git a/tests/array20.sub b/tests/array20.sub
index 035d936b..24dff930 100644
--- a/tests/array20.sub
+++ b/tests/array20.sub
@@ -1,3 +1,16 @@
+# 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 <http://www.gnu.org/licenses/>.
+#
# tests to make sure that $* and ${array[*]} expand consistently in `list'
# and `scalar' contexts
diff --git a/tests/array21.sub b/tests/array21.sub
index d1f705e3..97ff0936 100644
--- a/tests/array21.sub
+++ b/tests/array21.sub
@@ -1,3 +1,16 @@
+# 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 <http://www.gnu.org/licenses/>.
+#
typeset -a a
a=(1 2 3 4)
diff --git a/tests/array22.sub b/tests/array22.sub
index adae6e1a..3374ef2f 100644
--- a/tests/array22.sub
+++ b/tests/array22.sub
@@ -1,3 +1,16 @@
+# 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 <http://www.gnu.org/licenses/>.
+#
# This isn't perfect behavior, but it establishes a baseline and will provide
# a way to detect behavior changes
diff --git a/tests/array23.sub b/tests/array23.sub
index bd64fe1f..02d271db 100644
--- a/tests/array23.sub
+++ b/tests/array23.sub
@@ -1,3 +1,16 @@
+# 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 <http://www.gnu.org/licenses/>.
+#
# this captures how bash and ksh93 expand indexed array subscripts in
# various contexts. if changes are ever made, or an option added to do
# this differently, the diffs will show up here
diff --git a/tests/array24.sub b/tests/array24.sub
index 108f761b..461b4068 100644
--- a/tests/array24.sub
+++ b/tests/array24.sub
@@ -1,3 +1,16 @@
+# 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 <http://www.gnu.org/licenses/>.
+#
set -- "abc" "def ghi" "jkl"
A=("$@")
diff --git a/tests/array25.sub b/tests/array25.sub
index b550d9d5..fe6bb348 100644
--- a/tests/array25.sub
+++ b/tests/array25.sub
@@ -1,3 +1,16 @@
+# 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 <http://www.gnu.org/licenses/>.
+#
# tests with blank subscripts, indexed and associative
echo 1. indexed:
diff --git a/tests/array26.sub b/tests/array26.sub
index 826774f7..0f6cc8fa 100644
--- a/tests/array26.sub
+++ b/tests/array26.sub
@@ -1,3 +1,16 @@
+# 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 <http://www.gnu.org/licenses/>.
+#
# these should produce the same results
a=(aa bb)
set -- aa bb
diff --git a/tests/array27.sub b/tests/array27.sub
index fe1ffd35..44ed444d 100644
--- a/tests/array27.sub
+++ b/tests/array27.sub
@@ -1,3 +1,16 @@
+# 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 <http://www.gnu.org/licenses/>.
+#
# tests for `problem' keys when using associative arrays and assoc_expand_once
# deal with problems for now; this is a placeholder for if and when I fix them
diff --git a/tests/array4.sub b/tests/array4.sub
index 97c766db..443a0fd8 100644
--- a/tests/array4.sub
+++ b/tests/array4.sub
@@ -1,3 +1,16 @@
+# 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 <http://www.gnu.org/licenses/>.
+#
# compound assignment parsing problems in bash-3.1-release
func()
{
diff --git a/tests/array5.sub b/tests/array5.sub
index 00953c4a..0dda6969 100644
--- a/tests/array5.sub
+++ b/tests/array5.sub
@@ -1,3 +1,16 @@
+# 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 <http://www.gnu.org/licenses/>.
+#
: ${TMPDIR:=/tmp}
diff --git a/tests/array6.sub b/tests/array6.sub
index 0017f4cd..2c6c3502 100644
--- a/tests/array6.sub
+++ b/tests/array6.sub
@@ -1,3 +1,16 @@
+# 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 <http://www.gnu.org/licenses/>.
+#
# test cases for array quoting and escaping fixed post bash-3.2-release
oIFS="$IFS"
diff --git a/tests/array8.sub b/tests/array8.sub
index 481ccdbc..6e7e2d6c 100644
--- a/tests/array8.sub
+++ b/tests/array8.sub
@@ -1,3 +1,16 @@
+# 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 <http://www.gnu.org/licenses/>.
+#
IFS=/
declare -a i
diff --git a/tests/array9.sub b/tests/array9.sub
index 444247fa..c3aa31d1 100644
--- a/tests/array9.sub
+++ b/tests/array9.sub
@@ -1,3 +1,16 @@
+# 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 <http://www.gnu.org/licenses/>.
+#
echo $(( 0x7e ))
echo $(( 0x7f ))
echo $(( 0x80 ))
diff --git a/tests/assoc.right b/tests/assoc.right
index d2105488..83bf9ac9 100644
--- a/tests/assoc.right
+++ b/tests/assoc.right
@@ -7,17 +7,17 @@ declare -A fluff=([foo]="one" [bar]="two" )
declare -A fluff=([foo]="one" [bar]="two" )
declare -A fluff=([bar]="two" )
declare -A fluff=([bar]="newval" [qux]="assigned" )
-./assoc.tests: line 26: chaff: four: must use subscript when assigning associative array
+./assoc.tests: line 39: chaff: four: must use subscript when assigning associative array
declare -A BASH_ALIASES=()
declare -A BASH_CMDS=()
declare -Ai chaff=([zero]="5" [one]="10" )
-declare -Ar waste=([lineno]="28" [source]="./assoc.tests" [version]="4.0-devel" [pid]="42134" )
+declare -Ar waste=([lineno]="41" [source]="./assoc.tests" [version]="4.0-devel" [pid]="42134" )
declare -A wheat=([two]="b" [three]="c" [zero]="0" [one]="a" )
declare -A chaff=(["hello world"]="flip" [zero]="5" [one]="10" )
-./assoc.tests: line 38: waste: readonly variable
-./assoc.tests: line 39: unset: waste: cannot unset: readonly variable
-./assoc.tests: line 40: chaff[*]: bad array subscript
-./assoc.tests: line 41: [*]=12: invalid associative array key
+./assoc.tests: line 51: waste: readonly variable
+./assoc.tests: line 52: unset: waste: cannot unset: readonly variable
+./assoc.tests: line 53: chaff[*]: bad array subscript
+./assoc.tests: line 54: [*]=12: invalid associative array key
declare -A chaff=(["hello world"]="flip" [one]="a" )
flip
argv[1] = <multiple>
@@ -32,9 +32,9 @@ argv[2] = <words>
argv[3] = <flip>
argv[4] = <a>
argv[1] = <multiple words flip a>
-./assoc.tests: line 58: declare: chaff: cannot destroy array variables in this way
-./assoc.tests: line 60: chaff[*]: bad array subscript
-./assoc.tests: line 61: [*]=12: invalid associative array key
+./assoc.tests: line 71: declare: chaff: cannot destroy array variables in this way
+./assoc.tests: line 73: chaff[*]: bad array subscript
+./assoc.tests: line 74: [*]=12: invalid associative array key
declare -A wheat=(["foo bar"]="qux qix" [six]="6" )
argv[1] = <qux>
argv[2] = <qix>
@@ -137,7 +137,7 @@ argv[4] = <FOOQ>
abc
def
def
-./assoc5.sub: line 13: declare: `myarray[foo[bar]=bleh': not a valid identifier
+./assoc5.sub: line 26: declare: `myarray[foo[bar]=bleh': not a valid identifier
bleh def abc
myarray=([foo]="bleh" ["]"]="def" ["a]=test1;#a"]="123" ["a]a"]="abc" )
@@ -200,10 +200,10 @@ declare -A hash=([key]="value1 value2" )
declare -A b=([")"]="" ["\""]="" ["]"]="" ["\\"]="" ["\`"]="" )
declare -A b=(["]"]="" ["\`"]="" )
declare -A dict=(["'"]="3" ["\""]="1" ["\\"]="4" ["\`"]="2" )
-./assoc9.sub: line 23: unset: `dict[']': not a valid identifier
-./assoc9.sub: line 23: unset: `dict["]': not a valid identifier
-./assoc9.sub: line 23: unset: `dict[\]': not a valid identifier
-./assoc9.sub: line 23: unset: `dict[`]': not a valid identifier
+./assoc9.sub: line 36: unset: `dict[']': not a valid identifier
+./assoc9.sub: line 36: unset: `dict["]': not a valid identifier
+./assoc9.sub: line 36: unset: `dict[\]': not a valid identifier
+./assoc9.sub: line 36: unset: `dict[`]': not a valid identifier
declare -A dict=(["'"]="3" ["\""]="1" ["\\"]="4" ["\`"]="2" )
declare -A dict=(["'"]="3" ["\""]="1" ["\\"]="4" ["\`"]="2" )
declare -A dict=()
@@ -211,10 +211,10 @@ declare -A dict=()
4
a[$b]= 5
declare -A a=(["80's"]="Depeche Mode" )
-./assoc9.sub: line 71: read: `a[80's]': not a valid identifier
+./assoc9.sub: line 84: read: `a[80's]': not a valid identifier
declare -A a
declare -A a=(["80's"]="Depeche Mode" )
-./assoc9.sub: line 83: printf: `a[80's]': not a valid identifier
+./assoc9.sub: line 96: printf: `a[80's]': not a valid identifier
declare -A a
declare -A a=(["80's"]="Depeche Mode" )
6
@@ -222,9 +222,9 @@ declare -A a=(["80's"]="Depeche Mode" )
1+5
declare -A a=(["\$(date >&2)"]="5" )
declare -A myarray=([foo]="bleh" ["foo[bar"]="bleh" )
-./assoc10.sub: line 1: declare: a: cannot convert indexed to associative array
+./assoc10.sub: line 14: declare: a: cannot convert indexed to associative array
f: declare -a a
-./assoc10.sub: line 4: declare: a: cannot convert associative to indexed array
+./assoc10.sub: line 17: declare: a: cannot convert associative to indexed array
f: declare -A a
f: declare -a a
diff --git a/tests/assoc.tests b/tests/assoc.tests
index 579b1bf8..847b4779 100644
--- a/tests/assoc.tests
+++ b/tests/assoc.tests
@@ -1,3 +1,16 @@
+# 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 <http://www.gnu.org/licenses/>.
+#
# TEST - basic declaration and assignment
typeset -A fluff
declare -A
diff --git a/tests/assoc1.sub b/tests/assoc1.sub
index a045bde9..99a6e22a 100644
--- a/tests/assoc1.sub
+++ b/tests/assoc1.sub
@@ -1,3 +1,16 @@
+# 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 <http://www.gnu.org/licenses/>.
+#
hash -r
echo ${BASH_CMDS[@]}
diff --git a/tests/assoc10.sub b/tests/assoc10.sub
index 9eef2cac..5b215258 100644
--- a/tests/assoc10.sub
+++ b/tests/assoc10.sub
@@ -1,3 +1,16 @@
+# 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 <http://www.gnu.org/licenses/>.
+#
f() { declare -a a; declare -A a; echo -n "$FUNCNAME: " ; declare -p a; }
f
diff --git a/tests/assoc2.sub b/tests/assoc2.sub
index 396b87a3..470e2c94 100644
--- a/tests/assoc2.sub
+++ b/tests/assoc2.sub
@@ -1,3 +1,16 @@
+# 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 <http://www.gnu.org/licenses/>.
+#
echo ${BASH_ALIASES[@]}
alias foo=/usr/sbin/foo
diff --git a/tests/assoc3.sub b/tests/assoc3.sub
index 9129ef1d..a7eeb265 100644
--- a/tests/assoc3.sub
+++ b/tests/assoc3.sub
@@ -1,3 +1,16 @@
+# 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 <http://www.gnu.org/licenses/>.
+#
foo()
{
declare -A afoo=([six]="six" [foo bar]="foo quux")
diff --git a/tests/assoc4.sub b/tests/assoc4.sub
index 1516dc58..eff9d0e8 100644
--- a/tests/assoc4.sub
+++ b/tests/assoc4.sub
@@ -1,3 +1,16 @@
+# 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 <http://www.gnu.org/licenses/>.
+#
IFS=/
declare -A i
diff --git a/tests/assoc5.sub b/tests/assoc5.sub
index 400f3d39..844d9441 100644
--- a/tests/assoc5.sub
+++ b/tests/assoc5.sub
@@ -1,3 +1,16 @@
+# 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 <http://www.gnu.org/licenses/>.
+#
declare -A myarray
# this needs fixes to skipsubscript
diff --git a/tests/assoc6.sub b/tests/assoc6.sub
index 54112ee5..88b8eaf2 100644
--- a/tests/assoc6.sub
+++ b/tests/assoc6.sub
@@ -1,3 +1,16 @@
+# 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 <http://www.gnu.org/licenses/>.
+#
declare -A foo
foo=([bar\"bie]=doll)
diff --git a/tests/assoc7.sub b/tests/assoc7.sub
index 5bc5150e..cae57c55 100644
--- a/tests/assoc7.sub
+++ b/tests/assoc7.sub
@@ -1,3 +1,16 @@
+# 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 <http://www.gnu.org/licenses/>.
+#
# problem with bash versions through bash-4.2
foo()
{
diff --git a/tests/assoc9.sub b/tests/assoc9.sub
index c5fbe45b..8f2a23be 100644
--- a/tests/assoc9.sub
+++ b/tests/assoc9.sub
@@ -1,3 +1,16 @@
+# 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 <http://www.gnu.org/licenses/>.
+#
typeset -A a=( [\\]= [\"]= [\)]= ) b
for x in "${!a[@]}"; do b[$x]=; done
b+=([\`]= [\]]=)
diff --git a/tests/attr.right b/tests/attr.right
index 631b3f41..d2d28b7b 100644
--- a/tests/attr.right
+++ b/tests/attr.right
@@ -1,9 +1,9 @@
after f1:declare -ar a=([0]="1")
-./attr.tests: line 4: a: readonly variable
+./attr.tests: line 17: a: readonly variable
after f2:declare -ar a=([0]="1")
-./attr.tests: line 5: a: readonly variable
+./attr.tests: line 18: a: readonly variable
after f3:declare -ar a=([0]="1")
-./attr.tests: line 6: readonly: a: readonly variable
+./attr.tests: line 19: readonly: a: readonly variable
after f4:declare -ar a=([0]="1")
after f2:declare -ar b=([0]="2")
after f3:declare -ar c=([0]="(3)")
@@ -11,15 +11,15 @@ after f4:declare -ar d=([0]="4")
declare -r m="4"
in func:declare -r n="4"
declare -r n="4"
-./attr1.sub: line 13: p: readonly variable
+./attr1.sub: line 26: p: readonly variable
declare -r p="1"
-./attr1.sub: line 19: r: readonly variable
+./attr1.sub: line 32: r: readonly variable
declare -ar r=([0]="1")
-./attr1.sub: line 23: r: readonly variable
+./attr1.sub: line 36: r: readonly variable
declare -ar r=([0]="1")
-./attr1.sub: line 27: r: readonly variable
+./attr1.sub: line 40: r: readonly variable
declare -ar r=([0]="1")
-./attr1.sub: line 31: readonly: r: readonly variable
+./attr1.sub: line 44: readonly: r: readonly variable
declare -ar r=([0]="1")
declare -ar x=([0]="4")
in func:declare -ar y=([0]="4")
diff --git a/tests/attr.tests b/tests/attr.tests
index b5e01596..4874d9a7 100644
--- a/tests/attr.tests
+++ b/tests/attr.tests
@@ -1,3 +1,16 @@
+# 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 <http://www.gnu.org/licenses/>.
+#
a=(outside)
f1() { readonly a=(1) ; }
diff --git a/tests/attr1.sub b/tests/attr1.sub
index 1c0609ab..4424be95 100644
--- a/tests/attr1.sub
+++ b/tests/attr1.sub
@@ -1,3 +1,16 @@
+# 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 <http://www.gnu.org/licenses/>.
+#
m=1
readonly m=4
declare -p m
diff --git a/tests/attr2.sub b/tests/attr2.sub
index 28d447cc..dadca10b 100644
--- a/tests/attr2.sub
+++ b/tests/attr2.sub
@@ -1,3 +1,16 @@
+# 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 <http://www.gnu.org/licenses/>.
+#
p=1
export p
diff --git a/tests/braces.tests b/tests/braces.tests
index a80cf450..da0b624b 100644
--- a/tests/braces.tests
+++ b/tests/braces.tests
@@ -1,3 +1,16 @@
+# 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 <http://www.gnu.org/licenses/>.
+#
echo ff{c,b,a}
echo f{d,e,f}g
echo {l,n,m}xyz
diff --git a/tests/builtins.right b/tests/builtins.right
index 32db2a53..9aa182cd 100644
--- a/tests/builtins.right
+++ b/tests/builtins.right
@@ -105,9 +105,9 @@ m n o p
/tmp/bash-dir-a
/tmp/bash-dir-a
/tmp/bash-dir-a
-./source5.sub: line 10: /tmp/source-notthere: No such file or directory
+./source5.sub: line 23: /tmp/source-notthere: No such file or directory
after bad source 1
-./source5.sub: line 17: /tmp/source-notthere: No such file or directory
+./source5.sub: line 30: /tmp/source-notthere: No such file or directory
one - OK
0
0
@@ -144,11 +144,11 @@ AVAR
foo
declare -x foo=""
declare -x FOO="\$\$"
-./builtins.tests: line 213: declare: FOO: not found
+./builtins.tests: line 226: declare: FOO: not found
declare -x FOO="\$\$"
ok
ok
-./builtins.tests: line 245: kill: 4096: invalid signal specification
+./builtins.tests: line 258: kill: 4096: invalid signal specification
1
a\n\n\nb
a
@@ -208,8 +208,8 @@ f2 ()
all unset:
unset1
unset2
-./builtins6.sub: line 28: declare: f1: not found
-./builtins6.sub: line 28: declare: f2: not found
+./builtins6.sub: line 41: declare: f1: not found
+./builtins6.sub: line 41: declare: f2: not found
all reset:
one-one
two-one
@@ -235,4 +235,4 @@ f2 ()
funcs unset:
one-two
two-two
-./builtins.tests: line 266: exit: status: numeric argument required
+./builtins.tests: line 279: exit: status: numeric argument required
diff --git a/tests/builtins.tests b/tests/builtins.tests
index ac74fe6f..b422b217 100644
--- a/tests/builtins.tests
+++ b/tests/builtins.tests
@@ -1,3 +1,16 @@
+# 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 <http://www.gnu.org/licenses/>.
+#
# tests for miscellaneous builtins not tested elsewhere
set +p
set +o posix
diff --git a/tests/builtins4.sub b/tests/builtins4.sub
index b7d0c0c9..058ee2c1 100644
--- a/tests/builtins4.sub
+++ b/tests/builtins4.sub
@@ -1,3 +1,16 @@
+# 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 <http://www.gnu.org/licenses/>.
+#
declare -a c
declare -p c
diff --git a/tests/builtins5.sub b/tests/builtins5.sub
index 9a5dd7b9..d36e03a5 100644
--- a/tests/builtins5.sub
+++ b/tests/builtins5.sub
@@ -1,3 +1,16 @@
+# 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 <http://www.gnu.org/licenses/>.
+#
# a start at a test suite for what it means for an array to be set or unset and
# how to test that state
typeset -A A
diff --git a/tests/builtins6.sub b/tests/builtins6.sub
index c18b4766..d4fdf4ae 100644
--- a/tests/builtins6.sub
+++ b/tests/builtins6.sub
@@ -1,3 +1,16 @@
+# 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 <http://www.gnu.org/licenses/>.
+#
f1()
{
echo f1
diff --git a/tests/case.right b/tests/case.right
index d2055c9d..557bcadf 100644
--- a/tests/case.right
+++ b/tests/case.right
@@ -5,7 +5,7 @@ retest
and match
no more clauses
1.0
-./case.tests: line 29: xx: readonly variable
+./case.tests: line 42: xx: readonly variable
1.1
matches 1
no
diff --git a/tests/case.tests b/tests/case.tests
index fe9c05a7..2ffcb906 100644
--- a/tests/case.tests
+++ b/tests/case.tests
@@ -1,3 +1,16 @@
+# 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 <http://www.gnu.org/licenses/>.
+#
case foo in
bar) echo skip ;;
foo) echo fallthrough ;&
diff --git a/tests/case1.sub b/tests/case1.sub
index 7db09ab2..80771118 100644
--- a/tests/case1.sub
+++ b/tests/case1.sub
@@ -1,3 +1,16 @@
+# 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 <http://www.gnu.org/licenses/>.
+#
x='\x'
case x in
diff --git a/tests/case2.sub b/tests/case2.sub
index 085f888c..6c3be38e 100644
--- a/tests/case2.sub
+++ b/tests/case2.sub
@@ -1,3 +1,16 @@
+# 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 <http://www.gnu.org/licenses/>.
+#
x=$'\\a\\b\\c\\\001\\d\\e\\f'
y='\a\b\c\\d\e\f'
z=$'abc\001def'
diff --git a/tests/case3.sub b/tests/case3.sub
index 77526c32..1e8d785c 100644
--- a/tests/case3.sub
+++ b/tests/case3.sub
@@ -1,4 +1,16 @@
-#!/bin/sh
+# 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 <http://www.gnu.org/licenses/>.
+#
testmatch() {
case $1 in
diff --git a/tests/case4.sub b/tests/case4.sub
index 56f88baa..ababeb94 100644
--- a/tests/case4.sub
+++ b/tests/case4.sub
@@ -1,3 +1,16 @@
+# 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 <http://www.gnu.org/licenses/>.
+#
shopt -s -o posix
two="t w o"
ten="t e
diff --git a/tests/casemod.tests b/tests/casemod.tests
index dacdb0a8..20cb1cf5 100644
--- a/tests/casemod.tests
+++ b/tests/casemod.tests
@@ -1,3 +1,16 @@
+# 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 <http://www.gnu.org/licenses/>.
+#
S1=acknowledgement
S2=oenophile
diff --git a/tests/comsub-posix.tests b/tests/comsub-posix.tests
index d53e6ebc..2922a9c5 100644
--- a/tests/comsub-posix.tests
+++ b/tests/comsub-posix.tests
@@ -1,3 +1,16 @@
+# 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 <http://www.gnu.org/licenses/>.
+#
: ${HOME:=/}
# works right
diff --git a/tests/comsub-posix2.sub b/tests/comsub-posix2.sub
index 238745f7..d556fa93 100644
--- a/tests/comsub-posix2.sub
+++ b/tests/comsub-posix2.sub
@@ -1,3 +1,16 @@
+# 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 <http://www.gnu.org/licenses/>.
+#
# problem with bash-4.x versions before bash-4.2. required posix interp
swap32_posix()
{
diff --git a/tests/comsub-posix3.sub b/tests/comsub-posix3.sub
index 3a0e39a8..39262b22 100644
--- a/tests/comsub-posix3.sub
+++ b/tests/comsub-posix3.sub
@@ -1,3 +1,16 @@
+# 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 <http://www.gnu.org/licenses/>.
+#
# parsing errors before bash-4.2
a=$(/bin/cat << EOF | wc -l
diff --git a/tests/comsub.right b/tests/comsub.right
index 71bb205a..a329c832 100644
--- a/tests/comsub.right
+++ b/tests/comsub.right
@@ -1,4 +1,4 @@
-./comsub.tests: line 7: hijkl: command not found
+./comsub.tests: line 20: hijkl: command not found
argv[1] = <ab>
argv[2] = <cd>
argv[1] = <abmn>
diff --git a/tests/comsub.tests b/tests/comsub.tests
index ed56007c..47863024 100644
--- a/tests/comsub.tests
+++ b/tests/comsub.tests
@@ -1,3 +1,16 @@
+# 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 <http://www.gnu.org/licenses/>.
+#
# command substution parsing tests
TABSIZE=`grep -v '^[ #]' $CAPS </dev/null | grep -v "^$" | grep -v "^capalias"| grep -v "^infoalias" | wc -l`
diff --git a/tests/comsub1.sub b/tests/comsub1.sub
index b1af263b..ca722439 100644
--- a/tests/comsub1.sub
+++ b/tests/comsub1.sub
@@ -1,3 +1,16 @@
+# 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 <http://www.gnu.org/licenses/>.
+#
: $(echo \;)
: $(case a in a) echo ;;# comment
diff --git a/tests/comsub3.sub b/tests/comsub3.sub
index 69474000..757fbcae 100644
--- a/tests/comsub3.sub
+++ b/tests/comsub3.sub
@@ -1,3 +1,16 @@
+# 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 <http://www.gnu.org/licenses/>.
+#
x=$(
case 1 in
1) echo 1
diff --git a/tests/comsub4.sub b/tests/comsub4.sub
index 461a9ad1..e7a1c557 100644
--- a/tests/comsub4.sub
+++ b/tests/comsub4.sub
@@ -1,3 +1,16 @@
+# 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 <http://www.gnu.org/licenses/>.
+#
x=$(cat <<'EOT'
d \
g
diff --git a/tests/cond-regexp1.sub b/tests/cond-regexp1.sub
index dd287cbc..1ba9197a 100644
--- a/tests/cond-regexp1.sub
+++ b/tests/cond-regexp1.sub
@@ -1,3 +1,16 @@
+# 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 <http://www.gnu.org/licenses/>.
+#
VAR='[[:alpha:]]'
[[ $VAR =~ '[[:alpha:]]' ]] && echo match 1
diff --git a/tests/cond-regexp2.sub b/tests/cond-regexp2.sub
index 2bea6384..4da0a88f 100644
--- a/tests/cond-regexp2.sub
+++ b/tests/cond-regexp2.sub
@@ -1,3 +1,16 @@
+# 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 <http://www.gnu.org/licenses/>.
+#
[[ "\\" =~ ["."] ]] && echo bad 1
[[ "\\" =~ "[.]" ]] && echo bad 2
diff --git a/tests/cond-regexp3.sub b/tests/cond-regexp3.sub
index 8f098416..d939548c 100644
--- a/tests/cond-regexp3.sub
+++ b/tests/cond-regexp3.sub
@@ -1,3 +1,16 @@
+# 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 <http://www.gnu.org/licenses/>.
+#
# simple expansion -- no problem, it's quote_string_for_globbing that was flawed
c=$'\177'
r="\\$c"
diff --git a/tests/cond.right b/tests/cond.right
index 18ebd060..59a4a886 100644
--- a/tests/cond.right
+++ b/tests/cond.right
@@ -23,7 +23,7 @@ returns: 0
returns: 1
returns: 1
returns: 0
-./cond.tests: line 101: [[: 4+: syntax error: operand expected (error token is "+")
+./cond.tests: line 114: [[: 4+: syntax error: operand expected (error token is "+")
returns: 1
returns: 0
returns: 0
diff --git a/tests/cond.tests b/tests/cond.tests
index 2cef9293..aa6a8104 100755..100644
--- a/tests/cond.tests
+++ b/tests/cond.tests
@@ -1,3 +1,16 @@
+# 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 <http://www.gnu.org/licenses/>.
+#
#
# the test/[ code is tested elsewhere, and the [[...]] just uses the same
# code. this tests the special features of [[...]]
diff --git a/tests/coproc.tests b/tests/coproc.tests
index 5066f7c5..a7359320 100644
--- a/tests/coproc.tests
+++ b/tests/coproc.tests
@@ -1,3 +1,16 @@
+# 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 <http://www.gnu.org/licenses/>.
+#
: ${TMPDIR:=/tmp}
TMPOUT=${TMPDIR}/coproc-wait-$BASHPID
diff --git a/tests/cprint.tests b/tests/cprint.tests
index 08ff1ebc..e598f8c9 100644
--- a/tests/cprint.tests
+++ b/tests/cprint.tests
@@ -1,3 +1,16 @@
+# 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 <http://www.gnu.org/licenses/>.
+#
#
# a nonsense script and shell function to test out the command printing code
#
diff --git a/tests/dbg-support.right b/tests/dbg-support.right
index c4a1609e..6e2194aa 100644
--- a/tests/dbg-support.right
+++ b/tests/dbg-support.right
@@ -1,357 +1,357 @@
-debug lineno: 63 main
-debug lineno: 66 main
+debug lineno: 74 main
+debug lineno: 77 main
FUNCNAME main
-debug lineno: 70 main
-debug lineno: 17 fn1
-debug lineno: 18 fn1
-LINENO 18
-debug lineno: 19 fn1
-LINENO 19
-debug lineno: 20 fn1
+debug lineno: 81 main
+debug lineno: 30 fn1
+debug lineno: 31 fn1
+LINENO 31
+debug lineno: 32 fn1
+LINENO 32
+debug lineno: 33 fn1
BASH_SOURCE[0] ./dbg-support.tests
-debug lineno: 21 fn1
+debug lineno: 34 fn1
FUNCNAME[0] fn1
-debug lineno: 22 fn1
-debug lineno: 22 fn1 70 ./dbg-support.tests
-debug lineno: 23 fn1
-debug lineno: 23 fn1 70 main ./dbg-support.tests
-debug lineno: 24 fn1
-debug lineno: 24 fn1
-debug lineno: 25 fn1
-./dbg-support.tests: line 25: caller: foo: invalid number
+debug lineno: 35 fn1
+debug lineno: 35 fn1 81 ./dbg-support.tests
+debug lineno: 36 fn1
+debug lineno: 36 fn1 81 main ./dbg-support.tests
+debug lineno: 37 fn1
+debug lineno: 37 fn1
+debug lineno: 38 fn1
+./dbg-support.tests: line 38: caller: foo: invalid number
caller: usage: caller [expr]
-debug lineno: 25 fn1
-debug lineno: 17 fn1
-debug lineno: 12 print_return_trap
-debug lineno: 13 print_return_trap
-return lineno: 17 fn1
-debug lineno: 14 print_return_trap
-debug lineno: 71 main
-debug lineno: 28 fn2
-debug lineno: 29 fn2
+debug lineno: 38 fn1
+debug lineno: 30 fn1
+debug lineno: 25 print_return_trap
+debug lineno: 26 print_return_trap
+return lineno: 30 fn1
+debug lineno: 27 print_return_trap
+debug lineno: 82 main
+debug lineno: 41 fn2
+debug lineno: 42 fn2
fn2 here. Calling fn1...
-debug lineno: 30 fn2
-debug lineno: 17 fn1
-debug lineno: 18 fn1
-LINENO 18
-debug lineno: 19 fn1
-LINENO 19
-debug lineno: 20 fn1
+debug lineno: 43 fn2
+debug lineno: 30 fn1
+debug lineno: 31 fn1
+LINENO 31
+debug lineno: 32 fn1
+LINENO 32
+debug lineno: 33 fn1
BASH_SOURCE[0] ./dbg-support.tests
-debug lineno: 21 fn1
+debug lineno: 34 fn1
FUNCNAME[0] fn1
-debug lineno: 22 fn1
-debug lineno: 22 fn1 30 ./dbg-support.tests
-debug lineno: 23 fn1
-debug lineno: 23 fn1 30 fn2 ./dbg-support.tests
-debug lineno: 24 fn1
-debug lineno: 24 fn1 71 main ./dbg-support.tests
-debug lineno: 25 fn1
-./dbg-support.tests: line 25: caller: foo: invalid number
+debug lineno: 35 fn1
+debug lineno: 35 fn1 43 ./dbg-support.tests
+debug lineno: 36 fn1
+debug lineno: 36 fn1 43 fn2 ./dbg-support.tests
+debug lineno: 37 fn1
+debug lineno: 37 fn1 82 main ./dbg-support.tests
+debug lineno: 38 fn1
+./dbg-support.tests: line 38: caller: foo: invalid number
caller: usage: caller [expr]
-debug lineno: 25 fn1
-debug lineno: 17 fn1
-debug lineno: 12 print_return_trap
-debug lineno: 13 print_return_trap
-return lineno: 17 fn1
-debug lineno: 14 print_return_trap
-debug lineno: 28 fn2
-debug lineno: 12 print_return_trap
-debug lineno: 13 print_return_trap
-return lineno: 28 fn2
-debug lineno: 14 print_return_trap
-debug lineno: 72 main
-debug lineno: 33 fn3
-debug lineno: 34 fn3
-LINENO 34
-debug lineno: 35 fn3
+debug lineno: 38 fn1
+debug lineno: 30 fn1
+debug lineno: 25 print_return_trap
+debug lineno: 26 print_return_trap
+return lineno: 30 fn1
+debug lineno: 27 print_return_trap
+debug lineno: 41 fn2
+debug lineno: 25 print_return_trap
+debug lineno: 26 print_return_trap
+return lineno: 41 fn2
+debug lineno: 27 print_return_trap
+debug lineno: 83 main
+debug lineno: 46 fn3
+debug lineno: 47 fn3
+LINENO 47
+debug lineno: 48 fn3
BASH_SOURCE[0] ./dbg-support.tests
-debug lineno: 38 fn3
-debug lineno: 39 fn3
-debug lineno: 40 fn3
-debug lineno: 40 fn3
-debug lineno: 41 fn3
-debug lineno: 42 fn3
-debug lineno: 43 fn3
+debug lineno: 51 fn3
+debug lineno: 52 fn3
+debug lineno: 53 fn3
+debug lineno: 53 fn3
+debug lineno: 54 fn3
+debug lineno: 55 fn3
+debug lineno: 56 fn3
fn3 called from file `./dbg-support.tests' at line 0
-debug lineno: 40 fn3
-debug lineno: 40 fn3
-debug lineno: 41 fn3
-debug lineno: 42 fn3
-debug lineno: 42 fn3
-debug lineno: 43 fn3
+debug lineno: 53 fn3
+debug lineno: 53 fn3
+debug lineno: 54 fn3
+debug lineno: 55 fn3
+debug lineno: 55 fn3
+debug lineno: 56 fn3
main called from file `./dbg-support.tests' at line 0
-debug lineno: 40 fn3
-debug lineno: 40 fn3
-debug lineno: 46 fn3
-debug lineno: 18 source
-SOURCED LINENO 18
-debug lineno: 19 source
+debug lineno: 53 fn3
+debug lineno: 53 fn3
+debug lineno: 59 fn3
+debug lineno: 31 source
+SOURCED LINENO 31
+debug lineno: 32 source
SOURCED BASH_SOURCE[0] ./dbg-support.sub
-debug lineno: 20 source
-debug lineno: 3 sourced_fn
-debug lineno: 4 sourced_fn
-debug lineno: 5 sourced_fn
-SOURCED FN LINENO 5
-debug lineno: 8 sourced_fn
-debug lineno: 9 sourced_fn
-debug lineno: 10 sourced_fn
-debug lineno: 10 sourced_fn
-debug lineno: 11 sourced_fn
-debug lineno: 12 sourced_fn
-debug lineno: 13 sourced_fn
-FUNCNAME[0]: sourced_fn called from ./dbg-support.sub at line 20
-debug lineno: 10 sourced_fn
-debug lineno: 10 sourced_fn
-debug lineno: 11 sourced_fn
-debug lineno: 12 sourced_fn
-debug lineno: 13 sourced_fn
-FUNCNAME[1]: source called from ./dbg-support.tests at line 46
-debug lineno: 10 sourced_fn
-debug lineno: 10 sourced_fn
-debug lineno: 11 sourced_fn
-debug lineno: 12 sourced_fn
-debug lineno: 13 sourced_fn
-FUNCNAME[2]: fn3 called from ./dbg-support.tests at line 72
-debug lineno: 10 sourced_fn
-debug lineno: 10 sourced_fn
-debug lineno: 11 sourced_fn
-debug lineno: 12 sourced_fn
-debug lineno: 12 sourced_fn
-debug lineno: 13 sourced_fn
+debug lineno: 33 source
+debug lineno: 16 sourced_fn
+debug lineno: 17 sourced_fn
+debug lineno: 18 sourced_fn
+SOURCED FN LINENO 18
+debug lineno: 21 sourced_fn
+debug lineno: 22 sourced_fn
+debug lineno: 23 sourced_fn
+debug lineno: 23 sourced_fn
+debug lineno: 24 sourced_fn
+debug lineno: 25 sourced_fn
+debug lineno: 26 sourced_fn
+FUNCNAME[0]: sourced_fn called from ./dbg-support.sub at line 33
+debug lineno: 23 sourced_fn
+debug lineno: 23 sourced_fn
+debug lineno: 24 sourced_fn
+debug lineno: 25 sourced_fn
+debug lineno: 26 sourced_fn
+FUNCNAME[1]: source called from ./dbg-support.tests at line 59
+debug lineno: 23 sourced_fn
+debug lineno: 23 sourced_fn
+debug lineno: 24 sourced_fn
+debug lineno: 25 sourced_fn
+debug lineno: 26 sourced_fn
+FUNCNAME[2]: fn3 called from ./dbg-support.tests at line 83
+debug lineno: 23 sourced_fn
+debug lineno: 23 sourced_fn
+debug lineno: 24 sourced_fn
+debug lineno: 25 sourced_fn
+debug lineno: 25 sourced_fn
+debug lineno: 26 sourced_fn
FUNCNAME[3]: main called from ./dbg-support.tests at line 0
-debug lineno: 10 sourced_fn
-debug lineno: 10 sourced_fn
-debug lineno: 3 sourced_fn
-debug lineno: 12 print_return_trap
-debug lineno: 13 print_return_trap
-return lineno: 3 sourced_fn
-debug lineno: 14 print_return_trap
+debug lineno: 23 sourced_fn
+debug lineno: 23 sourced_fn
+debug lineno: 16 sourced_fn
+debug lineno: 25 print_return_trap
+debug lineno: 26 print_return_trap
+return lineno: 16 sourced_fn
+debug lineno: 27 print_return_trap
+debug lineno: 59 fn3
+debug lineno: 25 print_return_trap
+debug lineno: 26 print_return_trap
+return lineno: 59 fn3
+debug lineno: 27 print_return_trap
debug lineno: 46 fn3
-debug lineno: 12 print_return_trap
-debug lineno: 13 print_return_trap
+debug lineno: 25 print_return_trap
+debug lineno: 26 print_return_trap
return lineno: 46 fn3
-debug lineno: 14 print_return_trap
-debug lineno: 33 fn3
-debug lineno: 12 print_return_trap
-debug lineno: 13 print_return_trap
-return lineno: 33 fn3
-debug lineno: 14 print_return_trap
-debug lineno: 73 main
-debug lineno: 18 source
-SOURCED LINENO 18
-debug lineno: 19 source
+debug lineno: 27 print_return_trap
+debug lineno: 84 main
+debug lineno: 31 source
+SOURCED LINENO 31
+debug lineno: 32 source
SOURCED BASH_SOURCE[0] ./dbg-support.sub
-debug lineno: 20 source
-debug lineno: 3 sourced_fn
-debug lineno: 4 sourced_fn
-debug lineno: 5 sourced_fn
-SOURCED FN LINENO 5
-debug lineno: 8 sourced_fn
-debug lineno: 9 sourced_fn
-debug lineno: 10 sourced_fn
-debug lineno: 10 sourced_fn
-debug lineno: 11 sourced_fn
-debug lineno: 12 sourced_fn
-debug lineno: 13 sourced_fn
-FUNCNAME[0]: sourced_fn called from ./dbg-support.sub at line 20
-debug lineno: 10 sourced_fn
-debug lineno: 10 sourced_fn
-debug lineno: 11 sourced_fn
-debug lineno: 12 sourced_fn
-debug lineno: 13 sourced_fn
-FUNCNAME[1]: source called from ./dbg-support.tests at line 73
-debug lineno: 10 sourced_fn
-debug lineno: 10 sourced_fn
-debug lineno: 11 sourced_fn
-debug lineno: 12 sourced_fn
-debug lineno: 12 sourced_fn
-debug lineno: 13 sourced_fn
+debug lineno: 33 source
+debug lineno: 16 sourced_fn
+debug lineno: 17 sourced_fn
+debug lineno: 18 sourced_fn
+SOURCED FN LINENO 18
+debug lineno: 21 sourced_fn
+debug lineno: 22 sourced_fn
+debug lineno: 23 sourced_fn
+debug lineno: 23 sourced_fn
+debug lineno: 24 sourced_fn
+debug lineno: 25 sourced_fn
+debug lineno: 26 sourced_fn
+FUNCNAME[0]: sourced_fn called from ./dbg-support.sub at line 33
+debug lineno: 23 sourced_fn
+debug lineno: 23 sourced_fn
+debug lineno: 24 sourced_fn
+debug lineno: 25 sourced_fn
+debug lineno: 26 sourced_fn
+FUNCNAME[1]: source called from ./dbg-support.tests at line 84
+debug lineno: 23 sourced_fn
+debug lineno: 23 sourced_fn
+debug lineno: 24 sourced_fn
+debug lineno: 25 sourced_fn
+debug lineno: 25 sourced_fn
+debug lineno: 26 sourced_fn
FUNCNAME[2]: main called from ./dbg-support.tests at line 0
-debug lineno: 10 sourced_fn
-debug lineno: 10 sourced_fn
-debug lineno: 3 sourced_fn
-debug lineno: 12 print_return_trap
-debug lineno: 13 print_return_trap
-return lineno: 3 sourced_fn
-debug lineno: 14 print_return_trap
-debug lineno: 73 main
-debug lineno: 12 print_return_trap
-debug lineno: 13 print_return_trap
-return lineno: 73 main
-debug lineno: 14 print_return_trap
-debug lineno: 76 main
-debug lineno: 79 main
-LINENO 18
-LINENO 19
+debug lineno: 23 sourced_fn
+debug lineno: 23 sourced_fn
+debug lineno: 16 sourced_fn
+debug lineno: 25 print_return_trap
+debug lineno: 26 print_return_trap
+return lineno: 16 sourced_fn
+debug lineno: 27 print_return_trap
+debug lineno: 84 main
+debug lineno: 25 print_return_trap
+debug lineno: 26 print_return_trap
+return lineno: 84 main
+debug lineno: 27 print_return_trap
+debug lineno: 87 main
+debug lineno: 90 main
+LINENO 31
+LINENO 32
BASH_SOURCE[0] ./dbg-support.tests
FUNCNAME[0] fn1
-79 ./dbg-support.tests
-79 main ./dbg-support.tests
+90 ./dbg-support.tests
+90 main ./dbg-support.tests
-./dbg-support.tests: line 25: caller: foo: invalid number
+./dbg-support.tests: line 38: caller: foo: invalid number
caller: usage: caller [expr]
-debug lineno: 80 main
+debug lineno: 91 main
fn2 here. Calling fn1...
-LINENO 18
-LINENO 19
+LINENO 31
+LINENO 32
BASH_SOURCE[0] ./dbg-support.tests
FUNCNAME[0] fn1
-30 ./dbg-support.tests
-30 fn2 ./dbg-support.tests
-80 main ./dbg-support.tests
-./dbg-support.tests: line 25: caller: foo: invalid number
+43 ./dbg-support.tests
+43 fn2 ./dbg-support.tests
+91 main ./dbg-support.tests
+./dbg-support.tests: line 38: caller: foo: invalid number
caller: usage: caller [expr]
-debug lineno: 81 main
-LINENO 34
+debug lineno: 92 main
+LINENO 47
BASH_SOURCE[0] ./dbg-support.tests
fn3 called from file `./dbg-support.tests' at line 0
main called from file `./dbg-support.tests' at line 0
-SOURCED LINENO 18
+SOURCED LINENO 31
SOURCED BASH_SOURCE[0] ./dbg-support.sub
-SOURCED FN LINENO 5
-FUNCNAME[0]: sourced_fn called from ./dbg-support.sub at line 20
-FUNCNAME[1]: source called from ./dbg-support.tests at line 46
-FUNCNAME[2]: fn3 called from ./dbg-support.tests at line 81
+SOURCED FN LINENO 18
+FUNCNAME[0]: sourced_fn called from ./dbg-support.sub at line 33
+FUNCNAME[1]: source called from ./dbg-support.tests at line 59
+FUNCNAME[2]: fn3 called from ./dbg-support.tests at line 92
FUNCNAME[3]: main called from ./dbg-support.tests at line 0
-debug lineno: 82 main
+debug lineno: 93 main
fn4 here. Calling fn3...
-LINENO 34
+LINENO 47
BASH_SOURCE[0] ./dbg-support.tests
-fn3 called from file `./dbg-support.tests' at line 82
+fn3 called from file `./dbg-support.tests' at line 93
fn4 called from file `./dbg-support.tests' at line 0
main called from file `./dbg-support.tests' at line 0
-SOURCED LINENO 18
+SOURCED LINENO 31
SOURCED BASH_SOURCE[0] ./dbg-support.sub
-SOURCED FN LINENO 5
-FUNCNAME[0]: sourced_fn called from ./dbg-support.sub at line 20
-FUNCNAME[1]: source called from ./dbg-support.tests at line 46
-FUNCNAME[2]: fn3 called from ./dbg-support.tests at line 51
-FUNCNAME[3]: fn4 called from ./dbg-support.tests at line 82
+SOURCED FN LINENO 18
+FUNCNAME[0]: sourced_fn called from ./dbg-support.sub at line 33
+FUNCNAME[1]: source called from ./dbg-support.tests at line 59
+FUNCNAME[2]: fn3 called from ./dbg-support.tests at line 64
+FUNCNAME[3]: fn4 called from ./dbg-support.tests at line 93
FUNCNAME[4]: main called from ./dbg-support.tests at line 0
-debug lineno: 83 main
-SOURCED LINENO 18
+debug lineno: 94 main
+SOURCED LINENO 31
SOURCED BASH_SOURCE[0] ./dbg-support.sub
-SOURCED FN LINENO 5
-FUNCNAME[0]: sourced_fn called from ./dbg-support.sub at line 20
-FUNCNAME[1]: source called from ./dbg-support.tests at line 83
+SOURCED FN LINENO 18
+FUNCNAME[0]: sourced_fn called from ./dbg-support.sub at line 33
+FUNCNAME[1]: source called from ./dbg-support.tests at line 94
FUNCNAME[2]: main called from ./dbg-support.tests at line 0
-return lineno: 83 main
-debug lineno: 86 main
-debug lineno: 89 main
-debug lineno: 18 source
-SOURCED LINENO 18
-debug lineno: 19 source
+return lineno: 94 main
+debug lineno: 97 main
+debug lineno: 100 main
+debug lineno: 31 source
+SOURCED LINENO 31
+debug lineno: 32 source
SOURCED BASH_SOURCE[0] ./dbg-support.sub
-debug lineno: 20 source
-debug lineno: 3 sourced_fn
-debug lineno: 4 sourced_fn
-debug lineno: 5 sourced_fn
-SOURCED FN LINENO 5
-debug lineno: 8 sourced_fn
-debug lineno: 9 sourced_fn
-debug lineno: 10 sourced_fn
-debug lineno: 10 sourced_fn
-debug lineno: 11 sourced_fn
-debug lineno: 12 sourced_fn
-debug lineno: 13 sourced_fn
-FUNCNAME[0]: sourced_fn called from ./dbg-support.sub at line 20
-debug lineno: 10 sourced_fn
-debug lineno: 10 sourced_fn
-debug lineno: 11 sourced_fn
-debug lineno: 12 sourced_fn
-debug lineno: 13 sourced_fn
-FUNCNAME[1]: source called from ./dbg-support.tests at line 89
-debug lineno: 10 sourced_fn
-debug lineno: 10 sourced_fn
-debug lineno: 11 sourced_fn
-debug lineno: 12 sourced_fn
-debug lineno: 12 sourced_fn
-debug lineno: 13 sourced_fn
+debug lineno: 33 source
+debug lineno: 16 sourced_fn
+debug lineno: 17 sourced_fn
+debug lineno: 18 sourced_fn
+SOURCED FN LINENO 18
+debug lineno: 21 sourced_fn
+debug lineno: 22 sourced_fn
+debug lineno: 23 sourced_fn
+debug lineno: 23 sourced_fn
+debug lineno: 24 sourced_fn
+debug lineno: 25 sourced_fn
+debug lineno: 26 sourced_fn
+FUNCNAME[0]: sourced_fn called from ./dbg-support.sub at line 33
+debug lineno: 23 sourced_fn
+debug lineno: 23 sourced_fn
+debug lineno: 24 sourced_fn
+debug lineno: 25 sourced_fn
+debug lineno: 26 sourced_fn
+FUNCNAME[1]: source called from ./dbg-support.tests at line 100
+debug lineno: 23 sourced_fn
+debug lineno: 23 sourced_fn
+debug lineno: 24 sourced_fn
+debug lineno: 25 sourced_fn
+debug lineno: 25 sourced_fn
+debug lineno: 26 sourced_fn
FUNCNAME[2]: main called from ./dbg-support.tests at line 0
-debug lineno: 10 sourced_fn
-debug lineno: 10 sourced_fn
-debug lineno: 3 sourced_fn
-debug lineno: 12 print_return_trap
-debug lineno: 13 print_return_trap
-return lineno: 3 sourced_fn
-debug lineno: 14 print_return_trap
-debug lineno: 89 main
-debug lineno: 12 print_return_trap
-debug lineno: 13 print_return_trap
-return lineno: 89 main
-debug lineno: 14 print_return_trap
-debug lineno: 90 main
-debug lineno: 93 main
-debug lineno: 93 main
-debug lineno: 94 main
-debug lineno: 97 main
-debug lineno: 93 main
-debug lineno: 93 main
-debug lineno: 94 main
-debug lineno: 97 main
-debug lineno: 93 main
-debug lineno: 93 main
-debug lineno: 94 main
-debug lineno: 95 main
-Hit 2
-debug lineno: 97 main
-debug lineno: 93 main
-debug lineno: 93 main
-debug lineno: 103 main
-SOURCED FN LINENO 5 FUNCNAME[0]: sourced_fn called from ./dbg-support.tests at line 103 FUNCNAME[1]: main called from ./dbg-support.tests at line 0
+debug lineno: 23 sourced_fn
+debug lineno: 23 sourced_fn
+debug lineno: 16 sourced_fn
+debug lineno: 25 print_return_trap
+debug lineno: 26 print_return_trap
+return lineno: 16 sourced_fn
+debug lineno: 27 print_return_trap
+debug lineno: 100 main
+debug lineno: 25 print_return_trap
+debug lineno: 26 print_return_trap
+return lineno: 100 main
+debug lineno: 27 print_return_trap
+debug lineno: 101 main
+debug lineno: 104 main
+debug lineno: 104 main
+debug lineno: 105 main
+debug lineno: 108 main
+debug lineno: 104 main
+debug lineno: 104 main
+debug lineno: 105 main
+debug lineno: 108 main
+debug lineno: 104 main
debug lineno: 104 main
-SOURCED FN LINENO 5 FUNCNAME[0]: sourced_fn called from ./dbg-support.tests at line 104 FUNCNAME[1]: main called from ./dbg-support.tests at line 0
debug lineno: 105 main
debug lineno: 106 main
-SOURCED FN LINENO 5
-FUNCNAME[0]: sourced_fn called from ./dbg-support.tests at line 106
+Hit 2
+debug lineno: 108 main
+debug lineno: 104 main
+debug lineno: 104 main
+debug lineno: 114 main
+SOURCED FN LINENO 18 FUNCNAME[0]: sourced_fn called from ./dbg-support.tests at line 114 FUNCNAME[1]: main called from ./dbg-support.tests at line 0
+debug lineno: 115 main
+SOURCED FN LINENO 18 FUNCNAME[0]: sourced_fn called from ./dbg-support.tests at line 115 FUNCNAME[1]: main called from ./dbg-support.tests at line 0
+debug lineno: 116 main
+debug lineno: 117 main
+SOURCED FN LINENO 18
+FUNCNAME[0]: sourced_fn called from ./dbg-support.tests at line 117
FUNCNAME[1]: main called from ./dbg-support.tests at line 0
-debug lineno: 110 main
-debug lineno: 111 main
-debug lineno: 3 sourced_fn
-debug lineno: 4 sourced_fn
-debug lineno: 5 sourced_fn
-SOURCED FN LINENO 5
-debug lineno: 8 sourced_fn
-debug lineno: 9 sourced_fn
-debug lineno: 10 sourced_fn
-debug lineno: 10 sourced_fn
-debug lineno: 11 sourced_fn
-debug lineno: 12 sourced_fn
-debug lineno: 13 sourced_fn
-FUNCNAME[0]: sourced_fn called from ./dbg-support.tests at line 111
-debug lineno: 10 sourced_fn
-debug lineno: 10 sourced_fn
-debug lineno: 11 sourced_fn
-debug lineno: 12 sourced_fn
-debug lineno: 12 sourced_fn
-debug lineno: 13 sourced_fn
+debug lineno: 121 main
+debug lineno: 122 main
+debug lineno: 16 sourced_fn
+debug lineno: 17 sourced_fn
+debug lineno: 18 sourced_fn
+SOURCED FN LINENO 18
+debug lineno: 21 sourced_fn
+debug lineno: 22 sourced_fn
+debug lineno: 23 sourced_fn
+debug lineno: 23 sourced_fn
+debug lineno: 24 sourced_fn
+debug lineno: 25 sourced_fn
+debug lineno: 26 sourced_fn
+FUNCNAME[0]: sourced_fn called from ./dbg-support.tests at line 122
+debug lineno: 23 sourced_fn
+debug lineno: 23 sourced_fn
+debug lineno: 24 sourced_fn
+debug lineno: 25 sourced_fn
+debug lineno: 25 sourced_fn
+debug lineno: 26 sourced_fn
FUNCNAME[1]: main called from ./dbg-support.tests at line 0
-debug lineno: 10 sourced_fn
-debug lineno: 10 sourced_fn
-debug lineno: 3 sourced_fn
-debug lineno: 12 print_return_trap
-debug lineno: 13 print_return_trap
-return lineno: 3 sourced_fn
-debug lineno: 14 print_return_trap
-debug lineno: 114 main
-debug lineno: 119 main
-debug lineno: 123 main
+debug lineno: 23 sourced_fn
+debug lineno: 23 sourced_fn
+debug lineno: 16 sourced_fn
+debug lineno: 25 print_return_trap
+debug lineno: 26 print_return_trap
+return lineno: 16 sourced_fn
+debug lineno: 27 print_return_trap
+debug lineno: 125 main
+debug lineno: 130 main
+debug lineno: 134 main
got it
-debug lineno: 131 main
-debug lineno: 132 main
-debug lineno: 133 main
-debug lineno: 132 main
-debug lineno: 133 main
-debug lineno: 131 main
-debug lineno: 132 main
-debug lineno: 133 main
-debug lineno: 132 main
-debug lineno: 133 main
-debug lineno: 137 main
+debug lineno: 142 main
+debug lineno: 143 main
+debug lineno: 144 main
+debug lineno: 143 main
+debug lineno: 144 main
+debug lineno: 142 main
+debug lineno: 143 main
+debug lineno: 144 main
+debug lineno: 143 main
+debug lineno: 144 main
+debug lineno: 148 main
main: calling f1
f1: calling f2
f2: calling f3
@@ -364,7 +364,7 @@ deep 6
4 x
5 1
FUNCNAME stack: f3 f2 f1 main
-26 f2 ./dbg-support3.sub
+39 f2 ./dbg-support3.sub
f3: returning
f2: return from f3
f1: return from f2
diff --git a/tests/dbg-support.sub b/tests/dbg-support.sub
index f68f8d9b..8c82c80c 100644
--- a/tests/dbg-support.sub
+++ b/tests/dbg-support.sub
@@ -1,3 +1,16 @@
+# 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 <http://www.gnu.org/licenses/>.
+#
# This file is intended to be sourced from one of the bashdb test programs
sourced_fn() {
diff --git a/tests/dbg-support.tests b/tests/dbg-support.tests
index ad06d011..2e356696 100755..100644
--- a/tests/dbg-support.tests
+++ b/tests/dbg-support.tests
@@ -1,4 +1,17 @@
-#!../bash
+# 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 <http://www.gnu.org/licenses/>.
+#
+
#
# Test correct functioning bash debug support not via the bashdb
# debugger but merely by printing via print_trap()
@@ -51,8 +64,6 @@ fn4() {
fn3
}
-
-#!../bash
#
# Test of support for debugging facilities in bash
#
@@ -135,8 +146,3 @@ for i in 0 1 ; do
done
${THIS_SH} ./dbg-support3.sub
-
-#;;; Local Variables: ***
-#;;; mode:shell-script ***
-#;;; eval: (sh-set-shell "bash") ***
-#;;; End: ***
diff --git a/tests/dbg-support2.right b/tests/dbg-support2.right
index c9d884e6..5727d1f1 100644
--- a/tests/dbg-support2.right
+++ b/tests/dbg-support2.right
@@ -1,7 +1,7 @@
-lineno: 17 (6) main
-lineno: 18 (6) main
+lineno: 29 (18) main
+lineno: 30 (18) main
x is 1
-lineno: 19 (6) main
-lineno: 20 (6) main
-lineno: 21 (6) main
+lineno: 31 (18) main
+lineno: 32 (18) main
+lineno: 33 (18) main
x is 1
diff --git a/tests/dbg-support2.tests b/tests/dbg-support2.tests
index fdc0f31e..c33251d3 100755..100644
--- a/tests/dbg-support2.tests
+++ b/tests/dbg-support2.tests
@@ -1,4 +1,16 @@
-#!../bash
+# 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 <http://www.gnu.org/licenses/>.
+#
#
# Test correct trap return codes = 2 means skip execution.
shopt -s extdebug
@@ -19,8 +31,3 @@ echo "x is $x"
debug_exit=2
x=2
echo "x is $x"
-
-#;;; Local Variables: ***
-#;;; mode:shell-script ***
-#;;; eval: (sh-set-shell "bash") ***
-#;;; End: ***
diff --git a/tests/dbg-support3.sub b/tests/dbg-support3.sub
index cc52c654..146831f4 100644
--- a/tests/dbg-support3.sub
+++ b/tests/dbg-support3.sub
@@ -1,3 +1,16 @@
+# 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 <http://www.gnu.org/licenses/>.
+#
shopt -s extdebug
callstack(){
diff --git a/tests/dollar-at-star1.sub b/tests/dollar-at-star1.sub
index 0036915b..ef15efc3 100644
--- a/tests/dollar-at-star1.sub
+++ b/tests/dollar-at-star1.sub
@@ -1,3 +1,16 @@
+# 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 <http://www.gnu.org/licenses/>.
+#
# from dan douglas
expassign()
{
diff --git a/tests/dollar-at-star2.sub b/tests/dollar-at-star2.sub
index 780548ed..64ab1eb7 100644
--- a/tests/dollar-at-star2.sub
+++ b/tests/dollar-at-star2.sub
@@ -1,3 +1,16 @@
+# 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 <http://www.gnu.org/licenses/>.
+#
OIFS="$IFS"
foo=' ,foo'
set -- "$foo"
diff --git a/tests/dollar-at-star3.sub b/tests/dollar-at-star3.sub
index b37d64af..da05444b 100644
--- a/tests/dollar-at-star3.sub
+++ b/tests/dollar-at-star3.sub
@@ -1,3 +1,16 @@
+# 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 <http://www.gnu.org/licenses/>.
+#
unset f ; f=abcd
first_char=${f[@]:0:1}
diff --git a/tests/dollar-at-star4.sub b/tests/dollar-at-star4.sub
index be2892dd..9f7da8e8 100644
--- a/tests/dollar-at-star4.sub
+++ b/tests/dollar-at-star4.sub
@@ -1,3 +1,16 @@
+# 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 <http://www.gnu.org/licenses/>.
+#
# tests for quoted and unquoted, split and unsplit expansions of $@ and $*
# Posix interpretation 221 speaks to this issue
diff --git a/tests/dollar-at-star5.sub b/tests/dollar-at-star5.sub
index 3bd7b0f8..d07c61a0 100644
--- a/tests/dollar-at-star5.sub
+++ b/tests/dollar-at-star5.sub
@@ -1,3 +1,16 @@
+# 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 <http://www.gnu.org/licenses/>.
+#
# testing various combinations of quoted and unquoted expansions of $@, and
# whether they generate empty words after expansion
diff --git a/tests/dollar-at-star6.sub b/tests/dollar-at-star6.sub
index 7366df50..09353b8c 100644
--- a/tests/dollar-at-star6.sub
+++ b/tests/dollar-at-star6.sub
@@ -1,3 +1,16 @@
+# 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 <http://www.gnu.org/licenses/>.
+#
OIFS="$IFS"
arr=(a b c)
diff --git a/tests/dollar-at-star7.sub b/tests/dollar-at-star7.sub
index 47cb37f6..e4e63b7b 100644
--- a/tests/dollar-at-star7.sub
+++ b/tests/dollar-at-star7.sub
@@ -1,3 +1,16 @@
+# 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 <http://www.gnu.org/licenses/>.
+#
IFS='' # testing with only empty IFS
set -- this is a test
diff --git a/tests/dollar-at-star9.sub b/tests/dollar-at-star9.sub
index f3962f72..e5062f79 100644
--- a/tests/dollar-at-star9.sub
+++ b/tests/dollar-at-star9.sub
@@ -1,3 +1,16 @@
+# 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 <http://www.gnu.org/licenses/>.
+#
IFS=$' \t\n' # or any other IFS
set -- ''
recho ${v= "$*" }
diff --git a/tests/dollar-at1.sub b/tests/dollar-at1.sub
index 6d407863..c5079d64 100644
--- a/tests/dollar-at1.sub
+++ b/tests/dollar-at1.sub
@@ -1,3 +1,16 @@
+# 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 <http://www.gnu.org/licenses/>.
+#
echo_argc()
{
echo $#
diff --git a/tests/dollar-at2.sub b/tests/dollar-at2.sub
index c079a295..16defbdc 100644
--- a/tests/dollar-at2.sub
+++ b/tests/dollar-at2.sub
@@ -1,3 +1,16 @@
+# 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 <http://www.gnu.org/licenses/>.
+#
t1()
{
xxx="echo $@"
diff --git a/tests/dollar-at5.sub b/tests/dollar-at5.sub
index 75e2249f..9b26c392 100644
--- a/tests/dollar-at5.sub
+++ b/tests/dollar-at5.sub
@@ -1,3 +1,16 @@
+# 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 <http://www.gnu.org/licenses/>.
+#
args() { printf '<%s> ' "$@"; echo; }
set -- 1 2 3 4 5
diff --git a/tests/dollar-at6.sub b/tests/dollar-at6.sub
index 039e11f8..791fd899 100644
--- a/tests/dollar-at6.sub
+++ b/tests/dollar-at6.sub
@@ -1,3 +1,16 @@
+# 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 <http://www.gnu.org/licenses/>.
+#
set -- '';
recho "${@}" x
diff --git a/tests/dollar-at7.sub b/tests/dollar-at7.sub
index 311a6fef..cde11648 100644
--- a/tests/dollar-at7.sub
+++ b/tests/dollar-at7.sub
@@ -1,3 +1,16 @@
+# 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 <http://www.gnu.org/licenses/>.
+#
set -- ''
recho 1 ''"$@"
diff --git a/tests/dollar-star1.sub b/tests/dollar-star1.sub
index 63a9ef86..3e5ec36d 100644
--- a/tests/dollar-star1.sub
+++ b/tests/dollar-star1.sub
@@ -1,3 +1,16 @@
+# 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 <http://www.gnu.org/licenses/>.
+#
set -- a b c
x=(a b c); IFS='|'
diff --git a/tests/dollar-star10.sub b/tests/dollar-star10.sub
index fbd1063d..fce9ec1f 100644
--- a/tests/dollar-star10.sub
+++ b/tests/dollar-star10.sub
@@ -1,3 +1,16 @@
+# 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 <http://www.gnu.org/licenses/>.
+#
oIFS=$IFS
set -- ''
diff --git a/tests/dollar-star2.sub b/tests/dollar-star2.sub
index 844a2972..78e00a0c 100644
--- a/tests/dollar-star2.sub
+++ b/tests/dollar-star2.sub
@@ -1,3 +1,16 @@
+# 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 <http://www.gnu.org/licenses/>.
+#
set A B
IFS=
diff --git a/tests/dollar-star3.sub b/tests/dollar-star3.sub
index 8cf4bb22..a6ef09fe 100644
--- a/tests/dollar-star3.sub
+++ b/tests/dollar-star3.sub
@@ -1,3 +1,16 @@
+# 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 <http://www.gnu.org/licenses/>.
+#
IFS=/
#file=/mnt/cdrom/RedHat/RPMS
#recho "${file[*]:0:3}"
diff --git a/tests/dollar-star5.sub b/tests/dollar-star5.sub
index 8448bf3c..abd8bcc2 100644
--- a/tests/dollar-star5.sub
+++ b/tests/dollar-star5.sub
@@ -1,3 +1,16 @@
+# 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 <http://www.gnu.org/licenses/>.
+#
set -- a b
IFS=
diff --git a/tests/dollar-star6.sub b/tests/dollar-star6.sub
index dbd59ecf..095ec04f 100644
--- a/tests/dollar-star6.sub
+++ b/tests/dollar-star6.sub
@@ -1,3 +1,16 @@
+# 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 <http://www.gnu.org/licenses/>.
+#
recho "A${*:-w}R"
recho "A${*-w}R"
recho "A${*}R"
diff --git a/tests/dollar-star7.sub b/tests/dollar-star7.sub
index 72d6c24f..db352bfc 100644
--- a/tests/dollar-star7.sub
+++ b/tests/dollar-star7.sub
@@ -1,3 +1,16 @@
+# 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 <http://www.gnu.org/licenses/>.
+#
# if IFS side effects in ${IFS=} assignments take place, how do you cope with
# later changes to IFS in the same set of expansions? You've already
# committed to using the first character of the (old) IFS to expand $* in
diff --git a/tests/dollar-star8.sub b/tests/dollar-star8.sub
index 72ba1080..e6265646 100644
--- a/tests/dollar-star8.sub
+++ b/tests/dollar-star8.sub
@@ -1,3 +1,16 @@
+# 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 <http://www.gnu.org/licenses/>.
+#
IFS=
set "abc" "def ghi" "jkl"
diff --git a/tests/dollar-star9.sub b/tests/dollar-star9.sub
index 26d0ed21..d46de46a 100644
--- a/tests/dollar-star9.sub
+++ b/tests/dollar-star9.sub
@@ -1,3 +1,16 @@
+# 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 <http://www.gnu.org/licenses/>.
+#
set -- 1 2
IFS=
diff --git a/tests/dstack.right b/tests/dstack.right
index 8f27d28b..8f9d38c0 100644
--- a/tests/dstack.right
+++ b/tests/dstack.right
@@ -1,13 +1,13 @@
-./dstack.tests: line 6: pushd: /tmp/xxx-notthere: No such file or directory
-./dstack.tests: line 9: pushd: no other directory
-./dstack.tests: line 10: popd: directory stack empty
-./dstack.tests: line 13: pushd: -m: invalid number
+./dstack.tests: line 19: pushd: /tmp/xxx-notthere: No such file or directory
+./dstack.tests: line 22: pushd: no other directory
+./dstack.tests: line 23: popd: directory stack empty
+./dstack.tests: line 26: pushd: -m: invalid number
pushd: usage: pushd [-n] [+N | -N | dir]
-./dstack.tests: line 14: popd: -m: invalid number
+./dstack.tests: line 27: popd: -m: invalid number
popd: usage: popd [-n] [+N | -N]
-./dstack.tests: line 15: dirs: -m: invalid number
+./dstack.tests: line 28: dirs: -m: invalid number
dirs: usage: dirs [-clpv] [+N] [-N]
-./dstack.tests: line 16: dirs: 7: invalid option
+./dstack.tests: line 29: dirs: 7: invalid option
dirs: usage: dirs [-clpv] [+N] [-N]
/
ok
@@ -31,12 +31,12 @@ ok
/tmp
/usr
/usr
-./dstack.tests: line 58: dirs: 9: directory stack index out of range
-./dstack.tests: line 58: dirs: 9: directory stack index out of range
-./dstack.tests: line 59: pushd: +9: directory stack index out of range
-./dstack.tests: line 59: pushd: -9: directory stack index out of range
-./dstack.tests: line 60: popd: +9: directory stack index out of range
-./dstack.tests: line 60: popd: -9: directory stack index out of range
+./dstack.tests: line 71: dirs: 9: directory stack index out of range
+./dstack.tests: line 71: dirs: 9: directory stack index out of range
+./dstack.tests: line 72: pushd: +9: directory stack index out of range
+./dstack.tests: line 72: pushd: -9: directory stack index out of range
+./dstack.tests: line 73: popd: +9: directory stack index out of range
+./dstack.tests: line 73: popd: -9: directory stack index out of range
/tmp /etc /
/tmp /etc /
/tmp /etc /
diff --git a/tests/dstack.tests b/tests/dstack.tests
index 49b97d3f..33a4fbee 100644
--- a/tests/dstack.tests
+++ b/tests/dstack.tests
@@ -1,3 +1,16 @@
+# 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 <http://www.gnu.org/licenses/>.
+#
export LC_ALL=C
export LANG=C
diff --git a/tests/dstack2.tests b/tests/dstack2.tests
index 3aa105b3..08733198 100644
--- a/tests/dstack2.tests
+++ b/tests/dstack2.tests
@@ -1,3 +1,16 @@
+# 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 <http://www.gnu.org/licenses/>.
+#
wdir=$PWD
cd /
diff --git a/tests/dynvar.tests b/tests/dynvar.tests
index a01f5ed2..6e039900 100644
--- a/tests/dynvar.tests
+++ b/tests/dynvar.tests
@@ -1,3 +1,16 @@
+# 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 <http://www.gnu.org/licenses/>.
+#
# specvar -- test some of the dynamic variables
# BASHPID
diff --git a/tests/errors.right b/tests/errors.right
index d5fc6325..e62dda3f 100644
--- a/tests/errors.right
+++ b/tests/errors.right
@@ -1,108 +1,108 @@
-./errors.tests: line 17: alias: -x: invalid option
+./errors.tests: line 30: alias: -x: invalid option
alias: usage: alias [-p] [name[=value] ... ]
-./errors.tests: line 18: unalias: -x: invalid option
+./errors.tests: line 31: unalias: -x: invalid option
unalias: usage: unalias [-a] name [name ...]
-./errors.tests: line 19: alias: hoowah: not found
-./errors.tests: line 20: unalias: hoowah: not found
-./errors.tests: line 23: `1': not a valid identifier
+./errors.tests: line 32: alias: hoowah: not found
+./errors.tests: line 33: unalias: hoowah: not found
+./errors.tests: line 36: `1': not a valid identifier
declare -fr func
-./errors.tests: line 36: func: readonly function
-./errors.tests: line 39: unset: -x: invalid option
+./errors.tests: line 49: func: readonly function
+./errors.tests: line 52: unset: -x: invalid option
unset: usage: unset [-f] [-v] [-n] [name ...]
-./errors.tests: line 42: unset: func: cannot unset: readonly function
-./errors.tests: line 45: declare: func: readonly function
-./errors.tests: line 49: unset: XPATH: cannot unset: readonly variable
-./errors.tests: line 55: unset: cannot simultaneously unset a function and a variable
-./errors.tests: line 58: declare: -z: invalid option
+./errors.tests: line 55: unset: func: cannot unset: readonly function
+./errors.tests: line 58: declare: func: readonly function
+./errors.tests: line 62: unset: XPATH: cannot unset: readonly variable
+./errors.tests: line 68: unset: cannot simultaneously unset a function and a variable
+./errors.tests: line 71: declare: -z: invalid option
declare: usage: declare [-aAfFgilnrtux] [-p] [name[=value] ...]
-./errors.tests: line 60: declare: `-z': not a valid identifier
-./errors.tests: line 61: declare: `/bin/sh': not a valid identifier
-./errors.tests: line 65: declare: cannot use `-f' to make functions
-./errors.tests: line 68: exec: -i: invalid option
+./errors.tests: line 73: declare: `-z': not a valid identifier
+./errors.tests: line 74: declare: `/bin/sh': not a valid identifier
+./errors.tests: line 78: declare: cannot use `-f' to make functions
+./errors.tests: line 81: exec: -i: invalid option
exec: usage: exec [-cl] [-a name] [command [arguments ...]] [redirection ...]
-./errors.tests: line 72: export: XPATH: not a function
-./errors.tests: line 75: break: only meaningful in a `for', `while', or `until' loop
-./errors.tests: line 76: continue: only meaningful in a `for', `while', or `until' loop
-./errors.tests: line 79: shift: label: numeric argument required
-./errors.tests: line 84: shift: too many arguments
-./errors.tests: line 90: let: expression expected
-./errors.tests: line 93: local: can only be used in a function
-./errors.tests: line 96: logout: not login shell: use `exit'
-./errors.tests: line 99: hash: notthere: not found
-./errors.tests: line 102: hash: -v: invalid option
+./errors.tests: line 85: export: XPATH: not a function
+./errors.tests: line 88: break: only meaningful in a `for', `while', or `until' loop
+./errors.tests: line 89: continue: only meaningful in a `for', `while', or `until' loop
+./errors.tests: line 92: shift: label: numeric argument required
+./errors.tests: line 97: shift: too many arguments
+./errors.tests: line 103: let: expression expected
+./errors.tests: line 106: local: can only be used in a function
+./errors.tests: line 109: logout: not login shell: use `exit'
+./errors.tests: line 112: hash: notthere: not found
+./errors.tests: line 115: hash: -v: invalid option
hash: usage: hash [-lr] [-p pathname] [-dt] [name ...]
-./errors.tests: line 106: hash: hashing disabled
-./errors.tests: line 109: export: `AA[4]': not a valid identifier
-./errors.tests: line 110: readonly: `AA[4]': not a valid identifier
-./errors.tests: line 113: unset: [-2]: bad array subscript
-./errors.tests: line 117: AA: readonly variable
-./errors.tests: line 121: AA: readonly variable
-./errors.tests: line 129: shift: 5: shift count out of range
-./errors.tests: line 130: shift: -2: shift count out of range
-./errors.tests: line 133: shopt: no_such_option: invalid shell option name
-./errors.tests: line 134: shopt: no_such_option: invalid shell option name
-./errors.tests: line 137: umask: 09: octal number out of range
-./errors.tests: line 138: umask: `:': invalid symbolic mode character
-./errors.tests: line 139: umask: `:': invalid symbolic mode operator
-./errors.tests: line 142: umask: -i: invalid option
+./errors.tests: line 119: hash: hashing disabled
+./errors.tests: line 122: export: `AA[4]': not a valid identifier
+./errors.tests: line 123: readonly: `AA[4]': not a valid identifier
+./errors.tests: line 126: unset: [-2]: bad array subscript
+./errors.tests: line 130: AA: readonly variable
+./errors.tests: line 134: AA: readonly variable
+./errors.tests: line 142: shift: 5: shift count out of range
+./errors.tests: line 143: shift: -2: shift count out of range
+./errors.tests: line 146: shopt: no_such_option: invalid shell option name
+./errors.tests: line 147: shopt: no_such_option: invalid shell option name
+./errors.tests: line 150: umask: 09: octal number out of range
+./errors.tests: line 151: umask: `:': invalid symbolic mode character
+./errors.tests: line 152: umask: `:': invalid symbolic mode operator
+./errors.tests: line 155: umask: -i: invalid option
umask: usage: umask [-p] [-S] [mode]
-./errors.tests: line 146: umask: `u': invalid symbolic mode character
-./errors.tests: line 155: VAR: readonly variable
-./errors.tests: line 158: declare: VAR: readonly variable
-./errors.tests: line 159: declare: VAR: readonly variable
-./errors.tests: line 161: declare: unset: not found
-./errors.tests: line 164: VAR: readonly variable
-./errors.tests: command substitution: line 168: syntax error near unexpected token `)'
-./errors.tests: command substitution: line 168: ` for z in 1 2 3; do )'
-./errors.tests: command substitution: line 169: syntax error near unexpected token `done'
-./errors.tests: command substitution: line 169: ` for z in 1 2 3; done )'
-./errors.tests: line 171: cd: HOME not set
-./errors.tests: line 172: cd: /tmp/xyz.bash: No such file or directory
-./errors.tests: line 174: cd: OLDPWD not set
-./errors.tests: line 175: cd: /bin/sh: Not a directory
-./errors.tests: line 177: cd: /tmp/cd-notthere: No such file or directory
-./errors.tests: line 180: .: filename argument required
+./errors.tests: line 159: umask: `u': invalid symbolic mode character
+./errors.tests: line 168: VAR: readonly variable
+./errors.tests: line 171: declare: VAR: readonly variable
+./errors.tests: line 172: declare: VAR: readonly variable
+./errors.tests: line 174: declare: unset: not found
+./errors.tests: line 177: VAR: readonly variable
+./errors.tests: command substitution: line 181: syntax error near unexpected token `)'
+./errors.tests: command substitution: line 181: ` for z in 1 2 3; do )'
+./errors.tests: command substitution: line 182: syntax error near unexpected token `done'
+./errors.tests: command substitution: line 182: ` for z in 1 2 3; done )'
+./errors.tests: line 184: cd: HOME not set
+./errors.tests: line 185: cd: /tmp/xyz.bash: No such file or directory
+./errors.tests: line 187: cd: OLDPWD not set
+./errors.tests: line 188: cd: /bin/sh: Not a directory
+./errors.tests: line 190: cd: /tmp/cd-notthere: No such file or directory
+./errors.tests: line 193: .: filename argument required
.: usage: . filename [arguments]
-./errors.tests: line 181: source: filename argument required
+./errors.tests: line 194: source: filename argument required
source: usage: source filename [arguments]
-./errors.tests: line 184: .: -i: invalid option
+./errors.tests: line 197: .: -i: invalid option
.: usage: . filename [arguments]
-./errors.tests: line 187: set: -q: invalid option
+./errors.tests: line 200: set: -q: invalid option
set: usage: set [-abefhkmnptuvxBCHP] [-o option-name] [--] [arg ...]
-./errors.tests: line 190: enable: sh: not a shell builtin
-./errors.tests: line 190: enable: bash: not a shell builtin
-./errors.tests: line 193: shopt: cannot set and unset shell options simultaneously
-./errors.tests: line 196: read: var: invalid timeout specification
-./errors.tests: line 199: read: `/bin/sh': not a valid identifier
-./errors.tests: line 202: VAR: readonly variable
-./errors.tests: line 205: readonly: -x: invalid option
+./errors.tests: line 203: enable: sh: not a shell builtin
+./errors.tests: line 203: enable: bash: not a shell builtin
+./errors.tests: line 206: shopt: cannot set and unset shell options simultaneously
+./errors.tests: line 209: read: var: invalid timeout specification
+./errors.tests: line 212: read: `/bin/sh': not a valid identifier
+./errors.tests: line 215: VAR: readonly variable
+./errors.tests: line 218: readonly: -x: invalid option
readonly: usage: readonly [-aAf] [name[=value] ...] or readonly -p
-./errors.tests: line 208: eval: -i: invalid option
+./errors.tests: line 221: eval: -i: invalid option
eval: usage: eval [arg ...]
-./errors.tests: line 209: command: -i: invalid option
+./errors.tests: line 222: command: -i: invalid option
command: usage: command [-pVv] command [arg ...]
-./errors.tests: line 212: /bin/sh + 0: syntax error: operand expected (error token is "/bin/sh + 0")
-./errors.tests: line 213: /bin/sh + 0: syntax error: operand expected (error token is "/bin/sh + 0")
-./errors.tests: line 216: trap: NOSIG: invalid signal specification
-./errors.tests: line 219: trap: -s: invalid option
+./errors.tests: line 225: /bin/sh + 0: syntax error: operand expected (error token is "/bin/sh + 0")
+./errors.tests: line 226: /bin/sh + 0: syntax error: operand expected (error token is "/bin/sh + 0")
+./errors.tests: line 229: trap: NOSIG: invalid signal specification
+./errors.tests: line 232: trap: -s: invalid option
trap: usage: trap [-lp] [[arg] signal_spec ...]
-./errors.tests: line 225: return: can only `return' from a function or sourced script
-./errors.tests: line 229: break: 0: loop count out of range
-./errors.tests: line 233: continue: 0: loop count out of range
-./errors.tests: line 238: builtin: bash: not a shell builtin
-./errors.tests: line 242: bg: no job control
-./errors.tests: line 243: fg: no job control
-./errors.tests: line 246: kill: -s: option requires an argument
-./errors.tests: line 248: kill: S: invalid signal specification
-./errors.tests: line 250: kill: `': not a pid or valid job spec
+./errors.tests: line 238: return: can only `return' from a function or sourced script
+./errors.tests: line 242: break: 0: loop count out of range
+./errors.tests: line 246: continue: 0: loop count out of range
+./errors.tests: line 251: builtin: bash: not a shell builtin
+./errors.tests: line 255: bg: no job control
+./errors.tests: line 256: fg: no job control
+./errors.tests: line 259: kill: -s: option requires an argument
+./errors.tests: line 261: kill: S: invalid signal specification
+./errors.tests: line 263: kill: `': not a pid or valid job spec
kill: usage: kill [-s sigspec | -n signum | -sigspec] pid | jobspec ... or kill -l [sigspec]
-./errors.tests: line 255: set: trackall: invalid option name
-./errors.tests: line 259: xx: readonly variable
+./errors.tests: line 268: set: trackall: invalid option name
+./errors.tests: line 272: xx: readonly variable
1
-./errors1.sub: line 1: .: -i: invalid option
+./errors1.sub: line 14: .: -i: invalid option
.: usage: . filename [arguments]
-./errors1.sub: line 9: shift: -4: shift count out of range
-./errors1.sub: line 14: break: -1: loop count out of range
+./errors1.sub: line 22: shift: -4: shift count out of range
+./errors1.sub: line 27: break: -1: loop count out of range
after f
./errors2.sub: line 3: ${$NO_SUCH_VAR}: bad substitution
1
@@ -111,12 +111,12 @@ TEST
./errors3.sub: line 7: no_such_file: No such file or directory
1
2
-./errors4.sub: line 7: var: readonly variable
+./errors4.sub: line 20: var: readonly variable
after readonly assignment
-./errors4.sub: line 13: break: x: numeric argument required
+./errors4.sub: line 26: break: x: numeric argument required
1
2
-./errors4.sub: line 7: var: readonly variable
+./errors4.sub: line 20: var: readonly variable
./errors5.sub: line 6: array: unbound variable
./errors5.sub: line 7: array: unbound variable
./errors5.sub: line 8: array[7]: unbound variable
@@ -133,18 +133,18 @@ array after 2: 0
./errors6.sub: uvar: parameter null or not set
./errors6.sub: uvar: parameter null or not set
-./errors6.sub: line 25: ${-3:-${-3}}: bad substitution
-./errors6.sub: line 26: ${-3}: bad substitution
-./errors6.sub: line 27: -3: invalid variable name
+./errors6.sub: line 38: ${-3:-${-3}}: bad substitution
+./errors6.sub: line 39: ${-3}: bad substitution
+./errors6.sub: line 40: -3: invalid variable name
after indir: 1
-./errors6.sub: line 30: -3: invalid variable name
+./errors6.sub: line 43: -3: invalid variable name
unset
-./errors6.sub: line 37: var: invalid indirect expansion
-./errors6.sub: line 38: var: invalid indirect expansion
-./errors6.sub: line 41: invalid-ident: invalid variable name
-./errors6.sub: line 42: invalid-ident: invalid variable name
-./errors6.sub: line 43: invalid-ident: invalid variable name
+./errors6.sub: line 50: var: invalid indirect expansion
+./errors6.sub: line 51: var: invalid indirect expansion
+./errors6.sub: line 54: invalid-ident: invalid variable name
+./errors6.sub: line 55: invalid-ident: invalid variable name
+./errors6.sub: line 56: invalid-ident: invalid variable name
4
array after 1: 0
@@ -153,35 +153,35 @@ array after 2: 0
./errors6.sub: uvar: parameter null or not set
./errors6.sub: uvar: parameter null or not set
-./errors6.sub: line 25: ${-3:-${-3}}: bad substitution
-./errors6.sub: line 26: ${-3}: bad substitution
-./errors6.sub: line 27: -3: invalid variable name
+./errors6.sub: line 38: ${-3:-${-3}}: bad substitution
+./errors6.sub: line 39: ${-3}: bad substitution
+./errors6.sub: line 40: -3: invalid variable name
after indir: 1
-./errors6.sub: line 30: -3: invalid variable name
+./errors6.sub: line 43: -3: invalid variable name
unset
-./errors6.sub: line 37: var: invalid indirect expansion
-./errors6.sub: line 38: var: invalid indirect expansion
-./errors6.sub: line 41: invalid-ident: invalid variable name
-./errors6.sub: line 42: invalid-ident: invalid variable name
-./errors6.sub: line 43: invalid-ident: invalid variable name
-./errors7.sub: line 8: x: readonly variable
-./errors7.sub: line 8: notthere: command not found
+./errors6.sub: line 50: var: invalid indirect expansion
+./errors6.sub: line 51: var: invalid indirect expansion
+./errors6.sub: line 54: invalid-ident: invalid variable name
+./errors6.sub: line 55: invalid-ident: invalid variable name
+./errors6.sub: line 56: invalid-ident: invalid variable name
+./errors7.sub: line 21: x: readonly variable
+./errors7.sub: line 21: notthere: command not found
after no such command: 127
-./errors7.sub: line 10: x: readonly variable
+./errors7.sub: line 23: x: readonly variable
echo builtin
after non-special builtin: 0
-./errors7.sub: line 12: x: readonly variable
+./errors7.sub: line 25: x: readonly variable
after special builtin: 0
-./errors7.sub: line 14: x: readonly variable
-./errors7.sub: line 8: x: readonly variable
-./errors7.sub: line 8: notthere: command not found
+./errors7.sub: line 27: x: readonly variable
+./errors7.sub: line 21: x: readonly variable
+./errors7.sub: line 21: notthere: command not found
after no such command: 127
-./errors7.sub: line 10: x: readonly variable
+./errors7.sub: line 23: x: readonly variable
echo builtin
after non-special builtin: 0
-./errors7.sub: line 12: x: readonly variable
-./errors7.sub: line 14: x: readonly variable
+./errors7.sub: line 25: x: readonly variable
+./errors7.sub: line 27: x: readonly variable
./errors8.sub: eval: line 7: syntax error: unexpected end of file
ok 1
./errors8.sub: line 8: v: readonly variable
@@ -194,4 +194,4 @@ ok 4
ok 5
./errors8.sub: line 14: set: notanoption: invalid option name
ok 6
-./errors.tests: line 283: `!!': not a valid identifier
+./errors.tests: line 296: `!!': not a valid identifier
diff --git a/tests/errors.tests b/tests/errors.tests
index e1554cd1..36151bc3 100644
--- a/tests/errors.tests
+++ b/tests/errors.tests
@@ -1,3 +1,16 @@
+# 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 <http://www.gnu.org/licenses/>.
+#
# These should all be safe
LC_ALL=C
LC_CTYPE=C
diff --git a/tests/errors1.sub b/tests/errors1.sub
index 8e7440b5..52a9e342 100644
--- a/tests/errors1.sub
+++ b/tests/errors1.sub
@@ -1,3 +1,16 @@
+# 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 <http://www.gnu.org/licenses/>.
+#
. -i /dev/tty
f()
diff --git a/tests/errors4.sub b/tests/errors4.sub
index 8451b961..6b405024 100644
--- a/tests/errors4.sub
+++ b/tests/errors4.sub
@@ -1,3 +1,16 @@
+# 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 <http://www.gnu.org/licenses/>.
+#
# test effect of assigning to readonly vars on loops and non-interactive shells
# fatal error when in posix mode
var=foo
diff --git a/tests/errors6.sub b/tests/errors6.sub
index b80580e7..cac2c55b 100644
--- a/tests/errors6.sub
+++ b/tests/errors6.sub
@@ -1,3 +1,16 @@
+# 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 <http://www.gnu.org/licenses/>.
+#
# problems with non-fatal expansion errors through bash-4.3
: ${THIS_SH:=./bash}
diff --git a/tests/errors7.sub b/tests/errors7.sub
index 067867a1..add8782a 100644
--- a/tests/errors7.sub
+++ b/tests/errors7.sub
@@ -1,3 +1,16 @@
+# 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 <http://www.gnu.org/licenses/>.
+#
: ${THIS_SH:=./bash}
readonly x=4
diff --git a/tests/exec10.sub b/tests/exec10.sub
index af3ab0d9..db6a6710 100644
--- a/tests/exec10.sub
+++ b/tests/exec10.sub
@@ -1,3 +1,16 @@
+# 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 <http://www.gnu.org/licenses/>.
+#
# post bash-4.3 changes to how command -p works (avoid modifying $PATH)
: ${TMPDIR=/tmp}
diff --git a/tests/exec12.sub b/tests/exec12.sub
index 79bcfc77..0d7c8b89 100644
--- a/tests/exec12.sub
+++ b/tests/exec12.sub
@@ -1,3 +1,16 @@
+# 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 <http://www.gnu.org/licenses/>.
+#
: ${TMPDIR:=/var/tmp}
TMPFILE=$TMPDIR/exitcode
trap 'rm -f $TMPFILE' 0
diff --git a/tests/exec13.sub b/tests/exec13.sub
index 0f84daaa..76e13246 100644
--- a/tests/exec13.sub
+++ b/tests/exec13.sub
@@ -1,3 +1,16 @@
+# 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 <http://www.gnu.org/licenses/>.
+#
echo x1 | ( cat & wait )
echo x1a | ( :& cat & wait )
diff --git a/tests/exec6.sub b/tests/exec6.sub
index 50d0e701..dd53e74b 100644
--- a/tests/exec6.sub
+++ b/tests/exec6.sub
@@ -1,3 +1,16 @@
+# 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 <http://www.gnu.org/licenses/>.
+#
# builtins with exit status inverted
( true )
diff --git a/tests/exec7.sub b/tests/exec7.sub
index 0267505c..0c8c7cab 100644
--- a/tests/exec7.sub
+++ b/tests/exec7.sub
@@ -1,3 +1,16 @@
+# 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 <http://www.gnu.org/licenses/>.
+#
# make sure that bash really checks the right things when deciding what
# constitutes an executable file
diff --git a/tests/exec9.sub b/tests/exec9.sub
index b8d20b44..a47dfd00 100644
--- a/tests/exec9.sub
+++ b/tests/exec9.sub
@@ -1,3 +1,16 @@
+# 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 <http://www.gnu.org/licenses/>.
+#
# make sure commands before the last one in the pipeline can't change $?
false
false | echo $?
diff --git a/tests/exp.right b/tests/exp.right
index a2dc86f9..ce417cc9 100644
--- a/tests/exp.right
+++ b/tests/exp.right
@@ -232,7 +232,7 @@ declare -- var="x\001y\177z"$
argv[1] = <$'x\001y\177z'>
argv[1] = <x^Ay^?z>
var=$'x\001y\177z'
-./exp8.sub: line 16: xyz: syntax error: invalid arithmetic operator (error token is "z")
+./exp8.sub: line 29: xyz: syntax error: invalid arithmetic operator (error token is "z")
declare -a array=()
declare -a array=([0]=$'x\001y\177z')
argv[1] = <x^Ay^?z>
diff --git a/tests/exp.tests b/tests/exp.tests
index 6e364f9c..efb742f3 100644
--- a/tests/exp.tests
+++ b/tests/exp.tests
@@ -1,3 +1,16 @@
+# 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 <http://www.gnu.org/licenses/>.
+#
#
# A suite of tests for bash word expansions
#
diff --git a/tests/exp1.sub b/tests/exp1.sub
index 3e40f2a9..3dbe3d90 100644
--- a/tests/exp1.sub
+++ b/tests/exp1.sub
@@ -1,3 +1,16 @@
+# 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 <http://www.gnu.org/licenses/>.
+#
# Test the substitution quoting characters (CTLESC and CTLNUL) in different
# combinations
diff --git a/tests/exp10.sub b/tests/exp10.sub
index 6592bab9..42bdaf87 100644
--- a/tests/exp10.sub
+++ b/tests/exp10.sub
@@ -1,3 +1,16 @@
+# 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 <http://www.gnu.org/licenses/>.
+#
set -- ' A ' ' B '
IFS=
diff --git a/tests/exp11.sub b/tests/exp11.sub
index cae7b19c..b3e02e08 100644
--- a/tests/exp11.sub
+++ b/tests/exp11.sub
@@ -1,3 +1,16 @@
+# 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 <http://www.gnu.org/licenses/>.
+#
set -- '1 2'
unset var
diff --git a/tests/exp12.sub b/tests/exp12.sub
index 0aaa2f44..8c5005dc 100644
--- a/tests/exp12.sub
+++ b/tests/exp12.sub
@@ -1,3 +1,16 @@
+# 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 <http://www.gnu.org/licenses/>.
+#
# force single-byte versions of these functions
export LANG=C
diff --git a/tests/exp5.sub b/tests/exp5.sub
index 52dd4a15..5cf8ed71 100644
--- a/tests/exp5.sub
+++ b/tests/exp5.sub
@@ -1,3 +1,16 @@
+# 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 <http://www.gnu.org/licenses/>.
+#
# expansions involving patterns
var='[hello'
echo "${var//[/}"
diff --git a/tests/exp6.sub b/tests/exp6.sub
index a1c9fe63..582617c2 100644
--- a/tests/exp6.sub
+++ b/tests/exp6.sub
@@ -1,3 +1,16 @@
+# 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 <http://www.gnu.org/licenses/>.
+#
recho """"a
recho a""""
diff --git a/tests/exp7.sub b/tests/exp7.sub
index f3f3b6bd..a3993b50 100644
--- a/tests/exp7.sub
+++ b/tests/exp7.sub
@@ -1,3 +1,16 @@
+# 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 <http://www.gnu.org/licenses/>.
+#
IFS=$'\001'
c=$'\001'
c2=$'\003'
diff --git a/tests/exp8.sub b/tests/exp8.sub
index ff44febc..4c2870ca 100644
--- a/tests/exp8.sub
+++ b/tests/exp8.sub
@@ -1,3 +1,16 @@
+# 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 <http://www.gnu.org/licenses/>.
+#
var=$'x\001y\177z'
recho "$var"
diff --git a/tests/exp9.sub b/tests/exp9.sub
index a0399c7a..7e4a3b63 100644
--- a/tests/exp9.sub
+++ b/tests/exp9.sub
@@ -1,3 +1,16 @@
+# 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 <http://www.gnu.org/licenses/>.
+#
# expansion test cases from Posix interp 888
set "abc" "def ghi" "jkl"
diff --git a/tests/exportfunc.right b/tests/exportfunc.right
index 2ee35a7a..ff7fc8d9 100644
--- a/tests/exportfunc.right
+++ b/tests/exportfunc.right
@@ -1,14 +1,14 @@
exportfunc ok 1
exportfunc ok 2
-./exportfunc.tests: line 24: cve7169-bad: No such file or directory
-./exportfunc.tests: eval: line 31: syntax error: unexpected end of file
-./exportfunc.tests: line 30: cve7169-bad2: No such file or directory
-./exportfunc1.sub: line 1: maximum here-document count exceeded
-./exportfunc.tests: line 51: HELLO_WORLD: No such file or directory
+./exportfunc.tests: line 37: cve7169-bad: No such file or directory
+./exportfunc.tests: eval: line 44: syntax error: unexpected end of file
+./exportfunc.tests: line 43: cve7169-bad2: No such file or directory
+./exportfunc1.sub: line 14: maximum here-document count exceeded
+./exportfunc.tests: line 64: HELLO_WORLD: No such file or directory
eval ok
-./exportfunc3.sub: line 10: export: foo=bar: cannot export
+./exportfunc3.sub: line 23: export: foo=bar: cannot export
status: 1
equals-1
bad echo
-./exportfunc3.sub: line 23: export: /bin/echo: cannot export
+./exportfunc3.sub: line 36: export: /bin/echo: cannot export
bar
diff --git a/tests/exportfunc.tests b/tests/exportfunc.tests
index f5ef54f0..b2742d2c 100644
--- a/tests/exportfunc.tests
+++ b/tests/exportfunc.tests
@@ -1,3 +1,16 @@
+# 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 <http://www.gnu.org/licenses/>.
+#
# normal operation
foo()
{
diff --git a/tests/exportfunc1.sub b/tests/exportfunc1.sub
index d9c9fa1c..53b4c1fb 100644
--- a/tests/exportfunc1.sub
+++ b/tests/exportfunc1.sub
@@ -1,3 +1,16 @@
+# 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 <http://www.gnu.org/licenses/>.
+#
cat <<EOF <<EOF <<EOF <<EOF <<EOF <<EOF <<EOF <<EOF <<EOF <<EOF <<EOF <<EOF <<EOF <<EOF <<EOF <<EOF <<EOF <<EOF
EOF
EOF
diff --git a/tests/exportfunc2.sub b/tests/exportfunc2.sub
index 886b71bb..cf5df571 100644
--- a/tests/exportfunc2.sub
+++ b/tests/exportfunc2.sub
@@ -1,3 +1,16 @@
+# 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 <http://www.gnu.org/licenses/>.
+#
for x1 in ; do :
for x2 in ; do :
for x3 in ; do :
diff --git a/tests/exportfunc3.sub b/tests/exportfunc3.sub
index 7a7aa26e..af3125bb 100644
--- a/tests/exportfunc3.sub
+++ b/tests/exportfunc3.sub
@@ -1,3 +1,16 @@
+# 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 <http://www.gnu.org/licenses/>.
+#
# test function names that cannot be exported
unset foo # remove from environment if necessary
diff --git a/tests/extglob.tests b/tests/extglob.tests
index 32a6569f..4cb671a8 100644
--- a/tests/extglob.tests
+++ b/tests/extglob.tests
@@ -1,3 +1,16 @@
+# 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 <http://www.gnu.org/licenses/>.
+#
# test the ksh-like extended globbing features: [!@*?+](patlist)
shopt -s extglob
diff --git a/tests/extglob1.sub b/tests/extglob1.sub
index bf65a9ea..c73b1eae 100644
--- a/tests/extglob1.sub
+++ b/tests/extglob1.sub
@@ -1,3 +1,16 @@
+# 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 <http://www.gnu.org/licenses/>.
+#
MYDIR=$PWD
: ${TMPDIR:=/tmp}
diff --git a/tests/extglob1a.sub b/tests/extglob1a.sub
index 686dab74..14703862 100644
--- a/tests/extglob1a.sub
+++ b/tests/extglob1a.sub
@@ -1,3 +1,16 @@
+# 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 <http://www.gnu.org/licenses/>.
+#
shopt -s extglob
TESTDIR=${TMPDIR:-/tmp}/eglob-test-$$
diff --git a/tests/extglob2.tests b/tests/extglob2.tests
index f35c3e8b..187253b9 100755..100644
--- a/tests/extglob2.tests
+++ b/tests/extglob2.tests
@@ -1,3 +1,16 @@
+# 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 <http://www.gnu.org/licenses/>.
+#
#
# More ksh-like extended globbing tests, cribbed from zsh-3.1.5
#
diff --git a/tests/extglob3.sub b/tests/extglob3.sub
index 3f51c40c..bf5d2630 100644
--- a/tests/extglob3.sub
+++ b/tests/extglob3.sub
@@ -1,3 +1,16 @@
+# 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 <http://www.gnu.org/licenses/>.
+#
shopt -s extglob
DIR=$TMPDIR/extglob-$$
mkdir $DIR
diff --git a/tests/extglob3.tests b/tests/extglob3.tests
index 60454a27..56f8b397 100644
--- a/tests/extglob3.tests
+++ b/tests/extglob3.tests
@@ -1,3 +1,16 @@
+# 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 <http://www.gnu.org/licenses/>.
+#
shopt -s extglob
[[ ab/../ == @(ab|+([^/]))/..?(/) ]] && echo match 1
diff --git a/tests/extglob4.sub b/tests/extglob4.sub
index 2b4c53c9..5369cd69 100644
--- a/tests/extglob4.sub
+++ b/tests/extglob4.sub
@@ -1,3 +1,16 @@
+# 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 <http://www.gnu.org/licenses/>.
+#
LANG=C
LC_ALL=C
diff --git a/tests/extglob5.sub b/tests/extglob5.sub
index d400f839..580229b8 100644
--- a/tests/extglob5.sub
+++ b/tests/extglob5.sub
@@ -1,3 +1,16 @@
+# 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 <http://www.gnu.org/licenses/>.
+#
# globignore extglob patterns containing colons -- problem until bash-4.2
: ${TMPDIR:=/tmp}
diff --git a/tests/func.right b/tests/func.right
index 70bf123b..04e96f68 100644
--- a/tests/func.right
+++ b/tests/func.right
@@ -153,17 +153,17 @@ expect 2 40
2 40
expect 5 20
5 20
-./func4.sub: line 10: foo: maximum function nesting level exceeded (100)
+./func4.sub: line 23: foo: maximum function nesting level exceeded (100)
1
after: f = 100
-./func4.sub: line 10: foo: maximum function nesting level exceeded (100)
+./func4.sub: line 23: foo: maximum function nesting level exceeded (100)
1
after: f = 100
7
after FUNCNEST reset: f = 201
7
after FUNCNEST unset: f = 201
-./func4.sub: line 10: foo: maximum function nesting level exceeded (20)
+./func4.sub: line 23: foo: maximum function nesting level exceeded (20)
1
after FUNCNEST assign: f = 38
5
diff --git a/tests/func.tests b/tests/func.tests
index 8701c2ad..fffe3d2b 100644
--- a/tests/func.tests
+++ b/tests/func.tests
@@ -1,3 +1,16 @@
+# 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 <http://www.gnu.org/licenses/>.
+#
a()
{
x=$((x - 1))
diff --git a/tests/func1.sub b/tests/func1.sub
index 345645fd..f7e84f46 100644
--- a/tests/func1.sub
+++ b/tests/func1.sub
@@ -1,3 +1,16 @@
+# 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 <http://www.gnu.org/licenses/>.
+#
#
# Test that redirections attached to shell functions are printed correctly.
# This was a bug in all bash versions before bash-2.04.
diff --git a/tests/func2.sub b/tests/func2.sub
index 41a3844b..9caabfcb 100644
--- a/tests/func2.sub
+++ b/tests/func2.sub
@@ -1,3 +1,16 @@
+# 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 <http://www.gnu.org/licenses/>.
+#
funca() (
echo func-a
)
diff --git a/tests/func3.sub b/tests/func3.sub
index 9d3d0694..d2e57f12 100644
--- a/tests/func3.sub
+++ b/tests/func3.sub
@@ -1,3 +1,16 @@
+# 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 <http://www.gnu.org/licenses/>.
+#
#
# test some posix-mode-specific function behavior
#
diff --git a/tests/func4.sub b/tests/func4.sub
index 9c9c1b42..69f15e46 100644
--- a/tests/func4.sub
+++ b/tests/func4.sub
@@ -1,3 +1,16 @@
+# 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 <http://www.gnu.org/licenses/>.
+#
# test FUNCNEST functionality -- bash-4.2
FUNCNEST=100
diff --git a/tests/getopts.right b/tests/getopts.right
index fff9729f..4cd0e2bb 100644
--- a/tests/getopts.right
+++ b/tests/getopts.right
@@ -2,7 +2,7 @@ getopts: usage: getopts optstring name [arg]
2
getopts: usage: getopts optstring name [arg]
2
-./getopts.tests: line 10: getopts: -a: invalid option
+./getopts.tests: line 23: getopts: -a: invalid option
getopts: usage: getopts optstring name [arg]
-a specified
-b bval specified
@@ -52,7 +52,7 @@ remaining args:
-a specified
remaining args:
0
-./getopts7.sub: line 4: getopts: `opt-var': not a valid identifier
+./getopts7.sub: line 17: getopts: `opt-var': not a valid identifier
remaining args:
opt: x
opt: y
@@ -61,7 +61,7 @@ opt: b
opt: c
opt: z
$1 = a
-./getopts10.sub: line 3: OPTARG: readonly variable
+./getopts10.sub: line 16: OPTARG: readonly variable
OPTARG = x = ?
unset x = ?
declare -r RO="foo"
diff --git a/tests/getopts.tests b/tests/getopts.tests
index d54190cc..06cc29a2 100644
--- a/tests/getopts.tests
+++ b/tests/getopts.tests
@@ -1,3 +1,16 @@
+# 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 <http://www.gnu.org/licenses/>.
+#
# getopts tests
# this should fail
getopts
diff --git a/tests/getopts1.sub b/tests/getopts1.sub
index df0a342e..5145879a 100644
--- a/tests/getopts1.sub
+++ b/tests/getopts1.sub
@@ -1,3 +1,16 @@
+# 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 <http://www.gnu.org/licenses/>.
+#
aflag=
bflag=
diff --git a/tests/getopts10.sub b/tests/getopts10.sub
index 84bacf8f..cc8acb0c 100644
--- a/tests/getopts10.sub
+++ b/tests/getopts10.sub
@@ -1,3 +1,16 @@
+# 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 <http://www.gnu.org/licenses/>.
+#
set -- -a bb
readonly OPTARG
getopts :x x
diff --git a/tests/getopts2.sub b/tests/getopts2.sub
index d91fd26a..6bb8af54 100644
--- a/tests/getopts2.sub
+++ b/tests/getopts2.sub
@@ -1,3 +1,16 @@
+# 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 <http://www.gnu.org/licenses/>.
+#
aflag=
bflag=
diff --git a/tests/getopts3.sub b/tests/getopts3.sub
index 2d8b3162..6769c491 100644
--- a/tests/getopts3.sub
+++ b/tests/getopts3.sub
@@ -1,3 +1,16 @@
+# 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 <http://www.gnu.org/licenses/>.
+#
aflag=
bflag=
diff --git a/tests/getopts4.sub b/tests/getopts4.sub
index 9cd5aef4..5fbe9548 100644
--- a/tests/getopts4.sub
+++ b/tests/getopts4.sub
@@ -1,3 +1,16 @@
+# 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 <http://www.gnu.org/licenses/>.
+#
aflag=
bflag=
diff --git a/tests/getopts5.sub b/tests/getopts5.sub
index 874b2810..bf523107 100644
--- a/tests/getopts5.sub
+++ b/tests/getopts5.sub
@@ -1,3 +1,16 @@
+# 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 <http://www.gnu.org/licenses/>.
+#
#Time-stamp: <95/06/07 07:40:40 hrue@imf.unit.no>
getop () {
diff --git a/tests/getopts6.sub b/tests/getopts6.sub
index 75d768c6..d969ecef 100644
--- a/tests/getopts6.sub
+++ b/tests/getopts6.sub
@@ -1,3 +1,16 @@
+# 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 <http://www.gnu.org/licenses/>.
+#
aflag=
bflag=
diff --git a/tests/getopts7.sub b/tests/getopts7.sub
index a20a6df1..de7d7a65 100644
--- a/tests/getopts7.sub
+++ b/tests/getopts7.sub
@@ -1,3 +1,16 @@
+# 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 <http://www.gnu.org/licenses/>.
+#
aflag=
bflag=
diff --git a/tests/getopts9.sub b/tests/getopts9.sub
index fafb0670..f7dcabce 100644
--- a/tests/getopts9.sub
+++ b/tests/getopts9.sub
@@ -1,3 +1,16 @@
+# 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 <http://www.gnu.org/licenses/>.
+#
f()
{
OPTIND=4
diff --git a/tests/glob.right b/tests/glob.right
index df576cc9..469822d8 100644
--- a/tests/glob.right
+++ b/tests/glob.right
@@ -123,7 +123,7 @@ argv[2] = <abc>
argv[3] = <abd>
argv[4] = <abe>
tmp/l1 tmp/l2 tmp/*4 tmp/l3
-./glob.tests: line 50: no match: tmp/*4
+./glob.tests: line 63: no match: tmp/*4
argv[1] = <bdir/>
argv[1] = <*>
argv[1] = <a*>
diff --git a/tests/glob.tests b/tests/glob.tests
index dc86437e..1285530d 100644
--- a/tests/glob.tests
+++ b/tests/glob.tests
@@ -1,3 +1,16 @@
+# 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 <http://www.gnu.org/licenses/>.
+#
export LC_COLLATE=C
#
# test the shell globbing
diff --git a/tests/glob1.sub b/tests/glob1.sub
index 6b3b8ad1..27c216ba 100644
--- a/tests/glob1.sub
+++ b/tests/glob1.sub
@@ -1,3 +1,16 @@
+# 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 <http://www.gnu.org/licenses/>.
+#
# bash-2.01.1 failed this test
: ${TMPDIR:=/var/tmp}
diff --git a/tests/glob2.sub b/tests/glob2.sub
index d33013b6..cabc3502 100644
--- a/tests/glob2.sub
+++ b/tests/glob2.sub
@@ -1,3 +1,16 @@
+# 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 <http://www.gnu.org/licenses/>.
+#
. ./test-glue-functions
var='ab\'
diff --git a/tests/glob3.sub b/tests/glob3.sub
index 378234db..3c92854d 100644
--- a/tests/glob3.sub
+++ b/tests/glob3.sub
@@ -1,3 +1,16 @@
+# 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 <http://www.gnu.org/licenses/>.
+#
: ${TMPDIR:=/var/tmp}
cd $TMPDIR
diff --git a/tests/glob4.sub b/tests/glob4.sub
index 2733eb77..c7f51223 100644
--- a/tests/glob4.sub
+++ b/tests/glob4.sub
@@ -1,3 +1,16 @@
+# 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 <http://www.gnu.org/licenses/>.
+#
trap "rm 'a?' aa" EXIT
touch 'a?' aa
diff --git a/tests/glob5.sub b/tests/glob5.sub
index b8fa3b22..dfedb9dd 100644
--- a/tests/glob5.sub
+++ b/tests/glob5.sub
@@ -1,3 +1,16 @@
+# 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 <http://www.gnu.org/licenses/>.
+#
ORIGD=$PWD
: ${TMPDIR:=/var/tmp}
diff --git a/tests/glob6.sub b/tests/glob6.sub
index b099811d..5d06a91d 100644
--- a/tests/glob6.sub
+++ b/tests/glob6.sub
@@ -1,3 +1,16 @@
+# 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 <http://www.gnu.org/licenses/>.
+#
# tests of the backslash-in-glob-patterns discussion on the austin-group ML
: ${TMPDIR:=/var/tmp}
diff --git a/tests/globstar.tests b/tests/globstar.tests
index 9c3f823f..33714b4f 100644
--- a/tests/globstar.tests
+++ b/tests/globstar.tests
@@ -1,3 +1,16 @@
+# 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 <http://www.gnu.org/licenses/>.
+#
: ${TMPDIR:=/var/tmp}
dir=$PWD
diff --git a/tests/globstar1.sub b/tests/globstar1.sub
index 8b9e36dc..7097f5d4 100644
--- a/tests/globstar1.sub
+++ b/tests/globstar1.sub
@@ -1,3 +1,16 @@
+# 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 <http://www.gnu.org/licenses/>.
+#
shopt -s globstar
wdir=$PWD
diff --git a/tests/globstar2.sub b/tests/globstar2.sub
index 4e1a0245..ccf413b1 100644
--- a/tests/globstar2.sub
+++ b/tests/globstar2.sub
@@ -1,3 +1,16 @@
+# 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 <http://www.gnu.org/licenses/>.
+#
olddir=$PWD
: ${TMPDIR:=/var/tmp}
EMPTY=$TMPDIR/empty
diff --git a/tests/globstar3.sub b/tests/globstar3.sub
index 78c5e7e2..771d9061 100644
--- a/tests/globstar3.sub
+++ b/tests/globstar3.sub
@@ -1,3 +1,16 @@
+# 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 <http://www.gnu.org/licenses/>.
+#
olddir=$PWD
: ${TMPDIR:=/var/tmp}
diff --git a/tests/heredoc.right b/tests/heredoc.right
index 27065a7d..f6e53bea 100644
--- a/tests/heredoc.right
+++ b/tests/heredoc.right
@@ -67,13 +67,13 @@ qux
bar
qux
abc def geh
-./heredoc3.sub: line 10: warning: here-document at line 8 delimited by end-of-file (wanted `EOF')
+./heredoc3.sub: line 23: warning: here-document at line 21 delimited by end-of-file (wanted `EOF')
= here is the text =
-./heredoc3.sub: line 16: warning: here-document at line 14 delimited by end-of-file (wanted `EOF')
+./heredoc3.sub: line 29: warning: here-document at line 27 delimited by end-of-file (wanted `EOF')
this paren ) is not a problem
-./heredoc3.sub: line 22: warning: here-document at line 20 delimited by end-of-file (wanted `EOF')
+./heredoc3.sub: line 35: warning: here-document at line 33 delimited by end-of-file (wanted `EOF')
these balanced parens ( ) are not a problem
-./heredoc3.sub: line 28: warning: here-document at line 26 delimited by end-of-file (wanted `EOF')
+./heredoc3.sub: line 41: warning: here-document at line 39 delimited by end-of-file (wanted `EOF')
quoted balanced parens \( ) are not a problem either
more text in a subshell
some more text in a different subshell
@@ -90,8 +90,8 @@ end helloEND
hello
\END
end hello<NL>\END
-./heredoc3.sub: line 85: warning: here-document at line 83 delimited by end-of-file (wanted `EOF')
-./heredoc3.sub: line 86: syntax error: unexpected end of file
+./heredoc3.sub: line 98: warning: here-document at line 96 delimited by end-of-file (wanted `EOF')
+./heredoc3.sub: line 99: syntax error: unexpected end of file
heredoc1
EOF
Ok:0
@@ -101,6 +101,6 @@ argv[1] = <two>
argv[2] = <threefi>
argv[3] = <ve>
comsub here-string
-./heredoc.tests: line 136: warning: here-document at line 134 delimited by end-of-file (wanted `EOF')
+./heredoc.tests: line 149: warning: here-document at line 147 delimited by end-of-file (wanted `EOF')
hi
there
diff --git a/tests/heredoc.tests b/tests/heredoc.tests
index ae3d8393..430302f5 100644
--- a/tests/heredoc.tests
+++ b/tests/heredoc.tests
@@ -1,3 +1,16 @@
+# 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 <http://www.gnu.org/licenses/>.
+#
# basics
cat <<EOF
a
diff --git a/tests/heredoc1.sub b/tests/heredoc1.sub
index 3f85ead7..34977c51 100644
--- a/tests/heredoc1.sub
+++ b/tests/heredoc1.sub
@@ -1,3 +1,16 @@
+# 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 <http://www.gnu.org/licenses/>.
+#
foo()
{
echo
diff --git a/tests/heredoc3.sub b/tests/heredoc3.sub
index a5a2fbc0..efbdf7d4 100644
--- a/tests/heredoc3.sub
+++ b/tests/heredoc3.sub
@@ -1,3 +1,16 @@
+# 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 <http://www.gnu.org/licenses/>.
+#
SAVEPWD=$PWD
: ${TMPDIR:=/tmp}
cd $TMPDIR || echo "heredoc3.sub: cannot cd to $TMPDIR" >&2
diff --git a/tests/heredoc5.sub b/tests/heredoc5.sub
index 9f070c95..d7b5926d 100644
--- a/tests/heredoc5.sub
+++ b/tests/heredoc5.sub
@@ -1,3 +1,16 @@
+# 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 <http://www.gnu.org/licenses/>.
+#
# test here documents for sizes > 65536 (max pipe capacity I've seen),
# 4096 < size < 65536 (for smaller pipe capacities)
# 512 < size < 4096 (PIPE_BUF)
diff --git a/tests/herestr.tests b/tests/herestr.tests
index 154e4168..6f4c74c2 100644
--- a/tests/herestr.tests
+++ b/tests/herestr.tests
@@ -1,3 +1,16 @@
+# 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 <http://www.gnu.org/licenses/>.
+#
# basics
read x <<<"alpha"
echo "$x"
diff --git a/tests/histexp.right b/tests/histexp.right
index 9dc592cb..8439de99 100644
--- a/tests/histexp.right
+++ b/tests/histexp.right
@@ -1,5 +1,5 @@
echo $BASH_VERSION
-./histexp.tests: line 24: history: !!:z: history expansion failed
+./histexp.tests: line 37: history: !!:z: history expansion failed
1 for i in one two three; do echo $i; done
2 /bin/sh -c 'echo this is $0'
3 ls
@@ -202,7 +202,7 @@ d
!
e
! !
-./histexp4.sub: line 20: !': event not found
+./histexp4.sub: line 33: !': event not found
/tmp/Step1
echo /$(echo tmp)/Step1
/tmp/Step1
diff --git a/tests/histexp.tests b/tests/histexp.tests
index 5ae925e1..218af095 100644
--- a/tests/histexp.tests
+++ b/tests/histexp.tests
@@ -1,3 +1,16 @@
+# 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 <http://www.gnu.org/licenses/>.
+#
LC_ALL=C
LANG=C
trap 'rm $TMPDIR/newhistory' 0
diff --git a/tests/histexp1.sub b/tests/histexp1.sub
index a5948f1e..cc2c5d1d 100644
--- a/tests/histexp1.sub
+++ b/tests/histexp1.sub
@@ -1,3 +1,16 @@
+# 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 <http://www.gnu.org/licenses/>.
+#
LC_ALL=C
LANG=C
diff --git a/tests/histexp3.sub b/tests/histexp3.sub
index 495f0952..4962436d 100644
--- a/tests/histexp3.sub
+++ b/tests/histexp3.sub
@@ -1,3 +1,16 @@
+# 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 <http://www.gnu.org/licenses/>.
+#
HISTFILE=${TMPDIR}/bashhist-$$
set -o history
diff --git a/tests/histexp4.sub b/tests/histexp4.sub
index ddc3bb3c..9cae0e37 100644
--- a/tests/histexp4.sub
+++ b/tests/histexp4.sub
@@ -1,3 +1,16 @@
+# 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 <http://www.gnu.org/licenses/>.
+#
HISTFILE=$TMPDIR/bashhist-$$
set -o history
diff --git a/tests/histexp5.sub b/tests/histexp5.sub
index 0fe62fe4..9e6d01bc 100644
--- a/tests/histexp5.sub
+++ b/tests/histexp5.sub
@@ -1,3 +1,16 @@
+# 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 <http://www.gnu.org/licenses/>.
+#
set -o history
set -o histexpand
diff --git a/tests/histexp6.sub b/tests/histexp6.sub
index 00610b07..d52e5ea8 100644
--- a/tests/histexp6.sub
+++ b/tests/histexp6.sub
@@ -1,3 +1,16 @@
+# 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 <http://www.gnu.org/licenses/>.
+#
unset HISTIGNORE
HISTFILE=$TMPDIR/bashhist-$$
diff --git a/tests/history.right b/tests/history.right
index d83fc718..bd3be440 100644
--- a/tests/history.right
+++ b/tests/history.right
@@ -1,7 +1,7 @@
-./history.tests: line 4: history: -x: invalid option
+./history.tests: line 17: history: -x: invalid option
history: usage: history [-c] [-d offset] [n] or history -anrw [filename] or history -ps arg [arg...]
-./history.tests: line 6: history: cannot use more than one of -anrw
-./history.tests: line 9: fc: -v: invalid option
+./history.tests: line 19: history: cannot use more than one of -anrw
+./history.tests: line 22: fc: -v: invalid option
fc: usage: fc [-e ename] [-lnr] [first] [last] or fc -s [pat=rep] [command]
1 for i in one two three; do echo $i; done
2 /bin/sh -c 'echo this is $0'
@@ -97,7 +97,7 @@ line 2 for history
6 HISTFILE=$TMPDIR/newhistory
7 echo displaying \$HISTFILE after history -a
8 cat $HISTFILE
-./history.tests: line 76: fc: history specification out of range
+./history.tests: line 89: fc: history specification out of range
14 set -H
15 echo line 2 for history
16 unset HISTSIZE
@@ -107,7 +107,7 @@ echo xx xb xc
xx xb xc
echo 44 48 4c
44 48 4c
-./history.tests: line 91: fc: no command found
+./history.tests: line 104: fc: no command found
aa
bb
cc
@@ -167,11 +167,11 @@ i
4 echo g
5 echo h
-./history3.sub: line 27: history: 16: history position out of range
-./history3.sub: line 28: history: 200: history position out of range
-./history3.sub: line 29: history: -20: history position out of range
-./history3.sub: line 30: history: -50: history position out of range
-./history3.sub: line 31: history: 5-0xaf: history position out of range
+./history3.sub: line 40: history: 16: history position out of range
+./history3.sub: line 41: history: 200: history position out of range
+./history3.sub: line 42: history: -20: history position out of range
+./history3.sub: line 43: history: -50: history position out of range
+./history3.sub: line 44: history: 5-0xaf: history position out of range
1 echo a
2 echo e
3 echo f
diff --git a/tests/history.tests b/tests/history.tests
index 4001bd6c..e7451c7b 100644
--- a/tests/history.tests
+++ b/tests/history.tests
@@ -1,3 +1,16 @@
+# 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 <http://www.gnu.org/licenses/>.
+#
trap 'rm $TMPDIR/newhistory' 0
# bad options
diff --git a/tests/history1.sub b/tests/history1.sub
index 091b1edc..b67a0efa 100644
--- a/tests/history1.sub
+++ b/tests/history1.sub
@@ -1,3 +1,16 @@
+# 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 <http://www.gnu.org/licenses/>.
+#
trap 'rm -f $HISTFILE' 0 1 2 3 6 15
HISTFILE=$TMPDIR/foohist-$$
diff --git a/tests/history3.sub b/tests/history3.sub
index 8722666c..d8a22038 100644
--- a/tests/history3.sub
+++ b/tests/history3.sub
@@ -1,3 +1,16 @@
+# 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 <http://www.gnu.org/licenses/>.
+#
: ${TMPDIR:=/tmp}
set -o history
diff --git a/tests/ifs-posix.tests b/tests/ifs-posix.tests
index cf9a8987..21a90636 100644
--- a/tests/ifs-posix.tests
+++ b/tests/ifs-posix.tests
@@ -1,3 +1,16 @@
+# 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 <http://www.gnu.org/licenses/>.
+#
# Usage: $SHELL ifs.sh
#
# This script generates 6856 tests for the set(1) and read(1)
diff --git a/tests/ifs.tests b/tests/ifs.tests
index 71769005..27f27dd6 100644
--- a/tests/ifs.tests
+++ b/tests/ifs.tests
@@ -1,3 +1,16 @@
+# 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 <http://www.gnu.org/licenses/>.
+#
OIFS="$IFS"
IFS=":$IFS"
eval foo="a:b:c"
diff --git a/tests/intl.tests b/tests/intl.tests
index 5c15b47e..c3000fc7 100644
--- a/tests/intl.tests
+++ b/tests/intl.tests
@@ -1,3 +1,16 @@
+# 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 <http://www.gnu.org/licenses/>.
+#
export LC_ALL=en_US.UTF-8
a=$'\303\251'
diff --git a/tests/intl3.sub b/tests/intl3.sub
index 650000e9..56c86780 100644
--- a/tests/intl3.sub
+++ b/tests/intl3.sub
@@ -1,3 +1,16 @@
+# 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 <http://www.gnu.org/licenses/>.
+#
. ./test-glue-functions
# more tests to make sure that IFS splits on characters, not bytes
diff --git a/tests/invert.tests b/tests/invert.tests
index 8393d95a..f339d41f 100644
--- a/tests/invert.tests
+++ b/tests/invert.tests
@@ -1,3 +1,16 @@
+# 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 <http://www.gnu.org/licenses/>.
+#
# tests of return value inversion
# placeholder for future expansion
diff --git a/tests/iquote.tests b/tests/iquote.tests
index a1e63622..8411c8ab 100644
--- a/tests/iquote.tests
+++ b/tests/iquote.tests
@@ -1,3 +1,16 @@
+# 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 <http://www.gnu.org/licenses/>.
+#
# bug in bash up to and including bash-3.0 (including patches)
#
# problem is conflict between CTLNUL used internally to denote quoted null
diff --git a/tests/iquote1.sub b/tests/iquote1.sub
index 1a8a35c0..685a80ea 100644
--- a/tests/iquote1.sub
+++ b/tests/iquote1.sub
@@ -1,3 +1,16 @@
+# 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 <http://www.gnu.org/licenses/>.
+#
# Problems with variables that expand to 0x7f and quoted nulls in the same
# expansion -- affects bash versions 4.0-post 4.2
a=x
diff --git a/tests/jobs.right b/tests/jobs.right
index 0e9d1d19..0fe2abec 100644
--- a/tests/jobs.right
+++ b/tests/jobs.right
@@ -29,19 +29,19 @@ i killed it
[3]+ Running sleep 20 &
child1 exit status 0
0
-./jobs.tests: line 25: wait: %1: no such job
-./jobs.tests: line 30: fg: no job control
+./jobs.tests: line 38: wait: %1: no such job
+./jobs.tests: line 43: fg: no job control
wait-for-pid
wait-errors
-./jobs.tests: line 43: wait: `1-1': not a pid or valid job spec
-./jobs.tests: line 44: wait: `-4': not a pid or valid job spec
+./jobs.tests: line 56: wait: `1-1': not a pid or valid job spec
+./jobs.tests: line 57: wait: `-4': not a pid or valid job spec
wait-for-background-pids
async list wait-for-background-pids
async list wait for child
forked
wait-when-no-children
wait-for-job
-./jobs.tests: line 66: wait: %2: no such job
+./jobs.tests: line 79: wait: %2: no such job
127
async list wait-for-job
forked
@@ -54,19 +54,19 @@ sleep 5
fg-bg 4
sleep 5
fg-bg 5
-./jobs.tests: line 93: fg: %2: no such job
-./jobs.tests: line 94: bg: job 1 already in background
+./jobs.tests: line 106: fg: %2: no such job
+./jobs.tests: line 107: bg: job 1 already in background
fg-bg 6
-./jobs.tests: line 101: fg: -s: invalid option
+./jobs.tests: line 114: fg: -s: invalid option
fg: usage: fg [job_spec]
-./jobs.tests: line 102: bg: -s: invalid option
+./jobs.tests: line 115: bg: -s: invalid option
bg: usage: bg [job_spec ...]
-./jobs.tests: line 107: disown: -s: invalid option
+./jobs.tests: line 120: disown: -s: invalid option
disown: usage: disown [-h] [-ar] [jobspec ... | pid ...]
-./jobs.tests: line 111: disown: %1: no such job
-./jobs.tests: line 114: disown: %2: no such job
+./jobs.tests: line 124: disown: %1: no such job
+./jobs.tests: line 127: disown: %2: no such job
wait-for-non-child
-./jobs.tests: line 117: wait: pid 1 is not a child of this shell
+./jobs.tests: line 130: wait: pid 1 is not a child of this shell
127
3 -- 1 2 3 -- 1 - 2 - 3
[1] Running sleep 300 &
@@ -76,8 +76,8 @@ running jobs:
[1] Running sleep 300 &
[2]- Running sleep 350 &
[3]+ Running sleep 400 &
-./jobs.tests: line 134: kill: %4: no such job
-./jobs.tests: line 136: jobs: %4: no such job
+./jobs.tests: line 147: kill: %4: no such job
+./jobs.tests: line 149: jobs: %4: no such job
current job:
[3]+ Running sleep 400 &
previous job:
diff --git a/tests/jobs.tests b/tests/jobs.tests
index 3c2eef31..ce8f2f09 100644
--- a/tests/jobs.tests
+++ b/tests/jobs.tests
@@ -1,3 +1,16 @@
+# 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 <http://www.gnu.org/licenses/>.
+#
# test out %+, jobs -p, and $! agreement in a subshell first
${THIS_SH} ./jobs1.sub
diff --git a/tests/jobs1.sub b/tests/jobs1.sub
index 53f66cc6..84919d9b 100644
--- a/tests/jobs1.sub
+++ b/tests/jobs1.sub
@@ -1,3 +1,16 @@
+# 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 <http://www.gnu.org/licenses/>.
+#
# make sure that jobs -p, %+, and $! all agree
set -m
sleep 60 &
diff --git a/tests/jobs3.sub b/tests/jobs3.sub
index 6efd58b0..1337fc12 100644
--- a/tests/jobs3.sub
+++ b/tests/jobs3.sub
@@ -1,4 +1,17 @@
-#! /bin/bash
+# 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 <http://www.gnu.org/licenses/>.
+#
+
NJOB=8
i=0
diff --git a/tests/jobs4.sub b/tests/jobs4.sub
index 898b449b..7ecd7123 100644
--- a/tests/jobs4.sub
+++ b/tests/jobs4.sub
@@ -1,3 +1,16 @@
+# 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 <http://www.gnu.org/licenses/>.
+#
# test being able to use job control notation in jobs/kill/wait without
# job control active, as the SUS requires
diff --git a/tests/lastpipe.tests b/tests/lastpipe.tests
index 16dc8419..66ebfe2b 100644
--- a/tests/lastpipe.tests
+++ b/tests/lastpipe.tests
@@ -1,3 +1,16 @@
+# 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 <http://www.gnu.org/licenses/>.
+#
binfalse()
{
$binfalse || return 1 # normalize return value
diff --git a/tests/lastpipe2.sub b/tests/lastpipe2.sub
index 3bcc37d3..a4602863 100644
--- a/tests/lastpipe2.sub
+++ b/tests/lastpipe2.sub
@@ -1,3 +1,16 @@
+# 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 <http://www.gnu.org/licenses/>.
+#
shopt -s lastpipe
echo -e 'A\nB' | while read letter; do
echo -e '1\n2' | while read digit; do
diff --git a/tests/mapfile.tests b/tests/mapfile.tests
index ff8da32b..01f1f2e5 100644
--- a/tests/mapfile.tests
+++ b/tests/mapfile.tests
@@ -1,3 +1,16 @@
+# 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 <http://www.gnu.org/licenses/>.
+#
declare -a A
mapfile A < mapfile.data
for (( i = 0 ; i < ${#A[@]} ; i++ )); do
diff --git a/tests/more-exp.right b/tests/more-exp.right
index 91a375cb..f5f37c92 100644
--- a/tests/more-exp.right
+++ b/tests/more-exp.right
@@ -108,7 +108,7 @@ argv[3] = <c>
argv[4] = <d>
argv[5] = <e>
argv[6] = <f>
-./more-exp.tests: line 272: abc=def: command not found
+./more-exp.tests: line 285: abc=def: command not found
argv[1] = <a b c d e>
argv[1] = <a>
argv[2] = <b>
@@ -184,13 +184,13 @@ argv[1] = <1>
argv[1] = <5>
argv[1] = <5>
argv[1] = <0>
-./more-exp.tests: line 423: ${#:}: bad substitution
-./more-exp.tests: line 425: ${#/}: bad substitution
-./more-exp.tests: line 427: ${#%}: bad substitution
-./more-exp.tests: line 429: ${#=}: bad substitution
-./more-exp.tests: line 431: ${#+}: bad substitution
-./more-exp.tests: line 433: ${#1xyz}: bad substitution
-./more-exp.tests: line 436: #: %: syntax error: operand expected (error token is "%")
+./more-exp.tests: line 436: ${#:}: bad substitution
+./more-exp.tests: line 438: ${#/}: bad substitution
+./more-exp.tests: line 440: ${#%}: bad substitution
+./more-exp.tests: line 442: ${#=}: bad substitution
+./more-exp.tests: line 444: ${#+}: bad substitution
+./more-exp.tests: line 446: ${#1xyz}: bad substitution
+./more-exp.tests: line 449: #: %: syntax error: operand expected (error token is "%")
argv[1] = <0>
argv[1] = <a+b>
argv[1] = <+>
diff --git a/tests/more-exp.tests b/tests/more-exp.tests
index 10b3a47e..df12b998 100644
--- a/tests/more-exp.tests
+++ b/tests/more-exp.tests
@@ -1,3 +1,16 @@
+# 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 <http://www.gnu.org/licenses/>.
+#
expect()
{
echo expect "$@"
diff --git a/tests/nameref.right b/tests/nameref.right
index 698002ec..e824f5ad 100644
--- a/tests/nameref.right
+++ b/tests/nameref.right
@@ -27,12 +27,12 @@ changevar: expect <three four five>
argv[1] = <three four five>
expect <three four five>
argv[1] = <three four five>
-./nameref.tests: line 93: foo: readonly variable
-./nameref.tests: line 94: foo: readonly variable
+./nameref.tests: line 106: foo: readonly variable
+./nameref.tests: line 107: foo: readonly variable
one
one
-./nameref.tests: line 106: foo: readonly variable
-./nameref.tests: line 103: foo: readonly variable
+./nameref.tests: line 119: foo: readonly variable
+./nameref.tests: line 116: foo: readonly variable
one
abxde
abxde
@@ -48,8 +48,8 @@ argv[1] = <unset>
expect <bar>
argv[1] = <bar>
expect <unset>
-./nameref3.sub: line 16: foo: invalid indirect expansion
-./nameref3.sub: line 21: unset: bar: cannot unset: readonly variable
+./nameref3.sub: line 29: foo: invalid indirect expansion
+./nameref3.sub: line 34: unset: bar: cannot unset: readonly variable
expect <two>
two
expect <two>
@@ -105,14 +105,14 @@ ref -> one, value: 1
ref -> two, value: 2
ref -> three, value: 3
final state: ref -> three, value: 3
-./nameref5.sub: line 43: unset: three: cannot unset: readonly variable
+./nameref5.sub: line 56: unset: three: cannot unset: readonly variable
ref -> one, value: 1
ref -> two, value: 2
ref -> three, value: 3
final state: ref -> three, value: 3
-./nameref6.sub: line 2: typeset: x: nameref variable self references not allowed
-./nameref6.sub: line 5: typeset: x[3]: reference variable cannot be an array
-./nameref6.sub: line 12: typeset: x: reference variable cannot be an array
+./nameref6.sub: line 15: typeset: x: nameref variable self references not allowed
+./nameref6.sub: line 18: typeset: x[3]: reference variable cannot be an array
+./nameref6.sub: line 25: typeset: x: reference variable cannot be an array
the -- 1
42 -- 0
y -- 0
@@ -121,23 +121,23 @@ y -- 0
y -- 0
bar
unset
-./nameref8.sub: line 3: typeset: warning: v: circular name reference
-./nameref8.sub: line 3: warning: v: circular name reference
-./nameref8.sub: line 5: warning: v: circular name reference
+./nameref8.sub: line 16: typeset: warning: v: circular name reference
+./nameref8.sub: line 16: warning: v: circular name reference
+./nameref8.sub: line 18: warning: v: circular name reference
inside
inside: two
outside:
-./nameref8.sub: line 29: typeset: warning: x: circular name reference
-./nameref8.sub: line 29: warning: x: circular name reference
-./nameref8.sub: line 31: warning: x: circular name reference
+./nameref8.sub: line 42: typeset: warning: x: circular name reference
+./nameref8.sub: line 42: warning: x: circular name reference
+./nameref8.sub: line 44: warning: x: circular name reference
foo
-./nameref8.sub: line 38: typeset: warning: v: circular name reference
-./nameref8.sub: line 38: warning: v: circular name reference
-./nameref8.sub: line 38: warning: v: circular name reference
+./nameref8.sub: line 51: typeset: warning: v: circular name reference
+./nameref8.sub: line 51: warning: v: circular name reference
+./nameref8.sub: line 51: warning: v: circular name reference
local
-./nameref8.sub: line 47: typeset: v: nameref variable self references not allowed
-./nameref8.sub: line 54: warning: x: circular name reference
-./nameref8.sub: line 55: warning: x: circular name reference
+./nameref8.sub: line 60: typeset: v: nameref variable self references not allowed
+./nameref8.sub: line 67: warning: x: circular name reference
+./nameref8.sub: line 68: warning: x: circular name reference
x =
idx2
idX2
@@ -157,107 +157,107 @@ comsub
comsub
4
declare -n foo="somevariable"
-./nameref10.sub: line 38: typeset: somevariable: not found
+./nameref10.sub: line 51: typeset: somevariable: not found
foo =
declare -n foo="somevariable"
declare -A somevariable=([jug]="brown" )
declare -n foo="somevariable"
declare -A somevariable=([jug]="brown" )
declare -n foo="somevariable"
-./nameref10.sub: line 49: typeset: somevariable: not found
-./nameref10.sub: line 51: typeset: foo: not found
-./nameref10.sub: line 51: typeset: somevariable: not found
+./nameref10.sub: line 62: typeset: somevariable: not found
+./nameref10.sub: line 64: typeset: foo: not found
+./nameref10.sub: line 64: typeset: somevariable: not found
declare -n foo="bar"
-./nameref10.sub: line 55: typeset: bar: not found
+./nameref10.sub: line 68: typeset: bar: not found
declare -n foo="bar"
-./nameref10.sub: line 57: typeset: bar: not found
+./nameref10.sub: line 70: typeset: bar: not found
declare -n foo="bar"
declare -i bar="8"
8
declare -n foo="bar"
-./nameref10.sub: line 64: typeset: bar: not found
-./nameref11.sub: line 1: declare: `/': invalid variable name for name reference
-./nameref11.sub: line 2: declare: `/': invalid variable name for name reference
-./nameref11.sub: line 3: `/': not a valid identifier
-./nameref11.sub: line 4: declare: `/': not a valid identifier
-./nameref11.sub: line 5: `/': not a valid identifier
+./nameref10.sub: line 77: typeset: bar: not found
+./nameref11.sub: line 14: declare: `/': invalid variable name for name reference
+./nameref11.sub: line 15: declare: `/': invalid variable name for name reference
+./nameref11.sub: line 16: `/': not a valid identifier
+./nameref11.sub: line 17: declare: `/': not a valid identifier
+./nameref11.sub: line 18: `/': not a valid identifier
1) /
-#? ./nameref11.sub: line 6: `/': not a valid identifier
+#? ./nameref11.sub: line 19: `/': not a valid identifier
x
-./nameref11.sub: line 7: ((: `0': not a valid identifier
-./nameref11.sub: line 8: declare: `0': invalid variable name for name reference
-./nameref11.sub: line 9: declare: `/': invalid variable name for name reference
-./nameref11.sub: line 10: declare: `/': invalid variable name for name reference
+./nameref11.sub: line 20: ((: `0': not a valid identifier
+./nameref11.sub: line 21: declare: `0': invalid variable name for name reference
+./nameref11.sub: line 22: declare: `/': invalid variable name for name reference
+./nameref11.sub: line 23: declare: `/': invalid variable name for name reference
/
-./nameref11.sub: line 12: `/': not a valid identifier
-./nameref11.sub: line 13: exec: `10': not a valid identifier
-./nameref11.sub: line 13: r: cannot assign fd to variable
-./nameref11.sub: line 14: warning: r: removing nameref attribute
+./nameref11.sub: line 25: `/': not a valid identifier
+./nameref11.sub: line 26: exec: `10': not a valid identifier
+./nameref11.sub: line 26: r: cannot assign fd to variable
+./nameref11.sub: line 27: warning: r: removing nameref attribute
63
-./nameref11.sub: line 15: declare: RO: readonly variable
-./nameref11.sub: line 15: RO: readonly variable
-./nameref11.sub: line 16: declare: `/': invalid variable name for name reference
+./nameref11.sub: line 28: declare: RO: readonly variable
+./nameref11.sub: line 28: RO: readonly variable
+./nameref11.sub: line 29: declare: `/': invalid variable name for name reference
/
-./nameref11.sub: line 17: declare: `/': invalid variable name for name reference
+./nameref11.sub: line 30: declare: `/': invalid variable name for name reference
./nameref11.sub: illegal option -- h
-./nameref11.sub: line 18: getopts: `?': not a valid identifier
-./nameref11.sub: line 19: warning: r: removing nameref attribute
+./nameref11.sub: line 31: getopts: `?': not a valid identifier
+./nameref11.sub: line 32: warning: r: removing nameref attribute
declare -a r=()
-./nameref11.sub: line 20: declare: r: reference variable cannot be an array
-./nameref11.sub: line 21: printf: `/': not a valid identifier
-./nameref11.sub: line 23: `': not a valid identifier
-./nameref11.sub: line 24: declare: `': not a valid identifier
-./nameref11.sub: line 25: `': not a valid identifier
-./nameref11.sub: line 26: printf: `': not a valid identifier
-./nameref11.sub: line 27: declare: `': invalid variable name for name reference
+./nameref11.sub: line 33: declare: r: reference variable cannot be an array
+./nameref11.sub: line 34: printf: `/': not a valid identifier
+./nameref11.sub: line 36: `': not a valid identifier
+./nameref11.sub: line 37: declare: `': not a valid identifier
+./nameref11.sub: line 38: `': not a valid identifier
+./nameref11.sub: line 39: printf: `': not a valid identifier
+./nameref11.sub: line 40: declare: `': invalid variable name for name reference
declare -r ROVAR="42"
-./nameref11.sub: line 32: ROVAR: readonly variable
-./nameref11.sub: line 32: ROVAR: cannot unset: readonly variable
+./nameref11.sub: line 45: ROVAR: readonly variable
+./nameref11.sub: line 45: ROVAR: cannot unset: readonly variable
declare -r ROVAR="42"
./nameref11.sub
-./nameref11.sub: line 34: `@': not a valid identifier
+./nameref11.sub: line 47: `@': not a valid identifier
./nameref11.sub
declare -n ref="x"
-./nameref11.sub: line 39: RO: readonly variable
+./nameref11.sub: line 52: RO: readonly variable
declare -r RO_PID
-./nameref11.sub: line 39: RO: cannot unset: readonly variable
+./nameref11.sub: line 52: RO: cannot unset: readonly variable
declare -r RO="x"
-./nameref11.sub: line 39: declare: RO_PID: not found
-./nameref11.sub: line 41: RO2: readonly variable
+./nameref11.sub: line 52: declare: RO_PID: not found
+./nameref11.sub: line 54: RO2: readonly variable
declare -r RO2="a"
2
-./nameref11.sub: line 52: typeset: `2': invalid variable name for name reference
+./nameref11.sub: line 65: typeset: `2': invalid variable name for name reference
2
-./nameref11.sub: line 57: typeset: `2': invalid variable name for name reference
+./nameref11.sub: line 70: typeset: `2': invalid variable name for name reference
2
-./nameref11.sub: line 62: foo[2]: invalid indirect expansion
-./nameref11.sub: line 63: bar: invalid indirect expansion
-./nameref12.sub: line 6: declare: `/': invalid variable name for name reference
-./nameref12.sub: line 9: declare: `%': invalid variable name for name reference
-./nameref12.sub: line 13: `^': not a valid identifier
+./nameref11.sub: line 75: foo[2]: invalid indirect expansion
+./nameref11.sub: line 76: bar: invalid indirect expansion
+./nameref12.sub: line 19: declare: `/': invalid variable name for name reference
+./nameref12.sub: line 22: declare: `%': invalid variable name for name reference
+./nameref12.sub: line 26: `^': not a valid identifier
declare -n r
declare -a foo
declare -a foo=([0]="7")
-./nameref12.sub: line 26: declare: `42': not a valid identifier
-./nameref12.sub: line 27: declare: x: not found
+./nameref12.sub: line 39: declare: `42': not a valid identifier
+./nameref12.sub: line 40: declare: x: not found
declare -nr RO="foo"
/
-./nameref12.sub: line 45: declare: `7*6': not a valid identifier
-./nameref12.sub: line 45: declare: foo: not found
-./nameref12.sub: line 47: `7*6': not a valid identifier
+./nameref12.sub: line 58: declare: `7*6': not a valid identifier
+./nameref12.sub: line 58: declare: foo: not found
+./nameref12.sub: line 60: `7*6': not a valid identifier
declare -n ref="var"
declare -n ref="var"
-./nameref12.sub: line 74: readonly: `var[0]': not a valid identifier
+./nameref12.sub: line 87: readonly: `var[0]': not a valid identifier
declare -- var="foo"
declare -r var2="foo"
declare -n ref="var"
declare -a var=([0]="foo")
-./nameref12.sub: line 91: `': not a valid identifier
+./nameref12.sub: line 104: `': not a valid identifier
declare -n ref
declare -- ref="global"
declare -a var=([0]="foo2")
-./nameref12.sub: line 100: declare: global: not found
+./nameref12.sub: line 113: declare: global: not found
declare -- a
declare -n r="a"
declare -- a
@@ -270,9 +270,9 @@ declare -n r="a"
0
declare -n r
declare -n r
-./nameref13.sub: line 88: typeset: `12345': invalid variable name for name reference
+./nameref13.sub: line 101: typeset: `12345': invalid variable name for name reference
declare -n foo
-./nameref13.sub: line 97: typeset: `12345': invalid variable name for name reference
+./nameref13.sub: line 110: typeset: `12345': invalid variable name for name reference
declare -n foo
declare -nx ref="var"
var
@@ -285,7 +285,7 @@ foo
foo
before
declare -n ref="var"
-./nameref14.sub: line 23: typeset: var: not found
+./nameref14.sub: line 36: typeset: var: not found
first
declare -n ref="var"
declare -x var="xxx"
@@ -294,105 +294,105 @@ declare -n ref="var"
declare -x var="5"
after
declare -n ref="var"
-./nameref14.sub: line 32: typeset: var: not found
+./nameref14.sub: line 45: typeset: var: not found
declare -n ref="var"
-./nameref15.sub: line 1: local: warning: a: circular name reference
-./nameref15.sub: line 1: warning: a: circular name reference
-./nameref15.sub: line 1: `a[0]': not a valid identifier
+./nameref15.sub: line 14: local: warning: a: circular name reference
+./nameref15.sub: line 14: warning: a: circular name reference
+./nameref15.sub: line 14: `a[0]': not a valid identifier
declare -a a=([0]="0")
-./nameref15.sub: line 1: local: warning: a: circular name reference
-./nameref15.sub: line 1: warning: a: circular name reference
-./nameref15.sub: line 1: warning: a: circular name reference
+./nameref15.sub: line 14: local: warning: a: circular name reference
+./nameref15.sub: line 14: warning: a: circular name reference
+./nameref15.sub: line 14: warning: a: circular name reference
declare -a a=([0]="X")
declare -a b=([0]="X")
-./nameref15.sub: line 1: local: warning: a: circular name reference
-./nameref15.sub: line 1: warning: a: circular name reference
-./nameref15.sub: line 1: `a[0]': not a valid identifier
+./nameref15.sub: line 14: local: warning: a: circular name reference
+./nameref15.sub: line 14: warning: a: circular name reference
+./nameref15.sub: line 14: `a[0]': not a valid identifier
declare -a b=([0]="0")
-./nameref15.sub: line 19: typeset: warning: ref: circular name reference
-./nameref15.sub: line 19: warning: ref: circular name reference
-./nameref15.sub: line 20: warning: ref: circular name reference
-./nameref15.sub: line 21: warning: ref: circular name reference
+./nameref15.sub: line 32: typeset: warning: ref: circular name reference
+./nameref15.sub: line 32: warning: ref: circular name reference
+./nameref15.sub: line 33: warning: ref: circular name reference
+./nameref15.sub: line 34: warning: ref: circular name reference
inside X
outside X
before: 7
-./nameref15.sub: line 32: typeset: warning: xxx: circular name reference
-./nameref15.sub: line 32: warning: xxx: circular name reference
-./nameref15.sub: line 33: warning: xxx: circular name reference
+./nameref15.sub: line 45: typeset: warning: xxx: circular name reference
+./nameref15.sub: line 45: warning: xxx: circular name reference
+./nameref15.sub: line 46: warning: xxx: circular name reference
declare -n xxx="xxx"
-./nameref15.sub: line 35: warning: xxx: circular name reference
+./nameref15.sub: line 48: warning: xxx: circular name reference
xxx_func: inside: xxx = foo
after: foo
-./nameref15.sub: line 46: typeset: ref: nameref variable self references not allowed
-./nameref15.sub: line 48: ref: nameref variable self references not allowed
+./nameref15.sub: line 59: typeset: ref: nameref variable self references not allowed
+./nameref15.sub: line 61: ref: nameref variable self references not allowed
declare -n ref="re"
declare -n ref="re"
declare -- re="4"
4
declare -n foo="var[@]"
declare -n ref="var[@]"
-./nameref15.sub: line 65: var[@]: bad array subscript
+./nameref15.sub: line 78: var[@]: bad array subscript
declare -n bar="var[@]"
-./nameref15.sub: line 70: var[@]: bad array subscript
+./nameref15.sub: line 83: var[@]: bad array subscript
declare -n a="b"
declare -n b="a[1]"
-./nameref15.sub: line 78: warning: a: removing nameref attribute
+./nameref15.sub: line 91: warning: a: removing nameref attribute
declare -a a=([1]="foo")
declare -n b="a[1]"
-./nameref15.sub: line 83: warning: a: removing nameref attribute
+./nameref15.sub: line 96: warning: a: removing nameref attribute
declare -a a=([1]="foo")
declare -n b="a[1]"
declare -n n="v"
declare -a v=([1]="1")
-./nameref15.sub: line 99: typeset: n: not found
+./nameref15.sub: line 112: typeset: n: not found
declare -a v=([0]="0" [1]="1")
declare -n n="v[1]"
declare -a v=([0]="0")
declare -n r1="y"
declare -n r2="x"
-./nameref16.sub: line 12: typeset: x: not found
-./nameref16.sub: line 12: typeset: y: not found
+./nameref16.sub: line 25: typeset: x: not found
+./nameref16.sub: line 25: typeset: y: not found
declare -n r1="y"
declare -n r2="x"
-./nameref16.sub: line 21: typeset: x: not found
-./nameref16.sub: line 21: typeset: y: not found
+./nameref16.sub: line 34: typeset: x: not found
+./nameref16.sub: line 34: typeset: y: not found
declare -n r1="y"
declare -n r2="x"
-./nameref16.sub: line 33: typeset: x: not found
-./nameref16.sub: line 33: typeset: y: not found
+./nameref16.sub: line 46: typeset: x: not found
+./nameref16.sub: line 46: typeset: y: not found
declare -n r1="y"
declare -n r2="x"
declare -- x="one"
declare -- y="two"
-./nameref17.sub: line 8: declare: bar: not found
-./nameref17.sub: line 9: unset: foo0: cannot unset: readonly variable
+./nameref17.sub: line 21: declare: bar: not found
+./nameref17.sub: line 22: unset: foo0: cannot unset: readonly variable
declare -nr foo0="bar"
declare -nr foo0="bar"
declare -- bar
-./nameref17.sub: line 14: declare: foo0: readonly variable
-./nameref17.sub: line 15: declare: foo0: readonly variable
+./nameref17.sub: line 27: declare: foo0: readonly variable
+./nameref17.sub: line 28: declare: foo0: readonly variable
declare -nr foo1
-./nameref17.sub: line 24: typeset: foo1: readonly variable
+./nameref17.sub: line 37: typeset: foo1: readonly variable
declare -nr foo1
declare -n foo2="bar"
declare -r bar
-./nameref17.sub: line 35: bar: readonly variable
-./nameref17.sub: line 36: typeset: bar: readonly variable
+./nameref17.sub: line 48: bar: readonly variable
+./nameref17.sub: line 49: typeset: bar: readonly variable
declare -n foo2="bar"
declare -r bar
declare -- bar3="three"
-./nameref17.sub: line 46: unset: foo3: cannot unset: readonly variable
-./nameref17.sub: line 49: declare: bar3: readonly variable
+./nameref17.sub: line 59: unset: foo3: cannot unset: readonly variable
+./nameref17.sub: line 62: declare: bar3: readonly variable
declare -nr foo3="bar3"
declare -r bar3="three"
-./nameref17.sub: line 51: declare: foo3: readonly variable
+./nameref17.sub: line 64: declare: foo3: readonly variable
declare -nr foo4="bar4"
declare -- bar4="four"
-./nameref17.sub: line 63: typeset: foo4: readonly variable
+./nameref17.sub: line 76: typeset: foo4: readonly variable
declare -nr foo4="bar4"
declare -nr foo4="bar4"
declare -- bar4="four"
-./nameref17.sub: line 79: typeset: foo4: readonly variable
+./nameref17.sub: line 92: typeset: foo4: readonly variable
declare -nr foo4="bar4"
declare -nr foo4="bar4"
declare -- bar4="four"
@@ -400,33 +400,33 @@ declare -nr foo5
declare -r foo5
declare -nr foo5
declare -r foo5
-./nameref18.sub: line 2: mapfile: `XXX[0]': not a valid identifier
-./nameref18.sub: line 3: declare: XXX[0]: not found
-./nameref18.sub: line 9: `XXX[0]': not a valid identifier
-./nameref18.sub: line 10: declare: XXX[0]: not found
+./nameref18.sub: line 15: mapfile: `XXX[0]': not a valid identifier
+./nameref18.sub: line 16: declare: XXX[0]: not found
+./nameref18.sub: line 22: `XXX[0]': not a valid identifier
+./nameref18.sub: line 23: declare: XXX[0]: not found
declare -n ref="XXX[0]"
declare -a XXX=([0]="4")
-./nameref18.sub: line 24: `XXX[0]': not a valid identifier
-declare -n ref="XXX[0]"
-./nameref18.sub: line 25: declare: XXX[0]: not found
-./nameref18.sub: line 29: read: `XXX[0]': not a valid identifier
-./nameref18.sub: line 30: declare: XXX[0]: not found
-./nameref18.sub: line 35: `XXX[0]': not a valid identifier
+./nameref18.sub: line 37: `XXX[0]': not a valid identifier
declare -n ref="XXX[0]"
-./nameref18.sub: line 38: `XXX[0]': not a valid identifier
./nameref18.sub: line 38: declare: XXX[0]: not found
+./nameref18.sub: line 42: read: `XXX[0]': not a valid identifier
+./nameref18.sub: line 43: declare: XXX[0]: not found
+./nameref18.sub: line 48: `XXX[0]': not a valid identifier
+declare -n ref="XXX[0]"
+./nameref18.sub: line 51: `XXX[0]': not a valid identifier
+./nameref18.sub: line 51: declare: XXX[0]: not found
declare -n ref="var[123]"
-./nameref18.sub: line 46: declare: var[123]: not found
+./nameref18.sub: line 59: declare: var[123]: not found
declare -a var=([123]="")
declare -n ref="var[123]"
-./nameref18.sub: line 50: declare: var[123]: not found
+./nameref18.sub: line 63: declare: var[123]: not found
declare -a var=([123]="")
declare -n ref="var[123]"
-./nameref18.sub: line 54: declare: var[123]: not found
+./nameref18.sub: line 67: declare: var[123]: not found
declare -a var=([123]="X")
declare -n foo="bar"
declare -- foo="bar"
-./nameref19.sub: line 9: declare: bar: not found
+./nameref19.sub: line 22: declare: bar: not found
declare -n foo="bar"
declare -- foo="bar"
declare -i bar="11"
@@ -448,26 +448,26 @@ declare -a var=([0]="X")
declare -n ref="var"
declare -a var=([0]="X")
declare -n ref="var"
-./nameref20.sub: line 23: declare: var: not found
+./nameref20.sub: line 36: declare: var: not found
outside:
declare -a foo=([0]="X")
declare -n ref="var"
declare -a var=([0]="X")
outside:
-./nameref20.sub: line 38: declare: ref: not found
-./nameref20.sub: line 38: declare: var: not found
+./nameref20.sub: line 51: declare: ref: not found
+./nameref20.sub: line 51: declare: var: not found
declare -n ref="var"
declare -- var="X"
outside:
-./nameref20.sub: line 45: declare: ref: not found
-./nameref20.sub: line 45: declare: var: not found
+./nameref20.sub: line 58: declare: ref: not found
+./nameref20.sub: line 58: declare: var: not found
declare -n ref="var"
declare -a var=([0]="Y")
declare -- ref="Y"
declare -- var="X"
ref=Y
declare -- ref="Y"
-./nameref20.sub: line 61: declare: var: not found
+./nameref20.sub: line 74: declare: var: not found
ref=Y
declare -n ref="var"
declare -A var=([2]="" )
diff --git a/tests/nameref.tests b/tests/nameref.tests
index f4af904c..3a6c5d98 100644
--- a/tests/nameref.tests
+++ b/tests/nameref.tests
@@ -1,3 +1,16 @@
+# 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 <http://www.gnu.org/licenses/>.
+#
# basic nameref tests
bar=one
flow=two
diff --git a/tests/nameref10.sub b/tests/nameref10.sub
index 2a1ba359..742755b3 100644
--- a/tests/nameref10.sub
+++ b/tests/nameref10.sub
@@ -1,3 +1,16 @@
+# 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 <http://www.gnu.org/licenses/>.
+#
# testing behavior of command substitution as one of expansions performed by
# array subscripting; should behave the same directly as when done through
# a nameref
diff --git a/tests/nameref11.sub b/tests/nameref11.sub
index 402e5015..ea14c0db 100644
--- a/tests/nameref11.sub
+++ b/tests/nameref11.sub
@@ -1,3 +1,16 @@
+# 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 <http://www.gnu.org/licenses/>.
+#
r=/; declare -n r ; unset r
declare -n r=/ ; unset -n r
declare -n r; r=/ ; unset -n r
diff --git a/tests/nameref12.sub b/tests/nameref12.sub
index 24c33702..199b51c8 100644
--- a/tests/nameref12.sub
+++ b/tests/nameref12.sub
@@ -1,3 +1,16 @@
+# 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 <http://www.gnu.org/licenses/>.
+#
declare -n r
declare -n r
unset -n r
diff --git a/tests/nameref13.sub b/tests/nameref13.sub
index 556fbdb7..5c56428b 100644
--- a/tests/nameref13.sub
+++ b/tests/nameref13.sub
@@ -1,3 +1,16 @@
+# 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 <http://www.gnu.org/licenses/>.
+#
declare -nt r=a
f()
diff --git a/tests/nameref14.sub b/tests/nameref14.sub
index 7880b007..a14c440c 100644
--- a/tests/nameref14.sub
+++ b/tests/nameref14.sub
@@ -1,3 +1,16 @@
+# 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 <http://www.gnu.org/licenses/>.
+#
# exporting namerefs and putting namerefs in temp env post bash-4.3
typeset -nx ref=var;
diff --git a/tests/nameref15.sub b/tests/nameref15.sub
index 9fbacd4f..cce8fbd9 100644
--- a/tests/nameref15.sub
+++ b/tests/nameref15.sub
@@ -1,3 +1,16 @@
+# 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 <http://www.gnu.org/licenses/>.
+#
f() { local -n a=$1; a=X; }
a=(0); f 'a[0]'
diff --git a/tests/nameref16.sub b/tests/nameref16.sub
index 75c7ba11..d07a3a02 100644
--- a/tests/nameref16.sub
+++ b/tests/nameref16.sub
@@ -1,3 +1,16 @@
+# 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 <http://www.gnu.org/licenses/>.
+#
# post-bash-4.3 changes for more ksh93 compatibility when following nameref
# chains and using typeset/declare -n to operate on nameref variables rather
# than the variables they reference
diff --git a/tests/nameref17.sub b/tests/nameref17.sub
index 0cd5a42d..b8c3cc73 100644
--- a/tests/nameref17.sub
+++ b/tests/nameref17.sub
@@ -1,3 +1,16 @@
+# 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 <http://www.gnu.org/licenses/>.
+#
# test behavior of readonly namerefs and namerefs referencing readonly variables
# readonly nameref variable referencing read-write global variable
diff --git a/tests/nameref18.sub b/tests/nameref18.sub
index 1b022959..a29fe379 100644
--- a/tests/nameref18.sub
+++ b/tests/nameref18.sub
@@ -1,3 +1,16 @@
+# 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 <http://www.gnu.org/licenses/>.
+#
declare -n ref=XXX[0]
mapfile ref <<< $'1\n2'
declare -p XXX[0]
diff --git a/tests/nameref19.sub b/tests/nameref19.sub
index d46c003f..b00f68e5 100644
--- a/tests/nameref19.sub
+++ b/tests/nameref19.sub
@@ -1,3 +1,16 @@
+# 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 <http://www.gnu.org/licenses/>.
+#
# can we unset the nameref attribute on variables with values that reference
# unset variables?
diff --git a/tests/nameref20.sub b/tests/nameref20.sub
index 1e6faec9..715bc4dc 100644
--- a/tests/nameref20.sub
+++ b/tests/nameref20.sub
@@ -1,3 +1,16 @@
+# 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 <http://www.gnu.org/licenses/>.
+#
# a collection of cases in bug reports after bash-5.0-alpha was released
declare -n r=v[0]
diff --git a/tests/nameref21.sub b/tests/nameref21.sub
index a555a084..08d8f561 100644
--- a/tests/nameref21.sub
+++ b/tests/nameref21.sub
@@ -1,3 +1,16 @@
+# 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 <http://www.gnu.org/licenses/>.
+#
# issues with local variables and local namerefs post-bash-4.4
f()
diff --git a/tests/nameref3.sub b/tests/nameref3.sub
index 57902917..67cb0982 100644
--- a/tests/nameref3.sub
+++ b/tests/nameref3.sub
@@ -1,3 +1,16 @@
+# 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 <http://www.gnu.org/licenses/>.
+#
# nameref requires changes to unset
bar=one
typeset -n foo=bar
diff --git a/tests/nameref4.sub b/tests/nameref4.sub
index 4dd86b2f..6367d565 100644
--- a/tests/nameref4.sub
+++ b/tests/nameref4.sub
@@ -1,3 +1,16 @@
+# 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 <http://www.gnu.org/licenses/>.
+#
# test suite cribbed from ksh93 nameref tests
typeset -i errors=0
ckval()
diff --git a/tests/nameref5.sub b/tests/nameref5.sub
index 2c67a948..6855e992 100644
--- a/tests/nameref5.sub
+++ b/tests/nameref5.sub
@@ -1,3 +1,16 @@
+# 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 <http://www.gnu.org/licenses/>.
+#
# nameref variables as for loop index variables are special
v1=1
v2=2
diff --git a/tests/nameref6.sub b/tests/nameref6.sub
index cf70d412..8497967f 100644
--- a/tests/nameref6.sub
+++ b/tests/nameref6.sub
@@ -1,3 +1,16 @@
+# 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 <http://www.gnu.org/licenses/>.
+#
# these should be errors
typeset -n x=x
#echo $x -- $?
diff --git a/tests/nameref7.sub b/tests/nameref7.sub
index 19bdc989..5e67ac04 100644
--- a/tests/nameref7.sub
+++ b/tests/nameref7.sub
@@ -1,3 +1,16 @@
+# 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 <http://www.gnu.org/licenses/>.
+#
fn ()
{
declare -n var=foo; var=bar
diff --git a/tests/nameref8.sub b/tests/nameref8.sub
index 23808682..465463bf 100644
--- a/tests/nameref8.sub
+++ b/tests/nameref8.sub
@@ -1,3 +1,16 @@
+# 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 <http://www.gnu.org/licenses/>.
+#
function f1
{
typeset -n v=$1
diff --git a/tests/new-exp.right b/tests/new-exp.right
index 71312417..bf3fc350 100644
--- a/tests/new-exp.right
+++ b/tests/new-exp.right
@@ -3,7 +3,7 @@ argv[1] = <foo>
argv[1] = </usr/homes/chet>
argv[1] = </usr/homes/chet>
argv[1] = </usr/homes/chet>
-./new-exp.tests: line 28: HOME: }: syntax error: operand expected (error token is "}")
+./new-exp.tests: line 41: HOME: }: syntax error: operand expected (error token is "}")
unset
argv[1] = </usr/homes/chet>
argv[1] = </usr/homes/chet>
@@ -66,8 +66,8 @@ argv[4] = <d>
argv[1] = <a>
argv[2] = <b c>
argv[3] = <d>
-./new-exp.tests: line 184: ABX: unbound variable
-./new-exp.tests: line 188: $6: cannot assign in this way
+./new-exp.tests: line 197: ABX: unbound variable
+./new-exp.tests: line 201: $6: cannot assign in this way
argv[1] = <xxcde>
argv[1] = <axxde>
argv[1] = <abxyz>
@@ -170,13 +170,13 @@ This-string-has-multiple-lines.
this is a test of proc subst
this is test 2
a
-./new-exp2.sub: line 42: /tmp/redir-notthere: No such file or directory
+./new-exp2.sub: line 55: /tmp/redir-notthere: No such file or directory
1
-./new-exp2.sub: line 49: 1111111111111111111111: command not found
+./new-exp2.sub: line 62: 1111111111111111111111: command not found
argv[1] = <6>
-./new-exp.tests: line 289: ${#:}: bad substitution
+./new-exp.tests: line 302: ${#:}: bad substitution
argv[1] = <'>
argv[1] = <">
argv[1] = <"hello">
@@ -411,13 +411,13 @@ argv[6] = <w>
argv[7] = <x>
argv[8] = <y>
argv[9] = <z>
-./new-exp.tests: line 507: $9: unbound variable
-./new-exp.tests: line 508: 9: unbound variable
-./new-exp.tests: line 509: UNSET: unbound variable
-./new-exp.tests: line 510: UNSET: unbound variable
-./new-exp.tests: line 511: UNSET: unbound variable
-./new-exp.tests: line 512: UNSET: unbound variable
-./new-exp.tests: line 513: UNSET: unbound variable
+./new-exp.tests: line 520: $9: unbound variable
+./new-exp.tests: line 521: 9: unbound variable
+./new-exp.tests: line 522: UNSET: unbound variable
+./new-exp.tests: line 523: UNSET: unbound variable
+./new-exp.tests: line 524: UNSET: unbound variable
+./new-exp.tests: line 525: UNSET: unbound variable
+./new-exp.tests: line 526: UNSET: unbound variable
argv[1] = <5>
argv[1] = <#>
argv[1] = <#>
@@ -453,9 +453,9 @@ argv[3] = <_QUEST>
argv[4] = <_QUILL>
argv[5] = <_QUOTA>
argv[6] = <_QUOTE>
-./new-exp3.sub: line 23: ${!_Q* }: bad substitution
-./new-exp3.sub: line 28: ${!1*}: bad substitution
-./new-exp3.sub: line 30: ${!@*}: bad substitution
+./new-exp3.sub: line 36: ${!_Q* }: bad substitution
+./new-exp3.sub: line 41: ${!1*}: bad substitution
+./new-exp3.sub: line 43: ${!@*}: bad substitution
Case01---3---A:B:C---
Case02---1---A B C::---
Case03---3---A:B:C---
@@ -464,7 +464,7 @@ Case05---3---A:B:C---
Case06---1---A B C::---
Case07---3---A:B:C---
Case08---3---A:B:C---
-./new-exp.tests: line 533: ${$(($#-1))}: bad substitution
+./new-exp.tests: line 546: ${$(($#-1))}: bad substitution
argv[1] = <a>
argv[2] = <b>
argv[3] = <c>
@@ -481,7 +481,7 @@ argv[1] = <a>
argv[1] = <a>
argv[2] = <b>
argv[1] = <>
-./new-exp.tests: line 552: $(($# - 2)): substring expression < 0
+./new-exp.tests: line 565: $(($# - 2)): substring expression < 0
argv[1] = <bin>
argv[2] = <bin>
argv[3] = <ucb>
@@ -616,7 +616,7 @@ c Sub = 0 2 4 8
<>
<>
<'ab '\''cd'\'' ef'>
-./new-exp10.sub: line 11: ${x@C}: bad substitution
+./new-exp10.sub: line 24: ${x@C}: bad substitution
<'ab'> <'cd ef'> <''> <'gh'>
<'ab' 'cd ef' '' 'gh'>
<'ab'> <'cd> <ef'> <''> <'gh'>
@@ -672,4 +672,4 @@ PASS;1 foo;2 foo;
after: PASS
argv[1] = </>
argv[1] = </>
-./new-exp.tests: line 621: ABXD: parameter unset
+./new-exp.tests: line 634: ABXD: parameter unset
diff --git a/tests/new-exp.tests b/tests/new-exp.tests
index 9bfefbed..a73a5d93 100644
--- a/tests/new-exp.tests
+++ b/tests/new-exp.tests
@@ -1,3 +1,16 @@
+# 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 <http://www.gnu.org/licenses/>.
+#
if (( $UID == 0 )); then
echo "new-exp.tests: the test suite should not be run as root" >&2
fi
diff --git a/tests/new-exp1.sub b/tests/new-exp1.sub
index 2b621fca..d29b93c7 100644
--- a/tests/new-exp1.sub
+++ b/tests/new-exp1.sub
@@ -1,3 +1,16 @@
+# 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 <http://www.gnu.org/licenses/>.
+#
FN=${TMPDIR}/bashtest-$$
expect()
{
diff --git a/tests/new-exp10.sub b/tests/new-exp10.sub
index 9e89a701..bf9ebe7a 100644
--- a/tests/new-exp10.sub
+++ b/tests/new-exp10.sub
@@ -1,3 +1,16 @@
+# 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 <http://www.gnu.org/licenses/>.
+#
# new framework for parameter transformations, post bash-4.3
printf "<%s>" "${x@Q}" ; echo
diff --git a/tests/new-exp11.sub b/tests/new-exp11.sub
index da6b4e1f..6a9edd59 100644
--- a/tests/new-exp11.sub
+++ b/tests/new-exp11.sub
@@ -1,3 +1,16 @@
+# 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 <http://www.gnu.org/licenses/>.
+#
# pattern matching and replacement operators with multibyte characters
LANG=en_US.UTF-8
diff --git a/tests/new-exp12.sub b/tests/new-exp12.sub
index 6a33fa5b..1fbd5d63 100644
--- a/tests/new-exp12.sub
+++ b/tests/new-exp12.sub
@@ -1,4 +1,16 @@
-#!/bin/bash
+# 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 <http://www.gnu.org/licenses/>.
+#
#
# make sure indirect expansion for arrays uses the closest-scope instance
# of the resulting variable name
diff --git a/tests/new-exp2.sub b/tests/new-exp2.sub
index ea52b3ce..da38c479 100644
--- a/tests/new-exp2.sub
+++ b/tests/new-exp2.sub
@@ -1,3 +1,16 @@
+# 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 <http://www.gnu.org/licenses/>.
+#
export LC_ALL=C
export LANG=C
diff --git a/tests/new-exp3.sub b/tests/new-exp3.sub
index 2a766ebd..a0c6586d 100644
--- a/tests/new-exp3.sub
+++ b/tests/new-exp3.sub
@@ -1,3 +1,16 @@
+# 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 <http://www.gnu.org/licenses/>.
+#
:
# Set up some dummy variables beginning with _Q
_QUANTITY=
diff --git a/tests/new-exp4.sub b/tests/new-exp4.sub
index 45439a06..e491f5cf 100644
--- a/tests/new-exp4.sub
+++ b/tests/new-exp4.sub
@@ -1,4 +1,16 @@
-#!/bin/bash
+# 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 <http://www.gnu.org/licenses/>.
+#
arrayA=("A" "B" "C")
diff --git a/tests/new-exp5.sub b/tests/new-exp5.sub
index 0ee86e98..cb203a70 100644
--- a/tests/new-exp5.sub
+++ b/tests/new-exp5.sub
@@ -1,3 +1,16 @@
+# 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 <http://www.gnu.org/licenses/>.
+#
x=(one two)
echo ${x[@]:1}
echo ${x[@]:0:1}
diff --git a/tests/new-exp6.sub b/tests/new-exp6.sub
index 532ec1af..83b041ac 100644
--- a/tests/new-exp6.sub
+++ b/tests/new-exp6.sub
@@ -1,3 +1,16 @@
+# 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 <http://www.gnu.org/licenses/>.
+#
# quoted null problems in versions of bash prior to 3.2
str='12'
diff --git a/tests/new-exp8.sub b/tests/new-exp8.sub
index e047abce..9effec54 100644
--- a/tests/new-exp8.sub
+++ b/tests/new-exp8.sub
@@ -1,3 +1,16 @@
+# 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 <http://www.gnu.org/licenses/>.
+#
pat1='str'
pat2='[^;]'
pat3='[[:alnum:]_]'
diff --git a/tests/new-exp9.sub b/tests/new-exp9.sub
index c9d133c8..799f192d 100644
--- a/tests/new-exp9.sub
+++ b/tests/new-exp9.sub
@@ -1,3 +1,16 @@
+# 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 <http://www.gnu.org/licenses/>.
+#
indirarray()
{
local intermediary
diff --git a/tests/nquote.tests b/tests/nquote.tests
index 80d3cb46..20d6415d 100644
--- a/tests/nquote.tests
+++ b/tests/nquote.tests
@@ -1,3 +1,16 @@
+# 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 <http://www.gnu.org/licenses/>.
+#
expect()
{
echo expect "$@"
diff --git a/tests/nquote1.tests b/tests/nquote1.tests
index f47ab54e..679976c6 100644
--- a/tests/nquote1.tests
+++ b/tests/nquote1.tests
@@ -1,3 +1,16 @@
+# 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 <http://www.gnu.org/licenses/>.
+#
a=$'a\001b'
set $a
diff --git a/tests/nquote2.sub b/tests/nquote2.sub
index d3325f17..bfe2b190 100644
--- a/tests/nquote2.sub
+++ b/tests/nquote2.sub
@@ -1,3 +1,16 @@
+# 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 <http://www.gnu.org/licenses/>.
+#
t() {
printf '%s | %s\n' "$1" "$2"
}
diff --git a/tests/nquote2.tests b/tests/nquote2.tests
index c07bd9b8..e3af99af 100644
--- a/tests/nquote2.tests
+++ b/tests/nquote2.tests
@@ -1,3 +1,16 @@
+# 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 <http://www.gnu.org/licenses/>.
+#
a=$'a\001b'
e=$'uv\001\001wx'
diff --git a/tests/nquote3.tests b/tests/nquote3.tests
index a83ff56d..44b51c40 100644
--- a/tests/nquote3.tests
+++ b/tests/nquote3.tests
@@ -1,3 +1,16 @@
+# 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 <http://www.gnu.org/licenses/>.
+#
a=$'a\001b'
set $a
diff --git a/tests/nquote4.tests b/tests/nquote4.tests
index ed734677..5c67705b 100644
--- a/tests/nquote4.tests
+++ b/tests/nquote4.tests
@@ -1,3 +1,16 @@
+# 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 <http://www.gnu.org/licenses/>.
+#
recho $'ab\x{}cd'
recho $'ab\x{41}cd'
recho $'ab\x41cd'
diff --git a/tests/nquote5.tests b/tests/nquote5.tests
index 85a2ff63..ca0308d7 100644
--- a/tests/nquote5.tests
+++ b/tests/nquote5.tests
@@ -1,3 +1,16 @@
+# 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 <http://www.gnu.org/licenses/>.
+#
a=$'ab\001cd\001ef'
IFS=$'\001'
diff --git a/tests/posix2.right b/tests/posix2.right
index b1585a2e..40aea039 100644
--- a/tests/posix2.right
+++ b/tests/posix2.right
@@ -1,6 +1,6 @@
Testing for POSIX.2 conformance
-./posix2.tests: eval: line 182: syntax error near unexpected token `esac'
-./posix2.tests: eval: line 182: `case esac in (esac) ;; *) echo "case esac test 3" ;; esac'
-./posix2.tests: eval: line 184: syntax error near unexpected token `)'
-./posix2.tests: eval: line 184: `case esac in esac) ;; *) echo "case esac test 4";; esac'
+./posix2.tests: eval: line 195: syntax error near unexpected token `esac'
+./posix2.tests: eval: line 195: `case esac in (esac) ;; *) echo "case esac test 3" ;; esac'
+./posix2.tests: eval: line 197: syntax error near unexpected token `)'
+./posix2.tests: eval: line 197: `case esac in esac) ;; *) echo "case esac test 4";; esac'
All tests passed
diff --git a/tests/posix2.tests b/tests/posix2.tests
index ecf6a6fa..9b6c0932 100644
--- a/tests/posix2.tests
+++ b/tests/posix2.tests
@@ -1,4 +1,17 @@
-#! /bin/sh
+# 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 <http://www.gnu.org/licenses/>.
+#
+
# posix-2.sh - Simple identification tests for POSIX.2 features
# commonly missing or incorrectly implemented.
# Time-stamp: <96/04/10 16:43:48 gildea>
diff --git a/tests/posix2syntax.sub b/tests/posix2syntax.sub
index e7dda58f..39af9a55 100644
--- a/tests/posix2syntax.sub
+++ b/tests/posix2syntax.sub
@@ -1,3 +1,16 @@
+# 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 <http://www.gnu.org/licenses/>.
+#
: ${THIS_SH:=./bash}
bashname=bash${BASH_VERSION%%.*}
diff --git a/tests/posixexp.right b/tests/posixexp.right
index 53a08e3b..329c9822 100644
--- a/tests/posixexp.right
+++ b/tests/posixexp.right
@@ -279,5 +279,5 @@ argv[2] = <b>
OK
OK
5: $'not\ttoo\nbad'
-./posixexp.tests: line 83: unexpected EOF while looking for matching `}'
-./posixexp.tests: line 84: syntax error: unexpected end of file
+./posixexp.tests: line 96: unexpected EOF while looking for matching `}'
+./posixexp.tests: line 97: syntax error: unexpected end of file
diff --git a/tests/posixexp.tests b/tests/posixexp.tests
index 3368711f..b992c303 100644
--- a/tests/posixexp.tests
+++ b/tests/posixexp.tests
@@ -1,3 +1,16 @@
+# 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 <http://www.gnu.org/licenses/>.
+#
unset a
printf "%s\n" ${a:=a\ b}
echo "$a"
diff --git a/tests/posixexp1.sub b/tests/posixexp1.sub
index 91718e3d..c0d6861a 100644
--- a/tests/posixexp1.sub
+++ b/tests/posixexp1.sub
@@ -1,3 +1,16 @@
+# 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 <http://www.gnu.org/licenses/>.
+#
# $FreeBSD: src/tools/regression/bin/sh/expansion/set-u1.0,v 1.2 2010/10/12 18:20:38 obrien Exp $
${THIS_SH} -uc 'unset foo; echo ${foo}' 2>/dev/null && exit 1
diff --git a/tests/posixexp2.sub b/tests/posixexp2.sub
index 397769da..5c46192c 100644
--- a/tests/posixexp2.sub
+++ b/tests/posixexp2.sub
@@ -1,3 +1,16 @@
+# 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 <http://www.gnu.org/licenses/>.
+#
x=a\ b
[ "$x" = "${x?}" ] || exit 1
diff --git a/tests/posixexp2.tests b/tests/posixexp2.tests
index 2bec58e0..5f2392b5 100644
--- a/tests/posixexp2.tests
+++ b/tests/posixexp2.tests
@@ -1,3 +1,16 @@
+# 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 <http://www.gnu.org/licenses/>.
+#
# From mksh
set -o posix ; shopt -u xpg_echo
diff --git a/tests/posixexp3.sub b/tests/posixexp3.sub
index c40afa94..343adfe3 100644
--- a/tests/posixexp3.sub
+++ b/tests/posixexp3.sub
@@ -1,3 +1,16 @@
+# 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 <http://www.gnu.org/licenses/>.
+#
set -- 1 2
unset var
diff --git a/tests/posixexp4.sub b/tests/posixexp4.sub
index 22bfeca8..9d48b2f6 100644
--- a/tests/posixexp4.sub
+++ b/tests/posixexp4.sub
@@ -1,3 +1,16 @@
+# 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 <http://www.gnu.org/licenses/>.
+#
set -- ' abc' 'def ghi' 'jkl '
echo normal IFS
diff --git a/tests/posixexp5.sub b/tests/posixexp5.sub
index e477bbb1..b0e1c039 100644
--- a/tests/posixexp5.sub
+++ b/tests/posixexp5.sub
@@ -1,3 +1,16 @@
+# 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 <http://www.gnu.org/licenses/>.
+#
# test suite contribution from Martijn Dekker
defaultIFS=$IFS
diff --git a/tests/posixexp6.sub b/tests/posixexp6.sub
index ed38d535..b89b87f9 100644
--- a/tests/posixexp6.sub
+++ b/tests/posixexp6.sub
@@ -1,3 +1,16 @@
+# 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 <http://www.gnu.org/licenses/>.
+#
var=$'\01\02\03\177'
bar=${unset:-$var}
diff --git a/tests/posixpat.tests b/tests/posixpat.tests
index 65c557a3..5a7bafd7 100644
--- a/tests/posixpat.tests
+++ b/tests/posixpat.tests
@@ -1,3 +1,16 @@
+# 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 <http://www.gnu.org/licenses/>.
+#
# A test suite for the POSIX.2 (BRE) pattern matching code
LC_ALL=C
LANG=C
diff --git a/tests/posixpipe.tests b/tests/posixpipe.tests
index a2f047af..fa8febed 100644
--- a/tests/posixpipe.tests
+++ b/tests/posixpipe.tests
@@ -1,3 +1,16 @@
+# 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 <http://www.gnu.org/licenses/>.
+#
# Test timed and negated pipelines in bash-4.2 and later
export TIMEFORMAT=$'real %2R\nuser %2U\nsys %2S'
diff --git a/tests/printf.right b/tests/printf.right
index 593f084b..b032dcbf 100644
--- a/tests/printf.right
+++ b/tests/printf.right
@@ -30,7 +30,7 @@ A7
--\"abcd\"--
--\'abcd\'--
--a\x--
-./printf.tests: line 82: printf: missing hex digit for \x
+./printf.tests: line 95: printf: missing hex digit for \x
--\x--
----
----
@@ -91,12 +91,12 @@ A7
26
26
26
-./printf.tests: line 206: printf: `%10': missing format character
-./printf.tests: line 207: printf: `M': invalid format character
-ab./printf.tests: line 210: printf: `y': invalid format character
-./printf.tests: line 213: printf: GNU: invalid number
+./printf.tests: line 219: printf: `%10': missing format character
+./printf.tests: line 220: printf: `M': invalid format character
+ab./printf.tests: line 223: printf: `y': invalid format character
+./printf.tests: line 226: printf: GNU: invalid number
0
-./printf.tests: line 214: printf: GNU: invalid number
+./printf.tests: line 227: printf: GNU: invalid number
0
-
(foo )(bar )
@@ -174,7 +174,7 @@ A7
--\"abcd\"--
--\'abcd\'--
--a\x--
-./printf1.sub: line 94: printf: missing hex digit for \x
+./printf1.sub: line 107: printf: missing hex digit for \x
--\x--
----
----
@@ -235,12 +235,12 @@ A7
26
26
26
-./printf1.sub: line 280: printf: `%10': missing format character
-./printf1.sub: line 281: printf: `M': invalid format character
-./printf1.sub: line 284: printf: `y': invalid format character
-./printf1.sub: line 287: printf: GNU: invalid number
+./printf1.sub: line 293: printf: `%10': missing format character
+./printf1.sub: line 294: printf: `M': invalid format character
+./printf1.sub: line 297: printf: `y': invalid format character
+./printf1.sub: line 300: printf: GNU: invalid number
0
-./printf1.sub: line 289: printf: GNU: invalid number
+./printf1.sub: line 302: printf: GNU: invalid number
0
-
(foo )(bar )
@@ -252,7 +252,7 @@ A7
^Ge
"?
16:09:15
-./printf3.sub: line 14: printf: warning: `Z': invalid time format specification
+./printf3.sub: line 27: printf: warning: `Z': invalid time format specification
%(abde)Z
30-May-2010 16:09:15
05/30/10 15:09:15
diff --git a/tests/printf.tests b/tests/printf.tests
index 9dbac6f0..df37e47e 100644
--- a/tests/printf.tests
+++ b/tests/printf.tests
@@ -1,3 +1,16 @@
+# 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 <http://www.gnu.org/licenses/>.
+#
LC_ALL=C
LC_NUMERIC=C
diff --git a/tests/printf1.sub b/tests/printf1.sub
index 52612d5c..e4fb54b8 100644
--- a/tests/printf1.sub
+++ b/tests/printf1.sub
@@ -1,3 +1,16 @@
+# 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 <http://www.gnu.org/licenses/>.
+#
LC_ALL=C
LC_NUMERIC=C
diff --git a/tests/printf3.sub b/tests/printf3.sub
index d45e101c..4c54aa12 100644
--- a/tests/printf3.sub
+++ b/tests/printf3.sub
@@ -1,3 +1,16 @@
+# 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 <http://www.gnu.org/licenses/>.
+#
LC_ALL=C
LANG=C
diff --git a/tests/printf4.sub b/tests/printf4.sub
index 2ffd9979..ed4c5383 100644
--- a/tests/printf4.sub
+++ b/tests/printf4.sub
@@ -1,3 +1,16 @@
+# 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 <http://www.gnu.org/licenses/>.
+#
# Problems with padding, field widths, and `+' through bash-4.2
printf "x%10.0fx\n" 123
diff --git a/tests/procsub.tests b/tests/procsub.tests
index 01ba46a8..49ec9498 100644
--- a/tests/procsub.tests
+++ b/tests/procsub.tests
@@ -1,3 +1,16 @@
+# 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 <http://www.gnu.org/licenses/>.
+#
# process substitution constructs that have caused problems in the past
. ./test-glue-functions
diff --git a/tests/quote.tests b/tests/quote.tests
index 45bfc78c..0a0b4afe 100644
--- a/tests/quote.tests
+++ b/tests/quote.tests
@@ -1,3 +1,16 @@
+# 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 <http://www.gnu.org/licenses/>.
+#
echo "Single Quote"
echo 'foo
bar'
diff --git a/tests/quote1.sub b/tests/quote1.sub
index a9a1ef15..86f97869 100644
--- a/tests/quote1.sub
+++ b/tests/quote1.sub
@@ -1,3 +1,16 @@
+# 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 <http://www.gnu.org/licenses/>.
+#
# inconsistency with quoted pattern substitution patterns through bash-4.2
# fixed in a ksh93-compatible (and Posix-compatible, in general) way
# NOT backwards compatible
diff --git a/tests/quote2.sub b/tests/quote2.sub
index 7deb4cfa..1012b8fe 100644
--- a/tests/quote2.sub
+++ b/tests/quote2.sub
@@ -1,3 +1,16 @@
+# 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 <http://www.gnu.org/licenses/>.
+#
x=x
e=
diff --git a/tests/quote3.sub b/tests/quote3.sub
index 48228682..54bc5ed4 100644
--- a/tests/quote3.sub
+++ b/tests/quote3.sub
@@ -1,3 +1,16 @@
+# 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 <http://www.gnu.org/licenses/>.
+#
# new tests
x=4
sp=' '
diff --git a/tests/quote4.sub b/tests/quote4.sub
index fa24457c..ab534c8e 100644
--- a/tests/quote4.sub
+++ b/tests/quote4.sub
@@ -1,3 +1,16 @@
+# 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 <http://www.gnu.org/licenses/>.
+#
n() { echo $#; }
set --
diff --git a/tests/read.right b/tests/read.right
index 73cb7042..11440837 100644
--- a/tests/read.right
+++ b/tests/read.right
@@ -37,11 +37,11 @@ timeout 1: ok
timeout 2: ok
-./read2.sub: line 23: read: -3: invalid timeout specification
+./read2.sub: line 36: read: -3: invalid timeout specification
1
abcde
-./read3.sub: line 4: read: -1: invalid number
+./read3.sub: line 17: read: -1: invalid number
abc
ab
abc
diff --git a/tests/read.tests b/tests/read.tests
index f67cd00e..7384f05f 100644
--- a/tests/read.tests
+++ b/tests/read.tests
@@ -1,3 +1,16 @@
+# 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 <http://www.gnu.org/licenses/>.
+#
echo " a " | (read x; echo "$x.")
echo " a b " | ( read x y ; echo -"$x"-"$y"- )
diff --git a/tests/read1.sub b/tests/read1.sub
index 2a36449b..b3b85157 100644
--- a/tests/read1.sub
+++ b/tests/read1.sub
@@ -1,3 +1,16 @@
+# 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 <http://www.gnu.org/licenses/>.
+#
a=7
echo 'abcdefg|xyz' | {
read -d '|' a
diff --git a/tests/read2.sub b/tests/read2.sub
index c4a1f771..41698e46 100644
--- a/tests/read2.sub
+++ b/tests/read2.sub
@@ -1,3 +1,16 @@
+# 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 <http://www.gnu.org/licenses/>.
+#
a=4
read -t 2 a < /dev/tty
diff --git a/tests/read3.sub b/tests/read3.sub
index af41e3f2..d413f7db 100644
--- a/tests/read3.sub
+++ b/tests/read3.sub
@@ -1,3 +1,16 @@
+# 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 <http://www.gnu.org/licenses/>.
+#
# non-interactive
# error
diff --git a/tests/read5.sub b/tests/read5.sub
index e35674e0..e42a5be2 100644
--- a/tests/read5.sub
+++ b/tests/read5.sub
@@ -1,3 +1,16 @@
+# 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 <http://www.gnu.org/licenses/>.
+#
IFS=: read x y z << EOF
:::
EOF
diff --git a/tests/redir.right b/tests/redir.right
index d4ab60d5..608d0044 100644
--- a/tests/redir.right
+++ b/tests/redir.right
@@ -1,9 +1,9 @@
abc
-./redir.tests: line 15: /tmp/redir-test: cannot overwrite existing file
+./redir.tests: line 28: /tmp/redir-test: cannot overwrite existing file
abc
def
def
-./redir.tests: line 31: $z: ambiguous redirect
+./redir.tests: line 44: $z: ambiguous redirect
Point 1
Point 2
to a
@@ -24,8 +24,8 @@ read line3 "cd"
read line4 "daemon"
from stdin: aa
to stdout
-./redir4.sub: line 32: $fd: ambiguous redirect
-./redir4.sub: line 33: $fd: ambiguous redirect
+./redir4.sub: line 45: $fd: ambiguous redirect
+./redir4.sub: line 46: $fd: ambiguous redirect
err-and-out:
to stdout
to stderr
@@ -44,7 +44,20 @@ kl
ab
cd
cd
-./redir.tests: line 157: redir1.*: No such file or directory
+./redir.tests: line 170: redir1.*: No such file or directory
+# 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 <http://www.gnu.org/licenses/>.
+#
# tests of ksh93-like dup-and-close redirection operators
exec 9<$0
@@ -85,7 +98,7 @@ f ()
done
}
after read
-# tests of ksh93-like dup-and-close redirection operators
+# This program is free software: you can redistribute it and/or modify
/
/
/
@@ -141,7 +154,7 @@ foo
1
7
after: 42
-./redir11.sub: line 40: $(ss= declare -i ss): ambiguous redirect
+./redir11.sub: line 53: $(ss= declare -i ss): ambiguous redirect
after: 42
a+=3
foo
diff --git a/tests/redir.tests b/tests/redir.tests
index 6af02194..63bd4d37 100644
--- a/tests/redir.tests
+++ b/tests/redir.tests
@@ -1,3 +1,16 @@
+# 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 <http://www.gnu.org/licenses/>.
+#
: ${TMPDIR:=/tmp}
export LC_ALL=C
diff --git a/tests/redir10.sub b/tests/redir10.sub
index 27c48e82..7b1d682f 100644
--- a/tests/redir10.sub
+++ b/tests/redir10.sub
@@ -1,4 +1,16 @@
-#!/bin/bash
+# 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 <http://www.gnu.org/licenses/>.
+#
#
# Out of file descriptors, because it forgets to close redirection. Only
# happens in a shell function. Problem through bash-4.2.
diff --git a/tests/redir11.sub b/tests/redir11.sub
index a919602c..8af4334f 100644
--- a/tests/redir11.sub
+++ b/tests/redir11.sub
@@ -1,3 +1,16 @@
+# 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 <http://www.gnu.org/licenses/>.
+#
# make sure redirections do not have access to the temporary environment, even
# in subshells and command substitutions
diff --git a/tests/redir3.sub b/tests/redir3.sub
index c486253e..b9fd0fd9 100644
--- a/tests/redir3.sub
+++ b/tests/redir3.sub
@@ -1,3 +1,16 @@
+# 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 <http://www.gnu.org/licenses/>.
+#
read line1
echo read line1 \"$line1\"
diff --git a/tests/redir4.sub b/tests/redir4.sub
index 14406d01..a4829856 100644
--- a/tests/redir4.sub
+++ b/tests/redir4.sub
@@ -1,3 +1,16 @@
+# 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 <http://www.gnu.org/licenses/>.
+#
minus=-
# standard input
diff --git a/tests/redir5.sub b/tests/redir5.sub
index ee7b045a..fa0f0c07 100644
--- a/tests/redir5.sub
+++ b/tests/redir5.sub
@@ -1,3 +1,16 @@
+# 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 <http://www.gnu.org/licenses/>.
+#
# tests of ksh93-like dup-and-close redirection operators
exec 9<$0
diff --git a/tests/redir7.sub b/tests/redir7.sub
index 3fd371c7..65ca473b 100644
--- a/tests/redir7.sub
+++ b/tests/redir7.sub
@@ -1,3 +1,16 @@
+# 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 <http://www.gnu.org/licenses/>.
+#
# weird redirections that caused trouble and were fixed in post-3.0 bash
stuff()
{
diff --git a/tests/redir8.sub b/tests/redir8.sub
index 88753f2f..d2d700cb 100644
--- a/tests/redir8.sub
+++ b/tests/redir8.sub
@@ -1,3 +1,16 @@
+# 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 <http://www.gnu.org/licenses/>.
+#
cd ${TMPDIR:=/var/tmp}
rm -f u
diff --git a/tests/redir9.sub b/tests/redir9.sub
index 386ae56a..9050a94f 100644
--- a/tests/redir9.sub
+++ b/tests/redir9.sub
@@ -1,3 +1,16 @@
+# 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 <http://www.gnu.org/licenses/>.
+#
: ${TMPDIR:=/tmp}
func()
diff --git a/tests/rhs-exp.tests b/tests/rhs-exp.tests
index a28d7f03..6abdd2a7 100644
--- a/tests/rhs-exp.tests
+++ b/tests/rhs-exp.tests
@@ -1,3 +1,16 @@
+# 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 <http://www.gnu.org/licenses/>.
+#
selvecs='&m68kcoff_vec'
recho "TDEFAULTS = ${selvecs:+-DSELECT_VECS='$selvecs'}"
recho "TDEFAULTS = ${selvecs:+-DSELECT_VECS=\'$selvecs\'}"
diff --git a/tests/rhs-exp1.sub b/tests/rhs-exp1.sub
index 5631ea50..b194bf00 100644
--- a/tests/rhs-exp1.sub
+++ b/tests/rhs-exp1.sub
@@ -1,3 +1,16 @@
+# 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 <http://www.gnu.org/licenses/>.
+#
# fixes for bugs in bash-4.2 regarding empty strings in expand_string_for_rhs
f=abc
diff --git a/tests/rsh.right b/tests/rsh.right
index a728f137..a91974a5 100644
--- a/tests/rsh.right
+++ b/tests/rsh.right
@@ -1,19 +1,19 @@
-./rsh1.sub: line 9: /bin/sh: restricted
-./rsh1.sub: line 11: sh: not found
-./rsh1.sub: line 12: a: command not found
-./rsh2.sub: line 10: hash: /bin/sh: restricted
-./rsh2.sub: line 12: hash: sh: not found
-./rsh2.sub: line 13: a: command not found
-./rsh.tests: line 12: cd: restricted
-./rsh.tests: line 13: PATH: readonly variable
-./rsh.tests: line 14: SHELL: readonly variable
-./rsh.tests: line 15: /bin/sh: restricted: cannot specify `/' in command names
-./rsh.tests: line 17: .: ./source.sub3: restricted
-./rsh.tests: line 20: /tmp/restricted: restricted: cannot redirect output
-./rsh.tests: line 24: /tmp/restricted: restricted: cannot redirect output
-./rsh.tests: line 29: command: -p: restricted
-./rsh.tests: line 31: set: +r: invalid option
+./rsh1.sub: line 22: /bin/sh: restricted
+./rsh1.sub: line 24: sh: not found
+./rsh1.sub: line 25: a: command not found
+./rsh2.sub: line 23: hash: /bin/sh: restricted
+./rsh2.sub: line 25: hash: sh: not found
+./rsh2.sub: line 26: a: command not found
+./rsh.tests: line 25: cd: restricted
+./rsh.tests: line 26: PATH: readonly variable
+./rsh.tests: line 27: SHELL: readonly variable
+./rsh.tests: line 28: /bin/sh: restricted: cannot specify `/' in command names
+./rsh.tests: line 30: .: ./source.sub3: restricted
+./rsh.tests: line 33: /tmp/restricted: restricted: cannot redirect output
+./rsh.tests: line 37: /tmp/restricted: restricted: cannot redirect output
+./rsh.tests: line 42: command: -p: restricted
+./rsh.tests: line 44: set: +r: invalid option
set: usage: set [-abefhkmnptuvxBCHP] [-o option-name] [--] [arg ...]
-./rsh.tests: line 32: set: restricted: invalid option name
-./rsh.tests: line 34: exec: restricted
+./rsh.tests: line 45: set: restricted: invalid option name
+./rsh.tests: line 47: exec: restricted
./rsh.tests: after exec
diff --git a/tests/rsh.tests b/tests/rsh.tests
index d1d77784..0d06fa1e 100644
--- a/tests/rsh.tests
+++ b/tests/rsh.tests
@@ -1,3 +1,16 @@
+# 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 <http://www.gnu.org/licenses/>.
+#
# test restricted shell mode -- these should all be errors
#
# things not tested for:
diff --git a/tests/rsh1.sub b/tests/rsh1.sub
index fdd4ddd9..1539d740 100644
--- a/tests/rsh1.sub
+++ b/tests/rsh1.sub
@@ -1,3 +1,16 @@
+# 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 <http://www.gnu.org/licenses/>.
+#
cd ${TMPDIR:-/tmp}
cp /bin/sh .
diff --git a/tests/rsh2.sub b/tests/rsh2.sub
index 8c82c68b..7259dfbc 100644
--- a/tests/rsh2.sub
+++ b/tests/rsh2.sub
@@ -1,3 +1,16 @@
+# 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 <http://www.gnu.org/licenses/>.
+#
cd ${TMPDIR:-/tmp}
cp /bin/sh .
ln sh a
diff --git a/tests/run-all b/tests/run-all
index 36a3289c..b8219b2d 100644
--- a/tests/run-all
+++ b/tests/run-all
@@ -1,4 +1,18 @@
#! /bin/sh
+#
+# 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 <http://www.gnu.org/licenses/>.
+#
: ${TMPDIR:=/tmp}
export TMPDIR
diff --git a/tests/run-dbg-support b/tests/run-dbg-support
index 9e9c649c..af64517d 100644
--- a/tests/run-dbg-support
+++ b/tests/run-dbg-support
@@ -1,5 +1,3 @@
-#!../bash
-#$Id: run-dbg-support,v 1.5 2002/11/14 06:08:16 rockyb Exp $
TEST_NAME='dbg-support'
TEST_FILE="/tmp/${TEST_NAME}.check"
diff --git a/tests/run-dbg-support2 b/tests/run-dbg-support2
index f62583f8..375c32f9 100644
--- a/tests/run-dbg-support2
+++ b/tests/run-dbg-support2
@@ -1,5 +1,3 @@
-#!../bash
-#$Id: run-dbg-support2,v 1.3 2002/11/14 06:08:16 rockyb Exp $
TEST_NAME='dbg-support2'
TEST_FILE="/tmp/${TEST_NAME}.check"
@@ -9,8 +7,3 @@ diff $TEST_FILE ${TEST_NAME}.right && rm -f $TEST_FILE
# Return code tells testing mechanism whether passed or not.
exit $?
-
-#;;; Local Variables: ***
-#;;; mode:shell-script ***
-#;;; eval: (sh-set-shell "bash") ***
-#;;; End: ***
diff --git a/tests/run-gprof b/tests/run-gprof
index 04379864..8387dcc9 100644
--- a/tests/run-gprof
+++ b/tests/run-gprof
@@ -1,4 +1,19 @@
#! /bin/sh
+#
+# 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 <http://www.gnu.org/licenses/>.
+#
+
: ${TMPDIR:=/tmp}
export TMPDIR
diff --git a/tests/run-minimal b/tests/run-minimal
index 454d579a..ade30b15 100644
--- a/tests/run-minimal
+++ b/tests/run-minimal
@@ -1,5 +1,19 @@
#! /bin/sh
#
+# 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 <http://www.gnu.org/licenses/>.
+#
+#
# run-minimal - a version of run-all for shells configured with
# --enable-minimal-config
#
diff --git a/tests/set-e.tests b/tests/set-e.tests
index d38edf6c..3e0d6698 100644
--- a/tests/set-e.tests
+++ b/tests/set-e.tests
@@ -1,3 +1,16 @@
+# 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 <http://www.gnu.org/licenses/>.
+#
if : ; then
set -e
N=95
diff --git a/tests/set-e1.sub b/tests/set-e1.sub
index a8005607..cdd4d635 100644
--- a/tests/set-e1.sub
+++ b/tests/set-e1.sub
@@ -1,3 +1,16 @@
+# 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 <http://www.gnu.org/licenses/>.
+#
# subshell failure should cause the shell to exit silently
${THIS_SH} -ce '(exit 17) ; echo "after (exit 17): $?"'
diff --git a/tests/set-x.tests b/tests/set-x.tests
index 531c53f6..3723552d 100755..100644
--- a/tests/set-x.tests
+++ b/tests/set-x.tests
@@ -1,4 +1,17 @@
-#!../bash
+# 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 <http://www.gnu.org/licenses/>.
+#
+
# $Id: set-x.tests,v 1.1 2002/12/09 13:12:37 rockyb Exp $
#
# Test that "set -x" shows what we think it should.
diff --git a/tests/set-x1.sub b/tests/set-x1.sub
index b2aa2167..cb7fa827 100644
--- a/tests/set-x1.sub
+++ b/tests/set-x1.sub
@@ -1,3 +1,16 @@
+# 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 <http://www.gnu.org/licenses/>.
+#
: ${TMPDIR:=/var/tmp}
TRACEFILE=$TMPDIR/bash-trace-$$
trap 'rm -f $TRACEFILE' 0 1 2 3 6 15
diff --git a/tests/shopt.right b/tests/shopt.right
index 07277f90..e9e88727 100644
--- a/tests/shopt.right
+++ b/tests/shopt.right
@@ -1,4 +1,4 @@
-./shopt.tests: line 2: shopt: -z: invalid option
+./shopt.tests: line 15: shopt: -z: invalid option
shopt: usage: shopt [-pqsu] [-o] [optname ...]
--
shopt -u autocd
@@ -294,5 +294,5 @@ verbose off
vi off
xtrace off
--
-./shopt.tests: line 93: shopt: xyz1: invalid shell option name
-./shopt.tests: line 94: shopt: xyz1: invalid option name
+./shopt.tests: line 106: shopt: xyz1: invalid shell option name
+./shopt.tests: line 107: shopt: xyz1: invalid option name
diff --git a/tests/shopt.tests b/tests/shopt.tests
index d4f2a8b1..601da537 100644
--- a/tests/shopt.tests
+++ b/tests/shopt.tests
@@ -1,3 +1,16 @@
+# 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 <http://www.gnu.org/licenses/>.
+#
# let's try an error message first
shopt -z
diff --git a/tests/source5.sub b/tests/source5.sub
index e6188094..2f3048a6 100644
--- a/tests/source5.sub
+++ b/tests/source5.sub
@@ -1,3 +1,16 @@
+# 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 <http://www.gnu.org/licenses/>.
+#
LC_ALL=en_US.UTF-8
unset LC_ALL
unset LANG
diff --git a/tests/source6.sub b/tests/source6.sub
index 43db2031..24372927 100644
--- a/tests/source6.sub
+++ b/tests/source6.sub
@@ -1,3 +1,16 @@
+# 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 <http://www.gnu.org/licenses/>.
+#
# tests sourcing non-regular files, fixed post-3.2
: ${TMPDIR:=/tmp}
diff --git a/tests/source7.sub b/tests/source7.sub
index 8ca0aeff..474a66f7 100644
--- a/tests/source7.sub
+++ b/tests/source7.sub
@@ -1,3 +1,16 @@
+# 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 <http://www.gnu.org/licenses/>.
+#
shopt -s expand_aliases
: ${TMPDIR:=/var/tmp}
diff --git a/tests/strip.tests b/tests/strip.tests
index b669b52e..b16705f4 100644
--- a/tests/strip.tests
+++ b/tests/strip.tests
@@ -1,3 +1,16 @@
+# 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 <http://www.gnu.org/licenses/>.
+#
v=`echo "" ; echo "" ; echo ""`
echo "'$v'"
v=`echo -n " ab "`
diff --git a/tests/test.right b/tests/test.right
index 9832bd6d..a3a20e23 100644
--- a/tests/test.right
+++ b/tests/test.right
@@ -233,48 +233,48 @@ t -G /tmp/test.group
t -h /tmp/test.symlink
0
t 4+3 -eq 7
-./test.tests: line 13: test: 4+3: integer expression expected
+./test.tests: line 26: test: 4+3: integer expression expected
2
b 4-5 -eq 7
-./test.tests: line 7: [: 4+3: integer expression expected
+./test.tests: line 20: [: 4+3: integer expression expected
2
t 9 -eq 4+5
-./test.tests: line 13: test: 4+5: integer expression expected
+./test.tests: line 26: test: 4+5: integer expression expected
2
b 9 -eq 4+5
-./test.tests: line 7: [: 4+5: integer expression expected
+./test.tests: line 20: [: 4+5: integer expression expected
2
t A -eq 7
-./test.tests: line 13: test: A: integer expression expected
+./test.tests: line 26: test: A: integer expression expected
2
b A -eq 7
-./test.tests: line 7: [: A: integer expression expected
+./test.tests: line 20: [: A: integer expression expected
2
t 9 -eq B
-./test.tests: line 13: test: B: integer expression expected
+./test.tests: line 26: test: B: integer expression expected
2
b 9 -eq B
-./test.tests: line 7: [: B: integer expression expected
+./test.tests: line 20: [: B: integer expression expected
2
t ( 1 = 2
-./test.tests: line 13: test: `)' expected
+./test.tests: line 26: test: `)' expected
2
b ( 1 = 2
-./test.tests: line 7: [: `)' expected, found ]
+./test.tests: line 20: [: `)' expected, found ]
2
-./test.tests: line 13: test: a: unary operator expected
+./test.tests: line 26: test: a: unary operator expected
2
-./test.tests: line 13: test: b: binary operator expected
+./test.tests: line 26: test: b: binary operator expected
2
-./test.tests: line 13: test: -A: unary operator expected
+./test.tests: line 26: test: -A: unary operator expected
2
-./test.tests: line 13: test: too many arguments
+./test.tests: line 26: test: too many arguments
2
-./test.tests: line 13: test: too many arguments
+./test.tests: line 26: test: too many arguments
2
-./test.tests: line 418: [: missing `]'
+./test.tests: line 431: [: missing `]'
2
-./test.tests: line 13: test: (: unary operator expected
+./test.tests: line 26: test: (: unary operator expected
2
t -t a
1
diff --git a/tests/test.tests b/tests/test.tests
index dddd7e07..03e2754a 100644
--- a/tests/test.tests
+++ b/tests/test.tests
@@ -1,3 +1,16 @@
+# 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 <http://www.gnu.org/licenses/>.
+#
if (( $UID == 0 )); then
echo "test-tests: the test suite should not be run as root" >&2
fi
diff --git a/tests/test1.sub b/tests/test1.sub
index a1c58170..d25e0dc7 100644
--- a/tests/test1.sub
+++ b/tests/test1.sub
@@ -1,3 +1,16 @@
+# 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 <http://www.gnu.org/licenses/>.
+#
# some systems, like old SunOS, have stat on /dev/fd/N and fstat(N, ...)
# return different results
: ${TMPDIR:=/tmp}
diff --git a/tests/tilde.tests b/tests/tilde.tests
index 8a9f1369..48e1448d 100644
--- a/tests/tilde.tests
+++ b/tests/tilde.tests
@@ -1,3 +1,16 @@
+# 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 <http://www.gnu.org/licenses/>.
+#
wdir=$PWD
# this is needed because posix mode restricts tilde expansion to assignment
# statements preceding a command, instead of the default of expanding all
diff --git a/tests/tilde2.tests b/tests/tilde2.tests
index ff6c76f0..cc5dba9f 100644
--- a/tests/tilde2.tests
+++ b/tests/tilde2.tests
@@ -1,3 +1,16 @@
+# 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 <http://www.gnu.org/licenses/>.
+#
HOME=/usr/xyz
XPATH=/bin:/usr/bin:.
diff --git a/tests/time.tests b/tests/time.tests
index 06881e95..18ce0ee0 100644
--- a/tests/time.tests
+++ b/tests/time.tests
@@ -1,3 +1,16 @@
+# 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 <http://www.gnu.org/licenses/>.
+#
printf "time /dev/null:\n"
time ${THIS_SH} /dev/null
diff --git a/tests/trap.right b/tests/trap.right
index e12d6186..4338ff4c 100644
--- a/tests/trap.right
+++ b/tests/trap.right
@@ -5,9 +5,9 @@ trap -- 'echo aborting' SIGINT
trap -- 'echo aborting' SIGQUIT
trap -- 'echo aborting' SIGABRT
trap -- 'echo aborting' SIGTERM
-[20] debug
+[33] debug
debug line
-[22] debug
+[35] debug
trap -- 'echo exiting' EXIT
trap -- 'echo aborting' SIGHUP
trap -- 'echo aborting' SIGINT
@@ -15,10 +15,10 @@ trap -- 'echo aborting' SIGQUIT
trap -- 'echo aborting' SIGABRT
trap -- 'echo aborting' SIGTERM
trap -- 'echo [$LINENO] debug' DEBUG
-[24] debug
-func[16] funcdebug
+[37] debug
+func[29] funcdebug
funcdebug line
-./trap.tests[26] funcdebug
+./trap.tests[39] funcdebug
trap -- 'echo exiting' EXIT
trap -- 'echo aborting' SIGHUP
trap -- 'echo aborting' SIGINT
@@ -26,14 +26,14 @@ trap -- 'echo aborting' SIGQUIT
trap -- 'echo aborting' SIGABRT
trap -- 'echo aborting' SIGTERM
trap -- 'echo ${FUNCNAME:-$0}[$LINENO] funcdebug' DEBUG
-./trap.tests[28] funcdebug
-./trap.tests[33] debug
-./trap.tests[34] debug
-func2[30] debug
-func2[31] debug
+./trap.tests[41] funcdebug
+./trap.tests[46] debug
+./trap.tests[47] debug
+func2[43] debug
+func2[44] debug
func2debug line
-./trap.tests[36] debug
-./trap.tests[38] debug
+./trap.tests[49] debug
+./trap.tests[51] debug
trap -- 'echo exiting' EXIT
trap -- 'echo aborting' SIGHUP
trap -- 'echo aborting' SIGINT
diff --git a/tests/trap.tests b/tests/trap.tests
index 637bfd28..4f808be3 100644
--- a/tests/trap.tests
+++ b/tests/trap.tests
@@ -1,3 +1,16 @@
+# 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 <http://www.gnu.org/licenses/>.
+#
# test the trap code
trap 'echo exiting' 0
diff --git a/tests/trap2.sub b/tests/trap2.sub
index 0f1f2d96..bd9a76be 100755
--- a/tests/trap2.sub
+++ b/tests/trap2.sub
@@ -1,3 +1,16 @@
+# 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 <http://www.gnu.org/licenses/>.
+#
set +e
trap 'echo ERRTRAP' ERR
diff --git a/tests/trap4.sub b/tests/trap4.sub
index ab5ca3e3..c84b54e1 100644
--- a/tests/trap4.sub
+++ b/tests/trap4.sub
@@ -1,3 +1,16 @@
+# 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 <http://www.gnu.org/licenses/>.
+#
# make sure subshells at the end of pipelines run any exit traps they set
: | { trap 'echo exit subshell 1' EXIT; exit; }; echo current shell
diff --git a/tests/trap5.sub b/tests/trap5.sub
index 7f3380b4..826b794c 100644
--- a/tests/trap5.sub
+++ b/tests/trap5.sub
@@ -1,3 +1,16 @@
+# 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 <http://www.gnu.org/licenses/>.
+#
# make sure process substitution runs the exit trap
[[ -n $(< <(trap "cat /dev/fd/0" EXIT)) ]] <<<works && echo works || echo "fail :("
diff --git a/tests/trap6.sub b/tests/trap6.sub
index 332a1773..72685580 100644
--- a/tests/trap6.sub
+++ b/tests/trap6.sub
@@ -1,3 +1,16 @@
+# 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 <http://www.gnu.org/licenses/>.
+#
set -o functrace
fn() { return; }
diff --git a/tests/type.right b/tests/type.right
index 7ec6bfba..76ce2295 100644
--- a/tests/type.right
+++ b/tests/type.right
@@ -1,6 +1,6 @@
-./type.tests: line 9: type: -r: invalid option
+./type.tests: line 22: type: -r: invalid option
type: usage: type [-afptP] name [name ...]
-./type.tests: line 12: type: notthere: not found
+./type.tests: line 25: type: notthere: not found
function
keyword
builtin
@@ -24,7 +24,7 @@ func ()
}
while
while is a shell keyword
-./type.tests: line 43: type: m: not found
+./type.tests: line 56: type: m: not found
alias m='more'
alias m='more'
m is aliased to `more'
@@ -37,8 +37,8 @@ builtin
builtin is a shell builtin
/bin/sh
/bin/sh is /bin/sh
-./type.tests: line 65: type: func: not found
-./type.tests: line 67: type: m: not found
+./type.tests: line 78: type: func: not found
+./type.tests: line 80: type: m: not found
/bin/sh
/tmp/bash
bash is hashed (/tmp/bash)
diff --git a/tests/type.tests b/tests/type.tests
index 1c03e018..fd39c18a 100644
--- a/tests/type.tests
+++ b/tests/type.tests
@@ -1,3 +1,16 @@
+# 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 <http://www.gnu.org/licenses/>.
+#
set +o posix
hash -r
diff --git a/tests/type2.sub b/tests/type2.sub
index 3f85ead7..34977c51 100644
--- a/tests/type2.sub
+++ b/tests/type2.sub
@@ -1,3 +1,16 @@
+# 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 <http://www.gnu.org/licenses/>.
+#
foo()
{
echo
diff --git a/tests/type3.sub b/tests/type3.sub
index 442f22e4..1a95de38 100644
--- a/tests/type3.sub
+++ b/tests/type3.sub
@@ -1,3 +1,16 @@
+# 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 <http://www.gnu.org/licenses/>.
+#
cd ${TMPDIR:-/tmp}
foo() {
diff --git a/tests/type4.sub b/tests/type4.sub
index ed5bcf6a..937f9980 100644
--- a/tests/type4.sub
+++ b/tests/type4.sub
@@ -1,3 +1,16 @@
+# 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 <http://www.gnu.org/licenses/>.
+#
bb()
{
(
diff --git a/tests/unicode1.sub b/tests/unicode1.sub
index baa92eaa..fc742855 100644
--- a/tests/unicode1.sub
+++ b/tests/unicode1.sub
@@ -1,3 +1,16 @@
+# 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 <http://www.gnu.org/licenses/>.
+#
unset LC_ALL
ErrorCnt=0
diff --git a/tests/unicode2.sub b/tests/unicode2.sub
index 83ff2747..16dd604a 100644
--- a/tests/unicode2.sub
+++ b/tests/unicode2.sub
@@ -1,3 +1,16 @@
+# 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 <http://www.gnu.org/licenses/>.
+#
. ./test-glue-functions
export LANG=en_US.UTF-8
diff --git a/tests/varenv.right b/tests/varenv.right
index 82845dfe..8acb930b 100644
--- a/tests/varenv.right
+++ b/tests/varenv.right
@@ -60,7 +60,7 @@ FIN: asdf fdsa, asdf fdsa
g: v = , w =
f: v = , w =
FIN: v = two, w = one
-./varenv4.sub: line 54: bbb: unique: cannot convert indexed to associative array
+./varenv4.sub: line 67: bbb: unique: cannot convert indexed to associative array
after bbb: 1
declare -Ar FOOBAR=([foo]="bar" )
declare -Ar FOOBAR=([foo]="bar" )
@@ -77,7 +77,7 @@ declare -ar myvar=([0]="0")
declare -ir myvar="1"
declare -rx tempvar1='foo'
declare -rx tempvar2='qux'
-./varenv7.sub: line 44: local: var: readonly variable
+./varenv7.sub: line 57: local: var: readonly variable
inside: outside
outside: outside
local: unset1 unset2
@@ -95,30 +95,30 @@ in o1 (readonly modifying local scalars):
declare -r i1="a b c"
declare -r j1="1 2 3"
after o1:
-./varenv9.sub: line 15: declare: i1: not found
-./varenv9.sub: line 15: declare: j1: not found
+./varenv9.sub: line 28: declare: i1: not found
+./varenv9.sub: line 28: declare: j1: not found
in o2 (readonly setting global scalars):
declare -r i2="a b c"
declare -r j2="1 2 3"
after o2:
declare -r i2="a b c"
declare -r j2="1 2 3"
-./varenv9.sub: line 33: unset: i2: cannot unset: readonly variable
-./varenv9.sub: line 33: unset: j2: cannot unset: readonly variable
+./varenv9.sub: line 46: unset: i2: cannot unset: readonly variable
+./varenv9.sub: line 46: unset: j2: cannot unset: readonly variable
in o3 (readonly modifying locals, converting to arrays):
declare -ar i3=([0]="a" [1]="b" [2]="c")
declare -ar j3=([0]="1" [1]="2" [2]="3")
after o3:
-./varenv9.sub: line 48: declare: i3: not found
-./varenv9.sub: line 48: declare: j3: not found
+./varenv9.sub: line 61: declare: i3: not found
+./varenv9.sub: line 61: declare: j3: not found
in o4 (readonly setting global array variables):
declare -ar i4=([0]="a" [1]="b" [2]="c")
declare -ar j4=([0]="1" [1]="2" [2]="3")
after o4:
declare -ar i4=([0]="a" [1]="b" [2]="c")
declare -ar j4=([0]="1" [1]="2" [2]="3")
-./varenv9.sub: line 66: unset: i4: cannot unset: readonly variable
-./varenv9.sub: line 66: unset: j4: cannot unset: readonly variable
+./varenv9.sub: line 79: unset: i4: cannot unset: readonly variable
+./varenv9.sub: line 79: unset: j4: cannot unset: readonly variable
main: unset
inner: res unset
outer: res: X Y
@@ -128,13 +128,13 @@ outer: res: X Y
main: after second call: X
func: null or unset
after func: x = outside
-./varenv11.sub: line 4: local: qux: readonly variable
-./varenv11.sub: line 5: qux: readonly variable
+./varenv11.sub: line 17: local: qux: readonly variable
+./varenv11.sub: line 18: qux: readonly variable
declare -A foo=([zero]="zero" [one]="one" )
declare -a bar=([0]="zero" [1]="one")
declare -A foo=([zero]="zero" [one]="one" )
declare -a bar=([0]="zero" [1]="one")
-./varenv11.sub: line 29: a: readonly variable
+./varenv11.sub: line 42: a: readonly variable
foo=abc
func1: var =
@@ -163,25 +163,25 @@ foo: hello world
after foo: var=outside
bar: hello world
after bar: var=bar: hello world
-./varenv13.sub: line 3: `var[0]': not a valid identifier
-./varenv13.sub: line 3: `var[@]': not a valid identifier
-./varenv13.sub: line 1: declare: var: not found
-./varenv13.sub: line 12: var[@]: bad array subscript
+./varenv13.sub: line 16: `var[0]': not a valid identifier
+./varenv13.sub: line 16: `var[@]': not a valid identifier
+./varenv13.sub: line 14: declare: var: not found
+./varenv13.sub: line 25: var[@]: bad array subscript
declare -A var=([0]="X" )
help
-./varenv13.sub: line 21: `var[0]': not a valid identifier
+./varenv13.sub: line 34: `var[0]': not a valid identifier
1
-./varenv14.sub: line 6: warning: var: cannot inherit value from incompatible type
+./varenv14.sub: line 19: warning: var: cannot inherit value from incompatible type
declare -a var=([0]="X")
-./varenv14.sub: line 9: warning: var: cannot inherit value from incompatible type
+./varenv14.sub: line 22: warning: var: cannot inherit value from incompatible type
declare -a var=([0]="Y")
-./varenv14.sub: line 10: warning: var: cannot inherit value from incompatible type
+./varenv14.sub: line 23: warning: var: cannot inherit value from incompatible type
declare -a var=([0]="Y")
-./varenv14.sub: line 11: warning: var: cannot inherit value from incompatible type
+./varenv14.sub: line 24: warning: var: cannot inherit value from incompatible type
declare -a var=()
-./varenv14.sub: line 12: warning: var: cannot inherit value from incompatible type
+./varenv14.sub: line 25: warning: var: cannot inherit value from incompatible type
declare -a var=()
-./varenv14.sub: line 18: f: var: cannot convert indexed to associative array
+./varenv14.sub: line 31: f: var: cannot convert indexed to associative array
declare -a a=([0]="X")
declare -a s=([0]="X")
declare -a a=([0]="X" [1]="Y")
diff --git a/tests/varenv.tests b/tests/varenv.tests
index 5c69bbf4..c05d1f65 100644
--- a/tests/varenv.tests
+++ b/tests/varenv.tests
@@ -1,3 +1,16 @@
+# 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 <http://www.gnu.org/licenses/>.
+#
#
# varenv.sh
#
diff --git a/tests/varenv1.sub b/tests/varenv1.sub
index 168f87b1..8def153a 100644
--- a/tests/varenv1.sub
+++ b/tests/varenv1.sub
@@ -1,3 +1,16 @@
+# 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 <http://www.gnu.org/licenses/>.
+#
# test out the export behavior of variable assignments preceding `eval', `.'
# and shell functions
diff --git a/tests/varenv10.sub b/tests/varenv10.sub
index 887cfd2c..aa0175af 100644
--- a/tests/varenv10.sub
+++ b/tests/varenv10.sub
@@ -1,7 +1,19 @@
-#!/bin/bash
+# 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 <http://www.gnu.org/licenses/>.
+#
#
# various tests of unset when applied to variables at different local scopes
-
+#
# function unsetting variable at previous local scope, uncovering global
inner()
diff --git a/tests/varenv11.sub b/tests/varenv11.sub
index d4384983..638aa2c7 100644
--- a/tests/varenv11.sub
+++ b/tests/varenv11.sub
@@ -1,3 +1,16 @@
+# 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 <http://www.gnu.org/licenses/>.
+#
# couple of errors here
func()
{
diff --git a/tests/varenv12.sub b/tests/varenv12.sub
index f286cfbd..92b3692f 100644
--- a/tests/varenv12.sub
+++ b/tests/varenv12.sub
@@ -1,3 +1,16 @@
+# 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 <http://www.gnu.org/licenses/>.
+#
set -o posix
fn() { foo=abc : ; typeset +x foo; printenv|grep ^foo=; }
diff --git a/tests/varenv13.sub b/tests/varenv13.sub
index 0e6a42c1..1f837ec7 100644
--- a/tests/varenv13.sub
+++ b/tests/varenv13.sub
@@ -1,3 +1,16 @@
+# 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 <http://www.gnu.org/licenses/>.
+#
f() { declare -p ${!var*} | grep ^var; declare -p var ; }
var[0]=X var[@]=Y f
diff --git a/tests/varenv14.sub b/tests/varenv14.sub
index 52b20d81..2a1c645d 100644
--- a/tests/varenv14.sub
+++ b/tests/varenv14.sub
@@ -1,3 +1,16 @@
+# 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 <http://www.gnu.org/licenses/>.
+#
# testing framework for local variable inheritence
shopt -s localvar_inherit
diff --git a/tests/varenv15.sub b/tests/varenv15.sub
index 52c8a940..4c9ef0e4 100644
--- a/tests/varenv15.sub
+++ b/tests/varenv15.sub
@@ -1,3 +1,16 @@
+# 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 <http://www.gnu.org/licenses/>.
+#
# check saving and restoring positional parameters around function calls
f()
diff --git a/tests/varenv16.sub b/tests/varenv16.sub
index b3c342ca..847926c9 100644
--- a/tests/varenv16.sub
+++ b/tests/varenv16.sub
@@ -1,3 +1,16 @@
+# 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 <http://www.gnu.org/licenses/>.
+#
# test whether or not temporary environment assignments are exported
# in posix mode. works now, posix says it will not work in the future
diff --git a/tests/varenv2.sub b/tests/varenv2.sub
index b2935726..0fde5b20 100644
--- a/tests/varenv2.sub
+++ b/tests/varenv2.sub
@@ -1,3 +1,16 @@
+# 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 <http://www.gnu.org/licenses/>.
+#
fff()
{
typeset i=0 x=10
diff --git a/tests/varenv3.sub b/tests/varenv3.sub
index 1384fcb1..854e483d 100644
--- a/tests/varenv3.sub
+++ b/tests/varenv3.sub
@@ -1,4 +1,16 @@
-#!/bin/bash
+# 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 <http://www.gnu.org/licenses/>.
+#
oifs=$IFS
diff --git a/tests/varenv4.sub b/tests/varenv4.sub
index b2df61c9..9735b617 100644
--- a/tests/varenv4.sub
+++ b/tests/varenv4.sub
@@ -1,3 +1,16 @@
+# 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 <http://www.gnu.org/licenses/>.
+#
f()
{
local -a v
diff --git a/tests/varenv5.sub b/tests/varenv5.sub
index 8ebfa36d..b6eb70c2 100644
--- a/tests/varenv5.sub
+++ b/tests/varenv5.sub
@@ -1,3 +1,16 @@
+# 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 <http://www.gnu.org/licenses/>.
+#
function foobar {
declare -rgA FOOBAR=([foo]=bar)
declare -p FOOBAR
diff --git a/tests/varenv6.sub b/tests/varenv6.sub
index d0269fb6..8cf21f72 100644
--- a/tests/varenv6.sub
+++ b/tests/varenv6.sub
@@ -1,3 +1,16 @@
+# 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 <http://www.gnu.org/licenses/>.
+#
f()
{
local str=F
diff --git a/tests/varenv7.sub b/tests/varenv7.sub
index 45654da2..4b259606 100644
--- a/tests/varenv7.sub
+++ b/tests/varenv7.sub
@@ -1,3 +1,16 @@
+# 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 <http://www.gnu.org/licenses/>.
+#
foo()
{
local -a myvar=()
diff --git a/tests/varenv9.sub b/tests/varenv9.sub
index eda1be3f..5837aa54 100644
--- a/tests/varenv9.sub
+++ b/tests/varenv9.sub
@@ -1,3 +1,16 @@
+# 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 <http://www.gnu.org/licenses/>.
+#
# case 1: readonly modifying local scalar variables
o1() {
local i1 j1
diff --git a/tests/vredir.right b/tests/vredir.right
index f4fe0db8..b2c4cc9c 100644
--- a/tests/vredir.right
+++ b/tests/vredir.right
@@ -8,8 +8,8 @@ bar ()
exec {v}> $TMPFILE;
echo $v
}
-./vredir.tests: line 6: v: readonly variable
-./vredir.tests: line 6: v: cannot assign fd to variable
+./vredir.tests: line 19: v: readonly variable
+./vredir.tests: line 19: v: cannot assign fd to variable
42
bar is a function
bar ()
diff --git a/tests/vredir.tests b/tests/vredir.tests
index ce77deb7..ea59eecd 100644
--- a/tests/vredir.tests
+++ b/tests/vredir.tests
@@ -1,3 +1,16 @@
+# 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 <http://www.gnu.org/licenses/>.
+#
: ${TMPDIR:=/var/tmp}
TMPFILE=$TMPDIR/foo
diff --git a/tests/vredir1.sub b/tests/vredir1.sub
index 403734c8..484f313b 100644
--- a/tests/vredir1.sub
+++ b/tests/vredir1.sub
@@ -1,3 +1,16 @@
+# 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 <http://www.gnu.org/licenses/>.
+#
bar()
{
exec {v}<<EOF
diff --git a/tests/vredir2.sub b/tests/vredir2.sub
index e1a380df..4f9e7bb3 100644
--- a/tests/vredir2.sub
+++ b/tests/vredir2.sub
@@ -1,3 +1,16 @@
+# 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 <http://www.gnu.org/licenses/>.
+#
: ${TMPDIR:=/var/tmp}
SHELLSFILE=$TMPDIR/shells-$$
diff --git a/tests/vredir4.sub b/tests/vredir4.sub
index e1cef057..f861bcfc 100644
--- a/tests/vredir4.sub
+++ b/tests/vredir4.sub
@@ -1,3 +1,16 @@
+# 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 <http://www.gnu.org/licenses/>.
+#
swizzle()
{
fd0=0
diff --git a/tests/vredir5.sub b/tests/vredir5.sub
index d1531e91..beb45ac2 100644
--- a/tests/vredir5.sub
+++ b/tests/vredir5.sub
@@ -1,3 +1,16 @@
+# 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 <http://www.gnu.org/licenses/>.
+#
swizzle()
{
exec {fd0}<&0
diff --git a/tests/vredir7.sub b/tests/vredir7.sub
index 8cb80edd..0f76f404 100644
--- a/tests/vredir7.sub
+++ b/tests/vredir7.sub
@@ -1,3 +1,16 @@
+# 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 <http://www.gnu.org/licenses/>.
+#
swizzle()
{
exec {fd[0]}<&0