From nobody Mon Jul 20 21:53:58 2026 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4h3vRV4VL5z6dVWN for ; Mon, 20 Jul 2026 21:53:58 +0000 (UTC) (envelope-from git@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) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "YR1" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4h3vRV3VDyz3Gv2 for ; Mon, 20 Jul 2026 21:53:58 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1784584438; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=su1yS6FHgMlZX4Z20g4DVGcVQO2/kAMKvaSOq6zws3E=; b=GqXb4fqATDM1NimV/p5kfd+tJZtBg/fQsiAb3IvAHUgJl2cTXfBJsiD8R6r9/K2HLEuW/E BWzKsVshMGaWhOX0fFYAj/GEeJaHVV2nyoj7YXmpuv3CcVMRya3f/kQo6PmKKam5djtzUT LLHa3L6IOp5klwAw4u5CDga1/vOONXXBWtxqsz26PeMdXP4dkg1ERMVKrwPHGnClS0Pc1/ kRl6P6vcb/NKm8vgOxl9133cAFxvRwvdtqLM1VQgwQftHNq1CMIZFM708Mfz1oYfGgKWZU EuzPz97ttcsdpjInAvu96Z9lH9aDZRCyh3Kz3AdjtdaA5XU/MxbuAKX4TSGc1g== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1784584438; a=rsa-sha256; cv=none; b=UxrGHyTr0JCP/Ue9Y+NcXEwc7CplE+rGoc3XirXtVuPIK/unYWOHMBDKhBm17NigTM9drU 3ZEiVZZxFRARfjUpNuS69z080UzIsTtPWVZWY9955AMI8QrcdorSRSOeXbNNkCr0LPltJO OtEjpvbAwdK6VY3y2fJ4bYiQ9SZMwK2oTkpjKAU7oJGIkTeSxSCd1aT27bzrMFFHA4aJPP 14nbTjdjDbk26nwXPBjma9wNat5Z5LADr2oSMdiIXYC/6Jrxt0MZBL/9xtdq1elMJSxEq7 77YTKlpG/E76QHgNj1UnZqamrF6M7TVfU6J3mY2qGIwZQ1A2wmK5VlAUOS0cpw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1784584438; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=su1yS6FHgMlZX4Z20g4DVGcVQO2/kAMKvaSOq6zws3E=; b=fFWn5D4wSlk/xWv0anpk3uk3Y9TEnQvoivRSrb7Hdn/uBwpeg0mt1pV0GqLNzkihhVHJ5w JHBXFA+yaZFdB7zqSfw9aDBTvA+GdmcjgY5J/6G2PTxXlxdBOZ47ZisLt4jJoq3s2XA+nY U/zcEm8aK3fZUc7QmWlHDoeM2GJFNsiXBkFIaM83xsam/Gw5n54xwzoVxnh3Zr++52D8tY Z/7qXSi1x+YLW1nbvJrIEGiM3/l09KPUa/dNiQPjwP1V3LuPoMekolUAXQ4EEzJohIsS3K 7iDcJONPVa/MaWdzqUrM31PdcKDnwfwo54Q9DNOHR+9mgjnAVQN5vcDkpk9XGg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4h3vRV2Tlcz519 for ; Mon, 20 Jul 2026 21:53:58 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 23b55 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Mon, 20 Jul 2026 21:53:58 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Cc: Artem Bunichev From: Alexander Ziaee Subject: git: 6ee5895f88ed - main - sh.1: Document which features are non-POSIX List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: ziaee X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 6ee5895f88ed7ba6b16aae9ad5833df6df6864bc Auto-Submitted: auto-generated Date: Mon, 20 Jul 2026 21:53:58 +0000 Message-Id: <6a5e98f6.23b55.709aa08b@gitrepo.freebsd.org> The branch main has been updated by ziaee: URL: https://cgit.FreeBSD.org/src/commit/?id=6ee5895f88ed7ba6b16aae9ad5833df6df6864bc commit 6ee5895f88ed7ba6b16aae9ad5833df6df6864bc Author: Artem Bunichev AuthorDate: 2026-07-20 21:50:57 +0000 Commit: Alexander Ziaee CommitDate: 2026-07-20 21:53:53 +0000 sh.1: Document which features are non-POSIX Point out which features are non-POSIX and thus can not be safely assumed to be portable and exist in other implementations. Relnotes: YES! Reviewed by: ziaee, jilles Differential Revision: https://reviews.freebsd.org/D55333 --- bin/sh/sh.1 | 79 ++++++++++++++++++++++++++++++++++++++++++++++++------------- 1 file changed, 63 insertions(+), 16 deletions(-) diff --git a/bin/sh/sh.1 b/bin/sh/sh.1 index a19aa7459896..927ed666b440 100644 --- a/bin/sh/sh.1 +++ b/bin/sh/sh.1 @@ -41,7 +41,7 @@ .\" the referee document. The original Standard can be obtained online at .\" http://www.opengroup.org/unix/online.html. .\" -.Dd June 16, 2026 +.Dd July 19, 2026 .Dt SH 1 .Os .Sh NAME @@ -77,9 +77,7 @@ The current version of is close to the .St -p1003.1 specification for the shell. -It only supports features -designated by POSIX, -plus a few Berkeley extensions. +Any extensions which are non-POSIX are marked below. This man page is not intended to be a tutorial nor a complete specification of the shell. .Ss Overview @@ -228,6 +226,7 @@ command line editor (disables the .Fl V option if it has been set; set automatically when interactive on terminals). +Non-POSIX option. See .Sx Command Line Editing . .It Fl e Li errexit @@ -261,8 +260,12 @@ A do-nothing option for POSIX compliance. Ignore .Dv EOF Ap s from input when in interactive mode. +The short name +.Fl I +is non-POSIX. .It Fl i Li interactive Force the shell to behave interactively. +Non-POSIX option. .It Fl l Force the shell to act as if it has been invoked as a login shell. .It Fl m Li monitor @@ -272,6 +275,7 @@ Set automatically when interactive. In a non-interactive shell, this option can be set even if no terminal is available and is useful to place processes in separate process groups. +This option is specified by POSIX, but in practice is not entirely portable. .It Fl n Li noexec If not interactive, read commands but do not execute them. @@ -288,6 +292,7 @@ commands from to .Fl P (physical directory layout). +Non-POSIX option. .It Fl p Li privileged Turn on privileged mode. This mode is enabled on startup @@ -304,6 +309,7 @@ after is sourced, and the contents of the .Ev ENV variable are ignored. +This option is non-POSIX. .It Fl s Li stdin Read commands from standard input (set automatically if no file arguments are present). @@ -312,13 +318,16 @@ no effect when set after the shell has already started running (i.e., when set with the .Ic set command). +The short name +.Fl s +is non-POSIX. .It Fl T Li trapsasync When waiting for a child, execute traps immediately. If this option is not set, traps are executed after the child exits, as specified in .St -p1003.2 . -This nonstandard option is useful for putting guarding shells around +This non-POSIX option is useful for putting guarding shells around children that block signals. The surrounding shell may kill the child or it may just return control to the tty and leave the child alone, @@ -339,6 +348,9 @@ Enable the built-in command line editor (disables .Fl E if it has been set). +The short name +.Fl V +is non-POSIX. See .Sx Command Line Editing . .It Fl v Li verbose @@ -367,10 +379,15 @@ if a command such as in the pipeline terminates with status 0 without reading its input completely. This option only has a long name. +.Li pipefail +is specified by +.St -p1003.1-2024 , +but still is not entirely portable. .It Li verify Set .Dv O_VERIFY when sourcing files or loading profiles. +Non-POSIX option. .\" See also .\" .Xr mac_veriexec 4 . TODO Does not exist; write it. .El @@ -516,6 +533,9 @@ that byte and the rest of the string until the matching single-quote are ignored. .Pp Any other string starting with a backslash is an error. +.Pp +Dollar-single quotes are specified by POSIX, but in practice are not +entirely portable. .It Double Quotes Enclosing characters within double quotes preserves the literal meaning of all characters except dollar sign @@ -1085,6 +1105,8 @@ continuing until a list terminated with or the end of the .Ic case command. +.Ic case +fallthrough is specified by POSIX, but in practice is not entirely portable. .Ss Grouping Commands Together Commands may be grouped by writing either .Sm off @@ -1173,7 +1195,7 @@ In the latter case, the function will be executed in a subshell when invoked. .Pp Variables may be declared to be local to a function by -using the +using the non-POSIX .Ic local command: .Pp @@ -1449,7 +1471,7 @@ The primary prompt string, which defaults to unless you are the superuser, in which case it defaults to .Dq Li "# " . .Va PS1 -may include any of the following formatting sequences, +may include any of the following non-POSIX formatting sequences, which are replaced by the given information: .Bl -tag -width indent .It Li \eD{format} @@ -1590,7 +1612,7 @@ If the variants with or .Ql ?\& occur within a double-quoted string, -as an extension there may be unquoted parts +as a non-POSIX extension there may be unquoted parts (via double-quotes inside the expansion); .Ql } within such parts are also not examined in determining the matching @@ -1953,7 +1975,7 @@ The character class may be complemented by making an exclamation point the first character of the character class. A caret .Pq Ql ^ -has the same effect but is non-standard. +has the same effect but is non-POSIX. .Pp To include a .Ql \&] @@ -2079,6 +2101,8 @@ List or alter key bindings for the line editor, .Xr editline 7 . This command is documented in .Xr editrc 5 . +The behavior of this command depends on the library that is used +to read user input, and thus can not be assumed to be standard. .It Ic break Op Ar num See the .Sx Flow-Control Constructs @@ -2088,6 +2112,7 @@ Execute the specified built-in command, .Ar cmd . This is useful when the user wishes to override a shell function with the same name as a built-in command. +This command is non-POSIX. .It Ic cd Oo Fl L | P Oc Oo Fl e Oc Op Ar directory .It Ic cd Fl Switch to the specified @@ -2155,6 +2180,7 @@ to return exit status 1 if the full pathname of the new directory cannot be determined reliably or at all. Normally this is not considered an error, although a warning is printed. +This option is specified by POSIX, but in practice is not entirely portable. .Pp If changing the directory fails, the exit status is greater than 1. If the directory is changed, the exit status is 0, or also 1 if @@ -2222,6 +2248,7 @@ and append a newline character. .Bl -tag -width indent .It Fl n Suppress the output of the trailing newline. +Non-POSIX option. .It Fl e Process C-style backslash escape sequences. The @@ -2271,6 +2298,7 @@ a\eb $ echo -e a\e\e\e\eb a\eb .Ed +Non-POSIX option. .El .Pp Only one of the @@ -2322,6 +2350,7 @@ With no arguments the .Ic export command lists the names of all exported variables. +Behavior with no arguments is not specified by POSIX. If the .Fl p option is specified, the exported variables are printed as @@ -2505,7 +2534,7 @@ With arguments, the command removes each specified .Ar command from the hash table (unless they are functions) and then locates it. -With the +With the non-POSIX .Fl v option, .Ic hash @@ -2524,6 +2553,7 @@ argument is omitted, use the current job. See .Sx Job Control for a list of job ID forms. +This command is non-POSIX. .It Ic jobs Oo Fl lps Oc Op Ar job ... Print information about the specified jobs, or all jobs if no .Ar job @@ -2632,7 +2662,7 @@ If the option is specified, only the process IDs for the process group leaders are printed, one per line. .Pp -If the +If the non-POSIX .Fl s option is specified, only the PIDs of the job commands are printed, one per line. @@ -2677,7 +2707,7 @@ This is the default. .Fl t Ar timeout Oc Oo Fl er Oc Ar variable ... The .Ar prompt -is printed if the +is printed if the non-POSIX .Fl p option is specified and the standard input is a terminal. @@ -2710,7 +2740,7 @@ character will be treated as though it were not in .Va IFS , even if it is. .Pp -If the +If the non-POSIX .Fl t option is specified and the .Ar timeout @@ -2736,7 +2766,7 @@ they are added up, e.g.\& .Ql 1h30m15s which adds up to 5,415 seconds. .Pp -The +The non-POSIX .Fl e option exists only for backward compatibility with older scripts. .Pp @@ -2758,6 +2788,7 @@ by using the following form: With no arguments the .Ic readonly command lists the names of all read only variables. +Behavior with no arguments is not specified by POSIX. If the .Fl p option is specified, the read-only variables are printed as @@ -2817,7 +2848,7 @@ The .Ic setvar command is intended to be used in functions that assign values to variables whose names are passed as parameters. -In general it is better to write +This command is non-POSIX, and in general it is better to write .Dq Ar variable Ns = Ns Ar value rather than using .Ic setvar . @@ -2879,7 +2910,7 @@ command has no effect on signals that were ignored on entry to the shell. .Pp Option .Fl l -causes the +is non-POSIX and causes the .Ic trap command to display a list of valid signal names. .It Ic true @@ -2920,6 +2951,11 @@ or can be given. The default is to display the soft limits, and to set both the hard and the soft limits. +Both +.Fl H +and +.Fl S +are specified by POSIX, but in practice are not entirely portable. .Pp Option .Fl a @@ -2929,6 +2965,7 @@ command to display all resources. The parameter .Ar limit is not acceptable in this mode. +This option is specified by POSIX, but in practice is not entirely portable. .Pp The remaining options specify which resource value is to be displayed or modified. @@ -2936,6 +2973,7 @@ They are mutually exclusive. .Bl -tag -width indent .It Fl b Ar sbsize The maximum size of socket buffer usage, in bytes. +Non-POSIX option. .It Fl c Ar coredumpsize The maximal size of core dump files, in 512-byte blocks. Setting @@ -2943,6 +2981,7 @@ Setting to 0 prevents core dump files from being created. .It Fl d Ar datasize The maximal size of the data segment of a process, in kilobytes. +This option is specified by POSIX, but in practice is not entirely portable. .It Fl f Ar filesize The maximal size of a file, in 512-byte blocks. .It Fl k Ar kqueues @@ -2950,31 +2989,39 @@ The maximal number of kqueues (see .Xr kqueue 2 ) for this user ID. +Non-POSIX option. .It Fl l Ar lockedmem The maximal size of memory that can be locked by a process, in kilobytes. +Non-POSIX option. .It Fl m Ar memoryuse The maximal resident set size of a process, in kilobytes. +Non-POSIX option. .It Fl n Ar nofiles The maximal number of descriptors that could be opened by a process. +This option is specified by POSIX, but in practice is not entirely portable. .It Fl o Ar umtxp The maximal number of process-shared locks (see .Xr pthread 3 ) for this user ID. +Non-POSIX option. .It Fl p Ar pseudoterminals The maximal number of pseudo-terminals for this user ID. +Non-POSIX option. .It Fl s Ar stacksize The maximal size of the stack segment, in kilobytes. .It Fl t Ar time The maximal amount of CPU time to be used by each process, in seconds. .It Fl u Ar userproc The maximal number of simultaneous processes for this user ID. +Non-POSIX option. .It Fl v Ar virtualmem The maximal virtual size of a process, in kilobytes. .It Fl w Ar swapuse The maximum amount of swap space reserved or used for this user ID, in kilobytes. +Non-POSIX option. .El .It Ic umask Oo Fl S Oc Op Ar mask Set the file creation mask (see