git: 1245f6e34884 - stable/14 - sh(1): Replace recommendation of use of -e with a note
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Sat, 15 Mar 2025 14:00:31 UTC
The branch stable/14 has been updated by michaelo:
URL: https://cgit.FreeBSD.org/src/commit/?id=1245f6e34884699b6bb2a2e9f414d58ac8585034
commit 1245f6e34884699b6bb2a2e9f414d58ac8585034
Author: Michael Osipov <michaelo@FreeBSD.org>
AuthorDate: 2024-05-03 07:57:06 +0000
Commit: Michael Osipov <michaelo@FreeBSD.org>
CommitDate: 2025-03-15 14:00:17 +0000
sh(1): Replace recommendation of use of -e with a note
This partially reverts b14cfdf665bb8b7b2898a4ee5b073ab87f8ea3d0 and has
been discussed in D42719.
Reviewed by: jrm (mentor), otis (mentor), mandree, ziaee (manpages)
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D45073
(cherry picked from commit 7bd8da72c5814b486ae7f492286fe3ac0a5bf03d)
---
bin/sh/sh.1 | 10 ++++------
1 file changed, 4 insertions(+), 6 deletions(-)
diff --git a/bin/sh/sh.1 b/bin/sh/sh.1
index a780d730642c..c11920e2f2a7 100644
--- a/bin/sh/sh.1
+++ b/bin/sh/sh.1
@@ -33,7 +33,7 @@
.\"
.\" from: @(#)sh.1 8.6 (Berkeley) 5/4/95
.\"
-.Dd January 10, 2025
+.Dd March 8, 2025
.Dt SH 1
.Os
.Sh NAME
@@ -240,11 +240,9 @@ If a shell function is executed and its exit status is explicitly
tested, all commands of the function are considered to be tested as
well.
.Pp
-It is recommended to check for failures explicitly
-instead of relying on
-.Fl e
-because it tends to behave in unexpected ways,
-particularly in larger scripts.
+Note that many commands return non-zero values to convey information other
+than errors, which can cause unexpected program termination with
+.Fl e .
.It Fl f Li noglob
Disable pathname expansion.
.It Fl h Li trackall