From owner-svn-src-all@freebsd.org Mon Oct 21 18:09:00 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 7322715DC39; Mon, 21 Oct 2019 18:09:00 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46xl5838XZz4bq2; Mon, 21 Oct 2019 18:09:00 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 29A8627B6A; Mon, 21 Oct 2019 18:09:00 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x9LI90f0066325; Mon, 21 Oct 2019 18:09:00 GMT (envelope-from brooks@FreeBSD.org) Received: (from brooks@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x9LI8vsx066307; Mon, 21 Oct 2019 18:08:57 GMT (envelope-from brooks@FreeBSD.org) Message-Id: <201910211808.x9LI8vsx066307@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brooks set sender to brooks@FreeBSD.org using -f From: Brooks Davis Date: Mon, 21 Oct 2019 18:08:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r353835 - in vendor/tcsh/dist: . tests X-SVN-Group: vendor X-SVN-Commit-Author: brooks X-SVN-Commit-Paths: in vendor/tcsh/dist: . tests X-SVN-Commit-Revision: 353835 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Oct 2019 18:09:00 -0000 Author: brooks Date: Mon Oct 21 18:08:57 2019 New Revision: 353835 URL: https://svnweb.freebsd.org/changeset/base/353835 Log: Update vendor/tcsh to git 83c5be0: Upstream changes: 5. PR/113: Sobomax: avoid infinite loops for -c commands when stdout is not a tty. 4. Avoid infinite loops during history loads when merging, print a better error for errors during history load. 3. PR/88: Preserve empty arguments in :q 2. PR/94: Small apple issues (SAVESIGVEC, HOSTTYPE) 1. PR/81: Fix range matching issue where we were comparing with the range character instead of the start of range. [l-z]* would match foo Reported by: sobomax Modified: vendor/tcsh/dist/Fixes vendor/tcsh/dist/README.md vendor/tcsh/dist/glob.c vendor/tcsh/dist/host.defs vendor/tcsh/dist/sh.c vendor/tcsh/dist/sh.err.c vendor/tcsh/dist/sh.h vendor/tcsh/dist/sh.hist.c vendor/tcsh/dist/sh.lex.c vendor/tcsh/dist/tc.const.c vendor/tcsh/dist/tc.sig.h vendor/tcsh/dist/tcsh.man.new vendor/tcsh/dist/tests/lexical.at vendor/tcsh/dist/tests/subst.at vendor/tcsh/dist/tests/syntax.at vendor/tcsh/dist/tests/variables.at Modified: vendor/tcsh/dist/Fixes ============================================================================== --- vendor/tcsh/dist/Fixes Mon Oct 21 18:08:25 2019 (r353834) +++ vendor/tcsh/dist/Fixes Mon Oct 21 18:08:57 2019 (r353835) @@ -1,3 +1,11 @@ + 5. PR/113: Sobomax: avoid infinite loops for -c commands when stdout is + not a tty. + 4. Avoid infinite loops during history loads when merging, print a better + error for errors during history load. + 3. PR/88: Preserve empty arguments in :q + 2. PR/94: Small apple issues (SAVESIGVEC, HOSTTYPE) + 1. PR/81: Fix range matching issue where we were comparing with the + range character instead of the start of range. [l-z]* would match foo 12. V6.21.00 - 20190508 11. Abort history loading on words and lines too long https://bugzilla.redhat.com/show_bug.cgi?id=1598502 Modified: vendor/tcsh/dist/README.md ============================================================================== --- vendor/tcsh/dist/README.md Mon Oct 21 18:08:25 2019 (r353834) +++ vendor/tcsh/dist/README.md Mon Oct 21 18:08:57 2019 (r353835) @@ -1,4 +1,4 @@ -# Tcsh +# TCSH *C shell with file name completion and command line editing* @@ -14,10 +14,10 @@ PLEASE file any bug reports, fixes, and code for new f > https://bugs.astron.com/ Comments, questions, etc. (even flames) are welcome via email to -the Tcsh Bugs mailing list: +the tcsh mailing list: -> tcsh-bugs@astron.com -> https://mailman.astron.com/ +> tcsh@astron.com +> https://mailman.astron.com/mailman/listinfo/tcsh [![Build Status][status]][travis] Modified: vendor/tcsh/dist/glob.c ============================================================================== --- vendor/tcsh/dist/glob.c Mon Oct 21 18:08:25 2019 (r353834) +++ vendor/tcsh/dist/glob.c Mon Oct 21 18:08:57 2019 (r353835) @@ -100,7 +100,7 @@ static int Lstat (const char *, struct stat *); static int Stat (const char *, struct stat *sb); static Char *Strchr (Char *, int); #ifdef DEBUG -static void qprintf (const Char *); +static void qprintf (const char *, const Char *); #endif #define DOLLAR '$' @@ -254,19 +254,20 @@ Strchr(Char *str, int ch) #ifdef DEBUG static void -qprintf(const Char *s) +qprintf(const char *pre, const Char *s) { const Char *p; - + + xprintf("%s", pre); for (p = s; *p; p++) - printf("%c", *p & 0xff); - printf("\n"); + xprintf("%c", *p & 0xff); + xprintf("\n%s", pre); for (p = s; *p; p++) - printf("%c", *p & M_PROTECT ? '"' : ' '); - printf("\n"); + xprintf("%c", *p & M_PROTECT ? '"' : ' '); + xprintf("\n%s", pre); for (p = s; *p; p++) - printf("%c", *p & M_META ? '_' : ' '); - printf("\n"); + xprintf("%c", *p & M_META ? '_' : ' '); + xprintf("\n"); } #endif /* DEBUG */ @@ -410,7 +411,7 @@ glob(const char *pattern, int flags, int (*errfunc) (c } *bufnext = EOS; #ifdef DEBUG - qprintf(patbuf); + qprintf("patbuf=", patbuf); #endif if ((err = glob1(patbuf, pglob, no_match)) != 0) { @@ -707,7 +708,7 @@ match(const char *name, const Char *pat, const Char *p while (pat < patend || *name) { size_t lwk, pwk; - __Char wc, wk; + __Char wc, wk, wc1; c = *pat; /* Only for M_MASK bits */ if (*name == EOS) @@ -742,18 +743,20 @@ match(const char *name, const Char *pat, const Char *p pat += pwk; pwk = One_Char_mbtowc(&wc, pat, MB_LEN_MAX); } + wc1 = wc; while ((*pat & M_MASK) != M_END) { if ((*pat & M_MASK) == M_RNG) { __Char wc2; pat += pwk; pwk = One_Char_mbtowc(&wc2, pat, MB_LEN_MAX); - if (globcharcoll(wc, wk, 0) <= 0 && + if (globcharcoll(wc1, wk, 0) <= 0 && globcharcoll(wk, wc2, 0) <= 0) ok = 1; } else if (wc == wk) ok = 1; pat += pwk; + wc1 = wc; pwk = One_Char_mbtowc(&wc, pat, MB_LEN_MAX); } pat += pwk; Modified: vendor/tcsh/dist/host.defs ============================================================================== --- vendor/tcsh/dist/host.defs Mon Oct 21 18:08:25 2019 (r353834) +++ vendor/tcsh/dist/host.defs Mon Oct 21 18:08:57 2019 (r353835) @@ -854,9 +854,9 @@ enddef : newdef : defined(APPLE) && defined(MACH) comment : OS X vendor : : "apple" -hosttype: defined(i386) : "intel-pc" +hosttype: defined(i386) : "intel-mac" hosttype: defined(ppc) : "powermac" -hosttype: defined(M_amd64) : "amd" +hosttype: defined(M_amd64) : "intel-mac" ostype : : "darwin" machtype: defined(i386) : "i386" machtype: defined(M_amd64) : "x86_64" Modified: vendor/tcsh/dist/sh.c ============================================================================== --- vendor/tcsh/dist/sh.c Mon Oct 21 18:08:25 2019 (r353834) +++ vendor/tcsh/dist/sh.c Mon Oct 21 18:08:57 2019 (r353835) @@ -237,6 +237,7 @@ main(int argc, char **argv) int nofile = 0; volatile int nverbose = 0; volatile int rdirs = 0; + volatile int exitcode = 0; int quitit = 0; Char *cp; #ifdef AUTOLOGOUT @@ -1390,6 +1391,12 @@ main(int argc, char **argv) if (targinp) { + /* If this -c command caused an error before, skip processing */ + if (reenter && arginp) { + exitcode = 1; + goto done; + } + arginp = SAVE(targinp); /* * we put the command into a variable @@ -1422,6 +1429,7 @@ main(int argc, char **argv) */ process(setintr); +done: /* * Mop-up. */ @@ -1443,7 +1451,7 @@ main(int argc, char **argv) } record(); exitstat(); - return (0); + return exitcode; } void Modified: vendor/tcsh/dist/sh.err.c ============================================================================== --- vendor/tcsh/dist/sh.err.c Mon Oct 21 18:08:25 2019 (r353834) +++ vendor/tcsh/dist/sh.err.c Mon Oct 21 18:08:57 2019 (r353835) @@ -43,6 +43,7 @@ #endif char *seterr = NULL; /* Holds last error if there was one */ +extern int enterhist; #define ERR_FLAGS 0xf0000000 #define ERR_NAME 0x10000000 @@ -630,6 +631,8 @@ stderror(unsigned int id, ...) */ flush();/*FIXRESET*/ haderr = 1; /* Now to diagnostic output */ + if (enterhist) + xprintf("Can't load history: ");/*FIXRESET*/ if (flags & ERR_NAME) xprintf("%s: ", bname);/*FIXRESET*/ if ((flags & ERR_OLD)) { Modified: vendor/tcsh/dist/sh.h ============================================================================== --- vendor/tcsh/dist/sh.h Mon Oct 21 18:08:25 2019 (r353834) +++ vendor/tcsh/dist/sh.h Mon Oct 21 18:08:57 2019 (r353835) @@ -682,13 +682,27 @@ EXTERN int OLDSTD IZERO; /* Old standard input (def */ #ifdef SIGSETJMP - typedef struct { sigjmp_buf j; } jmp_buf_t; -# define setexit() sigsetjmp(reslab.j, 1) -# define _reset() siglongjmp(reslab.j, 1) + typedef struct { const char *f; size_t l; sigjmp_buf j; } jmp_buf_t; +# define tcsh_setjmp() sigsetjmp(reslab.j, 1) +# define tcsh_longjmp() siglongjmp(reslab.j, 1) +# define setexit() (reslab.f = __func__, \ + reslab.l = __LINE__, \ + sigsetjmp(reslab.j, 1)) +# define _reset() siglongjmp(reslab.j, 1) #else - typedef struct { jmp_buf j; } jmp_buf_t; -# define setexit() setjmp(reslab.j) -# define _reset() longjmp(reslab.j, 1) + typedef struct { const char *f; size_t l; jmp_buf j; } jmp_buf_t; +# define tcsh_setjmp() setjmp(reslab.j) +# define tcsh_longjmp() longjmp(reslab.j, 1) +#endif + +#define setexit() (reslab.f = __func__, \ + reslab.l = __LINE__, \ + tcsh_setjmp()) +#ifdef SETJMP_DEBUG +# define _reset() xprintf("reset %s %zu\n", reslab.f, reslab.l), \ + flush(), tcsh_longjmp() +#else +# define _reset() tcsh_longjmp() #endif #define getexit(a) (void) ((a) = reslab) Modified: vendor/tcsh/dist/sh.hist.c ============================================================================== --- vendor/tcsh/dist/sh.hist.c Mon Oct 21 18:08:25 2019 (r353834) +++ vendor/tcsh/dist/sh.hist.c Mon Oct 21 18:08:57 2019 (r353835) @@ -1281,6 +1281,7 @@ rechist(Char *fname, int ref) } if (merge) { + jmp_buf_t osetexit; if (lock) { #ifndef WINNT_NATIVE char *lockpath = strsave(short2str(fname)); @@ -1290,7 +1291,10 @@ rechist(Char *fname, int ref) cleanup_push(lockpath, dotlock_cleanup); #endif } - loadhist(fname, 1); + getexit(osetexit); + if (setexit()) + loadhist(fname, 1); + resexit(osetexit); } } rs = randsuf(); Modified: vendor/tcsh/dist/sh.lex.c ============================================================================== --- vendor/tcsh/dist/sh.lex.c Mon Oct 21 18:08:25 2019 (r353834) +++ vendor/tcsh/dist/sh.lex.c Mon Oct 21 18:08:57 2019 (r353835) @@ -1020,8 +1020,10 @@ domod(Char *cp, Char type) switch (type) { - case 'x': case 'q': + case 'x': + if (*cp == '\0') + return Strsave(STRQNULL); wp = Strsave(cp); for (xp = wp; (c = *xp) != 0; xp++) if ((c != ' ' && c != '\t') || type == 'q') Modified: vendor/tcsh/dist/tc.const.c ============================================================================== --- vendor/tcsh/dist/tc.const.c Mon Oct 21 18:08:25 2019 (r353834) +++ vendor/tcsh/dist/tc.const.c Mon Oct 21 18:08:57 2019 (r353835) @@ -253,10 +253,10 @@ Char STRnormal[] = { 'n', 'o', 'r', 'm', 'a', 'l', '\0 Char STRsldtlogout[] = { '/', '.', 'l', 'o', 'g', 'o', 'u', 't', '\0' }; Char STRjobs[] = { 'j', 'o', 'b', 's', '\0' }; Char STRdefprompt[] = { '%', '#', ' ', '\0' }; -Char STRmquestion[] = { '%', 'R', '?' | QUOTE, ' ', '\0' }; +Char STRmquestion[] = { '%', 'R', (Char)('?' | QUOTE), ' ', '\0' }; Char STRKCORRECT[] = { 'C', 'O', 'R', 'R', 'E', 'C', 'T', '>', '%', 'R', ' ', '(', 'y', '|', 'n', '|', 'e', '|', 'a', ')', - '?' | QUOTE, ' ', '\0' }; + (Char)('?' | QUOTE), ' ', '\0' }; Char STRunalias[] = { 'u', 'n', 'a', 'l', 'i', 'a', 's', '\0' }; Char STRalias[] = { 'a', 'l', 'i', 'a', 's', '\0' }; Char STRprecmd[] = { 'p', 'r', 'e', 'c', 'm', 'd', '\0' }; @@ -380,7 +380,7 @@ Char STRlistmaxrows[] = { 'l', 'i', 's', 't', 'm', 'a' Char STRlistmax[] = { 'l', 'i', 's', 't', 'm', 'a', 'x', '\0' }; Char STRlistlinks[] = { 'l', 'i', 's', 't', 'l', 'i', 'n', 'k', 's', '\0' }; Char STRDING[] = { 'D', 'I', 'N', 'G', '!', '\0' }; -Char STRQNULL[] = { '\0' | QUOTE, '\0' }; +Char STRQNULL[] = { (Char)('\0' | QUOTE), '\0' }; Char STRcorrect[] = { 'c', 'o', 'r', 'r', 'e', 'c', 't', '\0' }; Char STRcmd[] = { 'c', 'm', 'd', '\0' }; Char STRall[] = { 'a', 'l', 'l', '\0' }; Modified: vendor/tcsh/dist/tc.sig.h ============================================================================== --- vendor/tcsh/dist/tc.sig.h Mon Oct 21 18:08:25 2019 (r353834) +++ vendor/tcsh/dist/tc.sig.h Mon Oct 21 18:08:57 2019 (r353835) @@ -42,7 +42,7 @@ # include #endif /* SYSVREL > 0 */ -#if defined(__APPLE__) || defined(SUNOS4) || defined(DGUX) || defined(hp800) || (SYSVREL > 3 && defined(VFORK)) +#if defined(SUNOS4) || defined(DGUX) || defined(hp800) || (SYSVREL > 3 && defined(VFORK)) # define SAVESIGVEC #endif /* SUNOS4 || DGUX || hp800 || SVR4 & VFORK */ Modified: vendor/tcsh/dist/tcsh.man.new ============================================================================== --- vendor/tcsh/dist/tcsh.man.new Mon Oct 21 18:08:25 2019 (r353834) +++ vendor/tcsh/dist/tcsh.man.new Mon Oct 21 18:08:57 2019 (r353835) @@ -391,7 +391,7 @@ variants; see .Sx FILES . .Ss Editing We first describe -.Sx The command-line editor" +.Sx The command-line editor The .Sx Completion and listing and @@ -402,7 +402,7 @@ Finally, .Sx Editor commands lists and describes the editor commands specific to the shell and their default bindings. -.It Sx The command-line editor (+) +.Ss The command-line editor (+) Command-line input can be edited using key sequences much like those used in .Xr emacs 1 or @@ -684,9 +684,8 @@ If the .Va complete shell variable is set to .Sq enhance , -completion -1) ignores case and 2) considers periods, hyphens and underscores -.Sq ( . , +completion 1) ignores case and 2) considers periods, hyphens and underscores +.Sq ( \&. , .Sq \&- and .Sq _ ) @@ -727,7 +726,7 @@ hyphens or underscores. If the .Va complete shell variable is set to -.Sq enhance , +.Sq Enhance , completion ignores case and differences between a hyphen and an underscore word separator only when the user types a lowercase character or a hyphen. @@ -1093,17 +1092,20 @@ must be bound to a single character for this to work) or one of the following special characters may be typed: .Pp -.Sq ^W +.Bl -tag -width indent -compact +.It ^W Appends the rest of the word under the cursor to the search pattern. -delete (or any character bound to +.It delete +(or any character bound to .Ic backward-delete-char ) Undoes the effect of the last character typed and deletes a character from the search pattern if appropriate. -.Sq ^G +.It ^G If the previous search was successful, aborts the entire search. If not, goes back to the last successful search. -escape +.It escape Ends the search, leaving the current line in the input buffer. +.El .Pp Any other character not bound to .Ic self-insert-command @@ -1664,6 +1666,7 @@ The words of an input line are numbered from 0, the first (usually command) word being 0, the second word (first argument) being 1, etc. The basic word designators are: +.Pp .Bl -tag -width XXXX -offset indent -compact .It Ar 0 The first (command) word @@ -2021,7 +2024,7 @@ cause an error. .Pp Some aliases are referred to by the shell; see .Va Special aliases -.Sx Variable substitution +.Ss Variable substitution The shell maintains a list of variables, each of which has as value a list of zero or more words. The values of shell variables can be displayed and changed with the @@ -2219,7 +2222,7 @@ The following substitutions can not be modified with .Sq \&: modifiers. .Pp -.Bl -tag -width XXXXXXXX -offset indent -compact +.Bl -tag -width XXXXXXXXXX -offset indent -compact .It Ar $?name .It Ar ${?name} Substitutes the string @@ -2238,27 +2241,21 @@ if it is not. Always .Sq 0 in interactive shells. -.It Ar -$#name -${#name} +.It Ar $#name +.It Ar ${#name} Substitutes the number of words in .Va name -.It Ar -$# +.It Ar $# Equivalent to .Sq $#argv (+) -.It Ar -$% -.Va name +.It Ar $%name .It Ar ${%name} Substitutes the number of characters in .Va name (+) .Pp -$% -.Va number -.TP 8 +.It Ar $%number .It Ar ${%number} Substitutes the number of characters in .Va $argv[number] . @@ -2749,7 +2746,7 @@ file to it on standard input. The standard input and standard output of a command may be redirected with the following syntax: .Pp -.Bl -tag -width XXXXXX -offset indent -compact +.Bl -tag -width XXXXXXXXX -offset indent -compact .It Ar < name Open file .Va name @@ -3143,63 +3140,47 @@ They have the same format as before; .Va op may be one of .Pp -.PD 0 -.RS +4 -.TP 8 -.B A +.Bl -tag -width XXX -offset indent -compact +.It Ar A Last file access time, as the number of seconds since the epoch -.TP 8 -.B A: +.It Ar A: Like -.Va A +.Va Ar A , but in timestamp format, e.g., .Sq Fri May 14 16:36:10 1993 -.TP 8 -.B M +.It Ar M Last file modification time -.TP 8 -.B M: +.It Ar M: Like .Va M , but in timestamp format -.TP 8 -.B C +.It Ar C Last inode modification time -.TP 8 -.B C: +.It Ar C: Like .Va C , but in timestamp format -.TP 8 -.B D +.It Ar D Device number -.TP 8 -.B I +.It Ar I Inode number -.TP 8 -.B F +.It Ar F Composite .Va f ile identifier, in the form -.Va device -: +.Va device : .Va inode -.TP 8 -.B L +.It Ar L The name of the file pointed to by a symbolic link -.TP 8 -.B N +.It Ar N Number of (hard) links -.TP 8 -.B P +.It Ar P Permissions, in octal, without leading zero -.TP 8 -.B P: +.It Ar P: Like .Va P , with leading zero -.TP 8 -.B P\fImode +.It Ar P Equivalent to .Sq \-P .Va file @@ -3217,28 +3198,22 @@ if by group only, and .Sq 0 if by neither -.TP 8 -.B P\fImode\fB: -Like \fBP +.It Ar P: +Like +.Ar BP .Va mode , with leading zero -.TP 8 -.B U +.It Ar U Numeric userid -.TP 8 -.B U: +.It Ar U: Username, or the numeric userid if the username is unknown -.TP 8 -.B G +.It Ar G Numeric groupid -.TP 8 -.B G: +.It Ar G: Groupname, or the numeric groupid if the groupname is unknown -.TP 8 -.B Z +.It Ar Z Size, in bytes -.RE -.PD +.El .Pp Only one of these operators may appear in a multiple-operator test, and it must be the last. @@ -3791,45 +3766,24 @@ The next sections of this manual describe all of the a and .Va Special shell variables .Ss "Builtin commands" -.TP 8 -.B %\fIjob +.Bl -tag -width XXXXXXX -offset indent +.It Ar %job A synonym for the .Va fg builtin command. -.TP 8 -.B %\fIjob \fB& +.It Ar %job \&& A synonym for the .Va bg builtin command. -.TP 8 -.B : +.It Ar \&: Does nothing, successfully. .Pp -.B @ -.br -.B @ \fIname\fB = \fIexpr -.br -.B @ -.Va name -[ -.Va index -]\fB = \fIexpr -.br -.B @ \fIname -.Va ++ -|\fB-- -.PD 0 -.TP 8 -.B @ -.Va name -[ -.Va index -] -.Va ++ -|\fB-- +.It Ar @ +.It Ar @ name = expr +.It Ar @ name[index] = expr +.It Ar @ name++|-- +.It Ar @name[index]++|-- The first form prints the values of all shell variables. -.PD -.RS +8 .Pp The second form assigns the value of .Va expr @@ -3875,7 +3829,10 @@ has nothing to do with that described under .Va Expressions .Pp -The fourth and fifth forms increment (`++') or decrement (`\-\-') +The fourth and fifth forms increment ( +.Sq ++ ) +or decrement +.Sq ( -- ) .Va name or its .Va index @@ -3898,14 +3855,7 @@ are optional. Components of .Va expr must be separated by spaces. -.RE -.PD -.TP 8 -.B alias \fR[ -.Va name -[ -.Va wordlist -]] +.It Ar alias[name[wordlist]] Without arguments, prints all aliases. With .Va name @@ -3928,8 +3878,7 @@ or See also the .Va unalias builtin command. -.TP 8 -.B alloc +.It Ar alloc Shows the amount of dynamic memory acquired, broken down into used and free memory. With an argument shows the number of free and used blocks in each size @@ -3939,9 +3888,7 @@ This command's output may vary across system types, because systems other than the VAX may use a different memory allocator. .TP 8 -.B bg \fR[\fB% -.Va job -...] +.It Ar bg[%job...] Puts the specified jobs (or, without arguments, the current job) into the background, continuing each if it is stopped. .Va job @@ -3957,35 +3904,10 @@ as described under .Va Jobs .Pp -.B bindkey \fR[ -.Fl l\fR| -.Fl d\fR| -.Fl e\fR| -.Fl v\fR| -.Fl u\fR] (+) -.br -.Va bindkey -[ -.Fl a\fR] [ -.Fl b\fR] [ -.Fl k\fR] [ -.Fl r\fR] [ -.Fl \-\fR] -.Va key -(+) -.PD 0 -.TP 8 -.Va bindkey -[ -.Fl a\fR] [ -.Fl b\fR] [ -.Fl k\fR] [ -.Fl c\fR| -.Fl s\fR] [ -.Fl \-\fR] -.Va key command -(+) -.\" .B macro can't take too many words, so I used \fB in the previous tags +.It Ar bindkey Oo Fl l Ns | Ns Fl d Ns | Ns Fl e Ns | Ns Fl v Ns | Ns Fl u Oc (+) +.It Ar bindkey Oo Fl a Oc Oo Fl b Oc Oo Fl k Oc Oo Fl r Oc Oo Fl Fl Oc Ar key (+) +.It Ar bindkey Oo Fl a Oc Oo Fl b Oc Oo Fl k Oc Oo Fl c Ns | Ns Fl s Oc Oo Fl Fl Oc Ar key command (+) +.\" .It Ar macro can't take too many words, so I used \fB in the previous tags Without options, the first form lists all bound keys and the editor command to which each is bound, the second form lists the editor command to which .Va key @@ -3995,43 +3917,35 @@ the third form binds the editor command to .Va key Options include: -.PD .Pp -.PD 0 -.RS +8 -.TP 4 -.Fl l +.Bl -tag -width XXX -compact +.It Fl l Lists all editor commands and a short description of each. -.TP 4 -.Fl d +.It Fl d Binds all keys to the standard bindings for the default editor, as per .Va -e and .Va -v below. -.TP 4 -.Fl e +.It Fl e Binds all keys to .Va emacs (1)\-style bindings. Unsets .Va vimode -.TP 4 -.Fl v +.It Fl v Binds all keys to .Va vi (1)\-style bindings. Sets .Va vimode -.TP 4 -.Fl a +.It Fl a Lists or changes key-bindings in the alternative key map. This is the key map used in .Va vimode command mode. -.TP 4 -.Fl b +.It Fl b .Va key is interpreted as a control character written ^ @@ -4059,8 +3973,7 @@ or an extended prefix key written X- (e.g., .Sq X-A ). -.TP 4 -.Fl k +.It Fl k .Va key is interpreted as a symbolic arrow key name, which may be one of `down', @@ -4069,8 +3982,7 @@ is interpreted as a symbolic arrow key name, which may .Sq left or .Sq right -.TP 4 -.Fl r +.It Fl r Removes .Va key 's binding. @@ -4085,13 +3997,11 @@ to (q.v.), it unbinds .Va key completely. -.TP 4 -.Fl c +.It Fl c .Va command is interpreted as a builtin or external command instead of an editor command. -.TP 4 -.Fl s +.It Fl s .Va command is taken as a literal string and treated as terminal input when @@ -4101,15 +4011,14 @@ Bound keys in .Va command are themselves reinterpreted, and this continues for ten levels of interpretation. -.TP 4 -.Fl \- +.It Fl \&- Forces a break from option processing, so the next word is taken as .Va key -even if it begins with '\-'. -.TP 4 -.Fl u \fR(or any invalid option) +even if it begins with '\&-'. +.It Fl u +(or any invalid option) Prints a usage message. -.PD +.El .Pp .Va key may be a single character or a string. @@ -4137,48 +4046,35 @@ can contain backslashed escape sequences (in the style of System V .Va echo (1)) as follows: -.RS +4 -.TP 8 -.PD 0 -.B \ea +.Pp +.Bl -tag -width XXXX -compact -offset indent +.It \ea Bell -.TP 8 -.B \eb +.It \eb Backspace -.TP 8 -.B \ee +.It \ee Escape -.TP 8 -.B \ef +.It \ef Form feed -.TP 8 -.B \en +.It \en Newline -.TP 8 -.B \er +.It \er Carriage return -.TP 8 -.B \et +.It \et Horizontal tab -.TP 8 -.B \ev +.It \ev Vertical tab -.TP 8 -.B \e\fInnn +.It \e\fInnn The ASCII character corresponding to the octal number .Va nnn -.PD -.RE +.El .Pp `\e' nullifies the special meaning of the following character, if it has any, notably .Sq \e and .Sq ^ -.RE -.TP 8 -.B bs2cmd -.Va bs2000-command +.It bs2cmd Va bs2000-command (+) Passes .Va bs2000-command @@ -4186,8 +4082,7 @@ to the BS2000 command interpreter for execution. Only non-interactive commands can be executed, and it is not possible to execute any command that would overlay the image of the current process, like /EXECUTE or /CALL-PROCEDURE. (BS2000 only) -.TP 8 -.B break +.It break Causes execution to resume after the .Va end of the nearest @@ -4199,17 +4094,16 @@ The remaining commands on the current line are executed. Multi-level breaks are thus possible by writing them all on one line. -.TP 8 -.B breaksw +.It breaksw Causes a break from a .Va switch , resuming after the .Va endsw -.TP 8 -.B builtins \fR(+) + +.It builtins \fR(+) Prints the names of all builtin commands. -.TP 8 -.B bye \fR(+) + +.It bye \fR(+) A synonym for the .Va logout builtin command. @@ -4217,13 +4111,13 @@ Available only if the shell was so compiled; see the .Va version shell variable. -.TP 8 -.B case \fIlabel\fB: + +.It case \fIlabel\fB: A label in a .Va switch statement as discussed below. -.TP 8 -.B cd \fR[ + +.It cd \fR[ .Fl p\fR] [ .Fl l\fR] [ .Fl n\fR| @@ -4300,13 +4194,13 @@ and .Va cdtohome shell variables. .RE -.TP 8 -.B chdir + +.It chdir A synonym for the .Va cd builtin command. -.TP 8 -.B complete \fR[ + +.It complete \fR[ .Va command [\fIword\fB/\fIpattern\fB/ .Va list @@ -4350,7 +4244,7 @@ is to be completed, and may be one of the following: .PD 0 .RS +4 .TP 4 -.B c +.It c Current-word completion. .Va pattern is a glob-pattern which must match the beginning of the current word on @@ -4358,25 +4252,25 @@ the command line. .Va pattern is ignored when completing the current word. .TP 4 -.B C +.It C Like .Va c , but includes .Va pattern when completing the current word. .TP 4 -.B n +.It n Next-word completion. .Va pattern is a glob-pattern which must match the beginning of the previous word on the command line. .TP 4 -.B N +.It N Like .Va n , but must match the beginning of the word two before the current word. .TP 4 -.B p +.It p Position-dependent completion. .Va pattern is a numeric range, with the same syntax used to index shell @@ -4387,71 +4281,50 @@ variables, which must include the current word. .Va list , the list of possible completions, may be one of the following: .Pp -.PD 0 -.RS +4 -.TP 8 -.B a +.Bl -tag +.It a Aliases -.TP 8 -.B b +.It b Bindings (editor commands) -.TP 8 -.B c +.It c Commands (builtin or external commands) -.TP 8 -.B C +.It C External commands which begin with the supplied path prefix -.TP 8 -.B d +.It d Directories -.TP 8 -.B D *** DIFF OUTPUT TRUNCATED AT 1000 LINES ***