Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/bin/sh .Dl is a a single line .Bd -literal -offset indent so...



details:   https://anonhg.NetBSD.org/src/rev/aa52c307fa2f
branches:  trunk
changeset: 321372:aa52c307fa2f
user:      uwe <uwe%NetBSD.org@localhost>
date:      Tue Mar 13 19:43:52 2018 +0000

description:
.Dl is a a single line .Bd -literal -offset indent so don't abuse
multiple consecutive .Dl and use proper .Bd instead.

diffstat:

 bin/sh/sh.1 |  38 +++++++++++++++++++++++++-------------
 1 files changed, 25 insertions(+), 13 deletions(-)

diffs (61 lines):

diff -r 6c412f94c3d7 -r aa52c307fa2f bin/sh/sh.1
--- a/bin/sh/sh.1       Tue Mar 13 19:35:46 2018 +0000
+++ b/bin/sh/sh.1       Tue Mar 13 19:43:52 2018 +0000
@@ -1,4 +1,4 @@
-.\"    $NetBSD: sh.1,v 1.177 2018/03/13 19:35:46 uwe Exp $
+.\"    $NetBSD: sh.1,v 1.178 2018/03/13 19:43:52 uwe Exp $
 .\" Copyright (c) 1991, 1993
 .\"    The Regents of the University of California.  All rights reserved.
 .\"
@@ -1410,18 +1410,27 @@
 This means that a simple
 .Dq Hello World
 function might be written (in the extended syntax) as:
-.Dl hello() cat <<EOF
-.Dl Hello World!
-.Dl EOF
+.Bd -literal -offset indent
+hello() cat <<EOF
+Hello World!
+EOF
+.Ed
+.Pp
 To be correctly standards conforming this should be re-written as:
-.Dl hello() { cat; } <<EOF
-.Dl Hello World!
-.Dl EOF
+.Bd -literal -offset indent
+hello() { cat; } <<EOF
+Hello World!
+EOF
+.Ed
+.Pp
 Note the distinction between those forms, and
-.Dl hello() { cat <<EOF
-.Dl Hello World!
-.Dl EOF
-.Dl \&}
+.Bd -literal -offset indent
+hello() { cat <<EOF
+Hello World!
+EOF
+\&}
+.Ed
+.Pp
 which reads and processes the
 .Ic here document
 each time the shell executes the function, and which applies
@@ -2181,8 +2190,11 @@
 command invocation by a variable assignment to that variable,
 provided the variable is not also read-only.
 That is
-.Dl    export -x FOO ; # FOO will now not be exported by default
-.Dl    FOO=some_value my_command
+.Bd -literal -offset indent
+export -x FOO # FOO will now not be exported by default
+FOO=some_value my_command
+.Ed
+.Pp
 still passes the value (FOO=some_value) to
 .Ic my_command
 through the environment.



Home | Main Index | Thread Index | Old Index