]> xenbits.xensource.com Git - people/julieng/freebsd.git/commitdiff
sh(1): Mention portability issue with shifting zero positional parameters.
authorjilles <jilles@FreeBSD.org>
Fri, 7 Nov 2014 21:30:16 +0000 (21:30 +0000)
committerjilles <jilles@FreeBSD.org>
Fri, 7 Nov 2014 21:30:16 +0000 (21:30 +0000)
Per Austin Group issue #459, shifting zero positional parameters may or may
not be considered an operand error (which causes the shell to exit in most
cases).

bin/sh/sh.1

index 47b1b36c59f1301cfea52b06ede813bf46295aa9..c770aca07d597e8a3847b8703d7d31ecefc0118e 100644 (file)
@@ -32,7 +32,7 @@
 .\"    from: @(#)sh.1  8.6 (Berkeley) 5/4/95
 .\" $FreeBSD$
 .\"
-.Dd September 21, 2014
+.Dd November 7, 2014
 .Dt SH 1
 .Os
 .Sh NAME
@@ -2522,7 +2522,8 @@ and so on,
 decreasing the value of
 .Li $#
 by one.
-If there are zero positional parameters, shifting does not do anything.
+For portability, shifting if there are zero positional parameters
+should be avoided, since the shell may abort.
 .It Ic test
 A built-in equivalent of
 .Xr test 1 .