diff options
Diffstat (limited to 'bin/sh')
599 files changed, 619 insertions, 1063 deletions
diff --git a/bin/sh/Makefile b/bin/sh/Makefile index b074121d0ecd..d2043ecad269 100644 --- a/bin/sh/Makefile +++ b/bin/sh/Makefile @@ -1,5 +1,3 @@ -# @(#)Makefile 8.4 (Berkeley) 5/5/95 -# $FreeBSD$ .include <src.opts.mk> @@ -7,6 +5,7 @@ CONFGROUPS= ETC ROOT ETC= profile ROOT= dot.shrc dot.profile ROOTDIR= /root +ROOTDIR_MODE= 0750 ROOTNAME_dot.shrc= .shrc ROOTNAME_dot.profile= .profile PACKAGE=runtime @@ -39,24 +38,30 @@ CFLAGS+=-DSHELL -I. -I${.CURDIR} CLEANFILES+= mknodes mksyntax CLEANFILES+= ${GENSRCS} ${GENHDRS} +.if ${MACHINE} == "host" || ${MK_DIRDEPS_BUILD} == "no" build-tools: mknodes mksyntax +DEPENDOBJS+= mknodes mksyntax +mknodes mksyntax: ${BUILD_TOOLS_META} +builtins.c builtins.h: mkbuiltins +syntax.c syntax.h: mksyntax +nodes.c nodes.h: mknodes +.endif + .ORDER: builtins.c builtins.h builtins.h: .NOMETA -builtins.c builtins.h: mkbuiltins builtins.def +builtins.c builtins.h: builtins.def sh ${.CURDIR}/mkbuiltins ${.CURDIR} -DEPENDOBJS+= mknodes mksyntax -mknodes mksyntax: ${BUILD_TOOLS_META} .ORDER: nodes.c nodes.h nodes.h: .NOMETA -nodes.c nodes.h: mknodes nodetypes nodes.c.pat +nodes.c nodes.h: nodetypes nodes.c.pat ${BTOOLSPATH:U.}/mknodes ${.CURDIR}/nodetypes ${.CURDIR}/nodes.c.pat .ORDER: syntax.c syntax.h syntax.h: .NOMETA -syntax.c syntax.h: mksyntax +syntax.c syntax.h: ${BTOOLSPATH:U.}/mksyntax token.h: mktokens @@ -68,6 +73,7 @@ SUBDIR.${MK_TESTS}+= tests beforeinstallconfig: rm -f ${DESTDIR}/.profile +LINKMODE=${CONFMODE} afterinstallconfig: ${INSTALL_LINK} ${TAG_ARGS} ${DESTDIR}/root/.profile ${DESTDIR}/.profile diff --git a/bin/sh/Makefile.depend b/bin/sh/Makefile.depend index 0e0490b10835..17be3d459f0c 100644 --- a/bin/sh/Makefile.depend +++ b/bin/sh/Makefile.depend @@ -1,15 +1,14 @@ -# $FreeBSD$ # Autogenerated - do NOT edit! DIRDEPS = \ - gnu/lib/csu \ + bin/sh.host \ include \ include/xlocale \ lib/${CSU_DIR} \ lib/libc \ lib/libcompiler_rt \ lib/libedit \ - lib/ncurses/ncursesw \ + usr.bin/awk.host \ .include <dirdeps.mk> diff --git a/bin/sh/TOUR b/bin/sh/TOUR index 8f7a741ba5c4..37bed64b4080 100644 --- a/bin/sh/TOUR +++ b/bin/sh/TOUR @@ -1,5 +1,3 @@ -# @(#)TOUR 8.1 (Berkeley) 5/31/93 -# $FreeBSD$ NOTE -- This is the original TOUR paper distributed with ash and does not represent the current state of the shell. It is provided anyway diff --git a/bin/sh/alias.c b/bin/sh/alias.c index bbcf5fbe17e3..a02554d66e24 100644 --- a/bin/sh/alias.c +++ b/bin/sh/alias.c @@ -30,14 +30,6 @@ * SUCH DAMAGE. */ -#ifndef lint -#if 0 -static char sccsid[] = "@(#)alias.c 8.3 (Berkeley) 5/4/95"; -#endif -#endif /* not lint */ -#include <sys/cdefs.h> -__FBSDID("$FreeBSD$"); - #include <stdlib.h> #include "shell.h" #include "output.h" @@ -55,7 +47,7 @@ static int aliases; static void setalias(const char *, const char *); static int unalias(const char *); -static struct alias **hashalias(const char *); +static size_t hashalias(const char *); static void @@ -64,7 +56,7 @@ setalias(const char *name, const char *val) struct alias *ap, **app; unalias(name); - app = hashalias(name); + app = &atab[hashalias(name)]; INTOFF; ap = ckmalloc(sizeof (struct alias)); ap->name = savestr(name); @@ -89,7 +81,7 @@ unalias(const char *name) { struct alias *ap, **app; - app = hashalias(name); + app = &atab[hashalias(name)]; for (ap = *app; ap; app = &(ap->next), ap = ap->next) { if (equal(name, ap->name)) { @@ -147,7 +139,7 @@ lookupalias(const char *name, int check) if (aliases == 0) return (NULL); - for (ap = *hashalias(name); ap; ap = ap->next) { + for (ap = atab[hashalias(name)]; ap; ap = ap->next) { if (equal(name, ap->name)) { if (check && (ap->flag & ALIASINUSE)) return (NULL); @@ -244,7 +236,7 @@ unaliascmd(int argc __unused, char **argv __unused) return (i); } -static struct alias ** +static size_t hashalias(const char *p) { unsigned int hashval; @@ -252,5 +244,22 @@ hashalias(const char *p) hashval = (unsigned char)*p << 4; while (*p) hashval+= *p++; - return &atab[hashval % ATABSIZE]; + return (hashval % ATABSIZE); +} + +const struct alias * +iteralias(const struct alias *index) +{ + size_t i = 0; + + if (index != NULL) { + if (index->next != NULL) + return (index->next); + i = hashalias(index->name) + 1; + } + for (; i < ATABSIZE; i++) + if (atab[i] != NULL) + return (atab[i]); + + return (NULL); } diff --git a/bin/sh/alias.h b/bin/sh/alias.h index 92de705bc963..d0644b317472 100644 --- a/bin/sh/alias.h +++ b/bin/sh/alias.h @@ -28,9 +28,6 @@ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. - * - * @(#)alias.h 8.2 (Berkeley) 5/4/95 - * $FreeBSD$ */ #define ALIASINUSE 1 @@ -43,3 +40,4 @@ struct alias { }; struct alias *lookupalias(const char *, int); +const struct alias *iteralias(const struct alias *); diff --git a/bin/sh/arith.h b/bin/sh/arith.h index 569d0c58651f..3a7521956c09 100644 --- a/bin/sh/arith.h +++ b/bin/sh/arith.h @@ -25,9 +25,6 @@ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. - * - * @(#)arith.h 1.1 (Berkeley) 5/4/95 - * $FreeBSD$ */ #include "shell.h" diff --git a/bin/sh/arith_yacc.c b/bin/sh/arith_yacc.c index a08163bdc29b..cb88cdb4cbea 100644 --- a/bin/sh/arith_yacc.c +++ b/bin/sh/arith_yacc.c @@ -33,8 +33,6 @@ */ #include <sys/cdefs.h> -__FBSDID("$FreeBSD$"); - #include <limits.h> #include <errno.h> #include <inttypes.h> diff --git a/bin/sh/arith_yacc.h b/bin/sh/arith_yacc.h index 7fdd99b75b57..3203c664a8a8 100644 --- a/bin/sh/arith_yacc.h +++ b/bin/sh/arith_yacc.h @@ -30,8 +30,6 @@ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. - * - * $FreeBSD$ */ #define ARITH_ASS 1 diff --git a/bin/sh/arith_yylex.c b/bin/sh/arith_yylex.c index 9f320dbcb585..68a641d807af 100644 --- a/bin/sh/arith_yylex.c +++ b/bin/sh/arith_yylex.c @@ -33,8 +33,6 @@ */ #include <sys/cdefs.h> -__FBSDID("$FreeBSD$"); - #include <ctype.h> #include <errno.h> #include <inttypes.h> diff --git a/bin/sh/bltin/bltin.h b/bin/sh/bltin/bltin.h index 8149895815dd..8d541ed1e138 100644 --- a/bin/sh/bltin/bltin.h +++ b/bin/sh/bltin/bltin.h @@ -30,9 +30,6 @@ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. - * - * @(#)bltin.h 8.2 (Berkeley) 5/4/95 - * $FreeBSD$ */ /* diff --git a/bin/sh/bltin/echo.c b/bin/sh/bltin/echo.c index e8046c7615ec..648965ba78fa 100644 --- a/bin/sh/bltin/echo.c +++ b/bin/sh/bltin/echo.c @@ -30,13 +30,9 @@ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. - * - * @(#)echo.c 8.2 (Berkeley) 5/4/95 */ #include <sys/cdefs.h> -__FBSDID("$FreeBSD$"); - /* * Echo command. */ diff --git a/bin/sh/builtins.def b/bin/sh/builtins.def index f38af0f24dce..00f363bfb1c7 100644 --- a/bin/sh/builtins.def +++ b/bin/sh/builtins.def @@ -30,9 +30,6 @@ # LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY # OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF # SUCH DAMAGE. -# -# @(#)builtins.def 8.4 (Berkeley) 5/4/95 -# $FreeBSD$ # # This file lists all the builtin commands. The first column is the name diff --git a/bin/sh/cd.c b/bin/sh/cd.c index 66eee00b2c24..b908c4320c04 100644 --- a/bin/sh/cd.c +++ b/bin/sh/cd.c @@ -30,14 +30,6 @@ * SUCH DAMAGE. */ -#ifndef lint -#if 0 -static char sccsid[] = "@(#)cd.c 8.2 (Berkeley) 5/4/95"; -#endif -#endif /* not lint */ -#include <sys/cdefs.h> -__FBSDID("$FreeBSD$"); - #include <sys/types.h> #include <sys/stat.h> #include <stdlib.h> diff --git a/bin/sh/cd.h b/bin/sh/cd.h index a82d6370d57c..e2f8ca54748e 100644 --- a/bin/sh/cd.h +++ b/bin/sh/cd.h @@ -25,8 +25,6 @@ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. - * - * $FreeBSD$ */ void pwd_init(int); diff --git a/bin/sh/dot.profile b/bin/sh/dot.profile index fd0c43fdb927..d27a2ae2fdbe 100644 --- a/bin/sh/dot.profile +++ b/bin/sh/dot.profile @@ -1,9 +1,8 @@ -# $FreeBSD$ # -PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/sbin:/usr/local/bin:~/bin -export PATH HOME=/root export HOME +PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/sbin:/usr/local/bin:~/bin +export PATH TERM=${TERM:-xterm} export TERM PAGER=less diff --git a/bin/sh/dot.shrc b/bin/sh/dot.shrc index 5277e5b07b0a..2bcedf44a40e 100644 --- a/bin/sh/dot.shrc +++ b/bin/sh/dot.shrc @@ -1,4 +1,3 @@ -# $FreeBSD$ # # .shrc - bourne shell startup file # @@ -31,6 +30,19 @@ # alias mv='mv -i' # alias rm='rm -i' +# # csh like history on arrow up and down +bind ^[[A ed-search-prev-history +bind ^[[B ed-search-next-history + +# # ctrl+arrow allow to jump from words to words +bind "\\e[1;5C" em-next-word +bind "\\e[1;5D" ed-prev-word +alias history='fc -l' + +# Fix home/del for mobaxterm +bind ^[[5~ ed-move-to-beg +bind ^[[6~ ed-move-to-end + # read(2) of directories may not be desirable by default, as this will provoke # EISDIR errors from each directory encountered. # alias grep='grep -d skip' diff --git a/bin/sh/error.c b/bin/sh/error.c index bee2a4fe703b..fcc2f309ccbc 100644 --- a/bin/sh/error.c +++ b/bin/sh/error.c @@ -30,14 +30,6 @@ * SUCH DAMAGE. */ -#ifndef lint -#if 0 -static char sccsid[] = "@(#)error.c 8.2 (Berkeley) 5/4/95"; -#endif -#endif /* not lint */ -#include <sys/cdefs.h> -__FBSDID("$FreeBSD$"); - /* * Errors and exceptions. */ @@ -74,7 +66,7 @@ static void verrorwithstatus(int, const char *, va_list) __printf0like(2, 0) __d * just do a longjmp to the exception handler. The type of exception is * stored in the global variable "exception". * - * Interrupts are disabled; they should be reenabled when the exception is + * Interrupts are disabled; they should be re-enabled when the exception is * caught. */ diff --git a/bin/sh/error.h b/bin/sh/error.h index 3a79dec81b9d..cb64ec85c09f 100644 --- a/bin/sh/error.h +++ b/bin/sh/error.h @@ -28,9 +28,6 @@ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. - * - * @(#)error.h 8.2 (Berkeley) 5/4/95 - * $FreeBSD$ */ /* diff --git a/bin/sh/eval.c b/bin/sh/eval.c index b95689bce006..fdc7a2560694 100644 --- a/bin/sh/eval.c +++ b/bin/sh/eval.c @@ -30,14 +30,6 @@ * SUCH DAMAGE. */ -#ifndef lint -#if 0 -static char sccsid[] = "@(#)eval.c 8.9 (Berkeley) 6/8/95"; -#endif -#endif /* not lint */ -#include <sys/cdefs.h> -__FBSDID("$FreeBSD$"); - #include <paths.h> #include <signal.h> #include <stdlib.h> @@ -900,14 +892,14 @@ evalcommand(union node *cmd, int flags, struct backcmd *backcmd) * the hash table isn't filled with items * from the temporary setting. * - * It would be better to forbit using and + * It would be better to forbid using and * updating the table while this command * runs, by the command finding mechanism * is heavily integrated with hash handling, * so we just delete the hash before and after * the command runs. Partly deleting like * changepatch() does doesn't seem worth the - * bookinging effort, since most such runs add + * booking effort, since most such runs add * directories in front of the new PATH. */ clearcmdentry(); diff --git a/bin/sh/eval.h b/bin/sh/eval.h index d8a12eb79c7f..9a47e9a8db23 100644 --- a/bin/sh/eval.h +++ b/bin/sh/eval.h @@ -28,9 +28,6 @@ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. - * - * @(#)eval.h 8.2 (Berkeley) 5/4/95 - * $FreeBSD$ */ extern char *commandname; /* currently executing command */ diff --git a/bin/sh/exec.c b/bin/sh/exec.c index e3779b097e1d..f7788d0758e3 100644 --- a/bin/sh/exec.c +++ b/bin/sh/exec.c @@ -30,14 +30,6 @@ * SUCH DAMAGE. */ -#ifndef lint -#if 0 -static char sccsid[] = "@(#)exec.c 8.4 (Berkeley) 6/8/95"; -#endif -#endif /* not lint */ -#include <sys/cdefs.h> -__FBSDID("$FreeBSD$"); - #include <sys/types.h> #include <sys/stat.h> #include <unistd.h> @@ -418,7 +410,7 @@ find_command(const char *name, struct cmdentry *entry, int act, if (!S_ISREG(statb.st_mode)) continue; if (opt) { /* this is a %func directory */ - readcmdfile(fullname); + readcmdfile(fullname, -1 /* verify */); if ((cmdp = cmdlookup(name, 0)) == NULL || cmdp->cmdtype != CMDFUNCTION) error("%s not defined in %s", name, fullname); stunalloc(fullname); @@ -547,6 +539,19 @@ clearcmdentry(void) } +static unsigned int +hashname(const char *p) +{ + unsigned int hashval; + + hashval = (unsigned char)*p << 4; + while (*p) + hashval += *p++; + + return (hashval % CMDTABLESIZE); +} + + /* * Locate a command in the command hash table. If "add" is nonzero, * add the command to the table if it is not already present. The @@ -561,17 +566,11 @@ static struct tblentry **lastcmdentry; static struct tblentry * cmdlookup(const char *name, int add) { - unsigned int hashval; - const char *p; struct tblentry *cmdp; struct tblentry **pp; size_t len; - p = name; - hashval = (unsigned char)*p << 4; - while (*p) - hashval += *p++; - pp = &cmdtable[hashval % CMDTABLESIZE]; + pp = &cmdtable[hashname(name)]; for (cmdp = *pp ; cmdp ; cmdp = cmdp->next) { if (equal(cmdp->cmdname, name)) break; @@ -590,6 +589,31 @@ cmdlookup(const char *name, int add) return cmdp; } +const void * +itercmd(const void *entry, struct cmdentry *result) +{ + const struct tblentry *e = entry; + size_t i = 0; + + if (e != NULL) { + if (e->next != NULL) { + e = e->next; + goto success; + } + i = hashname(e->cmdname) + 1; + } + for (; i < CMDTABLESIZE; i++) + if ((e = cmdtable[i]) != NULL) + goto success; + + return (NULL); +success: + result->cmdtype = e->cmdtype; + result->cmdname = e->cmdname; + + return (e); +} + /* * Delete the command entry returned on the last lookup. */ diff --git a/bin/sh/exec.h b/bin/sh/exec.h index 03e7e6ab0b0c..ff4d5b3c20bc 100644 --- a/bin/sh/exec.h +++ b/bin/sh/exec.h @@ -28,9 +28,6 @@ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. - * - * @(#)exec.h 8.3 (Berkeley) 6/8/95 - * $FreeBSD$ */ /* values of cmdtype */ @@ -54,6 +51,7 @@ struct cmdentry { struct funcdef *func; } u; int special; + const char *cmdname; }; @@ -72,3 +70,4 @@ int unsetfunc(const char *); int isfunc(const char *); int typecmd_impl(int, char **, int, const char *); void clearcmdentry(void); +const void *itercmd(const void *, struct cmdentry *); diff --git a/bin/sh/expand.c b/bin/sh/expand.c index 922bf5c3c4e8..dfafe35fbaca 100644 --- a/bin/sh/expand.c +++ b/bin/sh/expand.c @@ -34,14 +34,6 @@ * SUCH DAMAGE. */ -#ifndef lint -#if 0 -static char sccsid[] = "@(#)expand.c 8.5 (Berkeley) 5/15/95"; -#endif -#endif /* not lint */ -#include <sys/cdefs.h> -__FBSDID("$FreeBSD$"); - #include <sys/types.h> #include <sys/time.h> #include <sys/stat.h> diff --git a/bin/sh/expand.h b/bin/sh/expand.h index a60ea29514d2..972032583958 100644 --- a/bin/sh/expand.h +++ b/bin/sh/expand.h @@ -28,9 +28,6 @@ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. - * - * @(#)expand.h 8.2 (Berkeley) 5/4/95 - * $FreeBSD$ */ struct arglist { diff --git a/bin/sh/funcs/cmv b/bin/sh/funcs/cmv index 815861eb5ebb..a87fcf8b7757 100644 --- a/bin/sh/funcs/cmv +++ b/bin/sh/funcs/cmv @@ -30,9 +30,6 @@ # LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY # OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF # SUCH DAMAGE. -# -# @(#)cmv 8.2 (Berkeley) 5/4/95 -# $FreeBSD$ # Conditional move--don't replace an existing file. diff --git a/bin/sh/funcs/dirs b/bin/sh/funcs/dirs index cac4c59af088..816230386725 100644 --- a/bin/sh/funcs/dirs +++ b/bin/sh/funcs/dirs @@ -30,9 +30,6 @@ # LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY # OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF # SUCH DAMAGE. -# -# @(#)dirs 8.2 (Berkeley) 5/4/95 -# $FreeBSD$ # pushd, popd, and dirs --- written by Chris Bertin # Pixel Computer Inc. ...!wjh12!pixel!pixutl!chris diff --git a/bin/sh/funcs/login b/bin/sh/funcs/login index 055bbe5a8fad..1569f88cb6be 100644 --- a/bin/sh/funcs/login +++ b/bin/sh/funcs/login @@ -30,9 +30,6 @@ # LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY # OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF # SUCH DAMAGE. -# -# @(#)login 8.2 (Berkeley) 5/4/95 -# $FreeBSD$ # replaces the login builtin in the BSD shell login () exec login "$@" diff --git a/bin/sh/funcs/newgrp b/bin/sh/funcs/newgrp index d1f8b84800d8..ab7d202940e5 100644 --- a/bin/sh/funcs/newgrp +++ b/bin/sh/funcs/newgrp @@ -30,8 +30,5 @@ # LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY # OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF # SUCH DAMAGE. -# -# @(#)newgrp 8.2 (Berkeley) 5/4/95 -# $FreeBSD$ newgrp() exec newgrp "$@" diff --git a/bin/sh/funcs/popd b/bin/sh/funcs/popd index 805a4aff4f94..816230386725 100644 --- a/bin/sh/funcs/popd +++ b/bin/sh/funcs/popd @@ -30,9 +30,6 @@ # LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY # OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF # SUCH DAMAGE. -# -# @(#)popd 8.2 (Berkeley) 5/4/95 -# $FreeBSD$ # pushd, popd, and dirs --- written by Chris Bertin # Pixel Computer Inc. ...!wjh12!pixel!pixutl!chris diff --git a/bin/sh/funcs/pushd b/bin/sh/funcs/pushd index 12b6fcf71d13..816230386725 100644 --- a/bin/sh/funcs/pushd +++ b/bin/sh/funcs/pushd @@ -30,9 +30,6 @@ # LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY # OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF # SUCH DAMAGE. -# -# @(#)pushd 8.2 (Berkeley) 5/4/95 -# $FreeBSD$ # pushd, popd, and dirs --- written by Chris Bertin # Pixel Computer Inc. ...!wjh12!pixel!pixutl!chris diff --git a/bin/sh/funcs/suspend b/bin/sh/funcs/suspend index aaa2f7370cde..fd54c7050ddf 100644 --- a/bin/sh/funcs/suspend +++ b/bin/sh/funcs/suspend @@ -28,9 +28,6 @@ # LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY # OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF # SUCH DAMAGE. -# -# @(#)suspend 8.2 (Berkeley) 5/4/95 -# $FreeBSD$ suspend() { local - diff --git a/bin/sh/histedit.c b/bin/sh/histedit.c index b680a99c4ace..5aea58650c67 100644 --- a/bin/sh/histedit.c +++ b/bin/sh/histedit.c @@ -30,26 +30,22 @@ * SUCH DAMAGE. */ -#ifndef lint -#if 0 -static char sccsid[] = "@(#)histedit.c 8.2 (Berkeley) 5/4/95"; -#endif -#endif /* not lint */ -#include <sys/cdefs.h> -__FBSDID("$FreeBSD$"); - #include <sys/param.h> #include <sys/stat.h> #include <dirent.h> +#include <errno.h> #include <fcntl.h> #include <limits.h> #include <paths.h> +#include <stdbool.h> #include <stdio.h> #include <stdlib.h> #include <unistd.h> /* * Editline and history functions (and glue). */ +#include "alias.h" +#include "exec.h" #include "shell.h" #include "parser.h" #include "var.h" @@ -70,13 +66,16 @@ __FBSDID("$FreeBSD$"); History *hist; /* history cookie */ EditLine *el; /* editline cookie */ int displayhist; +static int savehist; static FILE *el_in, *el_out; +static bool in_command_completion; static char *fc_replace(const char *, char *, char *); static int not_fcnumber(const char *); static int str_to_event(const char *, int); static int comparator(const void *, const void *, void *); static char **sh_matches(const char *, int, int); +static const char *append_char_function(const char *); static unsigned char sh_complete(EditLine *, int); static const char * @@ -85,7 +84,7 @@ get_histfile(void) const char *histfile; /* don't try to save if the history size is 0 */ - if (hist == NULL || histsizeval() == 0) + if (hist == NULL || !strcmp(histsizeval(), "0")) return (NULL); histfile = expandstr("${HISTFILE-${HOME-}/.sh_history}"); @@ -103,7 +102,7 @@ histsave(void) int fd; FILE *f; - if ((histfile = get_histfile()) == NULL) + if (!savehist || (histfile = get_histfile()) == NULL) return; INTOFF; asprintf(&histtmpname, "%s.XXXXXXXXXX", histfile); @@ -134,7 +133,9 @@ histload(void) if ((histfile = get_histfile()) == NULL) return; - history(hist, &he, H_LOAD, histfile); + errno = 0; + if (history(hist, &he, H_LOAD, histfile) != -1 || errno == ENOENT) + savehist = 1; } /* @@ -183,7 +184,7 @@ histedit(void) if (el != NULL) { if (hist) el_set(el, EL_HIST, history, hist); - el_set(el, EL_PROMPT, getprompt); + el_set(el, EL_PROMPT_ESC, getprompt, '\001'); el_set(el, EL_ADDFN, "sh-complete", "Filename completion", sh_complete); @@ -203,8 +204,6 @@ bad: el_set(el, EL_EDITOR, "vi"); else if (Eflag) { el_set(el, EL_EDITOR, "emacs"); - el_set(el, EL_BIND, "^R", "em-inc-search-prev", NULL); - el_set(el, EL_BIND, "^W", "ed-delete-prev-word", NULL); } el_set(el, EL_BIND, "^I", "sh-complete", NULL); el_source(el, NULL); @@ -250,7 +249,6 @@ setterm(const char *term) int histcmd(int argc, char **argv __unused) { - int ch; const char *editor = NULL; HistEvent he; int lflg = 0, nflg = 0, rflg = 0, sflg = 0; @@ -272,25 +270,29 @@ histcmd(int argc, char **argv __unused) if (argc == 1) error("missing history argument"); - while (not_fcnumber(*argptr) && (ch = nextopt("e:lnrs")) != '\0') - switch ((char)ch) { - case 'e': - editor = shoptarg; - break; - case 'l': - lflg = 1; - break; - case 'n': - nflg = 1; - break; - case 'r': - rflg = 1; - break; - case 's': - sflg = 1; - break; - } - + while (not_fcnumber(*argptr)) + do { + switch (nextopt("e:lnrs")) { + case 'e': + editor = shoptarg; + break; + case 'l': + lflg = 1; + break; + case 'n': + nflg = 1; + break; + case 'r': + rflg = 1; + break; + case 's': + sflg = 1; + break; + case '\0': + goto operands; + } + } while (nextopt_optptr != NULL); +operands: savehandler = handler; /* * If executing... @@ -445,7 +447,7 @@ histcmd(int argc, char **argv __unused) editcmd = stalloc(strlen(editor) + strlen(editfile) + 2); sprintf(editcmd, "%s %s", editor, editfile); evalstring(editcmd, 0); /* XXX - should use no JC command */ - readcmdfile(editfile); /* XXX - should read back - quick tst */ + readcmdfile(editfile, 0 /* verify */); /* XXX - should read back - quick tst */ unlink(editfile); } @@ -561,6 +563,13 @@ bindcmd(int argc, char **argv) fclose(out); + if (argc > 1 && argv[1][0] == '-' && + memchr("ve", argv[1][1], 2) != NULL) { + Vflag = argv[1][1] == 'v'; + Eflag = !Vflag; + histedit(); + } + INTON; return ret; @@ -574,27 +583,45 @@ static int comparator(const void *a, const void *b, void *thunk) { size_t curpos = (intptr_t)thunk; + return (strcmp(*(char *const *)a + curpos, *(char *const *)b + curpos)); } +static char +**add_match(char **matches, size_t i, size_t *size, char *match_copy) +{ + if (match_copy == NULL) + return (NULL); + matches[i] = match_copy; + if (i >= *size - 1) { + *size *= 2; + matches = reallocarray(matches, *size, sizeof(matches[0])); + } + + return (matches); +} + /* - * This function is passed to libedit's fn_complete2(). The library will - * use it instead of its standard function that finds matching files in - * current directory. If we're at the start of the line, we want to look - * for available commands from all paths in $PATH. + * This function is passed to libedit's fn_complete2(). The library will use + * it instead of its standard function that finds matching files in current + * directory. If we're at the start of the line, we want to look for + * available commands from all paths in $PATH. */ static char **sh_matches(const char *text, int start, int end) { char *free_path = NULL, *path; const char *dirname; - char **matches = NULL; - size_t i = 0, size = 16, j, k; - size_t curpos = end - start; + char **matches = NULL, **rmatches; + size_t i = 0, size = 16, uniq; + size_t curpos = end - start, lcstring = -1; + struct cmdentry e; + in_command_completion = false; if (start > 0 || memchr("/.~", text[0], 3) != NULL) return (NULL); + in_command_completion = true; if ((free_path = path = strdup(pathval())) == NULL) goto out; if ((matches = malloc(size * sizeof(matches[0]))) == NULL) @@ -613,7 +640,6 @@ static char } while ((entry = readdir(dir)) != NULL) { struct stat statb; - char **rmatches; if (strncmp(entry->d_name, text, curpos) != 0) continue; @@ -624,11 +650,8 @@ static char continue; } else if (entry->d_type != DT_REG) continue; - matches[++i] = strdup(entry->d_name); - if (i < size - 1) - continue; - size *= 2; - rmatches = reallocarray(matches, size, sizeof(matches[0])); + rmatches = add_match(matches, ++i, &size, + strdup(entry->d_name)); if (rmatches == NULL) { closedir(dir); goto out; @@ -637,45 +660,109 @@ static char } closedir(dir); } + for (const unsigned char *bp = builtincmd; *bp != 0; bp += 2 + bp[0]) { + if (curpos > bp[0] || memcmp(bp + 2, text, curpos) != 0) + continue; + rmatches = add_match(matches, ++i, &size, strndup(bp + 2, bp[0])); + if (rmatches == NULL) + goto out; + matches = rmatches; + } + for (const struct alias *ap = NULL; (ap = iteralias(ap)) != NULL;) { + if (strncmp(ap->name, text, curpos) != 0) + continue; + rmatches = add_match(matches, ++i, &size, strdup(ap->name)); + if (rmatches == NULL) + goto out; + matches = rmatches; + } + for (const void *a = NULL; (a = itercmd(a, &e)) != NULL;) { + if (e.cmdtype != CMDFUNCTION) + continue; + if (strncmp(e.cmdname, text, curpos) != 0) + continue; + rmatches = add_match(matches, ++i, &size, strdup(e.cmdname)); + if (rmatches == NULL) + goto out; + matches = rmatches; + } out: free(free_path); - /* - * matches[0] is special: it's not a real matching file name but a common - * prefix for all matching names. It can't be null, unlike any other - * element of the array. When strings matches[0] and matches[1] compare - * equal and matches[2] is null that means to libedit that there is only - * a single match. It will then replace user input with possibly escaped - * string in matches[0] which is the reason to copy the full name of the - * only match. - */ if (i == 0) { free(matches); return (NULL); - } else if (i == 1) { + } + uniq = 1; + if (i > 1) { + qsort_s(matches + 1, i, sizeof(matches[0]), comparator, + (void *)(intptr_t)curpos); + for (size_t k = 2; k <= i; k++) { + const char *l = matches[uniq] + curpos; + const char *r = matches[k] + curpos; + size_t common = 0; + + while (*l != '\0' && *r != '\0' && *l == *r) + (void)l++, r++, common++; + if (common < lcstring) + lcstring = common; + if (*l == *r) + free(matches[k]); + else + matches[++uniq] = matches[k]; + } + } + matches[uniq + 1] = NULL; + /* + * matches[0] is special: it's not a real matching file name but + * a common prefix for all matching names. It can't be null, unlike + * any other element of the array. When strings matches[0] and + * matches[1] compare equal and matches[2] is null that means to + * libedit that there is only a single match. It will then replace + * user input with possibly escaped string in matches[0] which is the + * reason to copy the full name of the only match. + */ + if (uniq == 1) matches[0] = strdup(matches[1]); - matches[2] = NULL; - if (matches[0] != NULL) - return (matches); - } else + else if (lcstring != (size_t)-1) + matches[0] = strndup(matches[1], curpos + lcstring); + else matches[0] = strdup(text); if (matches[0] == NULL) { - for (j = 1; j <= i; j++) - free(matches[j]); + for (size_t k = 1; k <= uniq; k++) + free(matches[k]); free(matches); return (NULL); } - qsort_s(matches + 1, i, sizeof(matches[0]), comparator, - (void *)(intptr_t)curpos); - for (j = 1, k = 2; k <= i; k++) - if (strcmp(matches[j] + curpos, matches[k] + curpos) == 0) - free(matches[k]); - else - matches[++j] = matches[k]; - matches[j + 1] = NULL; return (matches); } /* + * If we don't specify this function as app_func in the call to fn_complete2, + * libedit will use the default one, which adds a " " to plain files and + * a "/" to directories regardless of whether it's a command name or a plain + * path (relative or absolute). We never want to add "/" to commands. + * + * For example, after I did "mkdir rmdir", "rmdi" would be autocompleted to + * "rmdir/" instead of "rmdir ". + */ +static const char * +append_char_function(const char *name) +{ + struct stat stbuf; + char *expname = name[0] == '~' ? fn_tilde_expand(name) : NULL; + const char *rs; + + if (!in_command_completion && + stat(expname ? expname : name, &stbuf) == 0 && + S_ISDIR(stbuf.st_mode)) + rs = "/"; + else + rs = " "; + free(expname); + return (rs); +} + +/* * This is passed to el_set(el, EL_ADDFN, ...) so that it's possible to * bind a key (tab by default) to execute the function. */ @@ -683,8 +770,8 @@ unsigned char sh_complete(EditLine *sel, int ch __unused) { return (unsigned char)fn_complete2(sel, NULL, sh_matches, - L" \t\n\"\\'`@$><=;|&{(", NULL, NULL, (size_t)100, - NULL, &((int) {0}), NULL, NULL, FN_QUOTE_MATCH); + L" \t\n\"\\'`@$><=;|&{(", NULL, append_char_function, + (size_t)100, NULL, &((int) {0}), NULL, NULL, FN_QUOTE_MATCH); } #else diff --git a/bin/sh/input.c b/bin/sh/input.c index a8d048fc4890..26f233ebf7b6 100644 --- a/bin/sh/input.c +++ b/bin/sh/input.c @@ -30,14 +30,6 @@ * SUCH DAMAGE. */ -#ifndef lint -#if 0 -static char sccsid[] = "@(#)input.c 8.3 (Berkeley) 6/9/95"; -#endif -#endif /* not lint */ -#include <sys/cdefs.h> -__FBSDID("$FreeBSD$"); - #include <stdio.h> /* defines BUFSIZ */ #include <fcntl.h> #include <errno.h> @@ -59,7 +51,9 @@ __FBSDID("$FreeBSD$"); #include "error.h" #include "alias.h" #include "parser.h" +#ifndef NO_HISTORY #include "myhistedit.h" +#endif #include "trap.h" #define EOF_NLEFT -99 /* value of parsenleft when EOF pushed back */ @@ -352,17 +346,25 @@ popstring(void) /* * Set the input to take input from a file. If push is set, push the * old input onto the stack first. + * About verify: + * -1: Obey verifyflag + * 0: Do not verify + * 1: Do verify */ void -setinputfile(const char *fname, int push) +setinputfile(const char *fname, int push, int verify) { int e; int fd; int fd2; + int oflags = O_RDONLY | O_CLOEXEC; + + if (verify == 1 || (verify == -1 && verifyflag)) + oflags |= O_VERIFY; INTOFF; - if ((fd = open(fname, O_RDONLY | O_CLOEXEC)) < 0) { + if ((fd = open(fname, oflags)) < 0) { e = errno; errorwithstatus(e == ENOENT || e == ENOTDIR ? 127 : 126, "cannot open %s: %s", fname, strerror(e)); diff --git a/bin/sh/input.h b/bin/sh/input.h index 71046b9731c3..8cf4df1e4044 100644 --- a/bin/sh/input.h +++ b/bin/sh/input.h @@ -28,9 +28,6 @@ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. - * - * @(#)input.h 8.2 (Berkeley) 5/4/95 - * $FreeBSD$ */ /* PEOF (the end of file marker) is defined in syntax.h */ @@ -53,7 +50,7 @@ int preadbuffer(void); int preadateof(void); void pungetc(void); void pushstring(const char *, int, struct alias *); -void setinputfile(const char *, int); +void setinputfile(const char *, int, int); void setinputfd(int, int); void setinputstring(const char *, int); void popfile(void); diff --git a/bin/sh/jobs.c b/bin/sh/jobs.c index c0ba7d75e16d..1328ae50edef 100644 --- a/bin/sh/jobs.c +++ b/bin/sh/jobs.c @@ -30,14 +30,6 @@ * SUCH DAMAGE. */ -#ifndef lint -#if 0 -static char sccsid[] = "@(#)jobs.c 8.5 (Berkeley) 5/4/95"; -#endif -#endif /* not lint */ -#include <sys/cdefs.h> -__FBSDID("$FreeBSD$"); - #include <sys/ioctl.h> #include <sys/param.h> #include <sys/resource.h> @@ -101,7 +93,7 @@ struct job { short nprocs; /* number of processes */ pid_t pgrp; /* process group of this job */ char state; /* true if job is finished */ - char used; /* true if this entry is in used */ + char used; /* true if this entry is in use */ char changed; /* true if status has changed */ char foreground; /* true if running in the foreground */ char remembered; /* true if $! referenced */ @@ -587,6 +579,8 @@ waitcmdloop(struct job *job) return retval; } } else { + if (njobs == 0) + return 0; for (jp = jobtab ; jp < jobtab + njobs; jp++) if (jp->used && jp->state == JOBDONE) { if (! iflag || ! jp->changed) diff --git a/bin/sh/jobs.h b/bin/sh/jobs.h index d0caf0638617..149b85d7df80 100644 --- a/bin/sh/jobs.h +++ b/bin/sh/jobs.h @@ -28,9 +28,6 @@ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. - * - * @(#)jobs.h 8.2 (Berkeley) 5/4/95 - * $FreeBSD$ */ /* Mode argument to forkshell. Don't change FORK_FG or FORK_BG. */ @@ -55,7 +52,7 @@ void setjobctl(int); void showjobs(int, int); struct job *makejob(union node *, int); pid_t forkshell(struct job *, union node *, int); -pid_t vforkexecshell(struct job *, char **, char **, const char *, int, int []); +pid_t vforkexecshell(struct job *, char **, char **, const char *, int, int [2]); int waitforjob(struct job *, int *); int stoppedjobs(void); int backgndpidset(void); diff --git a/bin/sh/mail.c b/bin/sh/mail.c index 194f654484db..be5e76c221f8 100644 --- a/bin/sh/mail.c +++ b/bin/sh/mail.c @@ -30,14 +30,6 @@ * SUCH DAMAGE. */ -#ifndef lint -#if 0 -static char sccsid[] = "@(#)mail.c 8.2 (Berkeley) 5/4/95"; -#endif -#endif /* not lint */ -#include <sys/cdefs.h> -__FBSDID("$FreeBSD$"); - /* * Routines to check for mail. (Perhaps make part of main.c?) */ @@ -63,7 +55,7 @@ static time_t mailtime[MAXMBOXES]; /* times of mailboxes */ /* * Print appropriate message(s) if mail has arrived. If the argument is - * nozero, then the value of MAIL has changed, so we just update the + * non-zero, then the value of MAIL has changed, so we just update the * values. */ diff --git a/bin/sh/mail.h b/bin/sh/mail.h index 0bb565209c7f..fd05aaddf7af 100644 --- a/bin/sh/mail.h +++ b/bin/sh/mail.h @@ -30,9 +30,6 @@ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. - * - * @(#)mail.h 8.2 (Berkeley) 5/4/95 - * $FreeBSD$ */ void chkmail(int); diff --git a/bin/sh/main.c b/bin/sh/main.c index b0a5fac6fd4e..23147c1db0be 100644 --- a/bin/sh/main.c +++ b/bin/sh/main.c @@ -32,20 +32,6 @@ * SUCH DAMAGE. */ -#ifndef lint -static char const copyright[] = -"@(#) Copyright (c) 1991, 1993\n\ - The Regents of the University of California. All rights reserved.\n"; -#endif /* not lint */ - -#ifndef lint -#if 0 -static char sccsid[] = "@(#)main.c 8.6 (Berkeley) 5/28/95"; -#endif -#endif /* not lint */ -#include <sys/cdefs.h> -__FBSDID("$FreeBSD$"); - #include <stdio.h> #include <signal.h> #include <sys/stat.h> @@ -100,7 +86,13 @@ static char *find_dot_file(char *); int main(int argc, char *argv[]) { - struct stackmark smark, smark2; + /* + * As smark is accessed after a longjmp, it cannot be a local in main(). + * The C standard specifies that the values of non-volatile local + * variables are unspecified after a jump if modified between the + * setjmp and longjmp. + */ + static struct stackmark smark, smark2; volatile int state; char *shinit; @@ -253,12 +245,16 @@ read_profile(const char *name) { int fd; const char *expandedname; + int oflags = O_RDONLY | O_CLOEXEC; + + if (verifyflag) + oflags |= O_VERIFY; expandedname = expandstr(name); if (expandedname == NULL) return; INTOFF; - if ((fd = open(expandedname, O_RDONLY | O_CLOEXEC)) >= 0) + if ((fd = open(expandedname, oflags)) >= 0) setinputfd(fd, 1); INTON; if (fd < 0) @@ -274,9 +270,9 @@ read_profile(const char *name) */ void -readcmdfile(const char *name) +readcmdfile(const char *name, int verify) { - setinputfile(name, 1); + setinputfile(name, 1, verify); cmdloop(0); popfile(); } @@ -331,7 +327,7 @@ dotcmd(int argc, char **argv) filename = argc > 2 && strcmp(argv[1], "--") == 0 ? argv[2] : argv[1]; fullname = find_dot_file(filename); - setinputfile(fullname, 1); + setinputfile(fullname, 1, -1 /* verify */); commandname = fullname; cmdloop(0); popfile(); diff --git a/bin/sh/main.h b/bin/sh/main.h index ff0a1c61fa22..68a3ddc33126 100644 --- a/bin/sh/main.h +++ b/bin/sh/main.h @@ -30,13 +30,10 @@ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. - * - * @(#)main.h 8.2 (Berkeley) 5/4/95 - * $FreeBSD$ */ extern int rootpid; /* pid of main shell */ extern int rootshell; /* true if we aren't a child of the main shell */ extern struct jmploc main_handler; /* top level exception handler */ -void readcmdfile(const char *); +void readcmdfile(const char *, int); diff --git a/bin/sh/memalloc.c b/bin/sh/memalloc.c index 7ea31af050e5..9c50156e8e00 100644 --- a/bin/sh/memalloc.c +++ b/bin/sh/memalloc.c @@ -32,14 +32,6 @@ * SUCH DAMAGE. */ -#ifndef lint -#if 0 -static char sccsid[] = "@(#)memalloc.c 8.3 (Berkeley) 5/4/95"; -#endif -#endif /* not lint */ -#include <sys/cdefs.h> -__FBSDID("$FreeBSD$"); - #include <sys/param.h> #include "shell.h" #include "output.h" @@ -291,7 +283,7 @@ growstackblock(int min) /* - * The following routines are somewhat easier to use that the above. + * The following routines are somewhat easier to use than the above. * The user declares a variable of type STACKSTR, which may be declared * to be a register. The macro STARTSTACKSTR initializes things. Then * the user uses the macro STPUTC to add characters to the string. In diff --git a/bin/sh/memalloc.h b/bin/sh/memalloc.h index 6cb7bd818fb5..ef090d51896d 100644 --- a/bin/sh/memalloc.h +++ b/bin/sh/memalloc.h @@ -30,9 +30,6 @@ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. - * - * @(#)memalloc.h 8.2 (Berkeley) 5/4/95 - * $FreeBSD$ */ #include <string.h> diff --git a/bin/sh/miscbltin.c b/bin/sh/miscbltin.c index faccfa92d221..6364bd10a584 100644 --- a/bin/sh/miscbltin.c +++ b/bin/sh/miscbltin.c @@ -32,14 +32,6 @@ * SUCH DAMAGE. */ -#ifndef lint -#if 0 -static char sccsid[] = "@(#)miscbltin.c 8.4 (Berkeley) 5/4/95"; -#endif -#endif /* not lint */ -#include <sys/cdefs.h> -__FBSDID("$FreeBSD$"); - /* * Miscellaneous builtins. */ @@ -231,6 +223,8 @@ readcmd(int argc __unused, char **argv __unused) * If there's nothing ready, return an error. */ if (status <= 0) { + while (*ap != NULL) + setvar(*ap++, "", 0); sig = pendingsig; return (128 + (sig != 0 ? sig : SIGALRM)); } diff --git a/bin/sh/mkbuiltins b/bin/sh/mkbuiltins index a04a796e275f..e0f997ba50ae 100755 --- a/bin/sh/mkbuiltins +++ b/bin/sh/mkbuiltins @@ -30,9 +30,6 @@ # LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY # OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF # SUCH DAMAGE. -# -# @(#)mkbuiltins 8.2 (Berkeley) 5/4/95 -# $FreeBSD$ temp=`mktemp -t ka` srcdir=$1 diff --git a/bin/sh/mknodes.c b/bin/sh/mknodes.c index 5b923b7fe0c5..0c5dfb1accfb 100644 --- a/bin/sh/mknodes.c +++ b/bin/sh/mknodes.c @@ -32,20 +32,6 @@ * SUCH DAMAGE. */ -#if 0 -#ifndef lint -static char const copyright[] = -"@(#) Copyright (c) 1991, 1993\n\ - The Regents of the University of California. All rights reserved.\n"; -#endif /* not lint */ - -#ifndef lint -static char sccsid[] = "@(#)mknodes.c 8.2 (Berkeley) 5/4/95"; -#endif /* not lint */ -#endif -#include <sys/cdefs.h> -__FBSDID("$FreeBSD$"); - /* * This program reads the nodetypes file and nodes.c.pat file. It generates * the files nodes.h and nodes.c. diff --git a/bin/sh/mksyntax.c b/bin/sh/mksyntax.c index 24b118f64cbf..60570d0f60a4 100644 --- a/bin/sh/mksyntax.c +++ b/bin/sh/mksyntax.c @@ -32,20 +32,6 @@ * SUCH DAMAGE. */ -#if 0 -#ifndef lint -static char const copyright[] = -"@(#) Copyright (c) 1991, 1993\n\ - The Regents of the University of California. All rights reserved.\n"; -#endif /* not lint */ - -#ifndef lint -static char sccsid[] = "@(#)mksyntax.c 8.2 (Berkeley) 5/4/95"; -#endif /* not lint */ -#endif -#include <sys/cdefs.h> -__FBSDID("$FreeBSD$"); - /* * This program creates syntax.h and syntax.c. */ diff --git a/bin/sh/mktokens b/bin/sh/mktokens index b7213e6831f6..1b0b0b9a586a 100644 --- a/bin/sh/mktokens +++ b/bin/sh/mktokens @@ -30,9 +30,6 @@ # LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY # OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF # SUCH DAMAGE. -# -# @(#)mktokens 8.1 (Berkeley) 5/31/93 -# $FreeBSD$ # The following is a list of tokens. The second column is nonzero if the # token marks the end of a list. The third column is the name to print in diff --git a/bin/sh/myhistedit.h b/bin/sh/myhistedit.h index 1f513f0ae206..64539fc06c18 100644 --- a/bin/sh/myhistedit.h +++ b/bin/sh/myhistedit.h @@ -27,9 +27,6 @@ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. - * - * @(#)myhistedit.h 8.2 (Berkeley) 5/4/95 - * $FreeBSD$ */ #include <histedit.h> diff --git a/bin/sh/mystring.c b/bin/sh/mystring.c index 716f00345961..9ac590d39f64 100644 --- a/bin/sh/mystring.c +++ b/bin/sh/mystring.c @@ -32,14 +32,6 @@ * SUCH DAMAGE. */ -#ifndef lint -#if 0 -static char sccsid[] = "@(#)mystring.c 8.2 (Berkeley) 5/4/95"; -#endif -#endif /* not lint */ -#include <sys/cdefs.h> -__FBSDID("$FreeBSD$"); - /* * String functions. * diff --git a/bin/sh/mystring.h b/bin/sh/mystring.h index ff4384d21c35..d51d22de83a1 100644 --- a/bin/sh/mystring.h +++ b/bin/sh/mystring.h @@ -30,9 +30,6 @@ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. - * - * @(#)mystring.h 8.2 (Berkeley) 5/4/95 - * $FreeBSD$ */ #include <string.h> diff --git a/bin/sh/nodes.c.pat b/bin/sh/nodes.c.pat index 43fa515fe905..9cee0715d4fc 100644 --- a/bin/sh/nodes.c.pat +++ b/bin/sh/nodes.c.pat @@ -28,9 +28,6 @@ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. - * - * @(#)nodes.c.pat 8.2 (Berkeley) 5/4/95 - * $FreeBSD$ */ #include <sys/param.h> diff --git a/bin/sh/nodetypes b/bin/sh/nodetypes index 496ffba05924..1507a7ae847e 100644 --- a/bin/sh/nodetypes +++ b/bin/sh/nodetypes @@ -28,9 +28,6 @@ # LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY # OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF # SUCH DAMAGE. -# -# @(#)nodetypes 8.2 (Berkeley) 5/4/95 -# $FreeBSD$ # This file describes the nodes used in parse trees. Unindented lines # contain a node type followed by a structure tag. Subsequent indented @@ -64,7 +61,7 @@ NPIPE npipe # a pipeline backgnd int # set to run pipeline in background cmdlist nodelist # the commands in the pipeline -NREDIR nredir # redirection (of a compex command) +NREDIR nredir # redirection (of a complex command) type int n nodeptr # the command redirect nodeptr # list of file redirections diff --git a/bin/sh/options.c b/bin/sh/options.c index 73d79ca9a74f..2dab8f4ea998 100644 --- a/bin/sh/options.c +++ b/bin/sh/options.c @@ -32,14 +32,6 @@ * SUCH DAMAGE. */ -#ifndef lint -#if 0 -static char sccsid[] = "@(#)options.c 8.2 (Berkeley) 5/4/95"; -#endif -#endif /* not lint */ -#include <sys/cdefs.h> -__FBSDID("$FreeBSD$"); - #include <signal.h> #include <unistd.h> #include <stdlib.h> @@ -112,7 +104,7 @@ procargs(int argc, char **argv) arg0 = argv[0]; if (sflag == 0 && minusc == NULL) { scriptname = *argptr++; - setinputfile(scriptname, 0); + setinputfile(scriptname, 0, -1 /* verify */); commandname = arg0 = scriptname; } /* POSIX 1003.2: first arg after -c cmd is $0, remainder $1... */ @@ -589,6 +581,9 @@ nextopt(const char *optstring) shoptarg = p; p = NULL; } - nextopt_optptr = p; + if (p != NULL && *p != '\0') + nextopt_optptr = p; + else + nextopt_optptr = NULL; return c; } diff --git a/bin/sh/options.h b/bin/sh/options.h index 500d4ad5a903..206d32c8a706 100644 --- a/bin/sh/options.h +++ b/bin/sh/options.h @@ -30,9 +30,6 @@ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. - * - * @(#)options.h 8.2 (Berkeley) 5/4/95 - * $FreeBSD$ */ struct shparam { @@ -68,9 +65,10 @@ struct shparam { #define hflag optval[18] #define nologflag optval[19] #define pipefailflag optval[20] +#define verifyflag optval[21] #define NSHORTOPTS 19 -#define NOPTS 21 +#define NOPTS 22 extern char optval[NOPTS]; extern const char optletter[NSHORTOPTS]; @@ -99,6 +97,7 @@ static const unsigned char optname[] = "\010trackall" "\005nolog" "\010pipefail" + "\006verify" ; #endif diff --git a/bin/sh/output.c b/bin/sh/output.c index c01ddd5acb83..baf4b8b7cc17 100644 --- a/bin/sh/output.c +++ b/bin/sh/output.c @@ -32,14 +32,6 @@ * SUCH DAMAGE. */ -#ifndef lint -#if 0 -static char sccsid[] = "@(#)output.c 8.2 (Berkeley) 5/4/95"; -#endif -#endif /* not lint */ -#include <sys/cdefs.h> -__FBSDID("$FreeBSD$"); - /* * Shell output routines. We use our own output routines because: * When a builtin command is interrupted we have to discard diff --git a/bin/sh/output.h b/bin/sh/output.h index 62f006d32a36..3afc3f289ad6 100644 --- a/bin/sh/output.h +++ b/bin/sh/output.h @@ -30,9 +30,6 @@ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. - * - * @(#)output.h 8.2 (Berkeley) 5/4/95 - * $FreeBSD$ */ #ifndef OUTPUT_INCL diff --git a/bin/sh/parser.c b/bin/sh/parser.c index 297d19d4d9b6..0c1b7a91c257 100644 --- a/bin/sh/parser.c +++ b/bin/sh/parser.c @@ -32,19 +32,12 @@ * SUCH DAMAGE. */ -#ifndef lint -#if 0 -static char sccsid[] = "@(#)parser.c 8.7 (Berkeley) 5/16/95"; -#endif -#endif /* not lint */ -#include <sys/cdefs.h> -__FBSDID("$FreeBSD$"); - #include <sys/param.h> #include <pwd.h> #include <stdlib.h> #include <unistd.h> #include <stdio.h> +#include <time.h> #include "shell.h" #include "parser.h" @@ -70,7 +63,7 @@ __FBSDID("$FreeBSD$"); * Shell command parser. */ -#define PROMPTLEN 128 +#define PROMPTLEN 192 /* values of checkkwd variable */ #define CHKALIAS 0x1 @@ -480,9 +473,9 @@ command(void) n1 = (union node *)stalloc(sizeof (struct nfor)); n1->type = NFOR; n1->nfor.var = wordtext; - while (readtoken() == TNL) - ; - if (lasttoken == TWORD && ! quoteflag && equal(wordtext, "in")) { + checkkwd = CHKNL; + if (readtoken() == TWORD && !quoteflag && + equal(wordtext, "in")) { app = ≈ while (readtoken() == TWORD) { n2 = makename(); @@ -491,7 +484,9 @@ command(void) } *app = NULL; n1->nfor.args = ap; - if (lasttoken != TNL && lasttoken != TSEMI) + if (lasttoken == TNL) + tokpushback++; + else if (lasttoken != TSEMI) synexpect(-1); } else { static char argvars[5] = { @@ -507,7 +502,7 @@ command(void) * Newline or semicolon here is optional (but note * that the original Bourne shell only allowed NL). */ - if (lasttoken != TNL && lasttoken != TSEMI) + if (lasttoken != TSEMI) tokpushback++; } checkkwd = CHKNL | CHKKWD | CHKALIAS; @@ -526,8 +521,8 @@ command(void) n1->type = NCASE; consumetoken(TWORD); n1->ncase.expr = makename(); - while (readtoken() == TNL); - if (lasttoken != TWORD || ! equal(wordtext, "in")) + checkkwd = CHKNL; + if (readtoken() != TWORD || ! equal(wordtext, "in")) synerror("expecting \"in\""); cpp = &n1->ncase.cases; checkkwd = CHKNL | CHKKWD, readtoken(); @@ -2054,104 +2049,182 @@ getprompt(void *unused __unused) /* * Format prompt string. */ - for (i = 0; (i < PROMPTLEN - 1) && (*fmt != '\0'); i++, fmt++) - if (*fmt == '\\') - switch (*++fmt) { + for (i = 0; (i < PROMPTLEN - 1) && (*fmt != '\0'); i++, fmt++) { + if (*fmt != '\\') { + ps[i] = *fmt; + continue; + } - /* - * Hostname. - * - * \h specifies just the local hostname, - * \H specifies fully-qualified hostname. - */ - case 'h': - case 'H': - ps[i] = '\0'; - gethostname(&ps[i], PROMPTLEN - i - 1); - ps[PROMPTLEN - 1] = '\0'; - /* Skip to end of hostname. */ - trim = (*fmt == 'h') ? '.' : '\0'; - while ((ps[i] != '\0') && (ps[i] != trim)) - i++; - --i; - break; + switch (*++fmt) { - /* - * User name. - */ - case 'u': - ps[i] = '\0'; - getusername(&ps[i], PROMPTLEN - i); - /* Skip to end of username. */ - while (ps[i + 1] != '\0') - i++; - break; + /* + * Non-printing sequence begin and end. + */ + case '[': + case ']': + ps[i] = '\001'; + break; - /* - * Working directory. - * - * \W specifies just the final component, - * \w specifies the entire path. - */ - case 'W': - case 'w': - pwd = lookupvar("PWD"); - if (pwd == NULL || *pwd == '\0') - pwd = "?"; - if (*fmt == 'W' && - *pwd == '/' && pwd[1] != '\0') - strlcpy(&ps[i], strrchr(pwd, '/') + 1, - PROMPTLEN - i); - else { - home = lookupvar("HOME"); - if (home != NULL) - homelen = strlen(home); - if (home != NULL && - strcmp(home, "/") != 0 && - strncmp(pwd, home, homelen) == 0 && - (pwd[homelen] == '/' || - pwd[homelen] == '\0')) { - strlcpy(&ps[i], "~", - PROMPTLEN - i); - strlcpy(&ps[i + 1], - pwd + homelen, - PROMPTLEN - i - 1); - } else { - strlcpy(&ps[i], pwd, PROMPTLEN - i); - } - } - /* Skip to end of path. */ - while (ps[i + 1] != '\0') - i++; - break; + /* + * Literal \ and some ASCII characters: + * \a BEL + * \e ESC + * \r CR + */ + case '\\': + case 'a': + case 'e': + case 'r': + if (*fmt == 'a') + ps[i] = '\007'; + else if (*fmt == 'e') + ps[i] = '\033'; + else if (*fmt == 'r') + ps[i] = '\r'; + else + ps[i] = '\\'; + break; - /* - * Superuser status. - * - * '$' for normal users, '#' for root. - */ - case '$': - ps[i] = (geteuid() != 0) ? '$' : '#'; - break; + /* + * CRLF sequence + */ + case 'n': + if (i < PROMPTLEN - 3) { + ps[i++] = '\r'; + ps[i] = '\n'; + } + break; - /* - * A literal \. - */ - case '\\': - ps[i] = '\\'; - break; + /* + * Print the current time as per provided strftime format. + */ + case 'D': { + char tfmt[128] = "%X"; /* \D{} means %X. */ + struct tm *now; + if (fmt[1] != '{') { /* - * Emit unrecognized formats verbatim. + * "\D" but not "\D{", so treat the '\' + * literally and rewind fmt to treat 'D' + * literally next iteration. */ - default: ps[i] = '\\'; - if (i < PROMPTLEN - 2) - ps[++i] = *fmt; + fmt--; break; } - else - ps[i] = *fmt; + fmt += 2; /* Consume "D{". */ + if (fmt[0] != '}') { + char *end; + + end = memccpy(tfmt, fmt, '}', sizeof(tfmt)); + if (end == NULL) { + /* + * Format too long or no '}', so + * ignore "\D{" altogether. + * The loop will do i++, but nothing + * was written to ps, so do i-- here. + * Rewind fmt for similar reason. + */ + i--; + fmt--; + break; + } + *--end = '\0'; /* Ignore the copy of '}'. */ + fmt += end - tfmt; + } + now = localtime(&(time_t){time(NULL)}); + i += strftime(&ps[i], PROMPTLEN - i - 1, tfmt, now); + i--; /* The loop will do i++. */ + break; + } + + /* + * Hostname. + * + * \h specifies just the local hostname, + * \H specifies fully-qualified hostname. + */ + case 'h': + case 'H': + ps[i] = '\0'; + gethostname(&ps[i], PROMPTLEN - i - 1); + ps[PROMPTLEN - 1] = '\0'; + /* Skip to end of hostname. */ + trim = (*fmt == 'h') ? '.' : '\0'; + while ((ps[i] != '\0') && (ps[i] != trim)) + i++; + --i; + break; + + /* + * User name. + */ + case 'u': + ps[i] = '\0'; + getusername(&ps[i], PROMPTLEN - i); + /* Skip to end of username. */ + while (ps[i + 1] != '\0') + i++; + break; + + /* + * Working directory. + * + * \W specifies just the final component, + * \w specifies the entire path. + */ + case 'W': + case 'w': + pwd = lookupvar("PWD"); + if (pwd == NULL || *pwd == '\0') + pwd = "?"; + if (*fmt == 'W' && + *pwd == '/' && pwd[1] != '\0') + strlcpy(&ps[i], strrchr(pwd, '/') + 1, + PROMPTLEN - i); + else { + home = lookupvar("HOME"); + if (home != NULL) + homelen = strlen(home); + if (home != NULL && + strcmp(home, "/") != 0 && + strncmp(pwd, home, homelen) == 0 && + (pwd[homelen] == '/' || + pwd[homelen] == '\0')) { + strlcpy(&ps[i], "~", + PROMPTLEN - i); + strlcpy(&ps[i + 1], + pwd + homelen, + PROMPTLEN - i - 1); + } else { + strlcpy(&ps[i], pwd, PROMPTLEN - i); + } + } + /* Skip to end of path. */ + while (ps[i + 1] != '\0') + i++; + break; + + /* + * Superuser status. + * + * '$' for normal users, '#' for root. + */ + case '$': + ps[i] = (geteuid() != 0) ? '$' : '#'; + break; + + /* + * Emit unrecognized formats verbatim. + */ + default: + ps[i] = '\\'; + if (i < PROMPTLEN - 2) + ps[++i] = *fmt; + break; + } + + } ps[i] = '\0'; return (ps); } diff --git a/bin/sh/parser.h b/bin/sh/parser.h index aee8244ecf09..933066be87f0 100644 --- a/bin/sh/parser.h +++ b/bin/sh/parser.h @@ -30,9 +30,6 @@ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. - * - * @(#)parser.h 8.3 (Berkeley) 5/4/95 - * $FreeBSD$ */ /* control characters in argument strings */ diff --git a/bin/sh/profile b/bin/sh/profile index b77c8787c79d..ee0879a13e0b 100644 --- a/bin/sh/profile +++ b/bin/sh/profile @@ -1,4 +1,3 @@ -# $FreeBSD$ # # System-wide .profile file for sh(1). # @@ -12,3 +11,23 @@ # msgs -q # Allow terminal messages # mesg y + +# Load each .sh file in /etc/profile.d/, then /usr/local/etc/profile, +# then each .sh file in /usr/local/etc/profile.d/. +_loaded=${_loaded:-/etc/profile} +export _loaded +for _dir in /etc /usr/local/etc ; do + for _file in "${_dir}"/profile "${_dir}"/profile.d/*.sh ; do + if [ -f "${_file}" ] ; then + case :${_loaded}: in + *:"${_file}":*) + ;; + *) + _loaded="${_loaded:+${_loaded}:}${_file}" + . "${_file}" + ;; + esac + fi + done +done +unset _loaded _dir _file diff --git a/bin/sh/redir.c b/bin/sh/redir.c index e820fd2c05f7..eb0fc618a73e 100644 --- a/bin/sh/redir.c +++ b/bin/sh/redir.c @@ -32,14 +32,6 @@ * SUCH DAMAGE. */ -#ifndef lint -#if 0 -static char sccsid[] = "@(#)redir.c 8.2 (Berkeley) 5/4/95"; -#endif -#endif /* not lint */ -#include <sys/cdefs.h> -__FBSDID("$FreeBSD$"); - #include <sys/types.h> #include <sys/stat.h> #include <signal.h> diff --git a/bin/sh/redir.h b/bin/sh/redir.h index 08c52359c59e..de780f0c1bfc 100644 --- a/bin/sh/redir.h +++ b/bin/sh/redir.h @@ -30,9 +30,6 @@ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. - * - * @(#)redir.h 8.2 (Berkeley) 5/4/95 - * $FreeBSD$ */ /* flags passed to redirect */ diff --git a/bin/sh/sh.1 b/bin/sh/sh.1 index ca3faeff13af..849133540cdd 100644 --- a/bin/sh/sh.1 +++ b/bin/sh/sh.1 @@ -29,10 +29,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.\" from: @(#)sh.1 8.6 (Berkeley) 5/4/95 -.\" $FreeBSD$ -.\" -.Dd May 10, 2021 +.Dd December 14, 2022 .Dt SH 1 .Os .Sh NAME @@ -214,7 +211,7 @@ Do not overwrite existing files with .Ql > . .It Fl E Li emacs Enable the built-in -.Xr emacs 1 +.Xr emacs 1 Pq Pa ports/editors/emacs command line editor (disables the .Fl V option if it has been set; @@ -355,6 +352,12 @@ if a command such as in the pipeline terminates with status 0 without reading its input completely. This option only has a long name. +.It Li verify +Set +.Dv O_VERIFY +when sourcing files or loading profiles. +.\" See also +.\" .Xr mac_veriexec 4 . TODO Does not exist; write it. .El .Pp The @@ -372,7 +375,7 @@ to be enabled or disabled. For example, the following two invocations of .Nm both enable the built-in -.Xr emacs 1 +.Xr emacs 1 Pq Pa ports/editors/emacs command line editor: .Bd -literal -offset indent set -E @@ -1422,6 +1425,16 @@ unless you are the superuser, in which case it defaults to may include any of the following formatting sequences, which are replaced by the given information: .Bl -tag -width indent +.It Li \eD{format} +The current time in +.Xr strftime 3 +.Ar format . +The braces are required. +Empty +.Ar format +is equivalent to +\&%X, +national representation of the time. .It Li \eH This system's fully-qualified hostname (FQDN). .It Li \eh @@ -1440,6 +1453,24 @@ for normal users and for superusers. .It Li \e\e A literal backslash. +.It Li \e[ +Start of a sequence of non-printing characters (used, for example, +to embed ANSI CSI sequences into the prompt). +.It Li \e] +End of a sequence of non-printing characters. +.El +.Pp +The following special and non-printing characters are supported +within the sequence of non-printing characters: +.Bl -tag -width indent +.It Li \ea +Emits ASCII BEL (0x07, 007) character. +.It Li \ee +Emits ASCII ESC (0x1b, 033) character. +.It Li \er +Emits ASCII CR (0x0d, 015) character. +.It Li \en +Emits CRLF sequence. .El .It Va PS2 The secondary prompt string, which defaults to @@ -2863,7 +2894,7 @@ will return the argument. .Xr chsh 1 , .Xr echo 1 , .Xr ed 1 , -.Xr emacs 1 , +.Xr emacs 1 Pq Pa ports/editors/emacs , .Xr kill 1 , .Xr printf 1 , .Xr pwd 1 , diff --git a/bin/sh/shell.h b/bin/sh/shell.h index c06e737e658f..4b598899dee1 100644 --- a/bin/sh/shell.h +++ b/bin/sh/shell.h @@ -30,9 +30,6 @@ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. - * - * @(#)shell.h 8.2 (Berkeley) 5/4/95 - * $FreeBSD$ */ #ifndef SHELL_H_ @@ -55,7 +52,7 @@ /* #define DEBUG 1 */ /* - * Type of used arithmetics. SUSv3 requires us to have at least signed long. + * Type of used arithmetic. SUSv3 requires us to have at least signed long. */ typedef intmax_t arith_t; #define ARITH_FORMAT_STR "%" PRIdMAX diff --git a/bin/sh/show.c b/bin/sh/show.c index 01035d76093d..1ccd4583d3a9 100644 --- a/bin/sh/show.c +++ b/bin/sh/show.c @@ -32,14 +32,6 @@ * SUCH DAMAGE. */ -#ifndef lint -#if 0 -static char sccsid[] = "@(#)show.c 8.3 (Berkeley) 5/4/95"; -#endif -#endif /* not lint */ -#include <sys/cdefs.h> -__FBSDID("$FreeBSD$"); - #include <fcntl.h> #include <stdio.h> #include <stdlib.h> diff --git a/bin/sh/show.h b/bin/sh/show.h index 790a62e2942c..d57ba9aee8c0 100644 --- a/bin/sh/show.h +++ b/bin/sh/show.h @@ -27,9 +27,6 @@ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. - * - * @(#)show.h 1.1 (Berkeley) 5/4/95 - * $FreeBSD$ */ void showtree(union node *); diff --git a/bin/sh/tests/Makefile b/bin/sh/tests/Makefile index 59835cb73520..ea28b9d39bd8 100644 --- a/bin/sh/tests/Makefile +++ b/bin/sh/tests/Makefile @@ -1,4 +1,3 @@ -# $FreeBSD$ .include <bsd.own.mk> diff --git a/bin/sh/tests/Makefile.depend b/bin/sh/tests/Makefile.depend index f80275d86ab1..11aba52f82cf 100644 --- a/bin/sh/tests/Makefile.depend +++ b/bin/sh/tests/Makefile.depend @@ -1,4 +1,3 @@ -# $FreeBSD$ # Autogenerated - do NOT edit! DIRDEPS = \ diff --git a/bin/sh/tests/builtins/Makefile b/bin/sh/tests/builtins/Makefile index 197d735920e6..c3ed122791b5 100644 --- a/bin/sh/tests/builtins/Makefile +++ b/bin/sh/tests/builtins/Makefile @@ -1,4 +1,3 @@ -# $FreeBSD$ PACKAGE= tests @@ -94,6 +93,7 @@ ${PACKAGE}FILES+= exit3.0 ${PACKAGE}FILES+= export1.0 ${PACKAGE}FILES+= fc1.0 ${PACKAGE}FILES+= fc2.0 +${PACKAGE}FILES+= fc3.0 fc3.0.stdout fc3.0.stderr ${PACKAGE}FILES+= for1.0 ${PACKAGE}FILES+= for2.0 ${PACKAGE}FILES+= for3.0 @@ -141,6 +141,8 @@ ${PACKAGE}FILES+= read6.0 ${PACKAGE}FILES+= read7.0 ${PACKAGE}FILES+= read8.0 ${PACKAGE}FILES+= read9.0 +${PACKAGE}FILES+= read10.0 +${PACKAGE}FILES+= read11.0 ${PACKAGE}FILES+= return1.0 ${PACKAGE}FILES+= return2.1 ${PACKAGE}FILES+= return3.1 diff --git a/bin/sh/tests/builtins/Makefile.depend b/bin/sh/tests/builtins/Makefile.depend index f80275d86ab1..11aba52f82cf 100644 --- a/bin/sh/tests/builtins/Makefile.depend +++ b/bin/sh/tests/builtins/Makefile.depend @@ -1,4 +1,3 @@ -# $FreeBSD$ # Autogenerated - do NOT edit! DIRDEPS = \ diff --git a/bin/sh/tests/builtins/alias.0 b/bin/sh/tests/builtins/alias.0 index d9b27969cfd6..0da2587e3b52 100644 --- a/bin/sh/tests/builtins/alias.0 +++ b/bin/sh/tests/builtins/alias.0 @@ -1,4 +1,3 @@ -# $FreeBSD$ set -e unalias -a diff --git a/bin/sh/tests/builtins/alias.1 b/bin/sh/tests/builtins/alias.1 index 31403dc760bf..755d1f59aeae 100644 --- a/bin/sh/tests/builtins/alias.1 +++ b/bin/sh/tests/builtins/alias.1 @@ -1,3 +1,2 @@ -# $FreeBSD$ unalias -a alias foo diff --git a/bin/sh/tests/builtins/alias3.0 b/bin/sh/tests/builtins/alias3.0 index fe65e31f5f03..b0edcbc1b814 100644 --- a/bin/sh/tests/builtins/alias3.0 +++ b/bin/sh/tests/builtins/alias3.0 @@ -1,4 +1,3 @@ -# $FreeBSD$ set -e unalias -a diff --git a/bin/sh/tests/builtins/alias4.0 b/bin/sh/tests/builtins/alias4.0 index 3d5efeccf2c7..0e93513546f0 100644 --- a/bin/sh/tests/builtins/alias4.0 +++ b/bin/sh/tests/builtins/alias4.0 @@ -1,4 +1,3 @@ -# $FreeBSD$ unalias -a alias -- diff --git a/bin/sh/tests/builtins/break1.0 b/bin/sh/tests/builtins/break1.0 index ba0cbb4bd268..910a003c609e 100644 --- a/bin/sh/tests/builtins/break1.0 +++ b/bin/sh/tests/builtins/break1.0 @@ -1,4 +1,3 @@ -# $FreeBSD$ if [ "$1" != nested ]; then while :; do diff --git a/bin/sh/tests/builtins/break2.0 b/bin/sh/tests/builtins/break2.0 index ff52dd321469..43d037c10ee7 100644 --- a/bin/sh/tests/builtins/break2.0 +++ b/bin/sh/tests/builtins/break2.0 @@ -1,4 +1,3 @@ -# $FreeBSD$ # It is not immediately obvious that this should work, and someone probably # relies on it. diff --git a/bin/sh/tests/builtins/break3.0 b/bin/sh/tests/builtins/break3.0 index 10a5ca88edff..fe73dac6befe 100644 --- a/bin/sh/tests/builtins/break3.0 +++ b/bin/sh/tests/builtins/break3.0 @@ -1,4 +1,3 @@ -# $FreeBSD$ # We accept this and people might rely on it. # However, various other shells do not accept it. diff --git a/bin/sh/tests/builtins/break4.4 b/bin/sh/tests/builtins/break4.4 index d52ff52be4d4..24f804cff385 100644 --- a/bin/sh/tests/builtins/break4.4 +++ b/bin/sh/tests/builtins/break4.4 @@ -1,4 +1,3 @@ -# $FreeBSD$ # Although this is not specified by POSIX, some configure scripts (gawk 4.1.0) # appear to depend on it. diff --git a/bin/sh/tests/builtins/break5.4 b/bin/sh/tests/builtins/break5.4 index 7df8e186311c..161c376823bb 100644 --- a/bin/sh/tests/builtins/break5.4 +++ b/bin/sh/tests/builtins/break5.4 @@ -1,4 +1,3 @@ -# $FreeBSD$ # Although this is not specified by POSIX, some configure scripts (gawk 4.1.0) # appear to depend on it. diff --git a/bin/sh/tests/builtins/break6.0 b/bin/sh/tests/builtins/break6.0 index 09fc0d85eaa3..6d8a0f2b3f97 100644 --- a/bin/sh/tests/builtins/break6.0 +++ b/bin/sh/tests/builtins/break6.0 @@ -1,4 +1,3 @@ -# $FreeBSD$ # Per POSIX, this need only work if LONG_MAX > 4294967295. while :; do diff --git a/bin/sh/tests/builtins/builtin1.0 b/bin/sh/tests/builtins/builtin1.0 index b6083858f671..e52abf27c78a 100644 --- a/bin/sh/tests/builtins/builtin1.0 +++ b/bin/sh/tests/builtins/builtin1.0 @@ -1,4 +1,3 @@ -# $FreeBSD$ failures=0 diff --git a/bin/sh/tests/builtins/case1.0 b/bin/sh/tests/builtins/case1.0 index 860fc67dacda..3a89fd2c3729 100644 --- a/bin/sh/tests/builtins/case1.0 +++ b/bin/sh/tests/builtins/case1.0 @@ -1,4 +1,3 @@ -#$FreeBSD$ f() { false diff --git a/bin/sh/tests/builtins/case10.0 b/bin/sh/tests/builtins/case10.0 index a627b5cd996f..a0f2a988294e 100644 --- a/bin/sh/tests/builtins/case10.0 +++ b/bin/sh/tests/builtins/case10.0 @@ -1,4 +1,3 @@ -# $FreeBSD$ case ! in [\!!]) ;; diff --git a/bin/sh/tests/builtins/case11.0 b/bin/sh/tests/builtins/case11.0 index 0e66e11f0dee..50acd5db8e5b 100644 --- a/bin/sh/tests/builtins/case11.0 +++ b/bin/sh/tests/builtins/case11.0 @@ -1,4 +1,3 @@ -# $FreeBSD$ false case x in diff --git a/bin/sh/tests/builtins/case12.0 b/bin/sh/tests/builtins/case12.0 index 2a442ba7993a..9a4975b819c3 100644 --- a/bin/sh/tests/builtins/case12.0 +++ b/bin/sh/tests/builtins/case12.0 @@ -1,4 +1,3 @@ -# $FreeBSD$ false case x in diff --git a/bin/sh/tests/builtins/case13.0 b/bin/sh/tests/builtins/case13.0 index 78f4e9bdffde..83a26869da87 100644 --- a/bin/sh/tests/builtins/case13.0 +++ b/bin/sh/tests/builtins/case13.0 @@ -1,4 +1,3 @@ -# $FreeBSD$ case ^ in [\^^]) ;; diff --git a/bin/sh/tests/builtins/case14.0 b/bin/sh/tests/builtins/case14.0 index 0338e8a224e3..b3cf26c922a2 100644 --- a/bin/sh/tests/builtins/case14.0 +++ b/bin/sh/tests/builtins/case14.0 @@ -1,4 +1,3 @@ -# $FreeBSD$ case `false` in no) exit 3 ;; diff --git a/bin/sh/tests/builtins/case15.0 b/bin/sh/tests/builtins/case15.0 index 09b0e1133544..e0b2d70e5832 100644 --- a/bin/sh/tests/builtins/case15.0 +++ b/bin/sh/tests/builtins/case15.0 @@ -1,4 +1,3 @@ -# $FreeBSD$ case x in `false`) exit 3 ;; diff --git a/bin/sh/tests/builtins/case16.0 b/bin/sh/tests/builtins/case16.0 index 24303027ba91..e1ec8f1c9272 100644 --- a/bin/sh/tests/builtins/case16.0 +++ b/bin/sh/tests/builtins/case16.0 @@ -1,4 +1,3 @@ -# $FreeBSD$ f() { return 42; } f diff --git a/bin/sh/tests/builtins/case17.0 b/bin/sh/tests/builtins/case17.0 index ed1d25f0277a..42ff0ee4a90f 100644 --- a/bin/sh/tests/builtins/case17.0 +++ b/bin/sh/tests/builtins/case17.0 @@ -1,3 +1,2 @@ -# $FreeBSD$ ! case x in x) false ;& y) esac diff --git a/bin/sh/tests/builtins/case18.0 b/bin/sh/tests/builtins/case18.0 index 470253f622ea..76f4d6743503 100644 --- a/bin/sh/tests/builtins/case18.0 +++ b/bin/sh/tests/builtins/case18.0 @@ -1,4 +1,3 @@ -# $FreeBSD$ case x$(false) in x) ;& diff --git a/bin/sh/tests/builtins/case19.0 b/bin/sh/tests/builtins/case19.0 index 215066ad6321..2e8a2ec77f53 100644 --- a/bin/sh/tests/builtins/case19.0 +++ b/bin/sh/tests/builtins/case19.0 @@ -1,4 +1,3 @@ -# $FreeBSD$ [ "`case x in x) false ;& diff --git a/bin/sh/tests/builtins/case2.0 b/bin/sh/tests/builtins/case2.0 index e319148cdf5d..37d5f8c28503 100644 --- a/bin/sh/tests/builtins/case2.0 +++ b/bin/sh/tests/builtins/case2.0 @@ -1,5 +1,4 @@ # Generated by ./test-fnmatch -s 1, do not edit. -# $FreeBSD$ failures= failed() { printf '%s\n' "Failed: $1 '$2' '$3'"; failures=x$failures; } testmatch() { eval "case \$2 in ''$1) ;; *) failed testmatch \"\$@\";; esac"; } diff --git a/bin/sh/tests/builtins/case20.0 b/bin/sh/tests/builtins/case20.0 index 03a4eb2c9a23..800afa0db9fd 100644 --- a/bin/sh/tests/builtins/case20.0 +++ b/bin/sh/tests/builtins/case20.0 @@ -1,4 +1,3 @@ -# $FreeBSD$ # Shells do not agree about what this pattern should match, but it is # certain that it must not crash and the missing close bracket must not diff --git a/bin/sh/tests/builtins/case21.0 b/bin/sh/tests/builtins/case21.0 index ea7fb054a546..426ce8b4b08c 100644 --- a/bin/sh/tests/builtins/case21.0 +++ b/bin/sh/tests/builtins/case21.0 @@ -1,4 +1,3 @@ -# $FreeBSD$ case 5 in [0$((-9))]) ;; diff --git a/bin/sh/tests/builtins/case22.0 b/bin/sh/tests/builtins/case22.0 index ddc80051fa0a..5c36c483da44 100644 --- a/bin/sh/tests/builtins/case22.0 +++ b/bin/sh/tests/builtins/case22.0 @@ -1,4 +1,3 @@ -# $FreeBSD$ case 5 in [0"$((-9))"]) echo bad1 ;; diff --git a/bin/sh/tests/builtins/case23.0 b/bin/sh/tests/builtins/case23.0 index ce03cf96d62e..27fc79a65a68 100644 --- a/bin/sh/tests/builtins/case23.0 +++ b/bin/sh/tests/builtins/case23.0 @@ -1,4 +1,3 @@ -# $FreeBSD$ case [ in [[:alpha:]]) echo bad diff --git a/bin/sh/tests/builtins/case3.0 b/bin/sh/tests/builtins/case3.0 index 42e53d62a3cb..06080f9ec3dc 100644 --- a/bin/sh/tests/builtins/case3.0 +++ b/bin/sh/tests/builtins/case3.0 @@ -1,5 +1,4 @@ # Generated by ./test-fnmatch -s 2, do not edit. -# $FreeBSD$ failures= failed() { printf '%s\n' "Failed: $1 '$2' '$3'"; failures=x$failures; } # We do not treat a backslash specially in this case, diff --git a/bin/sh/tests/builtins/case4.0 b/bin/sh/tests/builtins/case4.0 index 18219f51ee09..abac705a8491 100644 --- a/bin/sh/tests/builtins/case4.0 +++ b/bin/sh/tests/builtins/case4.0 @@ -1,4 +1,3 @@ -# $FreeBSD$ set -- "*" case x in diff --git a/bin/sh/tests/builtins/case5.0 b/bin/sh/tests/builtins/case5.0 index 8c6db5ab8e57..118e001b8aa7 100644 --- a/bin/sh/tests/builtins/case5.0 +++ b/bin/sh/tests/builtins/case5.0 @@ -1,4 +1,3 @@ -# $FreeBSD$ unset LC_ALL LC_CTYPE=en_US.UTF-8 diff --git a/bin/sh/tests/builtins/case6.0 b/bin/sh/tests/builtins/case6.0 index 8d791831c3d8..2ea777aa7ea8 100644 --- a/bin/sh/tests/builtins/case6.0 +++ b/bin/sh/tests/builtins/case6.0 @@ -1,4 +1,3 @@ -# $FreeBSD$ unset LC_ALL LC_CTYPE=de_DE.ISO8859-1 diff --git a/bin/sh/tests/builtins/case7.0 b/bin/sh/tests/builtins/case7.0 index 96b9de66fe27..6c8e632fbda9 100644 --- a/bin/sh/tests/builtins/case7.0 +++ b/bin/sh/tests/builtins/case7.0 @@ -1,4 +1,3 @@ -# $FreeBSD$ # Character ranges in a locale other than the POSIX locale, not specified # by POSIX. diff --git a/bin/sh/tests/builtins/case8.0 b/bin/sh/tests/builtins/case8.0 index 8d9f8b604d88..01b5fdf35a7b 100644 --- a/bin/sh/tests/builtins/case8.0 +++ b/bin/sh/tests/builtins/case8.0 @@ -1,4 +1,3 @@ -# $FreeBSD$ case aZ_ in [[:alpha:]_][[:upper:]_][[:alpha:]_]) ;; diff --git a/bin/sh/tests/builtins/case9.0 b/bin/sh/tests/builtins/case9.0 index 476caec261ba..7719ba195126 100644 --- a/bin/sh/tests/builtins/case9.0 +++ b/bin/sh/tests/builtins/case9.0 @@ -1,4 +1,3 @@ -# $FreeBSD$ errors=0 diff --git a/bin/sh/tests/builtins/cd1.0 b/bin/sh/tests/builtins/cd1.0 index bc5108e6be3b..52d165df5ae2 100644 --- a/bin/sh/tests/builtins/cd1.0 +++ b/bin/sh/tests/builtins/cd1.0 @@ -1,4 +1,3 @@ -# $FreeBSD$ set -e P=${TMPDIR:-/tmp} diff --git a/bin/sh/tests/builtins/cd10.0 b/bin/sh/tests/builtins/cd10.0 index f4b5e0ffca5c..07396e8e0411 100644 --- a/bin/sh/tests/builtins/cd10.0 +++ b/bin/sh/tests/builtins/cd10.0 @@ -1,6 +1,5 @@ -# $FreeBSD$ # Precondition (cd /bin) || exit # Verify write error is ignored. -$SH +m -ic 'CDPATH=/:; cd bin 1</dev/null' +ENV= $SH +m -ic 'CDPATH=/:; cd bin 1</dev/null' diff --git a/bin/sh/tests/builtins/cd11.0 b/bin/sh/tests/builtins/cd11.0 index 53e63f736f30..04e3469f8f3e 100644 --- a/bin/sh/tests/builtins/cd11.0 +++ b/bin/sh/tests/builtins/cd11.0 @@ -1,4 +1,3 @@ -# $FreeBSD$ set -e T=$(mktemp -d "${TMPDIR:-/tmp}/sh-test.XXXXXX") diff --git a/bin/sh/tests/builtins/cd2.0 b/bin/sh/tests/builtins/cd2.0 index f2b6416a12ec..eea39115c3de 100644 --- a/bin/sh/tests/builtins/cd2.0 +++ b/bin/sh/tests/builtins/cd2.0 @@ -1,4 +1,3 @@ -# $FreeBSD$ set -e L=$(getconf PATH_MAX / 2>/dev/null) || L=4096 diff --git a/bin/sh/tests/builtins/cd3.0 b/bin/sh/tests/builtins/cd3.0 index 7729c54a6895..d7211f5c5084 100644 --- a/bin/sh/tests/builtins/cd3.0 +++ b/bin/sh/tests/builtins/cd3.0 @@ -1,4 +1,3 @@ -# $FreeBSD$ # If fully successful, cd -Pe must be like cd -P. diff --git a/bin/sh/tests/builtins/cd4.0 b/bin/sh/tests/builtins/cd4.0 index df3a9a48961c..33cf73632247 100644 --- a/bin/sh/tests/builtins/cd4.0 +++ b/bin/sh/tests/builtins/cd4.0 @@ -1,4 +1,3 @@ -# $FreeBSD$ # This test assumes that whatever mechanism cd -P uses to determine the # pathname to the current directory if it is longer than PATH_MAX requires diff --git a/bin/sh/tests/builtins/cd5.0 b/bin/sh/tests/builtins/cd5.0 index 3dff604583c9..ecb0d55a850b 100644 --- a/bin/sh/tests/builtins/cd5.0 +++ b/bin/sh/tests/builtins/cd5.0 @@ -1,4 +1,3 @@ -# $FreeBSD$ set -e T=$(mktemp -d "${TMPDIR:-/tmp}/sh-test.XXXXXX") diff --git a/bin/sh/tests/builtins/cd6.0 b/bin/sh/tests/builtins/cd6.0 index 083a06190e64..27f14172be65 100644 --- a/bin/sh/tests/builtins/cd6.0 +++ b/bin/sh/tests/builtins/cd6.0 @@ -1,4 +1,3 @@ -# $FreeBSD$ set -e cd -P /bin diff --git a/bin/sh/tests/builtins/cd7.0 b/bin/sh/tests/builtins/cd7.0 index 9adda86c1aed..5b656f422f02 100644 --- a/bin/sh/tests/builtins/cd7.0 +++ b/bin/sh/tests/builtins/cd7.0 @@ -1,4 +1,3 @@ -# $FreeBSD$ set -e cd /usr/bin diff --git a/bin/sh/tests/builtins/cd8.0 b/bin/sh/tests/builtins/cd8.0 index a68f77f26f75..3aff675d8dce 100644 --- a/bin/sh/tests/builtins/cd8.0 +++ b/bin/sh/tests/builtins/cd8.0 @@ -1,4 +1,3 @@ -# $FreeBSD$ # The exact wording of the error message is not standardized, but giving # a description of the errno is useful. diff --git a/bin/sh/tests/builtins/cd9.0 b/bin/sh/tests/builtins/cd9.0 index 78bcdff9a933..811d75fff03d 100644 --- a/bin/sh/tests/builtins/cd9.0 +++ b/bin/sh/tests/builtins/cd9.0 @@ -1,4 +1,3 @@ -# $FreeBSD$ cd /dev cd /bin diff --git a/bin/sh/tests/builtins/command1.0 b/bin/sh/tests/builtins/command1.0 index fd0afdfa0300..2f2b36bb6d2a 100644 --- a/bin/sh/tests/builtins/command1.0 +++ b/bin/sh/tests/builtins/command1.0 @@ -1,4 +1,3 @@ -# $FreeBSD$ true() { false } diff --git a/bin/sh/tests/builtins/command10.0 b/bin/sh/tests/builtins/command10.0 index 2c1adf1eb0bd..add9e8372b0e 100644 --- a/bin/sh/tests/builtins/command10.0 +++ b/bin/sh/tests/builtins/command10.0 @@ -1,4 +1,3 @@ -# $FreeBSD$ failures=0 diff --git a/bin/sh/tests/builtins/command11.0 b/bin/sh/tests/builtins/command11.0 index 10c86479d81b..9dc793d2f4f3 100644 --- a/bin/sh/tests/builtins/command11.0 +++ b/bin/sh/tests/builtins/command11.0 @@ -1,4 +1,3 @@ -# $FreeBSD$ failures=0 diff --git a/bin/sh/tests/builtins/command12.0 b/bin/sh/tests/builtins/command12.0 index f981db324946..a602a48cfcca 100644 --- a/bin/sh/tests/builtins/command12.0 +++ b/bin/sh/tests/builtins/command12.0 @@ -1,4 +1,3 @@ -# $FreeBSD$ alias aa=echo\ \'\"\' cmd=$(command -v aa) diff --git a/bin/sh/tests/builtins/command13.0 b/bin/sh/tests/builtins/command13.0 index 7c011c938a47..668664780ad0 100644 --- a/bin/sh/tests/builtins/command13.0 +++ b/bin/sh/tests/builtins/command13.0 @@ -1,4 +1,3 @@ -# $FreeBSD$ failures=0 diff --git a/bin/sh/tests/builtins/command14.0 b/bin/sh/tests/builtins/command14.0 index 5f6f4447ef61..6e4f0fd5822d 100644 --- a/bin/sh/tests/builtins/command14.0 +++ b/bin/sh/tests/builtins/command14.0 @@ -1,4 +1,3 @@ -# $FreeBSD$ r=`cd /bin && PATH=. command -V ls` case $r in diff --git a/bin/sh/tests/builtins/command2.0 b/bin/sh/tests/builtins/command2.0 index ff7b5f2c8dc8..0f6c76bf895f 100644 --- a/bin/sh/tests/builtins/command2.0 +++ b/bin/sh/tests/builtins/command2.0 @@ -1,3 +1,2 @@ -# $FreeBSD$ PATH= command -p cat < /dev/null diff --git a/bin/sh/tests/builtins/command3.0 b/bin/sh/tests/builtins/command3.0 index 9d4ae89e0e2e..d9e85caff744 100644 --- a/bin/sh/tests/builtins/command3.0 +++ b/bin/sh/tests/builtins/command3.0 @@ -1,4 +1,3 @@ -# $FreeBSD$ command -v ls command -v true command -v /bin/ls diff --git a/bin/sh/tests/builtins/command4.0 b/bin/sh/tests/builtins/command4.0 index 3e496137ff58..b2b0146fb56a 100644 --- a/bin/sh/tests/builtins/command4.0 +++ b/bin/sh/tests/builtins/command4.0 @@ -1,2 +1 @@ -# $FreeBSD$ ! command -v nonexisting diff --git a/bin/sh/tests/builtins/command5.0 b/bin/sh/tests/builtins/command5.0 index 13b3fe1fe3f4..050b44913f2d 100644 --- a/bin/sh/tests/builtins/command5.0 +++ b/bin/sh/tests/builtins/command5.0 @@ -1,4 +1,3 @@ -# $FreeBSD$ command -V ls command -V true command -V /bin/ls diff --git a/bin/sh/tests/builtins/command6.0 b/bin/sh/tests/builtins/command6.0 index 5b63bfecc0f0..56d65a095ab4 100644 --- a/bin/sh/tests/builtins/command6.0 +++ b/bin/sh/tests/builtins/command6.0 @@ -1,4 +1,3 @@ -# $FreeBSD$ PATH=/var/empty case $(command -pV ls) in */var/empty/ls*) diff --git a/bin/sh/tests/builtins/command7.0 b/bin/sh/tests/builtins/command7.0 index fc652f207584..f45809ddc86b 100644 --- a/bin/sh/tests/builtins/command7.0 +++ b/bin/sh/tests/builtins/command7.0 @@ -1,4 +1,3 @@ -# $FreeBSD$ failures=0 diff --git a/bin/sh/tests/builtins/command8.0 b/bin/sh/tests/builtins/command8.0 index 9e3a2b645fbb..df50cb4f973b 100644 --- a/bin/sh/tests/builtins/command8.0 +++ b/bin/sh/tests/builtins/command8.0 @@ -1,4 +1,3 @@ -# $FreeBSD$ IFS=, SPECIAL="break,\ diff --git a/bin/sh/tests/builtins/command9.0 b/bin/sh/tests/builtins/command9.0 index 212e52aafc98..3dbc1e0a433b 100644 --- a/bin/sh/tests/builtins/command9.0 +++ b/bin/sh/tests/builtins/command9.0 @@ -1,4 +1,3 @@ -# $FreeBSD$ failures=0 diff --git a/bin/sh/tests/builtins/dot1.0 b/bin/sh/tests/builtins/dot1.0 index 43eab0ddeb33..0ecfb7ef4886 100644 --- a/bin/sh/tests/builtins/dot1.0 +++ b/bin/sh/tests/builtins/dot1.0 @@ -1,4 +1,3 @@ -# $FreeBSD$ failures= failure() { diff --git a/bin/sh/tests/builtins/dot2.0 b/bin/sh/tests/builtins/dot2.0 index ed6379b993c3..497e2139513a 100644 --- a/bin/sh/tests/builtins/dot2.0 +++ b/bin/sh/tests/builtins/dot2.0 @@ -1,4 +1,3 @@ -# $FreeBSD$ failures= failure() { diff --git a/bin/sh/tests/builtins/dot3.0 b/bin/sh/tests/builtins/dot3.0 index b337f0f6d338..9017a52d816b 100644 --- a/bin/sh/tests/builtins/dot3.0 +++ b/bin/sh/tests/builtins/dot3.0 @@ -1,4 +1,3 @@ -# $FreeBSD$ # . should return 0 if no command was executed. diff --git a/bin/sh/tests/builtins/dot4.0 b/bin/sh/tests/builtins/dot4.0 index b898131c0e1c..c9cf7ec67f6f 100644 --- a/bin/sh/tests/builtins/dot4.0 +++ b/bin/sh/tests/builtins/dot4.0 @@ -1,4 +1,3 @@ -# $FreeBSD$ v=abcd v=$v$v$v$v diff --git a/bin/sh/tests/builtins/echo1.0 b/bin/sh/tests/builtins/echo1.0 index 75ed8fbbc45f..6b9b14da832e 100644 --- a/bin/sh/tests/builtins/echo1.0 +++ b/bin/sh/tests/builtins/echo1.0 @@ -1,4 +1,3 @@ -# $FreeBSD$ # Not specified by POSIX. diff --git a/bin/sh/tests/builtins/echo2.0 b/bin/sh/tests/builtins/echo2.0 index 254b5c4dca4f..9d8d9817e9a8 100644 --- a/bin/sh/tests/builtins/echo2.0 +++ b/bin/sh/tests/builtins/echo2.0 @@ -1,4 +1,3 @@ -# $FreeBSD$ # Not specified by POSIX. diff --git a/bin/sh/tests/builtins/echo3.0 b/bin/sh/tests/builtins/echo3.0 index ff8f6c2f26e4..a56d3da07aad 100644 --- a/bin/sh/tests/builtins/echo3.0 +++ b/bin/sh/tests/builtins/echo3.0 @@ -1,4 +1,3 @@ -# $FreeBSD$ # Not specified by POSIX. diff --git a/bin/sh/tests/builtins/eval1.0 b/bin/sh/tests/builtins/eval1.0 index 04606a4a87fe..9019d3b9bb98 100644 --- a/bin/sh/tests/builtins/eval1.0 +++ b/bin/sh/tests/builtins/eval1.0 @@ -1,4 +1,3 @@ -# $FreeBSD$ set -e eval diff --git a/bin/sh/tests/builtins/eval2.0 b/bin/sh/tests/builtins/eval2.0 index bf06b6e14e0c..b762ac2eea76 100644 --- a/bin/sh/tests/builtins/eval2.0 +++ b/bin/sh/tests/builtins/eval2.0 @@ -1,4 +1,3 @@ -# $FreeBSD$ eval ' false diff --git a/bin/sh/tests/builtins/eval3.0 b/bin/sh/tests/builtins/eval3.0 index dfb8357c727c..12f36dc00dfd 100644 --- a/bin/sh/tests/builtins/eval3.0 +++ b/bin/sh/tests/builtins/eval3.0 @@ -1,4 +1,3 @@ -# $FreeBSD$ eval 'false;' && exit 1 eval 'true;' || exit 1 diff --git a/bin/sh/tests/builtins/eval4.0 b/bin/sh/tests/builtins/eval4.0 index 67da2f5c832d..3eb4e3679fe7 100644 --- a/bin/sh/tests/builtins/eval4.0 +++ b/bin/sh/tests/builtins/eval4.0 @@ -1,4 +1,3 @@ -# $FreeBSD$ # eval should preserve $? from command substitutions when starting # the parsed command. diff --git a/bin/sh/tests/builtins/eval5.0 b/bin/sh/tests/builtins/eval5.0 index 3e86de92fbae..44d125408deb 100644 --- a/bin/sh/tests/builtins/eval5.0 +++ b/bin/sh/tests/builtins/eval5.0 @@ -1,4 +1,3 @@ -# $FreeBSD$ # eval should return 0 if no command was executed. eval $(false) diff --git a/bin/sh/tests/builtins/eval6.0 b/bin/sh/tests/builtins/eval6.0 index 6752bb65ad4d..84584f1c1bf3 100644 --- a/bin/sh/tests/builtins/eval6.0 +++ b/bin/sh/tests/builtins/eval6.0 @@ -1,4 +1,3 @@ -# $FreeBSD$ # eval should preserve $? from command substitutions when starting # the parsed command. diff --git a/bin/sh/tests/builtins/eval7.0 b/bin/sh/tests/builtins/eval7.0 index a309c917b102..238353fb5c5d 100644 --- a/bin/sh/tests/builtins/eval7.0 +++ b/bin/sh/tests/builtins/eval7.0 @@ -1,4 +1,3 @@ -# $FreeBSD$ # Assumes that break can break out of a loop outside eval. while :; do diff --git a/bin/sh/tests/builtins/eval8.7 b/bin/sh/tests/builtins/eval8.7 index af6064c388df..671fcb5cb190 100644 --- a/bin/sh/tests/builtins/eval8.7 +++ b/bin/sh/tests/builtins/eval8.7 @@ -1,4 +1,3 @@ -# $FreeBSD$ f() { eval "return 7 diff --git a/bin/sh/tests/builtins/exec1.0 b/bin/sh/tests/builtins/exec1.0 index dd30a4c9aa93..a3d993a739eb 100644 --- a/bin/sh/tests/builtins/exec1.0 +++ b/bin/sh/tests/builtins/exec1.0 @@ -1,4 +1,3 @@ -# $FreeBSD$ failures= failure() { diff --git a/bin/sh/tests/builtins/exec2.0 b/bin/sh/tests/builtins/exec2.0 index 3dcb6c41156a..9ed1013acd92 100644 --- a/bin/sh/tests/builtins/exec2.0 +++ b/bin/sh/tests/builtins/exec2.0 @@ -1,4 +1,3 @@ -# $FreeBSD$ failures= failure() { diff --git a/bin/sh/tests/builtins/exit1.0 b/bin/sh/tests/builtins/exit1.0 index 496d448761cc..fb6486cebeac 100644 --- a/bin/sh/tests/builtins/exit1.0 +++ b/bin/sh/tests/builtins/exit1.0 @@ -1,4 +1,3 @@ -# $FreeBSD$ # exit with an argument should overwrite the exit status in an EXIT trap. diff --git a/bin/sh/tests/builtins/exit2.8 b/bin/sh/tests/builtins/exit2.8 index 124c32e01a3c..327b620c3fa6 100644 --- a/bin/sh/tests/builtins/exit2.8 +++ b/bin/sh/tests/builtins/exit2.8 @@ -1,4 +1,3 @@ -# $FreeBSD$ # exit without arguments is the same as exit $? outside a trap. diff --git a/bin/sh/tests/builtins/exit3.0 b/bin/sh/tests/builtins/exit3.0 index 80655ac539c5..996074c10182 100644 --- a/bin/sh/tests/builtins/exit3.0 +++ b/bin/sh/tests/builtins/exit3.0 @@ -1,4 +1,3 @@ -# $FreeBSD$ # exit without arguments differs from exit $? in an EXIT trap. diff --git a/bin/sh/tests/builtins/export1.0 b/bin/sh/tests/builtins/export1.0 index 7b08c9de4349..e2802c4f8e89 100644 --- a/bin/sh/tests/builtins/export1.0 +++ b/bin/sh/tests/builtins/export1.0 @@ -1,3 +1,2 @@ -# $FreeBSD$ env @badness=1 ${SH} -c 'v=`export -p`; eval "$v"' diff --git a/bin/sh/tests/builtins/fc1.0 b/bin/sh/tests/builtins/fc1.0 index ab7a387b5077..c84fb0549012 100644 --- a/bin/sh/tests/builtins/fc1.0 +++ b/bin/sh/tests/builtins/fc1.0 @@ -1,4 +1,3 @@ -# $FreeBSD$ set -e trap 'echo Broken pipe -- test failed' PIPE @@ -8,7 +7,7 @@ T=$(mktemp -d sh-test.XXXXXX) cd $T mkfifo input output error -HISTFILE=/dev/null ${SH} +m -i <input >output 2>error & +ENV= HISTFILE=/dev/null ${SH} +m -i <input >output 2>error & { # Syntax error echo ')' >&3 diff --git a/bin/sh/tests/builtins/fc2.0 b/bin/sh/tests/builtins/fc2.0 index 7eb92acc2cdf..53c0f786cda2 100644 --- a/bin/sh/tests/builtins/fc2.0 +++ b/bin/sh/tests/builtins/fc2.0 @@ -1,4 +1,3 @@ -# $FreeBSD$ set -e trap 'echo Broken pipe -- test failed' PIPE diff --git a/bin/sh/tests/builtins/fc3.0 b/bin/sh/tests/builtins/fc3.0 new file mode 100644 index 000000000000..daa615bcc3ca --- /dev/null +++ b/bin/sh/tests/builtins/fc3.0 @@ -0,0 +1,9 @@ +export PS1='_ ' # cannot predict whether ran by root or not + +echo ': command1 +: command2 +: command3 +: command4 +fc -l -n -1 +fc -ln 2 3 +' | ENV= HISTFILE=/dev/null ${SH} +m -i diff --git a/bin/sh/tests/builtins/fc3.0.stderr b/bin/sh/tests/builtins/fc3.0.stderr new file mode 100644 index 000000000000..e05147fb8209 --- /dev/null +++ b/bin/sh/tests/builtins/fc3.0.stderr @@ -0,0 +1 @@ +_ _ _ _ _ _ _ _ diff --git a/bin/sh/tests/builtins/fc3.0.stdout b/bin/sh/tests/builtins/fc3.0.stdout new file mode 100644 index 000000000000..8c23c913635d --- /dev/null +++ b/bin/sh/tests/builtins/fc3.0.stdout @@ -0,0 +1,3 @@ +: command4 +: command2 +: command3 diff --git a/bin/sh/tests/builtins/for1.0 b/bin/sh/tests/builtins/for1.0 index cd55e2ca029e..f1a64f412bc4 100644 --- a/bin/sh/tests/builtins/for1.0 +++ b/bin/sh/tests/builtins/for1.0 @@ -1,4 +1,3 @@ -# $FreeBSD$ false for i in `false`; do exit 3; done diff --git a/bin/sh/tests/builtins/for2.0 b/bin/sh/tests/builtins/for2.0 index 48c22ce71119..0ed4e1158eaa 100644 --- a/bin/sh/tests/builtins/for2.0 +++ b/bin/sh/tests/builtins/for2.0 @@ -1,4 +1,3 @@ -# $FreeBSD$ r=x f() { return 42; } diff --git a/bin/sh/tests/builtins/for3.0 b/bin/sh/tests/builtins/for3.0 index cc37238abbc6..010606b16c75 100644 --- a/bin/sh/tests/builtins/for3.0 +++ b/bin/sh/tests/builtins/for3.0 @@ -1,4 +1,3 @@ -# $FreeBSD$ r=x f() { return 42; } diff --git a/bin/sh/tests/builtins/getopts1.0 b/bin/sh/tests/builtins/getopts1.0 index 10d2b59208e5..928f472900e6 100644 --- a/bin/sh/tests/builtins/getopts1.0 +++ b/bin/sh/tests/builtins/getopts1.0 @@ -1,4 +1,3 @@ -# $FreeBSD$ printf -- '-1-\n' set -- -abc diff --git a/bin/sh/tests/builtins/getopts10.0 b/bin/sh/tests/builtins/getopts10.0 index a88e6ca3e85e..5182da24a0b0 100644 --- a/bin/sh/tests/builtins/getopts10.0 +++ b/bin/sh/tests/builtins/getopts10.0 @@ -1,4 +1,3 @@ -# $FreeBSD$ set -- -x arg opt=not diff --git a/bin/sh/tests/builtins/getopts2.0 b/bin/sh/tests/builtins/getopts2.0 index 1bd2c32db81c..b12813e6247d 100644 --- a/bin/sh/tests/builtins/getopts2.0 +++ b/bin/sh/tests/builtins/getopts2.0 @@ -1,4 +1,3 @@ -# $FreeBSD$ set - -ax getopts ax option set -C diff --git a/bin/sh/tests/builtins/getopts3.0 b/bin/sh/tests/builtins/getopts3.0 index d02469b20469..c52e60ada860 100644 --- a/bin/sh/tests/builtins/getopts3.0 +++ b/bin/sh/tests/builtins/getopts3.0 @@ -1,4 +1,3 @@ -# $FreeBSD$ shift $# getopts x opt diff --git a/bin/sh/tests/builtins/getopts4.0 b/bin/sh/tests/builtins/getopts4.0 index 61d5c2b6b15c..f4df551cb571 100644 --- a/bin/sh/tests/builtins/getopts4.0 +++ b/bin/sh/tests/builtins/getopts4.0 @@ -1,4 +1,3 @@ -# $FreeBSD$ set -- -x opt=not diff --git a/bin/sh/tests/builtins/getopts5.0 b/bin/sh/tests/builtins/getopts5.0 index 666ee7652de5..d037b9705882 100644 --- a/bin/sh/tests/builtins/getopts5.0 +++ b/bin/sh/tests/builtins/getopts5.0 @@ -1,4 +1,3 @@ -# $FreeBSD$ set -- -x arg opt=not diff --git a/bin/sh/tests/builtins/getopts6.0 b/bin/sh/tests/builtins/getopts6.0 index 1d3c39ba953e..5cf2bc462915 100644 --- a/bin/sh/tests/builtins/getopts6.0 +++ b/bin/sh/tests/builtins/getopts6.0 @@ -1,4 +1,3 @@ -# $FreeBSD$ set -- -x -y getopts :x var || echo "First getopts bad: $?" diff --git a/bin/sh/tests/builtins/getopts7.0 b/bin/sh/tests/builtins/getopts7.0 index 3745555f8c1a..5dd5ed593c27 100644 --- a/bin/sh/tests/builtins/getopts7.0 +++ b/bin/sh/tests/builtins/getopts7.0 @@ -1,4 +1,3 @@ -# $FreeBSD$ set -- -x getopts :x: var diff --git a/bin/sh/tests/builtins/getopts8.0 b/bin/sh/tests/builtins/getopts8.0 index da4af6bd0b56..30b36630c7b0 100644 --- a/bin/sh/tests/builtins/getopts8.0 +++ b/bin/sh/tests/builtins/getopts8.0 @@ -1,4 +1,3 @@ -# $FreeBSD$ set -- -yz -wx opt=wrong1 OPTARG=wrong2 diff --git a/bin/sh/tests/builtins/getopts9.0 b/bin/sh/tests/builtins/getopts9.0 index 1c35fc68c2d1..5e91f92614dd 100644 --- a/bin/sh/tests/builtins/getopts9.0 +++ b/bin/sh/tests/builtins/getopts9.0 @@ -1,4 +1,3 @@ -# $FreeBSD$ args='-ab' getopts ab opt $args diff --git a/bin/sh/tests/builtins/hash1.0 b/bin/sh/tests/builtins/hash1.0 index 45cc3003fb59..750fd40cafe5 100644 --- a/bin/sh/tests/builtins/hash1.0 +++ b/bin/sh/tests/builtins/hash1.0 @@ -1,4 +1,3 @@ -# $FreeBSD$ cat /dev/null hash hash -r diff --git a/bin/sh/tests/builtins/hash2.0 b/bin/sh/tests/builtins/hash2.0 index e5cd21bc57dd..ec072b93a1a2 100644 --- a/bin/sh/tests/builtins/hash2.0 +++ b/bin/sh/tests/builtins/hash2.0 @@ -1,4 +1,3 @@ -# $FreeBSD$ hash hash cat hash diff --git a/bin/sh/tests/builtins/hash3.0 b/bin/sh/tests/builtins/hash3.0 index eade0b319546..3ef33dc4bb3a 100644 --- a/bin/sh/tests/builtins/hash3.0 +++ b/bin/sh/tests/builtins/hash3.0 @@ -1,3 +1,2 @@ -# $FreeBSD$ hash -v cat hash diff --git a/bin/sh/tests/builtins/hash4.0 b/bin/sh/tests/builtins/hash4.0 index dec584c4538f..3e99930bad47 100644 --- a/bin/sh/tests/builtins/hash4.0 +++ b/bin/sh/tests/builtins/hash4.0 @@ -1,4 +1,3 @@ -# $FreeBSD$ exec 3>&1 m=`hash nosuchtool 2>&1 >&3` diff --git a/bin/sh/tests/builtins/jobid1.0 b/bin/sh/tests/builtins/jobid1.0 index 483fda20743c..093b2c210778 100644 --- a/bin/sh/tests/builtins/jobid1.0 +++ b/bin/sh/tests/builtins/jobid1.0 @@ -1,4 +1,3 @@ -# $FreeBSD$ # Non-standard builtin. : & diff --git a/bin/sh/tests/builtins/jobid2.0 b/bin/sh/tests/builtins/jobid2.0 index 101831a2e4b8..bf3de17d01cf 100644 --- a/bin/sh/tests/builtins/jobid2.0 +++ b/bin/sh/tests/builtins/jobid2.0 @@ -1,4 +1,3 @@ -# $FreeBSD$ : & p1=$(jobid) diff --git a/bin/sh/tests/builtins/kill1.0 b/bin/sh/tests/builtins/kill1.0 index c1b85503848e..85b8b579b3ad 100644 --- a/bin/sh/tests/builtins/kill1.0 +++ b/bin/sh/tests/builtins/kill1.0 @@ -1,4 +1,3 @@ -# $FreeBSD$ : & p1=$! diff --git a/bin/sh/tests/builtins/kill2.0 b/bin/sh/tests/builtins/kill2.0 index 31e0ba362b80..13d2a4a896c1 100644 --- a/bin/sh/tests/builtins/kill2.0 +++ b/bin/sh/tests/builtins/kill2.0 @@ -1,4 +1,3 @@ -# $FreeBSD$ sleep 1 | sleep 1 & kill %+ diff --git a/bin/sh/tests/builtins/lineno.0 b/bin/sh/tests/builtins/lineno.0 index c9311f82d253..d314eef0f85c 100644 --- a/bin/sh/tests/builtins/lineno.0 +++ b/bin/sh/tests/builtins/lineno.0 @@ -1,4 +1,3 @@ -# $FreeBSD$ echo $LINENO echo $LINENO diff --git a/bin/sh/tests/builtins/lineno.0.stdout b/bin/sh/tests/builtins/lineno.0.stdout index 82583a93c82e..ab5ad9cbef51 100644 --- a/bin/sh/tests/builtins/lineno.0.stdout +++ b/bin/sh/tests/builtins/lineno.0.stdout @@ -1,9 +1,9 @@ +1 2 -3 2 3 +11 12 -13 foo foo 2 diff --git a/bin/sh/tests/builtins/lineno2.0 b/bin/sh/tests/builtins/lineno2.0 index ddbd10433a36..db2a6c8c7b4f 100644 --- a/bin/sh/tests/builtins/lineno2.0 +++ b/bin/sh/tests/builtins/lineno2.0 @@ -1,4 +1,3 @@ -# $FreeBSD$ f() { : ${LINENO+${x?}} diff --git a/bin/sh/tests/builtins/lineno3.0 b/bin/sh/tests/builtins/lineno3.0 index eb8f9ab7db94..66ede861dc75 100644 --- a/bin/sh/tests/builtins/lineno3.0 +++ b/bin/sh/tests/builtins/lineno3.0 @@ -1,4 +1,3 @@ -# $FreeBSD$ echo before: $LINENO dummy=$'a\0 diff --git a/bin/sh/tests/builtins/lineno3.0.stdout b/bin/sh/tests/builtins/lineno3.0.stdout index 6e0e4ac8ca57..f8b44636cb5d 100644 --- a/bin/sh/tests/builtins/lineno3.0.stdout +++ b/bin/sh/tests/builtins/lineno3.0.stdout @@ -1,2 +1,2 @@ -before: 3 -after: 6 +before: 2 +after: 5 diff --git a/bin/sh/tests/builtins/local1.0 b/bin/sh/tests/builtins/local1.0 index b28837ec005f..e5278d492639 100644 --- a/bin/sh/tests/builtins/local1.0 +++ b/bin/sh/tests/builtins/local1.0 @@ -1,4 +1,3 @@ -# $FreeBSD$ # A commonly used but non-POSIX builtin. f() { diff --git a/bin/sh/tests/builtins/local2.0 b/bin/sh/tests/builtins/local2.0 index cc8c10f40618..24cef4c1bc3a 100644 --- a/bin/sh/tests/builtins/local2.0 +++ b/bin/sh/tests/builtins/local2.0 @@ -1,4 +1,3 @@ -# $FreeBSD$ f() { local - diff --git a/bin/sh/tests/builtins/local3.0 b/bin/sh/tests/builtins/local3.0 index 39ee370099e7..e947b7c495f6 100644 --- a/bin/sh/tests/builtins/local3.0 +++ b/bin/sh/tests/builtins/local3.0 @@ -1,4 +1,3 @@ -# $FreeBSD$ f() { local "$@" diff --git a/bin/sh/tests/builtins/local4.0 b/bin/sh/tests/builtins/local4.0 index 3955aaa12f1a..bd5a5765192b 100644 --- a/bin/sh/tests/builtins/local4.0 +++ b/bin/sh/tests/builtins/local4.0 @@ -1,4 +1,3 @@ -# $FreeBSD$ f() { local -- x diff --git a/bin/sh/tests/builtins/local5.0 b/bin/sh/tests/builtins/local5.0 index 2f2a14e110ae..82b4014e8e4b 100644 --- a/bin/sh/tests/builtins/local5.0 +++ b/bin/sh/tests/builtins/local5.0 @@ -1,4 +1,3 @@ -# $FreeBSD$ f() { local PATH IFS elem diff --git a/bin/sh/tests/builtins/local6.0 b/bin/sh/tests/builtins/local6.0 index 017bb1234c8c..f179fe00f95d 100644 --- a/bin/sh/tests/builtins/local6.0 +++ b/bin/sh/tests/builtins/local6.0 @@ -1,4 +1,3 @@ -# $FreeBSD$ f() { local x diff --git a/bin/sh/tests/builtins/local7.0 b/bin/sh/tests/builtins/local7.0 index f7e6fc0aae97..591606d9bd93 100644 --- a/bin/sh/tests/builtins/local7.0 +++ b/bin/sh/tests/builtins/local7.0 @@ -1,4 +1,3 @@ -# $FreeBSD$ f() { local x diff --git a/bin/sh/tests/builtins/locale1.0 b/bin/sh/tests/builtins/locale1.0 index 90b10944c5a5..f81dbac4f342 100644 --- a/bin/sh/tests/builtins/locale1.0 +++ b/bin/sh/tests/builtins/locale1.0 @@ -1,4 +1,3 @@ -# $FreeBSD$ # Note: this test depends on strerror() using locale. failures=0 diff --git a/bin/sh/tests/builtins/locale2.0 b/bin/sh/tests/builtins/locale2.0 index 86dd237ff54a..050d7fc9fbfc 100644 --- a/bin/sh/tests/builtins/locale2.0 +++ b/bin/sh/tests/builtins/locale2.0 @@ -1,4 +1,3 @@ -# $FreeBSD$ $SH -c 'LC_ALL=C true; kill -INT $$; echo continued' r=$? diff --git a/bin/sh/tests/builtins/printf1.0 b/bin/sh/tests/builtins/printf1.0 index 99a82d014794..1dfbf7a9be4a 100644 --- a/bin/sh/tests/builtins/printf1.0 +++ b/bin/sh/tests/builtins/printf1.0 @@ -1,3 +1,2 @@ -# $FreeBSD$ [ "$(printf '%c\0%s%d' x '\' 010 | tr '\0' Z)" = 'xZ\8' ] diff --git a/bin/sh/tests/builtins/printf2.0 b/bin/sh/tests/builtins/printf2.0 index 7763d6fe9636..8376505c9df5 100644 --- a/bin/sh/tests/builtins/printf2.0 +++ b/bin/sh/tests/builtins/printf2.0 @@ -1,3 +1,2 @@ -# $FreeBSD$ [ "$(printf '%cZ%s%d' x '\' 010)" = 'xZ\8' ] diff --git a/bin/sh/tests/builtins/printf3.0 b/bin/sh/tests/builtins/printf3.0 index 0e7ea85cddb4..b431cc6d3d18 100644 --- a/bin/sh/tests/builtins/printf3.0 +++ b/bin/sh/tests/builtins/printf3.0 @@ -1,4 +1,3 @@ -# $FreeBSD$ set -e v=$(! printf "%d" @wrong 2>/dev/null) diff --git a/bin/sh/tests/builtins/printf4.0 b/bin/sh/tests/builtins/printf4.0 index 2dd3e729574a..15d57f782789 100644 --- a/bin/sh/tests/builtins/printf4.0 +++ b/bin/sh/tests/builtins/printf4.0 @@ -1,4 +1,3 @@ -# $FreeBSD$ set -e v=$(! printf "%d" 4wrong 2>/dev/null) diff --git a/bin/sh/tests/builtins/read1.0 b/bin/sh/tests/builtins/read1.0 index 06a68faa32a3..b1617c7f48bf 100644 --- a/bin/sh/tests/builtins/read1.0 +++ b/bin/sh/tests/builtins/read1.0 @@ -1,4 +1,3 @@ -# $FreeBSD$ set -e echo "1 2 3" | { read a; echo "x${a}x"; } diff --git a/bin/sh/tests/builtins/read10.0 b/bin/sh/tests/builtins/read10.0 new file mode 100644 index 000000000000..5fc19896390a --- /dev/null +++ b/bin/sh/tests/builtins/read10.0 @@ -0,0 +1,8 @@ + +set -e + +v=original_value +r=0 +read v < /dev/null || r=$? +[ "$r" -eq 1 ] +[ -z "$v" ] diff --git a/bin/sh/tests/builtins/read11.0 b/bin/sh/tests/builtins/read11.0 new file mode 100644 index 000000000000..c75ed9c92a83 --- /dev/null +++ b/bin/sh/tests/builtins/read11.0 @@ -0,0 +1,17 @@ + +set -e + +T=$(mktemp -d ${TMPDIR:-/tmp}/sh-test.XXXXXX) +trap 'rm -rf "$T"' 0 +cd $T +mkfifo fifo1 +# Open fifo1 for writing and then read block on a dummy fifo +{ mkfifo fifo2; read dummy <fifo2; } >fifo1 & +# Wait for the child to open fifo1 for writing +exec 3<fifo1 +v=original_value +r=0 +read -t 0 v <&3 || r=$? +kill -TERM "$!" || : +{ [ "$r" -gt 128 ] && [ "$(kill -l "$r")" = ALRM ]; } || exit +[ -z "$v" ] diff --git a/bin/sh/tests/builtins/read2.0 b/bin/sh/tests/builtins/read2.0 index fc7451191586..da7c48553ab0 100644 --- a/bin/sh/tests/builtins/read2.0 +++ b/bin/sh/tests/builtins/read2.0 @@ -1,4 +1,3 @@ -# $FreeBSD$ set -e { diff --git a/bin/sh/tests/builtins/read3.0 b/bin/sh/tests/builtins/read3.0 index c6ae9c1023c0..3674ec9f4055 100644 --- a/bin/sh/tests/builtins/read3.0 +++ b/bin/sh/tests/builtins/read3.0 @@ -1,4 +1,3 @@ -# $FreeBSD$ printf '%s\n' 'a\ b c' | { read a b; printf '%s\n' "x${a}x${b}x"; } printf '%s\n' 'a b\ c' | { read a b; printf '%s\n' "x${a}x${b}x"; } diff --git a/bin/sh/tests/builtins/read4.0 b/bin/sh/tests/builtins/read4.0 index 7204a35aa0a5..4856feddb5c8 100644 --- a/bin/sh/tests/builtins/read4.0 +++ b/bin/sh/tests/builtins/read4.0 @@ -1,4 +1,3 @@ -# $FreeBSD$ printf '%s\n' '\a\ b c' | { read a b; printf '%s\n' "x${a}x${b}x"; } printf '%s\n' '\a b\ c' | { read a b; printf '%s\n' "x${a}x${b}x"; } diff --git a/bin/sh/tests/builtins/read5.0 b/bin/sh/tests/builtins/read5.0 index 7d83391cba22..bbdf246287bd 100644 --- a/bin/sh/tests/builtins/read5.0 +++ b/bin/sh/tests/builtins/read5.0 @@ -1,4 +1,3 @@ -# $FreeBSD$ unset LC_ALL LC_CTYPE=en_US.ISO8859-1 diff --git a/bin/sh/tests/builtins/read6.0 b/bin/sh/tests/builtins/read6.0 index 2168e10c841a..60df35f7ee1f 100644 --- a/bin/sh/tests/builtins/read6.0 +++ b/bin/sh/tests/builtins/read6.0 @@ -1,4 +1,3 @@ -# $FreeBSD$ : | read x r=$? diff --git a/bin/sh/tests/builtins/read7.0 b/bin/sh/tests/builtins/read7.0 index e78f887b60b4..1e159dca6160 100644 --- a/bin/sh/tests/builtins/read7.0 +++ b/bin/sh/tests/builtins/read7.0 @@ -1,4 +1,3 @@ -# $FreeBSD$ { errmsg=`read x <&- 2>&1 >&3`; } 3>&1 r=$? diff --git a/bin/sh/tests/builtins/read8.0 b/bin/sh/tests/builtins/read8.0 index fb786ff008b9..3de0f72c4694 100644 --- a/bin/sh/tests/builtins/read8.0 +++ b/bin/sh/tests/builtins/read8.0 @@ -1,4 +1,3 @@ -# $FreeBSD$ read a b c <<\EOF \ diff --git a/bin/sh/tests/builtins/read9.0 b/bin/sh/tests/builtins/read9.0 index 080549889839..23d814934d3c 100644 --- a/bin/sh/tests/builtins/read9.0 +++ b/bin/sh/tests/builtins/read9.0 @@ -1,4 +1,3 @@ -# $FreeBSD$ empty='' read a b c <<EOF diff --git a/bin/sh/tests/builtins/return1.0 b/bin/sh/tests/builtins/return1.0 index 787e892a7698..b3820b4597a8 100644 --- a/bin/sh/tests/builtins/return1.0 +++ b/bin/sh/tests/builtins/return1.0 @@ -1,4 +1,3 @@ -# $FreeBSD$ f() { return 0 exit 1 diff --git a/bin/sh/tests/builtins/return2.1 b/bin/sh/tests/builtins/return2.1 index 0ef817179d73..8cd5ca58a42d 100644 --- a/bin/sh/tests/builtins/return2.1 +++ b/bin/sh/tests/builtins/return2.1 @@ -1,4 +1,3 @@ -# $FreeBSD$ f() { true && return 1 return 0 diff --git a/bin/sh/tests/builtins/return3.1 b/bin/sh/tests/builtins/return3.1 index 605ec680d66a..e871c055afce 100644 --- a/bin/sh/tests/builtins/return3.1 +++ b/bin/sh/tests/builtins/return3.1 @@ -1,3 +1,2 @@ -# $FreeBSD$ return 1 exit 0 diff --git a/bin/sh/tests/builtins/return4.0 b/bin/sh/tests/builtins/return4.0 index be5582b458b4..a2edab53c222 100644 --- a/bin/sh/tests/builtins/return4.0 +++ b/bin/sh/tests/builtins/return4.0 @@ -1,4 +1,3 @@ -# $FreeBSD$ failures= failure() { diff --git a/bin/sh/tests/builtins/return5.0 b/bin/sh/tests/builtins/return5.0 index 6e4b7bd751a8..46243b6b20c6 100644 --- a/bin/sh/tests/builtins/return5.0 +++ b/bin/sh/tests/builtins/return5.0 @@ -1,4 +1,3 @@ -# $FreeBSD$ if [ "$1" != nested ]; then f() { diff --git a/bin/sh/tests/builtins/return6.4 b/bin/sh/tests/builtins/return6.4 index e4d8e0d641a1..172459f40c68 100644 --- a/bin/sh/tests/builtins/return6.4 +++ b/bin/sh/tests/builtins/return6.4 @@ -1,3 +1,2 @@ -# $FreeBSD$ while return 4; do exit 3; done diff --git a/bin/sh/tests/builtins/return7.4 b/bin/sh/tests/builtins/return7.4 index 2047373473ab..9f914d70e928 100644 --- a/bin/sh/tests/builtins/return7.4 +++ b/bin/sh/tests/builtins/return7.4 @@ -1,4 +1,3 @@ -# $FreeBSD$ f() { while return 4; do exit 3; done diff --git a/bin/sh/tests/builtins/return8.0 b/bin/sh/tests/builtins/return8.0 index f00e859a74ce..c9f5b0a03c2f 100644 --- a/bin/sh/tests/builtins/return8.0 +++ b/bin/sh/tests/builtins/return8.0 @@ -1,4 +1,3 @@ -# $FreeBSD$ if [ "$1" = nested ]; then return 17 diff --git a/bin/sh/tests/builtins/set1.0 b/bin/sh/tests/builtins/set1.0 index fc39fade6270..3f311fc0287d 100644 --- a/bin/sh/tests/builtins/set1.0 +++ b/bin/sh/tests/builtins/set1.0 @@ -1,4 +1,3 @@ -# $FreeBSD$ set +C set +f diff --git a/bin/sh/tests/builtins/set2.0 b/bin/sh/tests/builtins/set2.0 index ad13eab0a7b8..f959cf797fe2 100644 --- a/bin/sh/tests/builtins/set2.0 +++ b/bin/sh/tests/builtins/set2.0 @@ -1,3 +1,2 @@ -# $FreeBSD$ ! env @badness=1 ${SH} -c 'v=`set`; eval "$v"' 2>&1 | grep @badness diff --git a/bin/sh/tests/builtins/set3.0 b/bin/sh/tests/builtins/set3.0 index c5536e96b7a1..44255adc4bda 100644 --- a/bin/sh/tests/builtins/set3.0 +++ b/bin/sh/tests/builtins/set3.0 @@ -1,4 +1,3 @@ -# $FreeBSD$ settings1=$(set +o) && set -o nolog && settings2=$(set +o) && [ "$settings1" != "$settings2" ] diff --git a/bin/sh/tests/builtins/trap1.0 b/bin/sh/tests/builtins/trap1.0 index 313f6a387678..7f39faba319a 100644 --- a/bin/sh/tests/builtins/trap1.0 +++ b/bin/sh/tests/builtins/trap1.0 @@ -1,4 +1,3 @@ -# $FreeBSD$ test "$(trap 'echo trapped' EXIT; :)" = trapped || exit 1 diff --git a/bin/sh/tests/builtins/trap10.0 b/bin/sh/tests/builtins/trap10.0 index fa0e35d6a6b2..96baa6532224 100644 --- a/bin/sh/tests/builtins/trap10.0 +++ b/bin/sh/tests/builtins/trap10.0 @@ -1,4 +1,3 @@ -# $FreeBSD$ # Check that the return statement will not break the EXIT trap, ie. all # trap commands are executed before the script exits. diff --git a/bin/sh/tests/builtins/trap11.0 b/bin/sh/tests/builtins/trap11.0 index cfeea9ed9ded..354698d90ea3 100644 --- a/bin/sh/tests/builtins/trap11.0 +++ b/bin/sh/tests/builtins/trap11.0 @@ -1,4 +1,3 @@ -# $FreeBSD$ # Check that the return statement will not break the USR1 trap, ie. all # trap commands are executed before the script resumes. diff --git a/bin/sh/tests/builtins/trap12.0 b/bin/sh/tests/builtins/trap12.0 index 8c62ffd2b570..87592af250ad 100644 --- a/bin/sh/tests/builtins/trap12.0 +++ b/bin/sh/tests/builtins/trap12.0 @@ -1,4 +1,3 @@ -# $FreeBSD$ f() { trap 'return 42' USR1 diff --git a/bin/sh/tests/builtins/trap13.0 b/bin/sh/tests/builtins/trap13.0 index d90eb08eb242..81db991a4978 100644 --- a/bin/sh/tests/builtins/trap13.0 +++ b/bin/sh/tests/builtins/trap13.0 @@ -1,4 +1,3 @@ -# $FreeBSD$ { trap 'exit 0' INT diff --git a/bin/sh/tests/builtins/trap14.0 b/bin/sh/tests/builtins/trap14.0 index 97cce8d0d244..cf22b15b4677 100644 --- a/bin/sh/tests/builtins/trap14.0 +++ b/bin/sh/tests/builtins/trap14.0 @@ -1,4 +1,3 @@ -# $FreeBSD$ { trap - INT diff --git a/bin/sh/tests/builtins/trap15.0 b/bin/sh/tests/builtins/trap15.0 index 6b9857df3d1a..a7e8d6475f10 100644 --- a/bin/sh/tests/builtins/trap15.0 +++ b/bin/sh/tests/builtins/trap15.0 @@ -1,4 +1,3 @@ -# $FreeBSD$ (${SH} -c 'term(){ exit 5;}; trap term TERM; kill -TERM $$') & wait >/dev/null 2>&1 $! diff --git a/bin/sh/tests/builtins/trap16.0 b/bin/sh/tests/builtins/trap16.0 index 3d70cce8a721..23c615ab41e3 100644 --- a/bin/sh/tests/builtins/trap16.0 +++ b/bin/sh/tests/builtins/trap16.0 @@ -1,4 +1,3 @@ -# $FreeBSD$ traps=$(${SH} -c 'trap "echo bad" 0; trap - 0; trap') [ -z "$traps" ] || exit 1 diff --git a/bin/sh/tests/builtins/trap17.0 b/bin/sh/tests/builtins/trap17.0 index 89be893edd1a..580c41fc2498 100644 --- a/bin/sh/tests/builtins/trap17.0 +++ b/bin/sh/tests/builtins/trap17.0 @@ -1,4 +1,3 @@ -# $FreeBSD$ # This use-after-free bug probably needs non-default settings to show up. v1=nothing v2=nothing diff --git a/bin/sh/tests/builtins/trap2.0 b/bin/sh/tests/builtins/trap2.0 index a05287a16771..d2ea0599940b 100644 --- a/bin/sh/tests/builtins/trap2.0 +++ b/bin/sh/tests/builtins/trap2.0 @@ -1,4 +1,3 @@ -# $FreeBSD$ # This is really a test for outqstr(), which is readily accessible via trap. runtest() diff --git a/bin/sh/tests/builtins/trap3.0 b/bin/sh/tests/builtins/trap3.0 index 81607293531e..5f6bd73654ec 100644 --- a/bin/sh/tests/builtins/trap3.0 +++ b/bin/sh/tests/builtins/trap3.0 @@ -1,4 +1,3 @@ -# $FreeBSD$ { trap '' garbage && exit 3 diff --git a/bin/sh/tests/builtins/trap4.0 b/bin/sh/tests/builtins/trap4.0 index 7f2080ee4dca..52ca5c777381 100644 --- a/bin/sh/tests/builtins/trap4.0 +++ b/bin/sh/tests/builtins/trap4.0 @@ -1,4 +1,3 @@ -# $FreeBSD$ T=$(mktemp -d ${TMPDIR:-/tmp}/sh-test.XXXXXX) trap 'rm -rf $T' 0 diff --git a/bin/sh/tests/builtins/trap5.0 b/bin/sh/tests/builtins/trap5.0 index 56e0fb1b89fe..7dd9bffa1f96 100644 --- a/bin/sh/tests/builtins/trap5.0 +++ b/bin/sh/tests/builtins/trap5.0 @@ -1,4 +1,3 @@ -# $FreeBSD$ set -e trap - USR1 diff --git a/bin/sh/tests/builtins/trap6.0 b/bin/sh/tests/builtins/trap6.0 index bd2bf7efe769..aca7e4c633d0 100644 --- a/bin/sh/tests/builtins/trap6.0 +++ b/bin/sh/tests/builtins/trap6.0 @@ -1,4 +1,3 @@ -# $FreeBSD$ v=$( ${SH} -c 'trap "echo ok; exit" USR1; kill -USR1 $$' & diff --git a/bin/sh/tests/builtins/trap7.0 b/bin/sh/tests/builtins/trap7.0 index 35529b80f4bf..0f208551017b 100644 --- a/bin/sh/tests/builtins/trap7.0 +++ b/bin/sh/tests/builtins/trap7.0 @@ -1,3 +1,2 @@ -# $FreeBSD$ [ "$(trap 'echo trapped' EXIT)" = trapped ] diff --git a/bin/sh/tests/builtins/trap8.0 b/bin/sh/tests/builtins/trap8.0 index cdce976e36da..b04f53079e9d 100644 --- a/bin/sh/tests/builtins/trap8.0 +++ b/bin/sh/tests/builtins/trap8.0 @@ -1,4 +1,3 @@ -# $FreeBSD$ # I am not sure if POSIX requires the shell to continue processing # further trap names in the same trap command after an invalid one. diff --git a/bin/sh/tests/builtins/trap9.0 b/bin/sh/tests/builtins/trap9.0 index 0f584ecec584..187249bf7ed0 100644 --- a/bin/sh/tests/builtins/trap9.0 +++ b/bin/sh/tests/builtins/trap9.0 @@ -1,3 +1,2 @@ -# $FreeBSD$ test "$(trap 'printf trap; echo ped' EXIT; f() { :; }; f)" = trapped || exit 1 diff --git a/bin/sh/tests/builtins/type1.0 b/bin/sh/tests/builtins/type1.0 index c5e456437946..35c9f7bed236 100644 --- a/bin/sh/tests/builtins/type1.0 +++ b/bin/sh/tests/builtins/type1.0 @@ -1,4 +1,3 @@ -# $FreeBSD$ command -v not-here && exit 1 command -v /not-here && exit 1 command -V not-here && exit 1 diff --git a/bin/sh/tests/builtins/type2.0 b/bin/sh/tests/builtins/type2.0 index fe44d957fc0a..79b912a52070 100644 --- a/bin/sh/tests/builtins/type2.0 +++ b/bin/sh/tests/builtins/type2.0 @@ -1,4 +1,3 @@ -# $FreeBSD$ failures=0 diff --git a/bin/sh/tests/builtins/type3.0 b/bin/sh/tests/builtins/type3.0 index 87cccdd812cc..ccca26b2d741 100644 --- a/bin/sh/tests/builtins/type3.0 +++ b/bin/sh/tests/builtins/type3.0 @@ -1,3 +1,2 @@ -# $FreeBSD$ [ "$(type type)" = "$(type -- type)" ] diff --git a/bin/sh/tests/builtins/type4.0 b/bin/sh/tests/builtins/type4.0 index 5b5f96c5078d..570c67d52cd7 100644 --- a/bin/sh/tests/builtins/type4.0 +++ b/bin/sh/tests/builtins/type4.0 @@ -1,4 +1,3 @@ -# $FreeBSD$ r=`cd /bin && PATH=. type ls` case $r in diff --git a/bin/sh/tests/builtins/unalias.0 b/bin/sh/tests/builtins/unalias.0 index 34d8d6e07d2e..3e5ae88e5432 100644 --- a/bin/sh/tests/builtins/unalias.0 +++ b/bin/sh/tests/builtins/unalias.0 @@ -1,4 +1,3 @@ -# $FreeBSD$ set -e alias false=true diff --git a/bin/sh/tests/builtins/var-assign.0 b/bin/sh/tests/builtins/var-assign.0 index efeb4bd130ac..06b13875e6ae 100644 --- a/bin/sh/tests/builtins/var-assign.0 +++ b/bin/sh/tests/builtins/var-assign.0 @@ -1,4 +1,3 @@ -# $FreeBSD$ IFS=, SPECIAL="break,\ diff --git a/bin/sh/tests/builtins/var-assign2.0 b/bin/sh/tests/builtins/var-assign2.0 index eafec89a681b..e8b14d3832b4 100644 --- a/bin/sh/tests/builtins/var-assign2.0 +++ b/bin/sh/tests/builtins/var-assign2.0 @@ -1,4 +1,3 @@ -# $FreeBSD$ IFS=, SPECIAL="break,\ diff --git a/bin/sh/tests/builtins/wait1.0 b/bin/sh/tests/builtins/wait1.0 index 1ca85308c9ac..8bd48fefde25 100644 --- a/bin/sh/tests/builtins/wait1.0 +++ b/bin/sh/tests/builtins/wait1.0 @@ -1,4 +1,3 @@ -# $FreeBSD$ failures= failure() { diff --git a/bin/sh/tests/builtins/wait10.0 b/bin/sh/tests/builtins/wait10.0 index 864fc7817276..e45d08727205 100644 --- a/bin/sh/tests/builtins/wait10.0 +++ b/bin/sh/tests/builtins/wait10.0 @@ -1,4 +1,3 @@ -# $FreeBSD$ # Init cannot be a child of the shell. exit 49 & p49=$! wait 1 "$p49" diff --git a/bin/sh/tests/builtins/wait2.0 b/bin/sh/tests/builtins/wait2.0 index e61455cf5f0e..97632575213b 100644 --- a/bin/sh/tests/builtins/wait2.0 +++ b/bin/sh/tests/builtins/wait2.0 @@ -1,4 +1,3 @@ -# $FreeBSD$ failures= failure() { diff --git a/bin/sh/tests/builtins/wait3.0 b/bin/sh/tests/builtins/wait3.0 index 1ed52999630d..4b62c1b897b6 100644 --- a/bin/sh/tests/builtins/wait3.0 +++ b/bin/sh/tests/builtins/wait3.0 @@ -1,4 +1,3 @@ -# $FreeBSD$ failures= failure() { diff --git a/bin/sh/tests/builtins/wait4.0 b/bin/sh/tests/builtins/wait4.0 index 79351315d384..972a27e3c3d4 100644 --- a/bin/sh/tests/builtins/wait4.0 +++ b/bin/sh/tests/builtins/wait4.0 @@ -1,4 +1,3 @@ -# $FreeBSD$ T=`mktemp -d ${TMPDIR:-/tmp}/sh-test.XXXXXX` trap 'rm -rf $T' 0 diff --git a/bin/sh/tests/builtins/wait5.0 b/bin/sh/tests/builtins/wait5.0 index 6874bf669302..71ecbe51639c 100644 --- a/bin/sh/tests/builtins/wait5.0 +++ b/bin/sh/tests/builtins/wait5.0 @@ -1,4 +1,3 @@ -# $FreeBSD$ T=`mktemp -d ${TMPDIR:-/tmp}/sh-test.XXXXXX` trap 'rm -rf $T' 0 diff --git a/bin/sh/tests/builtins/wait6.0 b/bin/sh/tests/builtins/wait6.0 index 20e3c6808679..757fee5ce5cf 100644 --- a/bin/sh/tests/builtins/wait6.0 +++ b/bin/sh/tests/builtins/wait6.0 @@ -1,3 +1,2 @@ -# $FreeBSD$ wait -- diff --git a/bin/sh/tests/builtins/wait7.0 b/bin/sh/tests/builtins/wait7.0 index 0fb092f8f614..db535e1c40d1 100644 --- a/bin/sh/tests/builtins/wait7.0 +++ b/bin/sh/tests/builtins/wait7.0 @@ -1,4 +1,3 @@ -# $FreeBSD$ : & wait -- $! diff --git a/bin/sh/tests/builtins/wait8.0 b/bin/sh/tests/builtins/wait8.0 index b59ff59622eb..3f6cdc72abc7 100644 --- a/bin/sh/tests/builtins/wait8.0 +++ b/bin/sh/tests/builtins/wait8.0 @@ -1,4 +1,3 @@ -# $FreeBSD$ exit 44 & p44=$! exit 45 & p45=$! diff --git a/bin/sh/tests/builtins/wait9.127 b/bin/sh/tests/builtins/wait9.127 index 661f275421f8..676973dc97dd 100644 --- a/bin/sh/tests/builtins/wait9.127 +++ b/bin/sh/tests/builtins/wait9.127 @@ -1,3 +1,2 @@ -# $FreeBSD$ # Init cannot be a child of the shell. wait 1 diff --git a/bin/sh/tests/errors/Makefile b/bin/sh/tests/errors/Makefile index 5f8d16d22295..27e4f7143de5 100644 --- a/bin/sh/tests/errors/Makefile +++ b/bin/sh/tests/errors/Makefile @@ -1,4 +1,3 @@ -# $FreeBSD$ PACKAGE= tests diff --git a/bin/sh/tests/errors/Makefile.depend b/bin/sh/tests/errors/Makefile.depend index f80275d86ab1..11aba52f82cf 100644 --- a/bin/sh/tests/errors/Makefile.depend +++ b/bin/sh/tests/errors/Makefile.depend @@ -1,4 +1,3 @@ -# $FreeBSD$ # Autogenerated - do NOT edit! DIRDEPS = \ diff --git a/bin/sh/tests/errors/assignment-error1.0 b/bin/sh/tests/errors/assignment-error1.0 index 00eaed9b8671..27f3b06fbc98 100644 --- a/bin/sh/tests/errors/assignment-error1.0 +++ b/bin/sh/tests/errors/assignment-error1.0 @@ -1,4 +1,3 @@ -# $FreeBSD$ IFS=, SPECIAL="break,\ diff --git a/bin/sh/tests/errors/assignment-error2.0 b/bin/sh/tests/errors/assignment-error2.0 index ff4e62995262..d9844b25cdc3 100644 --- a/bin/sh/tests/errors/assignment-error2.0 +++ b/bin/sh/tests/errors/assignment-error2.0 @@ -1,4 +1,3 @@ -# $FreeBSD$ set -e HOME=/ diff --git a/bin/sh/tests/errors/backquote-error1.0 b/bin/sh/tests/errors/backquote-error1.0 index 43e33034af9f..c4bdb6722dc4 100644 --- a/bin/sh/tests/errors/backquote-error1.0 +++ b/bin/sh/tests/errors/backquote-error1.0 @@ -1,4 +1,3 @@ -# $FreeBSD$ echo 'echo `for` echo ".BAD"CODE.' | ${SH} +m -i 2>&1 | grep -q BADCODE && exit 1 exit 0 diff --git a/bin/sh/tests/errors/backquote-error2.0 b/bin/sh/tests/errors/backquote-error2.0 index 5b49e2be17ce..05fcd96bb101 100644 --- a/bin/sh/tests/errors/backquote-error2.0 +++ b/bin/sh/tests/errors/backquote-error2.0 @@ -1,4 +1,3 @@ -# $FreeBSD$ ${SH} -c 'echo `echo .BA"DCODE.` echo ".BAD"CODE.' 2>&1 | grep -q BADCODE && exit 1 diff --git a/bin/sh/tests/errors/bad-binary1.126 b/bin/sh/tests/errors/bad-binary1.126 index d92e9ded5689..76ab2aa5a8fe 100644 --- a/bin/sh/tests/errors/bad-binary1.126 +++ b/bin/sh/tests/errors/bad-binary1.126 @@ -1,4 +1,3 @@ -# $FreeBSD$ # Checking for binary "scripts" without magic number is permitted but not # required by POSIX. However, it is preferable to getting errors like # Syntax error: word unexpected (expecting ")") diff --git a/bin/sh/tests/errors/bad-keyword1.0 b/bin/sh/tests/errors/bad-keyword1.0 index ac0153655f8d..f754e02c122a 100644 --- a/bin/sh/tests/errors/bad-keyword1.0 +++ b/bin/sh/tests/errors/bad-keyword1.0 @@ -1,4 +1,3 @@ -# $FreeBSD$ echo ':; fi' | ${SH} -n 2>/dev/null && exit 1 exit 0 diff --git a/bin/sh/tests/errors/bad-parm-exp1.0 b/bin/sh/tests/errors/bad-parm-exp1.0 index 6e949945f9f3..0cefdac9ea5d 100644 --- a/bin/sh/tests/errors/bad-parm-exp1.0 +++ b/bin/sh/tests/errors/bad-parm-exp1.0 @@ -1,4 +1,3 @@ -# $FreeBSD$ false && { ${} ${foo/} diff --git a/bin/sh/tests/errors/bad-parm-exp2.2 b/bin/sh/tests/errors/bad-parm-exp2.2 index a0826ecf9a8b..1de22a5c20d1 100644 --- a/bin/sh/tests/errors/bad-parm-exp2.2 +++ b/bin/sh/tests/errors/bad-parm-exp2.2 @@ -1,2 +1 @@ -# $FreeBSD$ eval '${}' diff --git a/bin/sh/tests/errors/bad-parm-exp3.2 b/bin/sh/tests/errors/bad-parm-exp3.2 index bb41208f258d..6f7b9347567f 100644 --- a/bin/sh/tests/errors/bad-parm-exp3.2 +++ b/bin/sh/tests/errors/bad-parm-exp3.2 @@ -1,2 +1 @@ -# $FreeBSD$ eval '${foo/}' diff --git a/bin/sh/tests/errors/bad-parm-exp4.2 b/bin/sh/tests/errors/bad-parm-exp4.2 index 2837f9b5be9e..9f4efa88c4b5 100644 --- a/bin/sh/tests/errors/bad-parm-exp4.2 +++ b/bin/sh/tests/errors/bad-parm-exp4.2 @@ -1,2 +1 @@ -# $FreeBSD$ eval '${foo:@abc}' diff --git a/bin/sh/tests/errors/bad-parm-exp5.2 b/bin/sh/tests/errors/bad-parm-exp5.2 index 1ba343bb710d..3c0d10296f6b 100644 --- a/bin/sh/tests/errors/bad-parm-exp5.2 +++ b/bin/sh/tests/errors/bad-parm-exp5.2 @@ -1,2 +1 @@ -# $FreeBSD$ eval '${/}' diff --git a/bin/sh/tests/errors/bad-parm-exp6.2 b/bin/sh/tests/errors/bad-parm-exp6.2 index b53a91b364b5..179aa5d06bb4 100644 --- a/bin/sh/tests/errors/bad-parm-exp6.2 +++ b/bin/sh/tests/errors/bad-parm-exp6.2 @@ -1,2 +1 @@ -# $FreeBSD$ eval '${#foo^}' diff --git a/bin/sh/tests/errors/bad-parm-exp7.0 b/bin/sh/tests/errors/bad-parm-exp7.0 index b8562fbed47b..d82b2eade819 100644 --- a/bin/sh/tests/errors/bad-parm-exp7.0 +++ b/bin/sh/tests/errors/bad-parm-exp7.0 @@ -1,4 +1,3 @@ -# $FreeBSD$ v=1 eval ": $(printf '${v-${\372}}')" diff --git a/bin/sh/tests/errors/bad-parm-exp8.0 b/bin/sh/tests/errors/bad-parm-exp8.0 index 28f00cde0f9f..9f983f1dad55 100644 --- a/bin/sh/tests/errors/bad-parm-exp8.0 +++ b/bin/sh/tests/errors/bad-parm-exp8.0 @@ -1,4 +1,3 @@ -# $FreeBSD$ v=1 eval ": $(printf '${v-${w\372}}')" diff --git a/bin/sh/tests/errors/option-error.0 b/bin/sh/tests/errors/option-error.0 index b4b44c4a4062..d5eac6f4c0c3 100644 --- a/bin/sh/tests/errors/option-error.0 +++ b/bin/sh/tests/errors/option-error.0 @@ -1,4 +1,3 @@ -# $FreeBSD$ IFS=, SPECIAL="break abc,\ diff --git a/bin/sh/tests/errors/redirection-error.0 b/bin/sh/tests/errors/redirection-error.0 index cb8c0b113c13..dfb9f1bfb100 100644 --- a/bin/sh/tests/errors/redirection-error.0 +++ b/bin/sh/tests/errors/redirection-error.0 @@ -1,4 +1,3 @@ -# $FreeBSD$ IFS=, SPECIAL="break,\ diff --git a/bin/sh/tests/errors/redirection-error2.2 b/bin/sh/tests/errors/redirection-error2.2 index 32bccd8e784a..0fb47d20917b 100644 --- a/bin/sh/tests/errors/redirection-error2.2 +++ b/bin/sh/tests/errors/redirection-error2.2 @@ -1,4 +1,3 @@ -# $FreeBSD$ # sh should fail gracefully on this bad redirect ${SH} -c 'echo 1 >&$a' 2>/dev/null diff --git a/bin/sh/tests/errors/redirection-error3.0 b/bin/sh/tests/errors/redirection-error3.0 index 8a07d037baec..d37ba8213547 100644 --- a/bin/sh/tests/errors/redirection-error3.0 +++ b/bin/sh/tests/errors/redirection-error3.0 @@ -1,4 +1,3 @@ -# $FreeBSD$ IFS=, SPECIAL="break,\ diff --git a/bin/sh/tests/errors/redirection-error4.0 b/bin/sh/tests/errors/redirection-error4.0 index 206097478e35..b7ce514a9fbc 100644 --- a/bin/sh/tests/errors/redirection-error4.0 +++ b/bin/sh/tests/errors/redirection-error4.0 @@ -1,4 +1,3 @@ -# $FreeBSD$ # A redirection error should not abort the shell if there is no command word. exec 2>/dev/null </var/empty/x diff --git a/bin/sh/tests/errors/redirection-error5.0 b/bin/sh/tests/errors/redirection-error5.0 index 1fcd47eebf96..1af2937839c2 100644 --- a/bin/sh/tests/errors/redirection-error5.0 +++ b/bin/sh/tests/errors/redirection-error5.0 @@ -1,4 +1,3 @@ -# $FreeBSD$ # A redirection error on a subshell should not abort the shell. exec 2>/dev/null ( echo bad ) </var/empty/x diff --git a/bin/sh/tests/errors/redirection-error6.0 b/bin/sh/tests/errors/redirection-error6.0 index 17d1109b390f..f0ac4a5025a5 100644 --- a/bin/sh/tests/errors/redirection-error6.0 +++ b/bin/sh/tests/errors/redirection-error6.0 @@ -1,4 +1,3 @@ -# $FreeBSD$ # A redirection error on a compound command should not abort the shell. exec 2>/dev/null { echo bad; } </var/empty/x diff --git a/bin/sh/tests/errors/redirection-error7.0 b/bin/sh/tests/errors/redirection-error7.0 index 5b20f04beb83..d853aee52fe2 100644 --- a/bin/sh/tests/errors/redirection-error7.0 +++ b/bin/sh/tests/errors/redirection-error7.0 @@ -1,4 +1,3 @@ -# $FreeBSD$ ! dummy=$( exec 3>&1 >&2 2>&3 diff --git a/bin/sh/tests/errors/redirection-error8.0 b/bin/sh/tests/errors/redirection-error8.0 index 91595457831e..4d2693f26319 100644 --- a/bin/sh/tests/errors/redirection-error8.0 +++ b/bin/sh/tests/errors/redirection-error8.0 @@ -1,4 +1,3 @@ -# $FreeBSD$ $SH -c '{ { :; } </var/empty/x; } 2>/dev/null || kill -INT $$; echo continued' r=$? diff --git a/bin/sh/tests/errors/script-error1.0 b/bin/sh/tests/errors/script-error1.0 index 558d9007353f..0020218cfd24 100644 --- a/bin/sh/tests/errors/script-error1.0 +++ b/bin/sh/tests/errors/script-error1.0 @@ -1,4 +1,3 @@ -# $FreeBSD$ { stderr=$(${SH} /var/empty/nosuchscript 2>&1 >&3); } 3>&1 r=$? diff --git a/bin/sh/tests/errors/write-error1.0 b/bin/sh/tests/errors/write-error1.0 index fcb52e74178c..027108f9ec51 100644 --- a/bin/sh/tests/errors/write-error1.0 +++ b/bin/sh/tests/errors/write-error1.0 @@ -1,3 +1,2 @@ -# $FreeBSD$ ! echo >&- 2>/dev/null diff --git a/bin/sh/tests/execution/Makefile b/bin/sh/tests/execution/Makefile index ab5218b10a0c..2b4f88db989c 100644 --- a/bin/sh/tests/execution/Makefile +++ b/bin/sh/tests/execution/Makefile @@ -1,4 +1,3 @@ -# $FreeBSD$ PACKAGE= tests diff --git a/bin/sh/tests/execution/Makefile.depend b/bin/sh/tests/execution/Makefile.depend index f80275d86ab1..11aba52f82cf 100644 --- a/bin/sh/tests/execution/Makefile.depend +++ b/bin/sh/tests/execution/Makefile.depend @@ -1,4 +1,3 @@ -# $FreeBSD$ # Autogenerated - do NOT edit! DIRDEPS = \ diff --git a/bin/sh/tests/execution/bg1.0 b/bin/sh/tests/execution/bg1.0 index edb92ae2ddd0..eae1e2a6eece 100644 --- a/bin/sh/tests/execution/bg1.0 +++ b/bin/sh/tests/execution/bg1.0 @@ -1,3 +1,2 @@ -# $FreeBSD$ : `false` & diff --git a/bin/sh/tests/execution/bg10.0 b/bin/sh/tests/execution/bg10.0 index 44a25dc23b2e..3e825d9eda20 100644 --- a/bin/sh/tests/execution/bg10.0 +++ b/bin/sh/tests/execution/bg10.0 @@ -1,4 +1,3 @@ -# $FreeBSD$ # The redirection overrides the </dev/null implicit in a background command. echo yes | ${SH} -c '{ cat & wait; } <&0' diff --git a/bin/sh/tests/execution/bg11.0 b/bin/sh/tests/execution/bg11.0 index e0c48ed16076..380d2180fe79 100644 --- a/bin/sh/tests/execution/bg11.0 +++ b/bin/sh/tests/execution/bg11.0 @@ -1,4 +1,3 @@ -# $FreeBSD$ T=`mktemp -d ${TMPDIR:-/tmp}/sh-test.XXXXXXXX` trap 'rm -rf $T' 0 diff --git a/bin/sh/tests/execution/bg12.0 b/bin/sh/tests/execution/bg12.0 index a9bde6cac8a3..ed1e0065b226 100644 --- a/bin/sh/tests/execution/bg12.0 +++ b/bin/sh/tests/execution/bg12.0 @@ -1,4 +1,3 @@ -# $FreeBSD$ T=`mktemp -d ${TMPDIR:-/tmp}/sh-test.XXXXXXXX` trap 'rm -rf $T' 0 diff --git a/bin/sh/tests/execution/bg13.0 b/bin/sh/tests/execution/bg13.0 index 37a4ad864ded..7f6fb87af665 100644 --- a/bin/sh/tests/execution/bg13.0 +++ b/bin/sh/tests/execution/bg13.0 @@ -1,4 +1,3 @@ -# $FreeBSD$ T=`mktemp -d ${TMPDIR:-/tmp}/sh-test.XXXXXXXX` trap 'rm -rf $T' 0 diff --git a/bin/sh/tests/execution/bg2.0 b/bin/sh/tests/execution/bg2.0 index 2e2fbc53bd26..29bdffb0b105 100644 --- a/bin/sh/tests/execution/bg2.0 +++ b/bin/sh/tests/execution/bg2.0 @@ -1,4 +1,3 @@ -# $FreeBSD$ f() { return 42; } f diff --git a/bin/sh/tests/execution/bg3.0 b/bin/sh/tests/execution/bg3.0 index 359fc6f476e6..0a411f611e1f 100644 --- a/bin/sh/tests/execution/bg3.0 +++ b/bin/sh/tests/execution/bg3.0 @@ -1,4 +1,3 @@ -# $FreeBSD$ f() { return 42; } f diff --git a/bin/sh/tests/execution/bg4.0 b/bin/sh/tests/execution/bg4.0 index 25e4f4e34fa5..4d63fa8b455f 100644 --- a/bin/sh/tests/execution/bg4.0 +++ b/bin/sh/tests/execution/bg4.0 @@ -1,4 +1,3 @@ -# $FreeBSD$ x='' : ${x:=1} & diff --git a/bin/sh/tests/execution/bg5.0 b/bin/sh/tests/execution/bg5.0 index cc9ceaa41d4e..94c45dba370b 100644 --- a/bin/sh/tests/execution/bg5.0 +++ b/bin/sh/tests/execution/bg5.0 @@ -1,4 +1,3 @@ -# $FreeBSD$ # A background command has an implicit </dev/null redirection. echo bad | ${SH} -c '{ cat & wait; }' diff --git a/bin/sh/tests/execution/bg6.0 b/bin/sh/tests/execution/bg6.0 index b0faf9e73708..ce6d88461f97 100644 --- a/bin/sh/tests/execution/bg6.0 +++ b/bin/sh/tests/execution/bg6.0 @@ -1,4 +1,3 @@ -# $FreeBSD$ # The redirection overrides the </dev/null implicit in a background command. echo yes | ${SH} -c '{ cat & wait; } </dev/stdin' diff --git a/bin/sh/tests/execution/bg7.0 b/bin/sh/tests/execution/bg7.0 index f771edc56cde..01a0a1a333f3 100644 --- a/bin/sh/tests/execution/bg7.0 +++ b/bin/sh/tests/execution/bg7.0 @@ -1,4 +1,3 @@ -# $FreeBSD$ # The redirection does not apply to the background command, and therefore # does not override the implicit </dev/null. diff --git a/bin/sh/tests/execution/bg8.0 b/bin/sh/tests/execution/bg8.0 index 33667cb1922b..4eeb235411f3 100644 --- a/bin/sh/tests/execution/bg8.0 +++ b/bin/sh/tests/execution/bg8.0 @@ -1,4 +1,3 @@ -# $FreeBSD$ # The redirection does not apply to the background command, and therefore # does not override the implicit </dev/null. diff --git a/bin/sh/tests/execution/bg9.0 b/bin/sh/tests/execution/bg9.0 index 64fde3e3e333..805c90a9caba 100644 --- a/bin/sh/tests/execution/bg9.0 +++ b/bin/sh/tests/execution/bg9.0 @@ -1,4 +1,3 @@ -# $FreeBSD$ # The redirection does not apply to the background command, and therefore # does not override the implicit </dev/null. diff --git a/bin/sh/tests/execution/env1.0 b/bin/sh/tests/execution/env1.0 index 7eb8abbd5247..f1abad21bade 100644 --- a/bin/sh/tests/execution/env1.0 +++ b/bin/sh/tests/execution/env1.0 @@ -1,4 +1,3 @@ -# $FreeBSD$ unset somestrangevar export somestrangevar diff --git a/bin/sh/tests/execution/fork1.0 b/bin/sh/tests/execution/fork1.0 index 2eeac79ae8c3..bf47ca044306 100644 --- a/bin/sh/tests/execution/fork1.0 +++ b/bin/sh/tests/execution/fork1.0 @@ -1,4 +1,3 @@ -# $FreeBSD$ shname=${SH%% *} shname=${shname##*/} diff --git a/bin/sh/tests/execution/fork2.0 b/bin/sh/tests/execution/fork2.0 index 62a25379123c..1b2ed28672ca 100644 --- a/bin/sh/tests/execution/fork2.0 +++ b/bin/sh/tests/execution/fork2.0 @@ -1,4 +1,3 @@ -# $FreeBSD$ result=$(${SH} -c '(/bin/sleep 1)& sleep 0.1; ps -p $! -o comm=; kill $!') test "$result" = sleep || exit 1 diff --git a/bin/sh/tests/execution/fork3.0 b/bin/sh/tests/execution/fork3.0 index 3cb678c2d08a..d9b2efb235bd 100644 --- a/bin/sh/tests/execution/fork3.0 +++ b/bin/sh/tests/execution/fork3.0 @@ -1,4 +1,3 @@ -# $FreeBSD$ result=$(${SH} -c 'f() { ps -p $$ -o comm=; }; f') test "$result" = "ps" diff --git a/bin/sh/tests/execution/func1.0 b/bin/sh/tests/execution/func1.0 index 29fcc077b592..0dfd341f9099 100644 --- a/bin/sh/tests/execution/func1.0 +++ b/bin/sh/tests/execution/func1.0 @@ -1,4 +1,3 @@ -# $FreeBSD$ MALLOC_OPTIONS=J ${SH} -c 'g() { g() { :; }; :; }; g' && MALLOC_OPTIONS=J ${SH} -c 'g() { unset -f g; :; }; g' diff --git a/bin/sh/tests/execution/func2.0 b/bin/sh/tests/execution/func2.0 index 9830b5e8a7cf..d0f505e30481 100644 --- a/bin/sh/tests/execution/func2.0 +++ b/bin/sh/tests/execution/func2.0 @@ -1,4 +1,3 @@ -# $FreeBSD$ # The empty pairs of braces here are to test that this does not cause a crash. f() { } diff --git a/bin/sh/tests/execution/func3.0 b/bin/sh/tests/execution/func3.0 index e0ed581f85ef..51e70bfa8ac2 100644 --- a/bin/sh/tests/execution/func3.0 +++ b/bin/sh/tests/execution/func3.0 @@ -1,4 +1,3 @@ -# $FreeBSD$ # This may fail when parsing or when defining the function, or the definition # may silently do nothing. In no event may the function be executed. diff --git a/bin/sh/tests/execution/hash1.0 b/bin/sh/tests/execution/hash1.0 index a645c2aef735..f41d38eb4a3c 100644 --- a/bin/sh/tests/execution/hash1.0 +++ b/bin/sh/tests/execution/hash1.0 @@ -1,4 +1,3 @@ -# $FreeBSD$ T=`mktemp -d "${TMPDIR:-/tmp}/sh-test.XXXXXXXX"` || exit trap 'rm -rf "${T}"' 0 diff --git a/bin/sh/tests/execution/int-cmd1.0 b/bin/sh/tests/execution/int-cmd1.0 index a1f097b774d6..05d08dc3d62d 100644 --- a/bin/sh/tests/execution/int-cmd1.0 +++ b/bin/sh/tests/execution/int-cmd1.0 @@ -1,3 +1,2 @@ -# $FreeBSD$ -! echo echo bad | $SH -ic 'fi' 2>/dev/null +! echo echo bad | ENV= $SH -ic 'fi' 2>/dev/null diff --git a/bin/sh/tests/execution/killed1.0 b/bin/sh/tests/execution/killed1.0 index 41d3e055723e..a3977b6ce10c 100644 --- a/bin/sh/tests/execution/killed1.0 +++ b/bin/sh/tests/execution/killed1.0 @@ -1,4 +1,3 @@ -# $FreeBSD$ # Sometimes the "Killed" message is not flushed soon enough and it # is redirected along with the output of a builtin. # Do not change the semicolon to a newline as it would hide the bug. diff --git a/bin/sh/tests/execution/killed2.0 b/bin/sh/tests/execution/killed2.0 index 7ff3fe2900d1..2b9a8fa628e1 100644 --- a/bin/sh/tests/execution/killed2.0 +++ b/bin/sh/tests/execution/killed2.0 @@ -1,4 +1,3 @@ -# $FreeBSD$ # Most shells print a message when a foreground job is killed by a signal. # POSIX allows this, provided the message is sent to stderr, not stdout. # Some trickery is needed to capture the message as redirecting stderr of diff --git a/bin/sh/tests/execution/not1.0 b/bin/sh/tests/execution/not1.0 index 12c6265a9282..86bd3fbe04d3 100644 --- a/bin/sh/tests/execution/not1.0 +++ b/bin/sh/tests/execution/not1.0 @@ -1,4 +1,3 @@ -# $FreeBSD$ f() { ! return $1; } f 0 && ! f 1 diff --git a/bin/sh/tests/execution/not2.0 b/bin/sh/tests/execution/not2.0 index 1b128d096716..896f59528c60 100644 --- a/bin/sh/tests/execution/not2.0 +++ b/bin/sh/tests/execution/not2.0 @@ -1,4 +1,3 @@ -# $FreeBSD$ while :; do ! break diff --git a/bin/sh/tests/execution/path1.0 b/bin/sh/tests/execution/path1.0 index 50829d629a4d..72537dac4973 100644 --- a/bin/sh/tests/execution/path1.0 +++ b/bin/sh/tests/execution/path1.0 @@ -1,4 +1,3 @@ -# $FreeBSD$ # Some builtins should not be overridable via PATH. set -e diff --git a/bin/sh/tests/execution/pipefail1.0 b/bin/sh/tests/execution/pipefail1.0 index df23a012ca07..d3ce51b3042b 100644 --- a/bin/sh/tests/execution/pipefail1.0 +++ b/bin/sh/tests/execution/pipefail1.0 @@ -1,4 +1,3 @@ -# $FreeBSD$ set -o pipefail : && : | : && : | : | : && : | : | : | : diff --git a/bin/sh/tests/execution/pipefail2.42 b/bin/sh/tests/execution/pipefail2.42 index b9092661c76e..93eded1deda3 100644 --- a/bin/sh/tests/execution/pipefail2.42 +++ b/bin/sh/tests/execution/pipefail2.42 @@ -1,4 +1,3 @@ -# $FreeBSD$ set -o pipefail (exit 42) | : diff --git a/bin/sh/tests/execution/pipefail3.42 b/bin/sh/tests/execution/pipefail3.42 index d96602b57f02..996a404a294c 100644 --- a/bin/sh/tests/execution/pipefail3.42 +++ b/bin/sh/tests/execution/pipefail3.42 @@ -1,4 +1,3 @@ -# $FreeBSD$ set -o pipefail : | (exit 42) diff --git a/bin/sh/tests/execution/pipefail4.42 b/bin/sh/tests/execution/pipefail4.42 index 3399dd8c4452..d18d36bf470b 100644 --- a/bin/sh/tests/execution/pipefail4.42 +++ b/bin/sh/tests/execution/pipefail4.42 @@ -1,4 +1,3 @@ -# $FreeBSD$ set -o pipefail (exit 43) | (exit 42) diff --git a/bin/sh/tests/execution/pipefail5.42 b/bin/sh/tests/execution/pipefail5.42 index 4effb2b3301e..3ccfb5d24940 100644 --- a/bin/sh/tests/execution/pipefail5.42 +++ b/bin/sh/tests/execution/pipefail5.42 @@ -1,4 +1,3 @@ -# $FreeBSD$ set -o pipefail (exit 42) | : & diff --git a/bin/sh/tests/execution/pipefail6.42 b/bin/sh/tests/execution/pipefail6.42 index 7395d8c785a6..4fbca1b09ad8 100644 --- a/bin/sh/tests/execution/pipefail6.42 +++ b/bin/sh/tests/execution/pipefail6.42 @@ -1,4 +1,3 @@ -# $FreeBSD$ set -o pipefail (exit 42) | : & diff --git a/bin/sh/tests/execution/pipefail7.0 b/bin/sh/tests/execution/pipefail7.0 index 797d485f3c61..84c551bdb6a3 100644 --- a/bin/sh/tests/execution/pipefail7.0 +++ b/bin/sh/tests/execution/pipefail7.0 @@ -1,4 +1,3 @@ -# $FreeBSD$ (exit 42) | : & set -o pipefail diff --git a/bin/sh/tests/execution/redir1.0 b/bin/sh/tests/execution/redir1.0 index dd0011f064b0..ffdc9c82a23d 100644 --- a/bin/sh/tests/execution/redir1.0 +++ b/bin/sh/tests/execution/redir1.0 @@ -1,4 +1,3 @@ -# $FreeBSD$ trap ': $((brokenpipe+=1))' PIPE P=${TMPDIR:-/tmp} diff --git a/bin/sh/tests/execution/redir2.0 b/bin/sh/tests/execution/redir2.0 index 1588105f599a..4eb44aa3a5bf 100644 --- a/bin/sh/tests/execution/redir2.0 +++ b/bin/sh/tests/execution/redir2.0 @@ -1,4 +1,3 @@ -# $FreeBSD$ trap ': $((brokenpipe+=1))' PIPE P=${TMPDIR:-/tmp} diff --git a/bin/sh/tests/execution/redir3.0 b/bin/sh/tests/execution/redir3.0 index d68e4504ed3d..3129abbee0b3 100644 --- a/bin/sh/tests/execution/redir3.0 +++ b/bin/sh/tests/execution/redir3.0 @@ -1,3 +1,2 @@ -# $FreeBSD$ 3>&- 3>&- diff --git a/bin/sh/tests/execution/redir4.0 b/bin/sh/tests/execution/redir4.0 index 57054c17c45f..bee2bd78f5b2 100644 --- a/bin/sh/tests/execution/redir4.0 +++ b/bin/sh/tests/execution/redir4.0 @@ -1,4 +1,3 @@ -# $FreeBSD$ { echo bad 0>&3; } 2>/dev/null 3>/dev/null 3>&- exit 0 diff --git a/bin/sh/tests/execution/redir5.0 b/bin/sh/tests/execution/redir5.0 index 707ca68f737a..d810475bfb1a 100644 --- a/bin/sh/tests/execution/redir5.0 +++ b/bin/sh/tests/execution/redir5.0 @@ -1,3 +1,2 @@ -# $FreeBSD$ { (echo bad) >/dev/null; } </dev/null diff --git a/bin/sh/tests/execution/redir6.0 b/bin/sh/tests/execution/redir6.0 index 4e3ac0cae055..d9a90a97523c 100644 --- a/bin/sh/tests/execution/redir6.0 +++ b/bin/sh/tests/execution/redir6.0 @@ -1,4 +1,3 @@ -# $FreeBSD$ failures=0 diff --git a/bin/sh/tests/execution/redir7.0 b/bin/sh/tests/execution/redir7.0 index 2487bcf2fc0d..59abf0698493 100644 --- a/bin/sh/tests/execution/redir7.0 +++ b/bin/sh/tests/execution/redir7.0 @@ -1,4 +1,3 @@ -# $FreeBSD$ failures=0 diff --git a/bin/sh/tests/execution/set-C1.0 b/bin/sh/tests/execution/set-C1.0 index 7877a33989b7..50ce8483c2d6 100644 --- a/bin/sh/tests/execution/set-C1.0 +++ b/bin/sh/tests/execution/set-C1.0 @@ -1,4 +1,3 @@ -# $FreeBSD$ T=$(mktemp -d "${TMPDIR:-/tmp}/sh-test.XXXXXXXX") || exit trap 'rm -rf "$T"' 0 diff --git a/bin/sh/tests/execution/set-n1.0 b/bin/sh/tests/execution/set-n1.0 index 14c9b9396ada..e3ee7d2c103d 100644 --- a/bin/sh/tests/execution/set-n1.0 +++ b/bin/sh/tests/execution/set-n1.0 @@ -1,4 +1,3 @@ -# $FreeBSD$ v=$( ($SH -n <<'EOF' for diff --git a/bin/sh/tests/execution/set-n2.0 b/bin/sh/tests/execution/set-n2.0 index c7f31629f474..1f309d59f619 100644 --- a/bin/sh/tests/execution/set-n2.0 +++ b/bin/sh/tests/execution/set-n2.0 @@ -1,4 +1,3 @@ -# $FreeBSD$ $SH -n <<'EOF' echo bad diff --git a/bin/sh/tests/execution/set-n3.0 b/bin/sh/tests/execution/set-n3.0 index 24a9159fdeb9..362dd121a1fe 100644 --- a/bin/sh/tests/execution/set-n3.0 +++ b/bin/sh/tests/execution/set-n3.0 @@ -1,4 +1,3 @@ -# $FreeBSD$ v=$( ($SH -nc 'for') 2>&1 >/dev/null) [ $? -ne 0 ] && [ -n "$v" ] diff --git a/bin/sh/tests/execution/set-n4.0 b/bin/sh/tests/execution/set-n4.0 index 36985084b26b..80a8c2bbcc46 100644 --- a/bin/sh/tests/execution/set-n4.0 +++ b/bin/sh/tests/execution/set-n4.0 @@ -1,3 +1,2 @@ -# $FreeBSD$ $SH -nc 'echo bad' diff --git a/bin/sh/tests/execution/set-x1.0 b/bin/sh/tests/execution/set-x1.0 index 7fe1dbf1076b..31dffe45d84d 100644 --- a/bin/sh/tests/execution/set-x1.0 +++ b/bin/sh/tests/execution/set-x1.0 @@ -1,4 +1,3 @@ -# $FreeBSD$ key='must_contain_this' { r=`set -x; { : "$key"; } 2>&1 >/dev/null`; } 2>/dev/null diff --git a/bin/sh/tests/execution/set-x2.0 b/bin/sh/tests/execution/set-x2.0 index 56d54e38d251..a1b8d6d37f79 100644 --- a/bin/sh/tests/execution/set-x2.0 +++ b/bin/sh/tests/execution/set-x2.0 @@ -1,4 +1,3 @@ -# $FreeBSD$ key='must contain this' PS4="$key+ " diff --git a/bin/sh/tests/execution/set-x3.0 b/bin/sh/tests/execution/set-x3.0 index 1ca57aca6baa..11f79ea5fcb9 100644 --- a/bin/sh/tests/execution/set-x3.0 +++ b/bin/sh/tests/execution/set-x3.0 @@ -1,4 +1,3 @@ -# $FreeBSD$ key='must contain this' PS4='$key+ ' diff --git a/bin/sh/tests/execution/set-x4.0 b/bin/sh/tests/execution/set-x4.0 index 0904766ccdd1..495a2d9c304c 100644 --- a/bin/sh/tests/execution/set-x4.0 +++ b/bin/sh/tests/execution/set-x4.0 @@ -1,4 +1,3 @@ -# $FreeBSD$ key=`printf '\r\t\001\200\300'` r=`{ set -x; : "$key"; } 2>&1 >/dev/null` diff --git a/bin/sh/tests/execution/shellproc1.0 b/bin/sh/tests/execution/shellproc1.0 index 1326bc27f1c1..125a177f8418 100644 --- a/bin/sh/tests/execution/shellproc1.0 +++ b/bin/sh/tests/execution/shellproc1.0 @@ -1,4 +1,3 @@ -# $FreeBSD$ T=`mktemp -d "${TMPDIR:-/tmp}/sh-test.XXXXXXXX"` || exit trap 'rm -rf "${T}"' 0 diff --git a/bin/sh/tests/execution/shellproc2.0 b/bin/sh/tests/execution/shellproc2.0 index 85e768070022..b599d16527be 100644 --- a/bin/sh/tests/execution/shellproc2.0 +++ b/bin/sh/tests/execution/shellproc2.0 @@ -1,4 +1,3 @@ -# $FreeBSD$ # This tests a quality of implementation issue. # Shells are not required to reject executing binary files as shell scripts # but executing, for example, ELF files for a different architecture as diff --git a/bin/sh/tests/execution/shellproc3.0 b/bin/sh/tests/execution/shellproc3.0 index 6ad455f2cd77..17026480a90a 100644 --- a/bin/sh/tests/execution/shellproc3.0 +++ b/bin/sh/tests/execution/shellproc3.0 @@ -1,4 +1,3 @@ -# $FreeBSD$ # This tests a quality of implementation issue. # Shells are not required to reject executing binary files as shell scripts # but executing, for example, ELF files for a different architecture as diff --git a/bin/sh/tests/execution/shellproc4.0 b/bin/sh/tests/execution/shellproc4.0 index fcc72eef073c..4aa944b55a86 100644 --- a/bin/sh/tests/execution/shellproc4.0 +++ b/bin/sh/tests/execution/shellproc4.0 @@ -1,4 +1,3 @@ -# $FreeBSD$ # This tests a quality of implementation issue. # Shells are not required to reject executing binary files as shell scripts # but executing, for example, ELF files for a different architecture as diff --git a/bin/sh/tests/execution/shellproc5.0 b/bin/sh/tests/execution/shellproc5.0 index c25ffe3e4693..535e5dabc4d9 100644 --- a/bin/sh/tests/execution/shellproc5.0 +++ b/bin/sh/tests/execution/shellproc5.0 @@ -1,4 +1,3 @@ -# $FreeBSD$ # This tests a quality of implementation issue. # Shells are not required to reject executing binary files as shell scripts # but executing, for example, ELF files for a different architecture as diff --git a/bin/sh/tests/execution/shellproc6.0 b/bin/sh/tests/execution/shellproc6.0 index 1c06bc3b05a9..f1527f6d854d 100644 --- a/bin/sh/tests/execution/shellproc6.0 +++ b/bin/sh/tests/execution/shellproc6.0 @@ -1,4 +1,3 @@ -# $FreeBSD$ T=`mktemp -d "${TMPDIR:-/tmp}/sh-test.XXXXXXXX"` || exit trap 'rm -rf "${T}"' 0 diff --git a/bin/sh/tests/execution/shellproc7.0 b/bin/sh/tests/execution/shellproc7.0 index 2a99ae74c151..b5e543826c8a 100644 --- a/bin/sh/tests/execution/shellproc7.0 +++ b/bin/sh/tests/execution/shellproc7.0 @@ -1,4 +1,3 @@ -# $FreeBSD$ # Non-POSIX trickery that is widely supported, # used by https://justine.lol/ape.html diff --git a/bin/sh/tests/execution/subshell1.0 b/bin/sh/tests/execution/subshell1.0 index 347806ed45ac..ddff2fee4999 100644 --- a/bin/sh/tests/execution/subshell1.0 +++ b/bin/sh/tests/execution/subshell1.0 @@ -1,4 +1,3 @@ -# $FreeBSD$ (eval "cd / v=$(printf %0100000d 1) diff --git a/bin/sh/tests/execution/subshell2.0 b/bin/sh/tests/execution/subshell2.0 index 32164495c9ca..ad5a3b87af47 100644 --- a/bin/sh/tests/execution/subshell2.0 +++ b/bin/sh/tests/execution/subshell2.0 @@ -1,4 +1,3 @@ -# $FreeBSD$ f() { x=2 diff --git a/bin/sh/tests/execution/subshell3.0 b/bin/sh/tests/execution/subshell3.0 index 9a87acb15e1c..4d1916dfa18e 100644 --- a/bin/sh/tests/execution/subshell3.0 +++ b/bin/sh/tests/execution/subshell3.0 @@ -1,4 +1,3 @@ -# $FreeBSD$ (false; exit) && exit 3 exit 0 diff --git a/bin/sh/tests/execution/subshell4.0 b/bin/sh/tests/execution/subshell4.0 index b39edb12eb2c..841186b5e619 100644 --- a/bin/sh/tests/execution/subshell4.0 +++ b/bin/sh/tests/execution/subshell4.0 @@ -1,3 +1,2 @@ -# $FreeBSD$ (eval "set v=1"; false) && echo bad; : diff --git a/bin/sh/tests/execution/unknown1.0 b/bin/sh/tests/execution/unknown1.0 index 45f541e6eeea..c41243454dbc 100644 --- a/bin/sh/tests/execution/unknown1.0 +++ b/bin/sh/tests/execution/unknown1.0 @@ -1,4 +1,3 @@ -# $FreeBSD$ nosuchtool 2>/dev/null [ $? -ne 127 ] && exit 1 diff --git a/bin/sh/tests/execution/unknown2.0 b/bin/sh/tests/execution/unknown2.0 index d316e01949f6..eb7ab0175a65 100644 --- a/bin/sh/tests/execution/unknown2.0 +++ b/bin/sh/tests/execution/unknown2.0 @@ -1,4 +1,3 @@ -# $FreeBSD$ { : $(/var/empty/nosuchtool) diff --git a/bin/sh/tests/execution/var-assign1.0 b/bin/sh/tests/execution/var-assign1.0 index 26e54249c1cc..8d49498d848e 100644 --- a/bin/sh/tests/execution/var-assign1.0 +++ b/bin/sh/tests/execution/var-assign1.0 @@ -1,3 +1,2 @@ -# $FreeBSD$ [ "$(HOME=/etc HOME=/ cd && pwd)" = / ] diff --git a/bin/sh/tests/expansion/Makefile b/bin/sh/tests/expansion/Makefile index 58df967304f5..d38fd49e14ee 100644 --- a/bin/sh/tests/expansion/Makefile +++ b/bin/sh/tests/expansion/Makefile @@ -1,4 +1,3 @@ -# $FreeBSD$ PACKAGE= tests diff --git a/bin/sh/tests/expansion/Makefile.depend b/bin/sh/tests/expansion/Makefile.depend index f80275d86ab1..11aba52f82cf 100644 --- a/bin/sh/tests/expansion/Makefile.depend +++ b/bin/sh/tests/expansion/Makefile.depend @@ -1,4 +1,3 @@ -# $FreeBSD$ # Autogenerated - do NOT edit! DIRDEPS = \ diff --git a/bin/sh/tests/expansion/arith1.0 b/bin/sh/tests/expansion/arith1.0 index 118ba2265687..c1338fc34962 100644 --- a/bin/sh/tests/expansion/arith1.0 +++ b/bin/sh/tests/expansion/arith1.0 @@ -1,4 +1,3 @@ -# $FreeBSD$ failures=0 diff --git a/bin/sh/tests/expansion/arith10.0 b/bin/sh/tests/expansion/arith10.0 index 1aaf6194fbaf..1e0c10dfda5e 100644 --- a/bin/sh/tests/expansion/arith10.0 +++ b/bin/sh/tests/expansion/arith10.0 @@ -1,4 +1,3 @@ -# $FreeBSD$ failures=0 diff --git a/bin/sh/tests/expansion/arith11.0 b/bin/sh/tests/expansion/arith11.0 index 6bc73697ffab..52c5a4420eb6 100644 --- a/bin/sh/tests/expansion/arith11.0 +++ b/bin/sh/tests/expansion/arith11.0 @@ -1,4 +1,3 @@ -# $FreeBSD$ # Try to divide the smallest integer by -1. # On amd64 this causes SIGFPE, so make sure the shell checks. diff --git a/bin/sh/tests/expansion/arith12.0 b/bin/sh/tests/expansion/arith12.0 index cb7da3b2e21a..3d54970d84b1 100644 --- a/bin/sh/tests/expansion/arith12.0 +++ b/bin/sh/tests/expansion/arith12.0 @@ -1,4 +1,3 @@ -# $FreeBSD$ _x=4 y_=5 z_z=6 [ "$((_x*100+y_*10+z_z))" = 456 ] diff --git a/bin/sh/tests/expansion/arith13.0 b/bin/sh/tests/expansion/arith13.0 index 207e4881935b..897e55f70206 100644 --- a/bin/sh/tests/expansion/arith13.0 +++ b/bin/sh/tests/expansion/arith13.0 @@ -1,4 +1,3 @@ -# $FreeBSD$ # Pre-increment and pre-decrement in arithmetic expansion are not in POSIX. # Require either an error or a correct implementation. diff --git a/bin/sh/tests/expansion/arith14.0 b/bin/sh/tests/expansion/arith14.0 index 836904335ef3..73f4ef3cab50 100644 --- a/bin/sh/tests/expansion/arith14.0 +++ b/bin/sh/tests/expansion/arith14.0 @@ -1,4 +1,3 @@ -# $FreeBSD$ # Check that <</>> use the low bits of the shift count. if [ $((1<<16<<16)) = 0 ]; then diff --git a/bin/sh/tests/expansion/arith15.0 b/bin/sh/tests/expansion/arith15.0 index 32b35bb907cd..198004aedbd4 100644 --- a/bin/sh/tests/expansion/arith15.0 +++ b/bin/sh/tests/expansion/arith15.0 @@ -1,4 +1,3 @@ -# $FreeBSD$ failures=0 diff --git a/bin/sh/tests/expansion/arith16.0 b/bin/sh/tests/expansion/arith16.0 index b764e3c216f8..4956aebbc665 100644 --- a/bin/sh/tests/expansion/arith16.0 +++ b/bin/sh/tests/expansion/arith16.0 @@ -1,4 +1,3 @@ -# $FreeBSD$ failures=0 diff --git a/bin/sh/tests/expansion/arith17.0 b/bin/sh/tests/expansion/arith17.0 index 0a9260886ddb..72e0eec8a183 100644 --- a/bin/sh/tests/expansion/arith17.0 +++ b/bin/sh/tests/expansion/arith17.0 @@ -1,3 +1,2 @@ -# $FreeBSD$ [ $((9223372036854775809)) -gt 0 ] diff --git a/bin/sh/tests/expansion/arith2.0 b/bin/sh/tests/expansion/arith2.0 index 95b48a06aae6..46aa968aa0a5 100644 --- a/bin/sh/tests/expansion/arith2.0 +++ b/bin/sh/tests/expansion/arith2.0 @@ -1,4 +1,3 @@ -# $FreeBSD$ failures=0 diff --git a/bin/sh/tests/expansion/arith3.0 b/bin/sh/tests/expansion/arith3.0 index b69159d9b5b8..622f8d1c8fef 100644 --- a/bin/sh/tests/expansion/arith3.0 +++ b/bin/sh/tests/expansion/arith3.0 @@ -1,4 +1,3 @@ -# $FreeBSD$ failures=0 diff --git a/bin/sh/tests/expansion/arith4.0 b/bin/sh/tests/expansion/arith4.0 index 610dad89e4dc..5a7e4d419c57 100644 --- a/bin/sh/tests/expansion/arith4.0 +++ b/bin/sh/tests/expansion/arith4.0 @@ -1,4 +1,3 @@ -# $FreeBSD$ failures=0 diff --git a/bin/sh/tests/expansion/arith5.0 b/bin/sh/tests/expansion/arith5.0 index d0f23312f9ca..c290a2426f10 100644 --- a/bin/sh/tests/expansion/arith5.0 +++ b/bin/sh/tests/expansion/arith5.0 @@ -1,4 +1,3 @@ -# $FreeBSD$ failures=0 diff --git a/bin/sh/tests/expansion/arith6.0 b/bin/sh/tests/expansion/arith6.0 index fc4589c1bac5..f3d7ca10b5e0 100644 --- a/bin/sh/tests/expansion/arith6.0 +++ b/bin/sh/tests/expansion/arith6.0 @@ -1,4 +1,3 @@ -# $FreeBSD$ v1=1\ +\ 1 v2=D diff --git a/bin/sh/tests/expansion/arith7.0 b/bin/sh/tests/expansion/arith7.0 index 5aada2b86586..8578436cb635 100644 --- a/bin/sh/tests/expansion/arith7.0 +++ b/bin/sh/tests/expansion/arith7.0 @@ -1,4 +1,3 @@ -# $FreeBSD$ v=1+ v=$v$v$v$v diff --git a/bin/sh/tests/expansion/arith8.0 b/bin/sh/tests/expansion/arith8.0 index 2d03e503387d..7c77f3e7e456 100644 --- a/bin/sh/tests/expansion/arith8.0 +++ b/bin/sh/tests/expansion/arith8.0 @@ -1,4 +1,3 @@ -# $FreeBSD$ v=$( (eval ': $((08))') 2>&1 >/dev/null) [ $? -ne 0 ] && [ -n "$v" ] diff --git a/bin/sh/tests/expansion/arith9.0 b/bin/sh/tests/expansion/arith9.0 index cc8b597d4755..94da20b17761 100644 --- a/bin/sh/tests/expansion/arith9.0 +++ b/bin/sh/tests/expansion/arith9.0 @@ -1,4 +1,3 @@ -# $FreeBSD$ failures=0 diff --git a/bin/sh/tests/expansion/assign1.0 b/bin/sh/tests/expansion/assign1.0 index d4fa7727f593..16bca926bc1d 100644 --- a/bin/sh/tests/expansion/assign1.0 +++ b/bin/sh/tests/expansion/assign1.0 @@ -1,4 +1,3 @@ -# $FreeBSD$ e= q='?' a='*' t=texttext s='ast*que?non' p='/et[c]/' w='a b c' b='{{(#)}}' h='##' diff --git a/bin/sh/tests/expansion/cmdsubst1.0 b/bin/sh/tests/expansion/cmdsubst1.0 index 515c7da9aca1..dd0a3f2f16b1 100644 --- a/bin/sh/tests/expansion/cmdsubst1.0 +++ b/bin/sh/tests/expansion/cmdsubst1.0 @@ -1,4 +1,3 @@ -# $FreeBSD$ failures=0 diff --git a/bin/sh/tests/expansion/cmdsubst10.0 b/bin/sh/tests/expansion/cmdsubst10.0 index 7cf17a3e8fe1..da78234418f7 100644 --- a/bin/sh/tests/expansion/cmdsubst10.0 +++ b/bin/sh/tests/expansion/cmdsubst10.0 @@ -1,4 +1,3 @@ -# $FreeBSD$ a1=$(alias) : $(alias testalias=abcd) diff --git a/bin/sh/tests/expansion/cmdsubst11.0 b/bin/sh/tests/expansion/cmdsubst11.0 index f1af547421f9..57d0114b19a4 100644 --- a/bin/sh/tests/expansion/cmdsubst11.0 +++ b/bin/sh/tests/expansion/cmdsubst11.0 @@ -1,4 +1,3 @@ -# $FreeBSD$ # Not required by POSIX but useful for efficiency. diff --git a/bin/sh/tests/expansion/cmdsubst12.0 b/bin/sh/tests/expansion/cmdsubst12.0 index 50394dbb00ca..3f4947dff788 100644 --- a/bin/sh/tests/expansion/cmdsubst12.0 +++ b/bin/sh/tests/expansion/cmdsubst12.0 @@ -1,4 +1,3 @@ -# $FreeBSD$ f() { echo x$(printf foo >&2)y diff --git a/bin/sh/tests/expansion/cmdsubst13.0 b/bin/sh/tests/expansion/cmdsubst13.0 index 7fdc5b217f19..d6b55ea8a3d4 100644 --- a/bin/sh/tests/expansion/cmdsubst13.0 +++ b/bin/sh/tests/expansion/cmdsubst13.0 @@ -1,4 +1,3 @@ -# $FreeBSD$ x=1 y=2 [ "$( diff --git a/bin/sh/tests/expansion/cmdsubst14.0 b/bin/sh/tests/expansion/cmdsubst14.0 index bdbbb823e2b2..b09a6b0a254b 100644 --- a/bin/sh/tests/expansion/cmdsubst14.0 +++ b/bin/sh/tests/expansion/cmdsubst14.0 @@ -1,4 +1,3 @@ -# $FreeBSD$ ! v=`false diff --git a/bin/sh/tests/expansion/cmdsubst15.0 b/bin/sh/tests/expansion/cmdsubst15.0 index 31d85d497e23..b9857775a376 100644 --- a/bin/sh/tests/expansion/cmdsubst15.0 +++ b/bin/sh/tests/expansion/cmdsubst15.0 @@ -1,4 +1,3 @@ -# $FreeBSD$ ! v=`false; diff --git a/bin/sh/tests/expansion/cmdsubst16.0 b/bin/sh/tests/expansion/cmdsubst16.0 index 71df562298e5..bbce408f4c74 100644 --- a/bin/sh/tests/expansion/cmdsubst16.0 +++ b/bin/sh/tests/expansion/cmdsubst16.0 @@ -1,4 +1,3 @@ -# $FreeBSD$ f() { return 3; } f diff --git a/bin/sh/tests/expansion/cmdsubst17.0 b/bin/sh/tests/expansion/cmdsubst17.0 index 8c29e8318327..8157a730f1b9 100644 --- a/bin/sh/tests/expansion/cmdsubst17.0 +++ b/bin/sh/tests/expansion/cmdsubst17.0 @@ -1,4 +1,3 @@ -# $FreeBSD$ f() { return 3; } f diff --git a/bin/sh/tests/expansion/cmdsubst18.0 b/bin/sh/tests/expansion/cmdsubst18.0 index a9791b3acae6..f320ca01f006 100644 --- a/bin/sh/tests/expansion/cmdsubst18.0 +++ b/bin/sh/tests/expansion/cmdsubst18.0 @@ -1,4 +1,3 @@ -# $FreeBSD$ x=X unset n diff --git a/bin/sh/tests/expansion/cmdsubst19.0 b/bin/sh/tests/expansion/cmdsubst19.0 index ae6619a775f7..d4ae49e54de1 100644 --- a/bin/sh/tests/expansion/cmdsubst19.0 +++ b/bin/sh/tests/expansion/cmdsubst19.0 @@ -1,4 +1,3 @@ -# $FreeBSD$ b=200 c=30 d=5 x=4 r=$(echo a)$(($(echo b) + ${x+$(echo c)} + ${x-$(echo d)}))$(echo e) diff --git a/bin/sh/tests/expansion/cmdsubst2.0 b/bin/sh/tests/expansion/cmdsubst2.0 index b86776ed24b0..af4b594c6f25 100644 --- a/bin/sh/tests/expansion/cmdsubst2.0 +++ b/bin/sh/tests/expansion/cmdsubst2.0 @@ -1,4 +1,3 @@ -# $FreeBSD$ failures=0 diff --git a/bin/sh/tests/expansion/cmdsubst20.0 b/bin/sh/tests/expansion/cmdsubst20.0 index 33932487b89f..8b759f46a01b 100644 --- a/bin/sh/tests/expansion/cmdsubst20.0 +++ b/bin/sh/tests/expansion/cmdsubst20.0 @@ -1,4 +1,3 @@ -# $FreeBSD$ set -T trapped='' diff --git a/bin/sh/tests/expansion/cmdsubst21.0 b/bin/sh/tests/expansion/cmdsubst21.0 index 87ff6a9db4ad..ed38a4e1d70e 100644 --- a/bin/sh/tests/expansion/cmdsubst21.0 +++ b/bin/sh/tests/expansion/cmdsubst21.0 @@ -1,4 +1,3 @@ -# $FreeBSD$ set -T trapped='' diff --git a/bin/sh/tests/expansion/cmdsubst22.0 b/bin/sh/tests/expansion/cmdsubst22.0 index 97c6c98dff87..c647fb205fa8 100644 --- a/bin/sh/tests/expansion/cmdsubst22.0 +++ b/bin/sh/tests/expansion/cmdsubst22.0 @@ -1,4 +1,3 @@ -# $FreeBSD$ set -T trapped='' diff --git a/bin/sh/tests/expansion/cmdsubst23.0 b/bin/sh/tests/expansion/cmdsubst23.0 index cde86981f461..97fcad3f9b32 100644 --- a/bin/sh/tests/expansion/cmdsubst23.0 +++ b/bin/sh/tests/expansion/cmdsubst23.0 @@ -1,4 +1,3 @@ -# $FreeBSD$ unset n x=abcd diff --git a/bin/sh/tests/expansion/cmdsubst24.0 b/bin/sh/tests/expansion/cmdsubst24.0 index 4b34247d6805..baf7841a491a 100644 --- a/bin/sh/tests/expansion/cmdsubst24.0 +++ b/bin/sh/tests/expansion/cmdsubst24.0 @@ -1,4 +1,3 @@ -# $FreeBSD$ # POSIX leaves the effect of NUL bytes in command substitution output # unspecified but we have always discarded them. diff --git a/bin/sh/tests/expansion/cmdsubst25.0 b/bin/sh/tests/expansion/cmdsubst25.0 index 83cca7d0b97e..4804602b9c54 100644 --- a/bin/sh/tests/expansion/cmdsubst25.0 +++ b/bin/sh/tests/expansion/cmdsubst25.0 @@ -1,4 +1,3 @@ -# $FreeBSD$ IFS=' ' set -- `printf '\n '` diff --git a/bin/sh/tests/expansion/cmdsubst26.0 b/bin/sh/tests/expansion/cmdsubst26.0 index 68a624b12471..25aa4b5a6ecc 100644 --- a/bin/sh/tests/expansion/cmdsubst26.0 +++ b/bin/sh/tests/expansion/cmdsubst26.0 @@ -1,4 +1,3 @@ -# $FreeBSD$ nl=' ' diff --git a/bin/sh/tests/expansion/cmdsubst3.0 b/bin/sh/tests/expansion/cmdsubst3.0 index abb6b225a257..b6a09a24bc91 100644 --- a/bin/sh/tests/expansion/cmdsubst3.0 +++ b/bin/sh/tests/expansion/cmdsubst3.0 @@ -1,4 +1,3 @@ -# $FreeBSD$ unset LC_ALL export LC_CTYPE=en_US.ISO8859-1 diff --git a/bin/sh/tests/expansion/cmdsubst4.0 b/bin/sh/tests/expansion/cmdsubst4.0 index ee1ce73e7e38..95db034ba7a8 100644 --- a/bin/sh/tests/expansion/cmdsubst4.0 +++ b/bin/sh/tests/expansion/cmdsubst4.0 @@ -1,4 +1,3 @@ -# $FreeBSD$ exec 2>/dev/null ! y=$(: </var/empty/nonexistent) diff --git a/bin/sh/tests/expansion/cmdsubst5.0 b/bin/sh/tests/expansion/cmdsubst5.0 index afca3719e8b0..a6b467ebf986 100644 --- a/bin/sh/tests/expansion/cmdsubst5.0 +++ b/bin/sh/tests/expansion/cmdsubst5.0 @@ -1,4 +1,3 @@ -# $FreeBSD$ unset v exec 2>/dev/null diff --git a/bin/sh/tests/expansion/cmdsubst6.0 b/bin/sh/tests/expansion/cmdsubst6.0 index 6586f330db5b..43a5d6240fec 100644 --- a/bin/sh/tests/expansion/cmdsubst6.0 +++ b/bin/sh/tests/expansion/cmdsubst6.0 @@ -1,4 +1,3 @@ -# $FreeBSD$ # This tests if the cmdsubst optimization is still used if possible. failures='' diff --git a/bin/sh/tests/expansion/cmdsubst7.0 b/bin/sh/tests/expansion/cmdsubst7.0 index dbd1aec5f9da..c767ac465f35 100644 --- a/bin/sh/tests/expansion/cmdsubst7.0 +++ b/bin/sh/tests/expansion/cmdsubst7.0 @@ -1,4 +1,3 @@ -# $FreeBSD$ failures='' ok='' diff --git a/bin/sh/tests/expansion/cmdsubst8.0 b/bin/sh/tests/expansion/cmdsubst8.0 index 52adaea33b93..fe8330a1bd10 100644 --- a/bin/sh/tests/expansion/cmdsubst8.0 +++ b/bin/sh/tests/expansion/cmdsubst8.0 @@ -1,4 +1,3 @@ -# $FreeBSD$ # Not required by POSIX (although referenced in a non-normative section), # but possibly useful. diff --git a/bin/sh/tests/expansion/cmdsubst9.0 b/bin/sh/tests/expansion/cmdsubst9.0 index 0b1f81f3537a..e512c6b86952 100644 --- a/bin/sh/tests/expansion/cmdsubst9.0 +++ b/bin/sh/tests/expansion/cmdsubst9.0 @@ -1,4 +1,3 @@ -# $FreeBSD$ set -e diff --git a/bin/sh/tests/expansion/export1.0 b/bin/sh/tests/expansion/export1.0 index 4ee3ef4ffa41..6b969c79e3bd 100644 --- a/bin/sh/tests/expansion/export1.0 +++ b/bin/sh/tests/expansion/export1.0 @@ -1,4 +1,3 @@ -# $FreeBSD$ w='@ vv=6' diff --git a/bin/sh/tests/expansion/export2.0 b/bin/sh/tests/expansion/export2.0 index 57f64e7f7f7b..2959e5684af5 100644 --- a/bin/sh/tests/expansion/export2.0 +++ b/bin/sh/tests/expansion/export2.0 @@ -1,4 +1,3 @@ -# $FreeBSD$ w='@ @' check() { diff --git a/bin/sh/tests/expansion/export3.0 b/bin/sh/tests/expansion/export3.0 index a1a0e6658a08..94f55c9bd66c 100644 --- a/bin/sh/tests/expansion/export3.0 +++ b/bin/sh/tests/expansion/export3.0 @@ -1,4 +1,3 @@ -# $FreeBSD$ w='@ @' check() { diff --git a/bin/sh/tests/expansion/heredoc1.0 b/bin/sh/tests/expansion/heredoc1.0 index a67b2da2e5f2..ade91b091b54 100644 --- a/bin/sh/tests/expansion/heredoc1.0 +++ b/bin/sh/tests/expansion/heredoc1.0 @@ -1,4 +1,3 @@ -# $FreeBSD$ f() { return $1; } diff --git a/bin/sh/tests/expansion/heredoc2.0 b/bin/sh/tests/expansion/heredoc2.0 index 255143296d4a..b8ce6055909b 100644 --- a/bin/sh/tests/expansion/heredoc2.0 +++ b/bin/sh/tests/expansion/heredoc2.0 @@ -1,4 +1,3 @@ -# $FreeBSD$ f() { return $1; } diff --git a/bin/sh/tests/expansion/ifs1.0 b/bin/sh/tests/expansion/ifs1.0 index e7f53c77a5f9..e803d63ce6fe 100644 --- a/bin/sh/tests/expansion/ifs1.0 +++ b/bin/sh/tests/expansion/ifs1.0 @@ -1,4 +1,3 @@ -# $FreeBSD$ c=: e= s=' ' failures='' diff --git a/bin/sh/tests/expansion/ifs2.0 b/bin/sh/tests/expansion/ifs2.0 index e91b86707183..35e76943deb3 100644 --- a/bin/sh/tests/expansion/ifs2.0 +++ b/bin/sh/tests/expansion/ifs2.0 @@ -1,4 +1,3 @@ -# $FreeBSD$ failures=0 i=1 diff --git a/bin/sh/tests/expansion/ifs3.0 b/bin/sh/tests/expansion/ifs3.0 index 0569b5729cae..fdf4e2f9d9b7 100644 --- a/bin/sh/tests/expansion/ifs3.0 +++ b/bin/sh/tests/expansion/ifs3.0 @@ -1,4 +1,3 @@ -# $FreeBSD$ failures=0 unset LC_ALL diff --git a/bin/sh/tests/expansion/ifs4.0 b/bin/sh/tests/expansion/ifs4.0 index 5b896a25413b..6ce097ede67d 100644 --- a/bin/sh/tests/expansion/ifs4.0 +++ b/bin/sh/tests/expansion/ifs4.0 @@ -1,4 +1,3 @@ -# $FreeBSD$ c=: e= s=' ' failures='' diff --git a/bin/sh/tests/expansion/ifs5.0 b/bin/sh/tests/expansion/ifs5.0 index ab0e64662fdf..6fdf6ebbdf41 100644 --- a/bin/sh/tests/expansion/ifs5.0 +++ b/bin/sh/tests/expansion/ifs5.0 @@ -1,4 +1,3 @@ -# $FreeBSD$ set -- $(echo a b c d) [ "$#" = 4 ] diff --git a/bin/sh/tests/expansion/ifs6.0 b/bin/sh/tests/expansion/ifs6.0 index be7794563085..e11a678cf41a 100644 --- a/bin/sh/tests/expansion/ifs6.0 +++ b/bin/sh/tests/expansion/ifs6.0 @@ -1,4 +1,3 @@ -# $FreeBSD$ IFS=': ' x=': :' diff --git a/bin/sh/tests/expansion/ifs7.0 b/bin/sh/tests/expansion/ifs7.0 index 0cc08348c04a..13e9419ce495 100644 --- a/bin/sh/tests/expansion/ifs7.0 +++ b/bin/sh/tests/expansion/ifs7.0 @@ -1,4 +1,3 @@ -# $FreeBSD$ IFS=2 set -- $((123)) diff --git a/bin/sh/tests/expansion/length1.0 b/bin/sh/tests/expansion/length1.0 index 2aaebf9048a2..48317c44f8b5 100644 --- a/bin/sh/tests/expansion/length1.0 +++ b/bin/sh/tests/expansion/length1.0 @@ -1,4 +1,3 @@ -# $FreeBSD$ v=abcd [ "${#v}" = 4 ] || echo '${#v} wrong' diff --git a/bin/sh/tests/expansion/length2.0 b/bin/sh/tests/expansion/length2.0 index d749b51f4b20..1e74564eba64 100644 --- a/bin/sh/tests/expansion/length2.0 +++ b/bin/sh/tests/expansion/length2.0 @@ -1,4 +1,3 @@ -# $FreeBSD$ v=$- [ "${#-}" = "${#v}" ] || echo '${#-} wrong' diff --git a/bin/sh/tests/expansion/length3.0 b/bin/sh/tests/expansion/length3.0 index 2093eed8bbd3..fe3e38e5c35a 100644 --- a/bin/sh/tests/expansion/length3.0 +++ b/bin/sh/tests/expansion/length3.0 @@ -1,4 +1,3 @@ -# $FreeBSD$ set -- 1 2 3 4 5 6 7 8 9 10 11 12 13 [ "$#" = 13 ] || echo '$# wrong' diff --git a/bin/sh/tests/expansion/length4.0 b/bin/sh/tests/expansion/length4.0 index 5348be511379..5c032d47ff91 100644 --- a/bin/sh/tests/expansion/length4.0 +++ b/bin/sh/tests/expansion/length4.0 @@ -1,4 +1,3 @@ -# $FreeBSD$ # The construct ${#?} is ambiguous in POSIX.1-2008: it could be the length # of $? or it could be $# giving an error in the (impossible) case that it diff --git a/bin/sh/tests/expansion/length5.0 b/bin/sh/tests/expansion/length5.0 index 322ca162b0b6..b2483127e441 100644 --- a/bin/sh/tests/expansion/length5.0 +++ b/bin/sh/tests/expansion/length5.0 @@ -1,4 +1,3 @@ -# $FreeBSD$ unset LC_ALL LC_CTYPE=en_US.ISO8859-1 diff --git a/bin/sh/tests/expansion/length6.0 b/bin/sh/tests/expansion/length6.0 index 6b78309f6b81..be719874dc10 100644 --- a/bin/sh/tests/expansion/length6.0 +++ b/bin/sh/tests/expansion/length6.0 @@ -1,4 +1,3 @@ -# $FreeBSD$ x='!@#$%^&*()[]' [ ${#x} = 12 ] || echo bad 1 diff --git a/bin/sh/tests/expansion/length7.0 b/bin/sh/tests/expansion/length7.0 index b79b11616c15..8bb128ba26d5 100644 --- a/bin/sh/tests/expansion/length7.0 +++ b/bin/sh/tests/expansion/length7.0 @@ -1,4 +1,3 @@ -# $FreeBSD$ unset LC_ALL LC_CTYPE=en_US.UTF-8 diff --git a/bin/sh/tests/expansion/length8.0 b/bin/sh/tests/expansion/length8.0 index 3cc6c15e7ece..1aae6d1a8cf9 100644 --- a/bin/sh/tests/expansion/length8.0 +++ b/bin/sh/tests/expansion/length8.0 @@ -1,4 +1,3 @@ -# $FreeBSD$ unset LC_ALL LC_CTYPE=en_US.ISO8859-1 diff --git a/bin/sh/tests/expansion/local1.0 b/bin/sh/tests/expansion/local1.0 index 34778351f1f3..745f49f2d5dd 100644 --- a/bin/sh/tests/expansion/local1.0 +++ b/bin/sh/tests/expansion/local1.0 @@ -1,4 +1,3 @@ -# $FreeBSD$ run_test() { w='@ @' diff --git a/bin/sh/tests/expansion/local2.0 b/bin/sh/tests/expansion/local2.0 index 19842900e0c1..365366e39905 100644 --- a/bin/sh/tests/expansion/local2.0 +++ b/bin/sh/tests/expansion/local2.0 @@ -1,4 +1,3 @@ -# $FreeBSD$ run_test() { w='@ @' diff --git a/bin/sh/tests/expansion/pathname1.0 b/bin/sh/tests/expansion/pathname1.0 index a4bb0938837f..1a3227d0d5d0 100644 --- a/bin/sh/tests/expansion/pathname1.0 +++ b/bin/sh/tests/expansion/pathname1.0 @@ -1,4 +1,3 @@ -# $FreeBSD$ unset LC_ALL LC_COLLATE=C diff --git a/bin/sh/tests/expansion/pathname2.0 b/bin/sh/tests/expansion/pathname2.0 index 5643cf907c87..69b8f7050cbc 100644 --- a/bin/sh/tests/expansion/pathname2.0 +++ b/bin/sh/tests/expansion/pathname2.0 @@ -1,4 +1,3 @@ -# $FreeBSD$ unset LC_ALL LC_COLLATE=C diff --git a/bin/sh/tests/expansion/pathname3.0 b/bin/sh/tests/expansion/pathname3.0 index d1672e057ec5..51f223dcf787 100644 --- a/bin/sh/tests/expansion/pathname3.0 +++ b/bin/sh/tests/expansion/pathname3.0 @@ -1,4 +1,3 @@ -# $FreeBSD$ v=12345678 v=$v$v$v$v diff --git a/bin/sh/tests/expansion/pathname4.0 b/bin/sh/tests/expansion/pathname4.0 index 18269c4318e6..5f6b54174332 100644 --- a/bin/sh/tests/expansion/pathname4.0 +++ b/bin/sh/tests/expansion/pathname4.0 @@ -1,4 +1,3 @@ -# $FreeBSD$ failures=0 diff --git a/bin/sh/tests/expansion/pathname5.0 b/bin/sh/tests/expansion/pathname5.0 index bc278124de4f..7277f7bc1e3c 100644 --- a/bin/sh/tests/expansion/pathname5.0 +++ b/bin/sh/tests/expansion/pathname5.0 @@ -1,3 +1,2 @@ -# $FreeBSD$ [ `echo '/[e]tc'` = /etc ] diff --git a/bin/sh/tests/expansion/pathname6.0 b/bin/sh/tests/expansion/pathname6.0 index dc425ce64950..f607c9a351ca 100644 --- a/bin/sh/tests/expansion/pathname6.0 +++ b/bin/sh/tests/expansion/pathname6.0 @@ -1,4 +1,3 @@ -# $FreeBSD$ unset LC_ALL LC_COLLATE=en_US.US-ASCII diff --git a/bin/sh/tests/expansion/plus-minus1.0 b/bin/sh/tests/expansion/plus-minus1.0 index 9a6a53a2414a..6b7f22f61287 100644 --- a/bin/sh/tests/expansion/plus-minus1.0 +++ b/bin/sh/tests/expansion/plus-minus1.0 @@ -1,4 +1,3 @@ -# $FreeBSD$ e= q='?' a='*' t=texttext s='ast*que?non' p='/et[c]/' w='a b c' b='{{(#)}}' h='##' diff --git a/bin/sh/tests/expansion/plus-minus2.0 b/bin/sh/tests/expansion/plus-minus2.0 index f5a87525ae37..b2794c5e7069 100644 --- a/bin/sh/tests/expansion/plus-minus2.0 +++ b/bin/sh/tests/expansion/plus-minus2.0 @@ -1,4 +1,3 @@ -# $FreeBSD$ e= test "${e:-\}}" = '}' diff --git a/bin/sh/tests/expansion/plus-minus3.0 b/bin/sh/tests/expansion/plus-minus3.0 index 49fcdc2f8f56..59c4326bbffe 100644 --- a/bin/sh/tests/expansion/plus-minus3.0 +++ b/bin/sh/tests/expansion/plus-minus3.0 @@ -1,4 +1,3 @@ -# $FreeBSD$ e= q='?' a='*' t=texttext s='ast*que?non' p='/et[c]/' w='a b c' b='{{(#)}}' h='##' diff --git a/bin/sh/tests/expansion/plus-minus4.0 b/bin/sh/tests/expansion/plus-minus4.0 index 66dea3851efc..fc845418b0e8 100644 --- a/bin/sh/tests/expansion/plus-minus4.0 +++ b/bin/sh/tests/expansion/plus-minus4.0 @@ -1,4 +1,3 @@ -# $FreeBSD$ # These may be a bit unclear in the POSIX spec or the proposed revisions, # and conflict with bash's interpretation, but I think ksh93's interpretation diff --git a/bin/sh/tests/expansion/plus-minus5.0 b/bin/sh/tests/expansion/plus-minus5.0 index 0b25e53cf82a..aa717c74ab34 100644 --- a/bin/sh/tests/expansion/plus-minus5.0 +++ b/bin/sh/tests/expansion/plus-minus5.0 @@ -1,4 +1,3 @@ -# $FreeBSD$ e= q='?' a='*' t=texttext s='ast*que?non' p='/et[c]/' w='a b c' b='{{(#)}}' h='##' diff --git a/bin/sh/tests/expansion/plus-minus6.0 b/bin/sh/tests/expansion/plus-minus6.0 index bc6680526823..dd959a9a894c 100644 --- a/bin/sh/tests/expansion/plus-minus6.0 +++ b/bin/sh/tests/expansion/plus-minus6.0 @@ -1,4 +1,3 @@ -# $FreeBSD$ failures=0 unset LC_ALL diff --git a/bin/sh/tests/expansion/plus-minus7.0 b/bin/sh/tests/expansion/plus-minus7.0 index 9e81f58a0a99..65c6eb98a338 100644 --- a/bin/sh/tests/expansion/plus-minus7.0 +++ b/bin/sh/tests/expansion/plus-minus7.0 @@ -1,4 +1,3 @@ -# $FreeBSD$ e= s='foo' failures='' diff --git a/bin/sh/tests/expansion/plus-minus8.0 b/bin/sh/tests/expansion/plus-minus8.0 index beba009b0660..ef8de8a46909 100644 --- a/bin/sh/tests/expansion/plus-minus8.0 +++ b/bin/sh/tests/expansion/plus-minus8.0 @@ -1,4 +1,3 @@ -# $FreeBSD$ set -- 1 2 3 4 5 6 7 8 9 10 11 12 13 [ "${#+hi}" = hi ] || echo '${#+hi} wrong' diff --git a/bin/sh/tests/expansion/plus-minus9.0 b/bin/sh/tests/expansion/plus-minus9.0 index bd2629ad9a76..1fa2c92d14cd 100644 --- a/bin/sh/tests/expansion/plus-minus9.0 +++ b/bin/sh/tests/expansion/plus-minus9.0 @@ -1,4 +1,3 @@ -# $FreeBSD$ a=1 b=${a+ diff --git a/bin/sh/tests/expansion/question1.0 b/bin/sh/tests/expansion/question1.0 index 663c68d2046d..b9d1b72be648 100644 --- a/bin/sh/tests/expansion/question1.0 +++ b/bin/sh/tests/expansion/question1.0 @@ -1,4 +1,3 @@ -# $FreeBSD$ x=a\ b [ "$x" = "${x?}" ] || exit 1 diff --git a/bin/sh/tests/expansion/question2.0 b/bin/sh/tests/expansion/question2.0 index 592385d1df02..af7d0db99271 100644 --- a/bin/sh/tests/expansion/question2.0 +++ b/bin/sh/tests/expansion/question2.0 @@ -1,4 +1,3 @@ -# $FreeBSD$ unset dummyvar msg=`(: ${dummyvar?}) 2>&1` diff --git a/bin/sh/tests/expansion/readonly1.0 b/bin/sh/tests/expansion/readonly1.0 index 5ad0e143f81f..5ced727a4fd6 100644 --- a/bin/sh/tests/expansion/readonly1.0 +++ b/bin/sh/tests/expansion/readonly1.0 @@ -1,4 +1,3 @@ -# $FreeBSD$ w='@ @' diff --git a/bin/sh/tests/expansion/redir1.0 b/bin/sh/tests/expansion/redir1.0 index aa13e1561b68..50b841e47439 100644 --- a/bin/sh/tests/expansion/redir1.0 +++ b/bin/sh/tests/expansion/redir1.0 @@ -1,4 +1,3 @@ -# $FreeBSD$ bad=0 for i in 0 1 2 3; do diff --git a/bin/sh/tests/expansion/set-u1.0 b/bin/sh/tests/expansion/set-u1.0 index 763eb7dcfc8f..da31fe6bac18 100644 --- a/bin/sh/tests/expansion/set-u1.0 +++ b/bin/sh/tests/expansion/set-u1.0 @@ -1,4 +1,3 @@ -# $FreeBSD$ ${SH} -uc 'unset foo; echo $foo' 2>/dev/null && exit 1 ${SH} -uc 'foo=; echo $foo' >/dev/null || exit 1 diff --git a/bin/sh/tests/expansion/set-u2.0 b/bin/sh/tests/expansion/set-u2.0 index f81aa62cb6ba..138f7bc27558 100644 --- a/bin/sh/tests/expansion/set-u2.0 +++ b/bin/sh/tests/expansion/set-u2.0 @@ -1,4 +1,3 @@ -# $FreeBSD$ set -u : $* $@ "$@" "$*" diff --git a/bin/sh/tests/expansion/set-u3.0 b/bin/sh/tests/expansion/set-u3.0 index 7f199b42c796..bd3644503515 100644 --- a/bin/sh/tests/expansion/set-u3.0 +++ b/bin/sh/tests/expansion/set-u3.0 @@ -1,4 +1,3 @@ -# $FreeBSD$ set -u unset x diff --git a/bin/sh/tests/expansion/tilde1.0 b/bin/sh/tests/expansion/tilde1.0 index 7d8581bbc8ee..66af698016d1 100644 --- a/bin/sh/tests/expansion/tilde1.0 +++ b/bin/sh/tests/expansion/tilde1.0 @@ -1,4 +1,3 @@ -# $FreeBSD$ HOME=/tmp roothome=~root diff --git a/bin/sh/tests/expansion/tilde2.0 b/bin/sh/tests/expansion/tilde2.0 index 4f8ed9b491c7..0d0cb1c95d76 100644 --- a/bin/sh/tests/expansion/tilde2.0 +++ b/bin/sh/tests/expansion/tilde2.0 @@ -1,4 +1,3 @@ -# $FreeBSD$ HOME=/tmp roothome=~root diff --git a/bin/sh/tests/expansion/trim1.0 b/bin/sh/tests/expansion/trim1.0 index b548e521792a..186c087062bd 100644 --- a/bin/sh/tests/expansion/trim1.0 +++ b/bin/sh/tests/expansion/trim1.0 @@ -1,4 +1,3 @@ -# $FreeBSD$ e= q='?' a='*' t=texttext s='ast*que?non' p='/et[c]/' w='a b c' b='{{(#)}}' h='##' diff --git a/bin/sh/tests/expansion/trim10.0 b/bin/sh/tests/expansion/trim10.0 index 7860485ed00a..1814af1b1793 100644 --- a/bin/sh/tests/expansion/trim10.0 +++ b/bin/sh/tests/expansion/trim10.0 @@ -1,4 +1,3 @@ -# $FreeBSD$ a='z ' diff --git a/bin/sh/tests/expansion/trim11.0 b/bin/sh/tests/expansion/trim11.0 index 904914789911..041095b66e57 100644 --- a/bin/sh/tests/expansion/trim11.0 +++ b/bin/sh/tests/expansion/trim11.0 @@ -1,4 +1,3 @@ -# $FreeBSD$ a='z ' diff --git a/bin/sh/tests/expansion/trim2.0 b/bin/sh/tests/expansion/trim2.0 index 619ef651cce6..337bbd4e46cc 100644 --- a/bin/sh/tests/expansion/trim2.0 +++ b/bin/sh/tests/expansion/trim2.0 @@ -1,4 +1,3 @@ -# $FreeBSD$ e= q='?' a='*' t=texttext s='ast*que?non' p='/et[c]/' w='a b c' b='{{(#)}}' h='##' diff --git a/bin/sh/tests/expansion/trim3.0 b/bin/sh/tests/expansion/trim3.0 index b89a04140c37..d58ae50c7824 100644 --- a/bin/sh/tests/expansion/trim3.0 +++ b/bin/sh/tests/expansion/trim3.0 @@ -1,4 +1,3 @@ -# $FreeBSD$ e= q='?' a='*' t=texttext s='ast*que?non' p='/et[c]/' w='a b c' b='{{(#)}}' h='##' c='\\\\' diff --git a/bin/sh/tests/expansion/trim4.0 b/bin/sh/tests/expansion/trim4.0 index 1000bd3d0245..2b0766abcdfd 100644 --- a/bin/sh/tests/expansion/trim4.0 +++ b/bin/sh/tests/expansion/trim4.0 @@ -1,4 +1,3 @@ -# $FreeBSD$ v1=/homes/SOME_USER v2= diff --git a/bin/sh/tests/expansion/trim5.0 b/bin/sh/tests/expansion/trim5.0 index 937ec9a708e0..a6131b321e21 100644 --- a/bin/sh/tests/expansion/trim5.0 +++ b/bin/sh/tests/expansion/trim5.0 @@ -1,4 +1,3 @@ -# $FreeBSD$ e= q='?' a='*' t=texttext s='ast*que?non' p='/et[c]/' w='a b c' b='{{(#)}}' h='##' diff --git a/bin/sh/tests/expansion/trim6.0 b/bin/sh/tests/expansion/trim6.0 index 3f753c4113f6..b0566b90d4b3 100644 --- a/bin/sh/tests/expansion/trim6.0 +++ b/bin/sh/tests/expansion/trim6.0 @@ -1,4 +1,3 @@ -# $FreeBSD$ e= for i in 0 1 2 3; do diff --git a/bin/sh/tests/expansion/trim7.0 b/bin/sh/tests/expansion/trim7.0 index 352bdea920bf..2fcb41535c68 100644 --- a/bin/sh/tests/expansion/trim7.0 +++ b/bin/sh/tests/expansion/trim7.0 @@ -1,4 +1,3 @@ -# $FreeBSD$ set -- 1 2 3 4 5 6 7 8 9 10 11 12 13 [ "${##1}" = 3 ] || echo '${##1} wrong' diff --git a/bin/sh/tests/expansion/trim8.0 b/bin/sh/tests/expansion/trim8.0 index f7272f371dce..579d78012c40 100644 --- a/bin/sh/tests/expansion/trim8.0 +++ b/bin/sh/tests/expansion/trim8.0 @@ -1,4 +1,3 @@ -# $FreeBSD$ unset LC_ALL LC_CTYPE=en_US.UTF-8 diff --git a/bin/sh/tests/expansion/trim9.0 b/bin/sh/tests/expansion/trim9.0 index 47c825a52c3a..a6314381d362 100644 --- a/bin/sh/tests/expansion/trim9.0 +++ b/bin/sh/tests/expansion/trim9.0 @@ -1,4 +1,3 @@ -# $FreeBSD$ # POSIX does not specify these but they occasionally occur in the wild. # This just serves to keep working what currently works. diff --git a/bin/sh/tests/functional_test.sh b/bin/sh/tests/functional_test.sh index 698053885adc..3a43ccbd1a17 100755 --- a/bin/sh/tests/functional_test.sh +++ b/bin/sh/tests/functional_test.sh @@ -24,7 +24,6 @@ # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. # -# $FreeBSD$ SRCDIR=$(atf_get_srcdir) diff --git a/bin/sh/tests/invocation/Makefile b/bin/sh/tests/invocation/Makefile index b0bf97be9e69..6c892026ec75 100644 --- a/bin/sh/tests/invocation/Makefile +++ b/bin/sh/tests/invocation/Makefile @@ -1,4 +1,3 @@ -# $FreeBSD$ PACKAGE= tests diff --git a/bin/sh/tests/invocation/Makefile.depend b/bin/sh/tests/invocation/Makefile.depend index f80275d86ab1..11aba52f82cf 100644 --- a/bin/sh/tests/invocation/Makefile.depend +++ b/bin/sh/tests/invocation/Makefile.depend @@ -1,4 +1,3 @@ -# $FreeBSD$ # Autogenerated - do NOT edit! DIRDEPS = \ diff --git a/bin/sh/tests/invocation/sh-ac1.0 b/bin/sh/tests/invocation/sh-ac1.0 index 0e0818b8a2c4..8386679a6653 100644 --- a/bin/sh/tests/invocation/sh-ac1.0 +++ b/bin/sh/tests/invocation/sh-ac1.0 @@ -1,4 +1,3 @@ -# $FreeBSD$ # Test that attached options before c are processed case `${SH} -ac 'echo $-:$0' moo` in diff --git a/bin/sh/tests/invocation/sh-c-missing1.0 b/bin/sh/tests/invocation/sh-c-missing1.0 index 6089a6df3eb1..630158a754fd 100644 --- a/bin/sh/tests/invocation/sh-c-missing1.0 +++ b/bin/sh/tests/invocation/sh-c-missing1.0 @@ -1,3 +1,2 @@ -# $FreeBSD$ ! echo echo bad | ${SH} -c 2>/dev/null diff --git a/bin/sh/tests/invocation/sh-c1.0 b/bin/sh/tests/invocation/sh-c1.0 index 6bda19837b90..07dc0d840145 100644 --- a/bin/sh/tests/invocation/sh-c1.0 +++ b/bin/sh/tests/invocation/sh-c1.0 @@ -1,4 +1,3 @@ -# $FreeBSD$ # Test that -c executes command_string with the given name and arg ${SH} -c 'echo $0 $@' moo foo | grep -qx -- "moo foo" diff --git a/bin/sh/tests/invocation/sh-ca1.0 b/bin/sh/tests/invocation/sh-ca1.0 index 188b6453db2a..6fe78f1c57aa 100644 --- a/bin/sh/tests/invocation/sh-ca1.0 +++ b/bin/sh/tests/invocation/sh-ca1.0 @@ -1,4 +1,3 @@ -# $FreeBSD$ # Test that attached options after c are processed case `${SH} -ca 'echo $-:$0' moo` in diff --git a/bin/sh/tests/invocation/sh-fca1.0 b/bin/sh/tests/invocation/sh-fca1.0 index c010a5ebacdf..f31312d779d0 100644 --- a/bin/sh/tests/invocation/sh-fca1.0 +++ b/bin/sh/tests/invocation/sh-fca1.0 @@ -1,4 +1,3 @@ -# $FreeBSD$ # Test that attached options before and after c are processed case `${SH} -fca 'echo $-:$-:$0:$@' foo -bar` in diff --git a/bin/sh/tests/parameters/Makefile b/bin/sh/tests/parameters/Makefile index 939bd199a72b..0d6722b1d65a 100644 --- a/bin/sh/tests/parameters/Makefile +++ b/bin/sh/tests/parameters/Makefile @@ -1,4 +1,3 @@ -# $FreeBSD$ PACKAGE= tests diff --git a/bin/sh/tests/parameters/Makefile.depend b/bin/sh/tests/parameters/Makefile.depend index f80275d86ab1..11aba52f82cf 100644 --- a/bin/sh/tests/parameters/Makefile.depend +++ b/bin/sh/tests/parameters/Makefile.depend @@ -1,4 +1,3 @@ -# $FreeBSD$ # Autogenerated - do NOT edit! DIRDEPS = \ diff --git a/bin/sh/tests/parameters/env1.0 b/bin/sh/tests/parameters/env1.0 index c0d4a2cc9141..ade1ed6249c6 100644 --- a/bin/sh/tests/parameters/env1.0 +++ b/bin/sh/tests/parameters/env1.0 @@ -1,4 +1,3 @@ -# $FreeBSD$ export key='must contain this' unset x diff --git a/bin/sh/tests/parameters/exitstatus1.0 b/bin/sh/tests/parameters/exitstatus1.0 index 696823d58043..f3243926813c 100644 --- a/bin/sh/tests/parameters/exitstatus1.0 +++ b/bin/sh/tests/parameters/exitstatus1.0 @@ -1,4 +1,3 @@ -# $FreeBSD$ f() { [ $? = $1 ] || exit 1 } diff --git a/bin/sh/tests/parameters/ifs1.0 b/bin/sh/tests/parameters/ifs1.0 index b93d99a8a8c7..9462a46e1ae9 100644 --- a/bin/sh/tests/parameters/ifs1.0 +++ b/bin/sh/tests/parameters/ifs1.0 @@ -1,4 +1,3 @@ -# $FreeBSD$ env IFS=_ ${SH} -c ' rc=2 diff --git a/bin/sh/tests/parameters/mail1.0 b/bin/sh/tests/parameters/mail1.0 index 5791a5accc7c..09102d811513 100644 --- a/bin/sh/tests/parameters/mail1.0 +++ b/bin/sh/tests/parameters/mail1.0 @@ -1,4 +1,3 @@ -# $FreeBSD$ # Test that a non-interactive shell does not access $MAIL. goodfile=/var/empty/sh-test-goodfile diff --git a/bin/sh/tests/parameters/mail2.0 b/bin/sh/tests/parameters/mail2.0 index 343c99de9b27..d594c4a74356 100644 --- a/bin/sh/tests/parameters/mail2.0 +++ b/bin/sh/tests/parameters/mail2.0 @@ -1,4 +1,3 @@ -# $FreeBSD$ # Test that an interactive shell accesses $MAIL. goodfile=/var/empty/sh-test-goodfile diff --git a/bin/sh/tests/parameters/optind1.0 b/bin/sh/tests/parameters/optind1.0 index 33e0288e861f..516f124c38a7 100644 --- a/bin/sh/tests/parameters/optind1.0 +++ b/bin/sh/tests/parameters/optind1.0 @@ -1,3 +1,2 @@ -# $FreeBSD$ unset OPTIND && [ -z "$OPTIND" ] diff --git a/bin/sh/tests/parameters/optind2.0 b/bin/sh/tests/parameters/optind2.0 index a7689f6841a5..3ca60ba6f78d 100644 --- a/bin/sh/tests/parameters/optind2.0 +++ b/bin/sh/tests/parameters/optind2.0 @@ -1,3 +1,2 @@ -# $FreeBSD$ [ "$(OPTIND=42 ${SH} -c 'printf %s "$OPTIND"')" = 1 ] diff --git a/bin/sh/tests/parameters/positional1.0 b/bin/sh/tests/parameters/positional1.0 index 67d19516a5d9..0186ffbd6d55 100644 --- a/bin/sh/tests/parameters/positional1.0 +++ b/bin/sh/tests/parameters/positional1.0 @@ -1,4 +1,3 @@ -# $FreeBSD$ set -- a b c d e f g h i j [ "$1" = a ] || echo "error at line $LINENO" diff --git a/bin/sh/tests/parameters/positional2.0 b/bin/sh/tests/parameters/positional2.0 index fcec2a4b676e..88bd93dcfe6c 100644 --- a/bin/sh/tests/parameters/positional2.0 +++ b/bin/sh/tests/parameters/positional2.0 @@ -1,4 +1,3 @@ -# $FreeBSD$ failures='' ok='' diff --git a/bin/sh/tests/parameters/positional3.0 b/bin/sh/tests/parameters/positional3.0 index 1200469b4e12..28311fa2ee1a 100644 --- a/bin/sh/tests/parameters/positional3.0 +++ b/bin/sh/tests/parameters/positional3.0 @@ -1,4 +1,3 @@ -# $FreeBSD$ r=$(${SH} -c 'echo ${01:+yes}${010:+yes}' '' a '' '' '' '' '' '' '' '' b) [ "$r" = yesyes ] diff --git a/bin/sh/tests/parameters/positional4.0 b/bin/sh/tests/parameters/positional4.0 index c1c380c0feac..1b290b99da0c 100644 --- a/bin/sh/tests/parameters/positional4.0 +++ b/bin/sh/tests/parameters/positional4.0 @@ -1,4 +1,3 @@ -# $FreeBSD$ set -- "x$0" 2 3 4 5 6 7 8 9 "y$0" [ "${01}.${010}" = "$1.${10}" ] diff --git a/bin/sh/tests/parameters/positional5.0 b/bin/sh/tests/parameters/positional5.0 index eeaaba5321ff..ac6471ed57fd 100644 --- a/bin/sh/tests/parameters/positional5.0 +++ b/bin/sh/tests/parameters/positional5.0 @@ -1,4 +1,3 @@ -# $FreeBSD$ i=1 r=0 diff --git a/bin/sh/tests/parameters/positional6.0 b/bin/sh/tests/parameters/positional6.0 index 1410668b8a9f..43df962106b3 100644 --- a/bin/sh/tests/parameters/positional6.0 +++ b/bin/sh/tests/parameters/positional6.0 @@ -1,4 +1,3 @@ -# $FreeBSD$ IFS=? set p r diff --git a/bin/sh/tests/parameters/positional7.0 b/bin/sh/tests/parameters/positional7.0 index f170ad343996..8a21da97973e 100644 --- a/bin/sh/tests/parameters/positional7.0 +++ b/bin/sh/tests/parameters/positional7.0 @@ -1,4 +1,3 @@ -# $FreeBSD$ set -- / '' IFS=* diff --git a/bin/sh/tests/parameters/positional8.0 b/bin/sh/tests/parameters/positional8.0 index 4c4dbd5cf1a6..1b1b941c8ee6 100644 --- a/bin/sh/tests/parameters/positional8.0 +++ b/bin/sh/tests/parameters/positional8.0 @@ -1,4 +1,3 @@ -# $FreeBSD$ failures='' ok='' diff --git a/bin/sh/tests/parameters/positional9.0 b/bin/sh/tests/parameters/positional9.0 index 8571bfaf6135..823995f0c783 100644 --- a/bin/sh/tests/parameters/positional9.0 +++ b/bin/sh/tests/parameters/positional9.0 @@ -1,4 +1,3 @@ -# $FreeBSD$ # Although POSIX leaves the result of expanding ${#@} and ${#*} unspecified, # make sure it is at least numeric. diff --git a/bin/sh/tests/parameters/pwd1.0 b/bin/sh/tests/parameters/pwd1.0 index 0099379a9d3c..cd0d8329cd8c 100644 --- a/bin/sh/tests/parameters/pwd1.0 +++ b/bin/sh/tests/parameters/pwd1.0 @@ -1,4 +1,3 @@ -# $FreeBSD$ # Check that bogus PWD values are not accepted from the environment. cd / || exit 3 diff --git a/bin/sh/tests/parameters/pwd2.0 b/bin/sh/tests/parameters/pwd2.0 index 2297f8b753d4..69ab5c896f9e 100644 --- a/bin/sh/tests/parameters/pwd2.0 +++ b/bin/sh/tests/parameters/pwd2.0 @@ -1,4 +1,3 @@ -# $FreeBSD$ # Check that PWD is exported and accepted from the environment. set -e diff --git a/bin/sh/tests/parser/Makefile b/bin/sh/tests/parser/Makefile index f3a15badeb52..812edafa7ca8 100644 --- a/bin/sh/tests/parser/Makefile +++ b/bin/sh/tests/parser/Makefile @@ -1,4 +1,3 @@ -# $FreeBSD$ PACKAGE= tests @@ -65,6 +64,9 @@ ${PACKAGE}FILES+= heredoc10.0 ${PACKAGE}FILES+= heredoc11.0 ${PACKAGE}FILES+= heredoc12.0 ${PACKAGE}FILES+= heredoc13.0 +${PACKAGE}FILES+= heredoc14.0 +${PACKAGE}FILES+= heredoc15.0 +${PACKAGE}FILES+= heredoc16.0 ${PACKAGE}FILES+= line-cont1.0 ${PACKAGE}FILES+= line-cont2.0 ${PACKAGE}FILES+= line-cont3.0 diff --git a/bin/sh/tests/parser/Makefile.depend b/bin/sh/tests/parser/Makefile.depend index f80275d86ab1..11aba52f82cf 100644 --- a/bin/sh/tests/parser/Makefile.depend +++ b/bin/sh/tests/parser/Makefile.depend @@ -1,4 +1,3 @@ -# $FreeBSD$ # Autogenerated - do NOT edit! DIRDEPS = \ diff --git a/bin/sh/tests/parser/alias1.0 b/bin/sh/tests/parser/alias1.0 index 75dd9ab9b8f1..2380bb95e449 100644 --- a/bin/sh/tests/parser/alias1.0 +++ b/bin/sh/tests/parser/alias1.0 @@ -1,4 +1,3 @@ -# $FreeBSD$ alias alias0=exit eval 'alias0 0' diff --git a/bin/sh/tests/parser/alias10.0 b/bin/sh/tests/parser/alias10.0 index 30d99f49bbf4..d8c77691b2b8 100644 --- a/bin/sh/tests/parser/alias10.0 +++ b/bin/sh/tests/parser/alias10.0 @@ -1,4 +1,3 @@ -# $FreeBSD$ # This test may start consuming memory indefinitely if it fails. ulimit -t 5 2>/dev/null diff --git a/bin/sh/tests/parser/alias11.0 b/bin/sh/tests/parser/alias11.0 index 522264ff823f..286323028a2c 100644 --- a/bin/sh/tests/parser/alias11.0 +++ b/bin/sh/tests/parser/alias11.0 @@ -1,4 +1,3 @@ -# $FreeBSD$ alias alias0=alias1 alias alias1=exit diff --git a/bin/sh/tests/parser/alias12.0 b/bin/sh/tests/parser/alias12.0 index 2e4379155d4a..30be135c0cd1 100644 --- a/bin/sh/tests/parser/alias12.0 +++ b/bin/sh/tests/parser/alias12.0 @@ -1,4 +1,3 @@ -# $FreeBSD$ unalias -a alias alias0=command diff --git a/bin/sh/tests/parser/alias13.0 b/bin/sh/tests/parser/alias13.0 index 53b949dc23e9..df35c5045aa5 100644 --- a/bin/sh/tests/parser/alias13.0 +++ b/bin/sh/tests/parser/alias13.0 @@ -1,4 +1,3 @@ -# $FreeBSD$ unalias -a alias command=command diff --git a/bin/sh/tests/parser/alias14.0 b/bin/sh/tests/parser/alias14.0 index 1b92fc07d5b2..20acd59d4d4c 100644 --- a/bin/sh/tests/parser/alias14.0 +++ b/bin/sh/tests/parser/alias14.0 @@ -1,4 +1,3 @@ -# $FreeBSD$ alias command='command ' alias alias0=exit diff --git a/bin/sh/tests/parser/alias15.0 b/bin/sh/tests/parser/alias15.0 index f0fbadbb20e7..19a1a36eaaff 100644 --- a/bin/sh/tests/parser/alias15.0 +++ b/bin/sh/tests/parser/alias15.0 @@ -1,4 +1,3 @@ -# $FreeBSD$ f_echoanddo() { printf '%s\n' "$*" diff --git a/bin/sh/tests/parser/alias16.0 b/bin/sh/tests/parser/alias16.0 index 2df9c254e57d..b611c69ab04f 100644 --- a/bin/sh/tests/parser/alias16.0 +++ b/bin/sh/tests/parser/alias16.0 @@ -1,4 +1,3 @@ -# $FreeBSD$ v=1 alias a='unalias a diff --git a/bin/sh/tests/parser/alias17.0 b/bin/sh/tests/parser/alias17.0 index 005eeb72dee4..c2e24c68aa5f 100644 --- a/bin/sh/tests/parser/alias17.0 +++ b/bin/sh/tests/parser/alias17.0 @@ -1,4 +1,3 @@ -# $FreeBSD$ v=1 alias a='unalias -a diff --git a/bin/sh/tests/parser/alias18.0 b/bin/sh/tests/parser/alias18.0 index 74234fe72c05..05117c5a830f 100644 --- a/bin/sh/tests/parser/alias18.0 +++ b/bin/sh/tests/parser/alias18.0 @@ -1,4 +1,3 @@ -# $FreeBSD$ v=1 alias a='alias a=v=2 diff --git a/bin/sh/tests/parser/alias19.0 b/bin/sh/tests/parser/alias19.0 index d086f652fea5..c35930e9835d 100644 --- a/bin/sh/tests/parser/alias19.0 +++ b/bin/sh/tests/parser/alias19.0 @@ -1,4 +1,3 @@ -# $FreeBSD$ alias begin={ end=} begin diff --git a/bin/sh/tests/parser/alias2.0 b/bin/sh/tests/parser/alias2.0 index ae99b8a588c2..e92d62eaefdc 100644 --- a/bin/sh/tests/parser/alias2.0 +++ b/bin/sh/tests/parser/alias2.0 @@ -1,4 +1,3 @@ -# $FreeBSD$ alias alias0=exit x=alias0 diff --git a/bin/sh/tests/parser/alias20.0 b/bin/sh/tests/parser/alias20.0 index 0eedd5214016..7e1767eaccd8 100644 --- a/bin/sh/tests/parser/alias20.0 +++ b/bin/sh/tests/parser/alias20.0 @@ -1,4 +1,3 @@ -# $FreeBSD$ alias begin={ end=} : <<EOF && diff --git a/bin/sh/tests/parser/alias3.0 b/bin/sh/tests/parser/alias3.0 index e0721e2aaa01..4651ba149c60 100644 --- a/bin/sh/tests/parser/alias3.0 +++ b/bin/sh/tests/parser/alias3.0 @@ -1,4 +1,3 @@ -# $FreeBSD$ alias alias0=exit x=alias0 diff --git a/bin/sh/tests/parser/alias4.0 b/bin/sh/tests/parser/alias4.0 index 19332ed09056..a46923d1ebdd 100644 --- a/bin/sh/tests/parser/alias4.0 +++ b/bin/sh/tests/parser/alias4.0 @@ -1,4 +1,3 @@ -# $FreeBSD$ alias alias0=exit eval 'x=1 alias0 0' diff --git a/bin/sh/tests/parser/alias5.0 b/bin/sh/tests/parser/alias5.0 index 3d0205fd2332..4c393cd116d9 100644 --- a/bin/sh/tests/parser/alias5.0 +++ b/bin/sh/tests/parser/alias5.0 @@ -1,4 +1,3 @@ -# $FreeBSD$ alias alias0=exit eval '</dev/null alias0 0' diff --git a/bin/sh/tests/parser/alias6.0 b/bin/sh/tests/parser/alias6.0 index c723d08ab3eb..23c3d39de002 100644 --- a/bin/sh/tests/parser/alias6.0 +++ b/bin/sh/tests/parser/alias6.0 @@ -1,4 +1,3 @@ -# $FreeBSD$ alias alias0='| cat >/dev/null' diff --git a/bin/sh/tests/parser/alias7.0 b/bin/sh/tests/parser/alias7.0 index b26f0dd067cd..f644ceaa7abd 100644 --- a/bin/sh/tests/parser/alias7.0 +++ b/bin/sh/tests/parser/alias7.0 @@ -1,4 +1,3 @@ -# $FreeBSD$ alias echo='echo a' [ "`eval echo b`" = "a b" ] diff --git a/bin/sh/tests/parser/alias8.0 b/bin/sh/tests/parser/alias8.0 index 7fc2f15f0931..c71997f362cf 100644 --- a/bin/sh/tests/parser/alias8.0 +++ b/bin/sh/tests/parser/alias8.0 @@ -1,4 +1,3 @@ -# $FreeBSD$ alias echo='echo' [ "`eval echo b`" = b ] diff --git a/bin/sh/tests/parser/alias9.0 b/bin/sh/tests/parser/alias9.0 index 6bd8808cc379..50fe86e2b8fd 100644 --- a/bin/sh/tests/parser/alias9.0 +++ b/bin/sh/tests/parser/alias9.0 @@ -1,4 +1,3 @@ -# $FreeBSD$ alias alias0=: alias alias0=exit diff --git a/bin/sh/tests/parser/and-pipe-not.0 b/bin/sh/tests/parser/and-pipe-not.0 index 35b125c14767..90889bfe62f6 100644 --- a/bin/sh/tests/parser/and-pipe-not.0 +++ b/bin/sh/tests/parser/and-pipe-not.0 @@ -1,2 +1 @@ -# $FreeBSD$ true && ! true | false diff --git a/bin/sh/tests/parser/case1.0 b/bin/sh/tests/parser/case1.0 index 49b4c45155fa..8b4e1c342a68 100644 --- a/bin/sh/tests/parser/case1.0 +++ b/bin/sh/tests/parser/case1.0 @@ -1,4 +1,3 @@ -# $FreeBSD$ keywords='if then else elif fi while until for do done { } case esac ! in' diff --git a/bin/sh/tests/parser/case2.0 b/bin/sh/tests/parser/case2.0 index 14610e415c19..578187a5a320 100644 --- a/bin/sh/tests/parser/case2.0 +++ b/bin/sh/tests/parser/case2.0 @@ -1,4 +1,3 @@ -# $FreeBSD$ # Pretty much only ash derivatives can parse all of this. diff --git a/bin/sh/tests/parser/comment1.0 b/bin/sh/tests/parser/comment1.0 index 21e7ade957bc..59904fb98ced 100644 --- a/bin/sh/tests/parser/comment1.0 +++ b/bin/sh/tests/parser/comment1.0 @@ -1,3 +1,2 @@ -# $FreeBSD$ ${SH} -c '#' diff --git a/bin/sh/tests/parser/comment2.42 b/bin/sh/tests/parser/comment2.42 index 196b73354493..30ab4c4d1df5 100644 --- a/bin/sh/tests/parser/comment2.42 +++ b/bin/sh/tests/parser/comment2.42 @@ -1,4 +1,3 @@ -# $FreeBSD$ ${SH} -c '# exit 42' diff --git a/bin/sh/tests/parser/dollar-quote1.0 b/bin/sh/tests/parser/dollar-quote1.0 index 12061417e108..2862b8a20b09 100644 --- a/bin/sh/tests/parser/dollar-quote1.0 +++ b/bin/sh/tests/parser/dollar-quote1.0 @@ -1,4 +1,3 @@ -# $FreeBSD$ set -e diff --git a/bin/sh/tests/parser/dollar-quote10.0 b/bin/sh/tests/parser/dollar-quote10.0 index ad166da23ffe..e28ea482ac23 100644 --- a/bin/sh/tests/parser/dollar-quote10.0 +++ b/bin/sh/tests/parser/dollar-quote10.0 @@ -1,4 +1,3 @@ -# $FreeBSD$ # a umlaut s=$(printf '\303\244') diff --git a/bin/sh/tests/parser/dollar-quote11.0 b/bin/sh/tests/parser/dollar-quote11.0 index 2e872abfe5b0..de567ebeed43 100644 --- a/bin/sh/tests/parser/dollar-quote11.0 +++ b/bin/sh/tests/parser/dollar-quote11.0 @@ -1,4 +1,3 @@ -# $FreeBSD$ # some sort of 't' outside BMP s=$s$(printf '\360\235\225\245') diff --git a/bin/sh/tests/parser/dollar-quote12.0 b/bin/sh/tests/parser/dollar-quote12.0 index 838e27cda706..a6207d29a2ba 100644 --- a/bin/sh/tests/parser/dollar-quote12.0 +++ b/bin/sh/tests/parser/dollar-quote12.0 @@ -1,4 +1,3 @@ -# $FreeBSD$ # \u without any digits at all remains invalid. # Our choice is a parse error. diff --git a/bin/sh/tests/parser/dollar-quote13.0 b/bin/sh/tests/parser/dollar-quote13.0 index 2247da7abbc9..d042ad741646 100644 --- a/bin/sh/tests/parser/dollar-quote13.0 +++ b/bin/sh/tests/parser/dollar-quote13.0 @@ -1,4 +1,3 @@ -# $FreeBSD$ # This Unicode escape sequence that has never been in range should either # fail to expand or expand to a fallback. diff --git a/bin/sh/tests/parser/dollar-quote2.0 b/bin/sh/tests/parser/dollar-quote2.0 index 4617ed8d9086..87a1b39a62ba 100644 --- a/bin/sh/tests/parser/dollar-quote2.0 +++ b/bin/sh/tests/parser/dollar-quote2.0 @@ -1,4 +1,3 @@ -# $FreeBSD$ # This depends on the ASCII character set. diff --git a/bin/sh/tests/parser/dollar-quote3.0 b/bin/sh/tests/parser/dollar-quote3.0 index a7e68527791c..9ac5afb6d2bc 100644 --- a/bin/sh/tests/parser/dollar-quote3.0 +++ b/bin/sh/tests/parser/dollar-quote3.0 @@ -1,4 +1,3 @@ -# $FreeBSD$ unset LC_ALL LC_CTYPE=en_US.ISO8859-1 diff --git a/bin/sh/tests/parser/dollar-quote4.0 b/bin/sh/tests/parser/dollar-quote4.0 index f620af5b12c2..be0de8bbb508 100644 --- a/bin/sh/tests/parser/dollar-quote4.0 +++ b/bin/sh/tests/parser/dollar-quote4.0 @@ -1,4 +1,3 @@ -# $FreeBSD$ unset LC_ALL LC_CTYPE=en_US.ISO8859-1 diff --git a/bin/sh/tests/parser/dollar-quote5.0 b/bin/sh/tests/parser/dollar-quote5.0 index c2c44ca620e5..2bf6a0ea2183 100644 --- a/bin/sh/tests/parser/dollar-quote5.0 +++ b/bin/sh/tests/parser/dollar-quote5.0 @@ -1,4 +1,3 @@ -# $FreeBSD$ # This depends on the ASCII character set. diff --git a/bin/sh/tests/parser/dollar-quote6.0 b/bin/sh/tests/parser/dollar-quote6.0 index a4b1e3f48729..dc6f8ab45cf2 100644 --- a/bin/sh/tests/parser/dollar-quote6.0 +++ b/bin/sh/tests/parser/dollar-quote6.0 @@ -1,4 +1,3 @@ -# $FreeBSD$ # This depends on the ASCII character set. diff --git a/bin/sh/tests/parser/dollar-quote7.0 b/bin/sh/tests/parser/dollar-quote7.0 index c866b1af68bb..5108fd4eb146 100644 --- a/bin/sh/tests/parser/dollar-quote7.0 +++ b/bin/sh/tests/parser/dollar-quote7.0 @@ -1,4 +1,3 @@ -# $FreeBSD$ set -e diff --git a/bin/sh/tests/parser/dollar-quote8.0 b/bin/sh/tests/parser/dollar-quote8.0 index 8f0b41a0a3f7..81dcb9b394f7 100644 --- a/bin/sh/tests/parser/dollar-quote8.0 +++ b/bin/sh/tests/parser/dollar-quote8.0 @@ -1,4 +1,3 @@ -# $FreeBSD$ [ $'hello\0' = hello ] [ $'hello\0world' = hello ] diff --git a/bin/sh/tests/parser/dollar-quote9.0 b/bin/sh/tests/parser/dollar-quote9.0 index df64b7dfc0b1..845f8c284326 100644 --- a/bin/sh/tests/parser/dollar-quote9.0 +++ b/bin/sh/tests/parser/dollar-quote9.0 @@ -1,4 +1,3 @@ -# $FreeBSD$ # POSIX and C99 say D800-DFFF are undefined in a universal character name. # We reject this but many other shells expand to something that looks like diff --git a/bin/sh/tests/parser/empty-braces1.0 b/bin/sh/tests/parser/empty-braces1.0 index 5ab443c48d8a..11032811c80e 100644 --- a/bin/sh/tests/parser/empty-braces1.0 +++ b/bin/sh/tests/parser/empty-braces1.0 @@ -1,4 +1,3 @@ -# $FreeBSD$ # Unfortunately, some scripts depend on the extension of allowing an empty # pair of braces. diff --git a/bin/sh/tests/parser/empty-cmd1.0 b/bin/sh/tests/parser/empty-cmd1.0 index f8b01e9c7997..15f4f4ac995b 100644 --- a/bin/sh/tests/parser/empty-cmd1.0 +++ b/bin/sh/tests/parser/empty-cmd1.0 @@ -1,3 +1,2 @@ -# $FreeBSD$ ! (eval ': || f()') 2>/dev/null diff --git a/bin/sh/tests/parser/for1.0 b/bin/sh/tests/parser/for1.0 index eb7c881237fd..1633385068c2 100644 --- a/bin/sh/tests/parser/for1.0 +++ b/bin/sh/tests/parser/for1.0 @@ -1,4 +1,3 @@ -# $FreeBSD$ nl=' ' diff --git a/bin/sh/tests/parser/for2.0 b/bin/sh/tests/parser/for2.0 index 54ebfc3d7193..2dd2d5acd1c3 100644 --- a/bin/sh/tests/parser/for2.0 +++ b/bin/sh/tests/parser/for2.0 @@ -1,4 +1,3 @@ -# $FreeBSD$ # Common extensions to the 'for' syntax. diff --git a/bin/sh/tests/parser/func1.0 b/bin/sh/tests/parser/func1.0 index 4e887b25f285..93381364aa6c 100644 --- a/bin/sh/tests/parser/func1.0 +++ b/bin/sh/tests/parser/func1.0 @@ -1,4 +1,3 @@ -# $FreeBSD$ # POSIX does not require these bytes to work in function names, # but making them all work seems a good goal. diff --git a/bin/sh/tests/parser/func2.0 b/bin/sh/tests/parser/func2.0 index 5fd4dda8cca9..dc9eb6ed1579 100644 --- a/bin/sh/tests/parser/func2.0 +++ b/bin/sh/tests/parser/func2.0 @@ -1,4 +1,3 @@ -# $FreeBSD$ f() { return 42; } f() { return 3; } & diff --git a/bin/sh/tests/parser/func3.0 b/bin/sh/tests/parser/func3.0 index dcac7323ad3f..c1462a33c80c 100644 --- a/bin/sh/tests/parser/func3.0 +++ b/bin/sh/tests/parser/func3.0 @@ -1,4 +1,3 @@ -# $FreeBSD$ name=/var/empty/nosuch f() { true; } <$name diff --git a/bin/sh/tests/parser/heredoc1.0 b/bin/sh/tests/parser/heredoc1.0 index 5ce38977d7f5..6bfee605633a 100644 --- a/bin/sh/tests/parser/heredoc1.0 +++ b/bin/sh/tests/parser/heredoc1.0 @@ -1,4 +1,3 @@ -# $FreeBSD$ failures=0 diff --git a/bin/sh/tests/parser/heredoc10.0 b/bin/sh/tests/parser/heredoc10.0 index 27369a0b1b4c..95e280381bd3 100644 --- a/bin/sh/tests/parser/heredoc10.0 +++ b/bin/sh/tests/parser/heredoc10.0 @@ -1,4 +1,3 @@ -# $FreeBSD$ # It may be argued that # x=$(cat <<EOF diff --git a/bin/sh/tests/parser/heredoc11.0 b/bin/sh/tests/parser/heredoc11.0 index 5839e46b36ce..71bf7c017df4 100644 --- a/bin/sh/tests/parser/heredoc11.0 +++ b/bin/sh/tests/parser/heredoc11.0 @@ -1,4 +1,3 @@ -# $FreeBSD$ failures='' diff --git a/bin/sh/tests/parser/heredoc12.0 b/bin/sh/tests/parser/heredoc12.0 index 964838453237..0209a94d5f40 100644 --- a/bin/sh/tests/parser/heredoc12.0 +++ b/bin/sh/tests/parser/heredoc12.0 @@ -1,4 +1,3 @@ -# $FreeBSD$ failures=0 diff --git a/bin/sh/tests/parser/heredoc13.0 b/bin/sh/tests/parser/heredoc13.0 index 225d4f08f492..1a3de0572142 100644 --- a/bin/sh/tests/parser/heredoc13.0 +++ b/bin/sh/tests/parser/heredoc13.0 @@ -1,4 +1,3 @@ -# $FreeBSD$ failures=0 diff --git a/bin/sh/tests/parser/heredoc14.0 b/bin/sh/tests/parser/heredoc14.0 new file mode 100644 index 000000000000..036be53dc0c9 --- /dev/null +++ b/bin/sh/tests/parser/heredoc14.0 @@ -0,0 +1,8 @@ +# +read x <<EOF; for i in "$x" +value +EOF +do + x=$x.$i +done +[ "$x" = value.value ] diff --git a/bin/sh/tests/parser/heredoc15.0 b/bin/sh/tests/parser/heredoc15.0 new file mode 100644 index 000000000000..94c5c5f31b18 --- /dev/null +++ b/bin/sh/tests/parser/heredoc15.0 @@ -0,0 +1,9 @@ +# +set -- dummy +read x <<EOF; for i +value +EOF +do + x=$x.$i +done +[ "$x" = value.dummy ] diff --git a/bin/sh/tests/parser/heredoc16.0 b/bin/sh/tests/parser/heredoc16.0 new file mode 100644 index 000000000000..84e5e02ae3e1 --- /dev/null +++ b/bin/sh/tests/parser/heredoc16.0 @@ -0,0 +1,8 @@ +# +read x <<EOF; case $x +value +EOF +in + value) x=$x.extended +esac +[ "$x" = value.extended ] diff --git a/bin/sh/tests/parser/heredoc2.0 b/bin/sh/tests/parser/heredoc2.0 index 4bb85ad80c17..8b936bcb3799 100644 --- a/bin/sh/tests/parser/heredoc2.0 +++ b/bin/sh/tests/parser/heredoc2.0 @@ -1,4 +1,3 @@ -# $FreeBSD$ failures=0 diff --git a/bin/sh/tests/parser/heredoc3.0 b/bin/sh/tests/parser/heredoc3.0 index b250272f3319..dabd0650bd56 100644 --- a/bin/sh/tests/parser/heredoc3.0 +++ b/bin/sh/tests/parser/heredoc3.0 @@ -1,4 +1,3 @@ -# $FreeBSD$ # This may be expected to work, but pretty much only ash derivatives allow it. diff --git a/bin/sh/tests/parser/heredoc4.0 b/bin/sh/tests/parser/heredoc4.0 index fa3af5fd5a97..46262887d707 100644 --- a/bin/sh/tests/parser/heredoc4.0 +++ b/bin/sh/tests/parser/heredoc4.0 @@ -1,4 +1,3 @@ -# $FreeBSD$ failures=0 diff --git a/bin/sh/tests/parser/heredoc5.0 b/bin/sh/tests/parser/heredoc5.0 index 84b0eb2705d4..a336205acf75 100644 --- a/bin/sh/tests/parser/heredoc5.0 +++ b/bin/sh/tests/parser/heredoc5.0 @@ -1,4 +1,3 @@ -# $FreeBSD$ failures=0 diff --git a/bin/sh/tests/parser/heredoc6.0 b/bin/sh/tests/parser/heredoc6.0 index 3a634de167a7..24570bcfd42f 100644 --- a/bin/sh/tests/parser/heredoc6.0 +++ b/bin/sh/tests/parser/heredoc6.0 @@ -1,4 +1,3 @@ -# $FreeBSD$ r= ! command eval ": <<EOF; )" 2>/dev/null; command eval : hi \${r:=0} diff --git a/bin/sh/tests/parser/heredoc7.0 b/bin/sh/tests/parser/heredoc7.0 index a15010648780..821e89700389 100644 --- a/bin/sh/tests/parser/heredoc7.0 +++ b/bin/sh/tests/parser/heredoc7.0 @@ -1,4 +1,3 @@ -# $FreeBSD$ # Some of these created malformed parse trees with null pointers for here # documents, causing the here document writing process to segfault. diff --git a/bin/sh/tests/parser/heredoc8.0 b/bin/sh/tests/parser/heredoc8.0 index 598358a0494b..673fc270fa32 100644 --- a/bin/sh/tests/parser/heredoc8.0 +++ b/bin/sh/tests/parser/heredoc8.0 @@ -1,4 +1,3 @@ -# $FreeBSD$ failures=0 diff --git a/bin/sh/tests/parser/heredoc9.0 b/bin/sh/tests/parser/heredoc9.0 index 125a542ab717..d071bf51ef15 100644 --- a/bin/sh/tests/parser/heredoc9.0 +++ b/bin/sh/tests/parser/heredoc9.0 @@ -1,4 +1,3 @@ -# $FreeBSD$ # It may be argued that # x=$(cat <<EOF diff --git a/bin/sh/tests/parser/line-cont1.0 b/bin/sh/tests/parser/line-cont1.0 index 7ef5eba82b1e..c130070e3769 100644 --- a/bin/sh/tests/parser/line-cont1.0 +++ b/bin/sh/tests/parser/line-cont1.0 @@ -1,4 +1,3 @@ -# $FreeBSD$ i\ f diff --git a/bin/sh/tests/parser/line-cont10.0 b/bin/sh/tests/parser/line-cont10.0 index 1e74108757a0..d416e4241468 100644 --- a/bin/sh/tests/parser/line-cont10.0 +++ b/bin/sh/tests/parser/line-cont10.0 @@ -1,4 +1,3 @@ -# $FreeBSD$ v=XaaaXbbbX [ "${v\ diff --git a/bin/sh/tests/parser/line-cont11.0 b/bin/sh/tests/parser/line-cont11.0 index 22e49758dbc6..e1c2245b7566 100644 --- a/bin/sh/tests/parser/line-cont11.0 +++ b/bin/sh/tests/parser/line-cont11.0 @@ -1,4 +1,3 @@ -# $FreeBSD$ T=$(mktemp "${TMPDIR:-/tmp}/sh-test.XXXXXXXX") || exit trap 'rm -f -- "$T"' 0 diff --git a/bin/sh/tests/parser/line-cont12.0 b/bin/sh/tests/parser/line-cont12.0 index 27f8260feee9..2028a2ee6def 100644 --- a/bin/sh/tests/parser/line-cont12.0 +++ b/bin/sh/tests/parser/line-cont12.0 @@ -1,4 +1,3 @@ -# $FreeBSD$ [ '\ ' = "\\ diff --git a/bin/sh/tests/parser/line-cont2.0 b/bin/sh/tests/parser/line-cont2.0 index 9a293faf6bc2..d5f7ae903748 100644 --- a/bin/sh/tests/parser/line-cont2.0 +++ b/bin/sh/tests/parser/line-cont2.0 @@ -1,4 +1,3 @@ -# $FreeBSD$ [ "a\ b" = ab ] diff --git a/bin/sh/tests/parser/line-cont3.0 b/bin/sh/tests/parser/line-cont3.0 index 09d3aa8bba83..3f9d83a14105 100644 --- a/bin/sh/tests/parser/line-cont3.0 +++ b/bin/sh/tests/parser/line-cont3.0 @@ -1,4 +1,3 @@ -# $FreeBSD$ v=`printf %s 'a\ b'` diff --git a/bin/sh/tests/parser/line-cont4.0 b/bin/sh/tests/parser/line-cont4.0 index 5803276f2b3b..0a58847b2c35 100644 --- a/bin/sh/tests/parser/line-cont4.0 +++ b/bin/sh/tests/parser/line-cont4.0 @@ -1,4 +1,3 @@ -# $FreeBSD$ v=abcd [ "$\ diff --git a/bin/sh/tests/parser/line-cont5.0 b/bin/sh/tests/parser/line-cont5.0 index a7aa02688310..d8b5f08d7bbb 100644 --- a/bin/sh/tests/parser/line-cont5.0 +++ b/bin/sh/tests/parser/line-cont5.0 @@ -1,4 +1,3 @@ -# $FreeBSD$ bad=1 case x in diff --git a/bin/sh/tests/parser/line-cont6.0 b/bin/sh/tests/parser/line-cont6.0 index b12125b929e5..c5da14929ec0 100644 --- a/bin/sh/tests/parser/line-cont6.0 +++ b/bin/sh/tests/parser/line-cont6.0 @@ -1,4 +1,3 @@ -# $FreeBSD$ v0\ =abc diff --git a/bin/sh/tests/parser/line-cont7.0 b/bin/sh/tests/parser/line-cont7.0 index 27f8aec9515c..ccc7fe4f0239 100644 --- a/bin/sh/tests/parser/line-cont7.0 +++ b/bin/sh/tests/parser/line-cont7.0 @@ -1,4 +1,3 @@ -# $FreeBSD$ [ "$(\ ( diff --git a/bin/sh/tests/parser/line-cont8.0 b/bin/sh/tests/parser/line-cont8.0 index 88667760b47b..7db2c9d65386 100644 --- a/bin/sh/tests/parser/line-cont8.0 +++ b/bin/sh/tests/parser/line-cont8.0 @@ -1,4 +1,3 @@ -# $FreeBSD$ set -- a b c d e f g h i j [ "${1\ diff --git a/bin/sh/tests/parser/line-cont9.0 b/bin/sh/tests/parser/line-cont9.0 index 4e73c8f04abc..e0f8c2b0616c 100644 --- a/bin/sh/tests/parser/line-cont9.0 +++ b/bin/sh/tests/parser/line-cont9.0 @@ -1,4 +1,3 @@ -# $FreeBSD$ [ "${$\ :\ diff --git a/bin/sh/tests/parser/no-space1.0 b/bin/sh/tests/parser/no-space1.0 index 6df9f6395ff6..2baba775200b 100644 --- a/bin/sh/tests/parser/no-space1.0 +++ b/bin/sh/tests/parser/no-space1.0 @@ -1,4 +1,3 @@ -# $FreeBSD$ # These are ugly but are required to work. diff --git a/bin/sh/tests/parser/no-space2.0 b/bin/sh/tests/parser/no-space2.0 index 4e8447b11e4c..d03d7aa81568 100644 --- a/bin/sh/tests/parser/no-space2.0 +++ b/bin/sh/tests/parser/no-space2.0 @@ -1,4 +1,3 @@ -# $FreeBSD$ # This conflicts with ksh extended patterns but occurs in the wild. diff --git a/bin/sh/tests/parser/nul1.0 b/bin/sh/tests/parser/nul1.0 index 49c5ab1b0cfb..292669003acd 100644 --- a/bin/sh/tests/parser/nul1.0 +++ b/bin/sh/tests/parser/nul1.0 @@ -1,4 +1,3 @@ -# $FreeBSD$ # Although POSIX does not specify the effect of NUL bytes in scripts, # we ignore them. diff --git a/bin/sh/tests/parser/only-redir1.0 b/bin/sh/tests/parser/only-redir1.0 index 46076c882a5e..1d8aff62e78c 100644 --- a/bin/sh/tests/parser/only-redir1.0 +++ b/bin/sh/tests/parser/only-redir1.0 @@ -1,3 +1,2 @@ -# $FreeBSD$ </dev/null & wait $! diff --git a/bin/sh/tests/parser/only-redir2.0 b/bin/sh/tests/parser/only-redir2.0 index b9e9501c2027..efe4c3947dde 100644 --- a/bin/sh/tests/parser/only-redir2.0 +++ b/bin/sh/tests/parser/only-redir2.0 @@ -1,2 +1 @@ -# $FreeBSD$ </dev/null | : diff --git a/bin/sh/tests/parser/only-redir3.0 b/bin/sh/tests/parser/only-redir3.0 index 128a48391ded..549873d15b1a 100644 --- a/bin/sh/tests/parser/only-redir3.0 +++ b/bin/sh/tests/parser/only-redir3.0 @@ -1,2 +1 @@ -# $FreeBSD$ case x in x) </dev/null ;; esac diff --git a/bin/sh/tests/parser/only-redir4.0 b/bin/sh/tests/parser/only-redir4.0 index d804e128debe..f85e9da727c5 100644 --- a/bin/sh/tests/parser/only-redir4.0 +++ b/bin/sh/tests/parser/only-redir4.0 @@ -1,2 +1 @@ -# $FreeBSD$ case x in x) </dev/null ;& esac diff --git a/bin/sh/tests/parser/pipe-not1.0 b/bin/sh/tests/parser/pipe-not1.0 index 9842ff0afd05..12ad17288182 100644 --- a/bin/sh/tests/parser/pipe-not1.0 +++ b/bin/sh/tests/parser/pipe-not1.0 @@ -1,3 +1,2 @@ -# $FreeBSD$ : | ! : | false diff --git a/bin/sh/tests/parser/set-v1.0 b/bin/sh/tests/parser/set-v1.0 index 687cb8317557..65106bc70b93 100644 --- a/bin/sh/tests/parser/set-v1.0 +++ b/bin/sh/tests/parser/set-v1.0 @@ -1,4 +1,3 @@ -# $FreeBSD$ ${SH} <<\EOF echo one >&2 diff --git a/bin/sh/tests/parser/var-assign1.0 b/bin/sh/tests/parser/var-assign1.0 index 1fd3b26f8a26..55034f2ccc4d 100644 --- a/bin/sh/tests/parser/var-assign1.0 +++ b/bin/sh/tests/parser/var-assign1.0 @@ -1,4 +1,3 @@ -# $FreeBSD$ # In a variable assignment, both the name and the equals sign must be entirely # unquoted. Therefore, there is only one assignment below; the other words # containing equals signs are command words. diff --git a/bin/sh/tests/set-e/Makefile b/bin/sh/tests/set-e/Makefile index 211fc95d326a..0d72e148da2c 100644 --- a/bin/sh/tests/set-e/Makefile +++ b/bin/sh/tests/set-e/Makefile @@ -1,4 +1,3 @@ -# $FreeBSD$ PACKAGE= tests diff --git a/bin/sh/tests/set-e/Makefile.depend b/bin/sh/tests/set-e/Makefile.depend index f80275d86ab1..11aba52f82cf 100644 --- a/bin/sh/tests/set-e/Makefile.depend +++ b/bin/sh/tests/set-e/Makefile.depend @@ -1,4 +1,3 @@ -# $FreeBSD$ # Autogenerated - do NOT edit! DIRDEPS = \ diff --git a/bin/sh/tests/set-e/and1.0 b/bin/sh/tests/set-e/and1.0 index 607b7c350020..c5b91a5fafb5 100644 --- a/bin/sh/tests/set-e/and1.0 +++ b/bin/sh/tests/set-e/and1.0 @@ -1,3 +1,2 @@ -# $FreeBSD$ set -e true && true diff --git a/bin/sh/tests/set-e/and2.1 b/bin/sh/tests/set-e/and2.1 index 78e203ab0059..c6994aaa1bc4 100644 --- a/bin/sh/tests/set-e/and2.1 +++ b/bin/sh/tests/set-e/and2.1 @@ -1,4 +1,3 @@ -# $FreeBSD$ set -e true && false exit 0 diff --git a/bin/sh/tests/set-e/and3.0 b/bin/sh/tests/set-e/and3.0 index 9fafb1c45dd8..da983d7a24a2 100644 --- a/bin/sh/tests/set-e/and3.0 +++ b/bin/sh/tests/set-e/and3.0 @@ -1,4 +1,3 @@ -# $FreeBSD$ set -e false && true exit 0 diff --git a/bin/sh/tests/set-e/and4.0 b/bin/sh/tests/set-e/and4.0 index 25d0e6147dea..1ca44a840dcb 100644 --- a/bin/sh/tests/set-e/and4.0 +++ b/bin/sh/tests/set-e/and4.0 @@ -1,4 +1,3 @@ -# $FreeBSD$ set -e false && false exit 0 diff --git a/bin/sh/tests/set-e/background1.0 b/bin/sh/tests/set-e/background1.0 index 21577f4f78c7..288f9c4076fb 100644 --- a/bin/sh/tests/set-e/background1.0 +++ b/bin/sh/tests/set-e/background1.0 @@ -1,3 +1,2 @@ -# $FreeBSD$ set -e false & diff --git a/bin/sh/tests/set-e/cmd1.0 b/bin/sh/tests/set-e/cmd1.0 index 67fdcbc3d83e..5f06bd404ae8 100644 --- a/bin/sh/tests/set-e/cmd1.0 +++ b/bin/sh/tests/set-e/cmd1.0 @@ -1,3 +1,2 @@ -# $FreeBSD$ set -e true diff --git a/bin/sh/tests/set-e/cmd2.1 b/bin/sh/tests/set-e/cmd2.1 index 7cd8b09d64a8..1f677ce66b4f 100644 --- a/bin/sh/tests/set-e/cmd2.1 +++ b/bin/sh/tests/set-e/cmd2.1 @@ -1,4 +1,3 @@ -# $FreeBSD$ set -e false exit 0 diff --git a/bin/sh/tests/set-e/elif1.0 b/bin/sh/tests/set-e/elif1.0 index 6a5937d496ae..5f438bab1c84 100644 --- a/bin/sh/tests/set-e/elif1.0 +++ b/bin/sh/tests/set-e/elif1.0 @@ -1,4 +1,3 @@ -# $FreeBSD$ set -e if false; then : diff --git a/bin/sh/tests/set-e/elif2.0 b/bin/sh/tests/set-e/elif2.0 index 9dbb4bf514af..f691da558387 100644 --- a/bin/sh/tests/set-e/elif2.0 +++ b/bin/sh/tests/set-e/elif2.0 @@ -1,4 +1,3 @@ -# $FreeBSD$ set -e if false; then : diff --git a/bin/sh/tests/set-e/eval1.0 b/bin/sh/tests/set-e/eval1.0 index 9b7f67b6b0d4..60bb4e237a82 100644 --- a/bin/sh/tests/set-e/eval1.0 +++ b/bin/sh/tests/set-e/eval1.0 @@ -1,3 +1,2 @@ -# $FreeBSD$ set -e eval false || true diff --git a/bin/sh/tests/set-e/eval2.1 b/bin/sh/tests/set-e/eval2.1 index 8bb7f3a92fcb..83171c5aedcd 100644 --- a/bin/sh/tests/set-e/eval2.1 +++ b/bin/sh/tests/set-e/eval2.1 @@ -1,4 +1,3 @@ -# $FreeBSD$ set -e eval false exit 0 diff --git a/bin/sh/tests/set-e/for1.0 b/bin/sh/tests/set-e/for1.0 index 67eb718ee614..345bf14bda3c 100644 --- a/bin/sh/tests/set-e/for1.0 +++ b/bin/sh/tests/set-e/for1.0 @@ -1,4 +1,3 @@ -# $FreeBSD$ set -e f() { for i in a b c; do diff --git a/bin/sh/tests/set-e/func1.0 b/bin/sh/tests/set-e/func1.0 index 3c6b70492fa2..a06e7978bc40 100644 --- a/bin/sh/tests/set-e/func1.0 +++ b/bin/sh/tests/set-e/func1.0 @@ -1,4 +1,3 @@ -# $FreeBSD$ set -e f() { false diff --git a/bin/sh/tests/set-e/func2.1 b/bin/sh/tests/set-e/func2.1 index cc76d6edfa53..9fb0ee3919ea 100644 --- a/bin/sh/tests/set-e/func2.1 +++ b/bin/sh/tests/set-e/func2.1 @@ -1,4 +1,3 @@ -# $FreeBSD$ set -e f() { false diff --git a/bin/sh/tests/set-e/if1.0 b/bin/sh/tests/set-e/if1.0 index 36aa4bdcbcd3..a4bd95763b25 100644 --- a/bin/sh/tests/set-e/if1.0 +++ b/bin/sh/tests/set-e/if1.0 @@ -1,4 +1,3 @@ -# $FreeBSD$ set -e if false; then : diff --git a/bin/sh/tests/set-e/if2.0 b/bin/sh/tests/set-e/if2.0 index 495540854099..2323448ef752 100644 --- a/bin/sh/tests/set-e/if2.0 +++ b/bin/sh/tests/set-e/if2.0 @@ -1,4 +1,3 @@ -# $FreeBSD$ set -e # PR 28852 if true; then diff --git a/bin/sh/tests/set-e/if3.0 b/bin/sh/tests/set-e/if3.0 index a4916a842664..3dd39380a747 100644 --- a/bin/sh/tests/set-e/if3.0 +++ b/bin/sh/tests/set-e/if3.0 @@ -1,4 +1,3 @@ -# $FreeBSD$ set -e if false; false; then : diff --git a/bin/sh/tests/set-e/not1.0 b/bin/sh/tests/set-e/not1.0 index 21c089a23221..eba0792db738 100644 --- a/bin/sh/tests/set-e/not1.0 +++ b/bin/sh/tests/set-e/not1.0 @@ -1,4 +1,3 @@ -# $FreeBSD$ set -e ! true exit 0 diff --git a/bin/sh/tests/set-e/not2.0 b/bin/sh/tests/set-e/not2.0 index 7d93b4d09e85..40a551c664a6 100644 --- a/bin/sh/tests/set-e/not2.0 +++ b/bin/sh/tests/set-e/not2.0 @@ -1,4 +1,3 @@ -# $FreeBSD$ set -e ! false ! eval false diff --git a/bin/sh/tests/set-e/or1.0 b/bin/sh/tests/set-e/or1.0 index c2dcbe9b682a..b556313d4b29 100644 --- a/bin/sh/tests/set-e/or1.0 +++ b/bin/sh/tests/set-e/or1.0 @@ -1,3 +1,2 @@ -# $FreeBSD$ set -e true || false diff --git a/bin/sh/tests/set-e/or2.0 b/bin/sh/tests/set-e/or2.0 index 934e2a68de9e..3606cc173c37 100644 --- a/bin/sh/tests/set-e/or2.0 +++ b/bin/sh/tests/set-e/or2.0 @@ -1,3 +1,2 @@ -# $FreeBSD$ set -e false || true diff --git a/bin/sh/tests/set-e/or3.1 b/bin/sh/tests/set-e/or3.1 index 7a617a14b4a4..ae6c5cdd64da 100644 --- a/bin/sh/tests/set-e/or3.1 +++ b/bin/sh/tests/set-e/or3.1 @@ -1,4 +1,3 @@ -# $FreeBSD$ set -e false || false exit 0 diff --git a/bin/sh/tests/set-e/pipe1.1 b/bin/sh/tests/set-e/pipe1.1 index c0bad0fa732d..ce3f84861e70 100644 --- a/bin/sh/tests/set-e/pipe1.1 +++ b/bin/sh/tests/set-e/pipe1.1 @@ -1,4 +1,3 @@ -# $FreeBSD$ set -e true | false exit 0 diff --git a/bin/sh/tests/set-e/pipe2.0 b/bin/sh/tests/set-e/pipe2.0 index 1e25566a156b..987d0f1a3ce9 100644 --- a/bin/sh/tests/set-e/pipe2.0 +++ b/bin/sh/tests/set-e/pipe2.0 @@ -1,3 +1,2 @@ -# $FreeBSD$ set -e false | true diff --git a/bin/sh/tests/set-e/return1.0 b/bin/sh/tests/set-e/return1.0 index 961bd4120865..66a58cba78b3 100644 --- a/bin/sh/tests/set-e/return1.0 +++ b/bin/sh/tests/set-e/return1.0 @@ -1,4 +1,3 @@ -# $FreeBSD$ set -e # PR 77067, 85267 diff --git a/bin/sh/tests/set-e/semi1.1 b/bin/sh/tests/set-e/semi1.1 index 90476a98f1ec..74a6a0d725f4 100644 --- a/bin/sh/tests/set-e/semi1.1 +++ b/bin/sh/tests/set-e/semi1.1 @@ -1,4 +1,3 @@ -# $FreeBSD$ set -e false; true exit 0 diff --git a/bin/sh/tests/set-e/semi2.1 b/bin/sh/tests/set-e/semi2.1 index 8f510ac9c164..3a37f73fbf23 100644 --- a/bin/sh/tests/set-e/semi2.1 +++ b/bin/sh/tests/set-e/semi2.1 @@ -1,4 +1,3 @@ -# $FreeBSD$ set -e true; false exit 0 diff --git a/bin/sh/tests/set-e/subshell1.0 b/bin/sh/tests/set-e/subshell1.0 index 8e5831bd1907..10561215e644 100644 --- a/bin/sh/tests/set-e/subshell1.0 +++ b/bin/sh/tests/set-e/subshell1.0 @@ -1,3 +1,2 @@ -# $FreeBSD$ set -e (true) diff --git a/bin/sh/tests/set-e/subshell2.1 b/bin/sh/tests/set-e/subshell2.1 index 619e98a7d2df..e5d2976d3566 100644 --- a/bin/sh/tests/set-e/subshell2.1 +++ b/bin/sh/tests/set-e/subshell2.1 @@ -1,4 +1,3 @@ -# $FreeBSD$ set -e (false) exit 0 diff --git a/bin/sh/tests/set-e/until1.0 b/bin/sh/tests/set-e/until1.0 index 71ea7f2cf704..6a6c10dbfcf1 100644 --- a/bin/sh/tests/set-e/until1.0 +++ b/bin/sh/tests/set-e/until1.0 @@ -1,4 +1,3 @@ -# $FreeBSD$ set -e until false; do break diff --git a/bin/sh/tests/set-e/until2.0 b/bin/sh/tests/set-e/until2.0 index 24ea2760400b..628ebb27b1bc 100644 --- a/bin/sh/tests/set-e/until2.0 +++ b/bin/sh/tests/set-e/until2.0 @@ -1,4 +1,3 @@ -# $FreeBSD$ set -e until false; false; do break diff --git a/bin/sh/tests/set-e/until3.0 b/bin/sh/tests/set-e/until3.0 index 597db593bdaf..54f233537d80 100644 --- a/bin/sh/tests/set-e/until3.0 +++ b/bin/sh/tests/set-e/until3.0 @@ -1,4 +1,3 @@ -# $FreeBSD$ set -e f() { until false; do diff --git a/bin/sh/tests/set-e/while1.0 b/bin/sh/tests/set-e/while1.0 index 371c94a0440d..367609b6929f 100644 --- a/bin/sh/tests/set-e/while1.0 +++ b/bin/sh/tests/set-e/while1.0 @@ -1,4 +1,3 @@ -# $FreeBSD$ set -e while false; do : diff --git a/bin/sh/tests/set-e/while2.0 b/bin/sh/tests/set-e/while2.0 index 124966ca59e9..7ec5dff28391 100644 --- a/bin/sh/tests/set-e/while2.0 +++ b/bin/sh/tests/set-e/while2.0 @@ -1,4 +1,3 @@ -# $FreeBSD$ set -e while false; false; do : diff --git a/bin/sh/tests/set-e/while3.0 b/bin/sh/tests/set-e/while3.0 index dd3c79025236..b0cf7ab17117 100644 --- a/bin/sh/tests/set-e/while3.0 +++ b/bin/sh/tests/set-e/while3.0 @@ -1,4 +1,3 @@ -# $FreeBSD$ set -e f() { while true; do diff --git a/bin/sh/trap.c b/bin/sh/trap.c index 2dd394035ca4..2863026a4794 100644 --- a/bin/sh/trap.c +++ b/bin/sh/trap.c @@ -32,14 +32,6 @@ * SUCH DAMAGE. */ -#ifndef lint -#if 0 -static char sccsid[] = "@(#)trap.c 8.5 (Berkeley) 6/5/95"; -#endif -#endif /* not lint */ -#include <sys/cdefs.h> -__FBSDID("$FreeBSD$"); - #include <signal.h> #include <unistd.h> #include <stdlib.h> @@ -58,7 +50,9 @@ __FBSDID("$FreeBSD$"); #include "trap.h" #include "mystring.h" #include "builtins.h" +#ifndef NO_HISTORY #include "myhistedit.h" +#endif /* diff --git a/bin/sh/trap.h b/bin/sh/trap.h index fdc4b7a9683a..c7da30326911 100644 --- a/bin/sh/trap.h +++ b/bin/sh/trap.h @@ -30,9 +30,6 @@ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. - * - * @(#)trap.h 8.3 (Berkeley) 6/5/95 - * $FreeBSD$ */ extern volatile sig_atomic_t pendingsig; diff --git a/bin/sh/var.c b/bin/sh/var.c index 0758289151ba..2f9820a91bdd 100644 --- a/bin/sh/var.c +++ b/bin/sh/var.c @@ -32,14 +32,6 @@ * SUCH DAMAGE. */ -#ifndef lint -#if 0 -static char sccsid[] = "@(#)var.c 8.3 (Berkeley) 5/4/95"; -#endif -#endif /* not lint */ -#include <sys/cdefs.h> -__FBSDID("$FreeBSD$"); - #include <unistd.h> #include <stdlib.h> #include <paths.h> diff --git a/bin/sh/var.h b/bin/sh/var.h index eaf4f427f63b..800f7bcc0390 100644 --- a/bin/sh/var.h +++ b/bin/sh/var.h @@ -30,9 +30,6 @@ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. - * - * @(#)var.h 8.2 (Berkeley) 5/4/95 - * $FreeBSD$ */ /* |