Subject: bin/36533: minor doc fixes for sh(1)
To: None <gnats-admin@netbsd.org, netbsd-bugs@netbsd.org>
From: Greg A. Woods <woods@planix.com>
List: netbsd-bugs
Date: 06/23/2007 19:05:00
>Number: 36533
>Category: bin
>Synopsis: minor doc fixes for sh(1)
>Confidential: no
>Severity: non-critical
>Priority: medium
>Responsible: bin-bug-people
>State: open
>Class: doc-bug
>Submitter-Id: net
>Arrival-Date: Sat Jun 23 19:05:00 +0000 2007
>Originator: Greg A. Woods
>Release: netbsd-4 2007/06/22
>Organization:
Planix, Inc.; Toronto, Ontario; Canada
>Environment:
System: NetBSD
>Description:
some minor doc fixes for sh(1)
>How-To-Repeat:
>Fix:
mostly formatting and grammar, plus a minor semantic fix
Index: bin/sh/sh.1
===================================================================
RCS file: /cvs/master/m-NetBSD/main/src/bin/sh/sh.1,v
retrieving revision 1.85.2.1
diff -u -r1.85.2.1 sh.1
--- bin/sh/sh.1 16 Apr 2007 19:33:51 -0000 1.85.2.1
+++ bin/sh/sh.1 17 Apr 2007 22:00:52 -0000
@@ -672,6 +672,9 @@
.Dq baz
and nothing else.
This is not the way it works in C.
+Also, if you forget the left-hand side (for example when continuing lines but
+forgetting to use a backslash) it defaults to a true statement.
+This behavior is not useful and should not be relied upon.
.Ss Flow-Control Constructs -- if, while, for, case
The syntax of the if command is
.Bd -literal -offset indent
@@ -775,7 +778,8 @@
.Pp
.Dl local [ variable | - ] ...
.Pp
-Local is implemented as a built-in command.
+.Dq Local
+is implemented as a built-in command.
.Pp
When a variable is made local, it inherits the initial value and exported
and read-only flags from the variable with the same name in the surrounding
@@ -1163,7 +1167,7 @@
need to perform some operation that can't be performed by a separate
process.
In addition to these, there are several other commands that may
-be built-in for efficiency (e.g.
+be built in for efficiency (e.g.
.Xr printf 1 ,
.Xr echo 1 ,
.Xr test 1 ,
@@ -1213,7 +1217,9 @@
Do not execute the command but
search for the command and print the resolution of the
command search.
-This is the same as the type built-in.
+This is the same as the
+.Ic type
+built-in.
.It Fl v
Do not execute the command but
search for the command and print the absolute pathname
@@ -1822,25 +1828,37 @@
enables emacs-mode editing.
The command
.Ql set -o vi
-enables vi-mode editing and places sh into vi insert mode.
+enables vi-mode editing and places the current shell process into
+.Ar vi
+insert mode.
(See the
.Sx Argument List Processing
section above.)
.Pp
-The vi mode uses commands similar to a subset of those described in the
+The
+.Ar vi
+mode uses commands similar to a subset of those described in the
.Xr vi 1
man page.
With vi-mode
-enabled, sh can be switched between insert mode and command mode.
-It's similar to vi: typing
+enabled,
+.Nm sh
+can be switched between insert mode and command mode.
+It's similar to
+.Xr vi 1 :
+pressing the
.Aq ESC
-will throw you into command VI command mode.
-Hitting
+key will throw you into command VI command mode.
+Pressing the
.Aq return
-while in command mode will pass the line to the shell.
+key while in command mode will pass the line to the shell.
.Pp
-The emacs mode uses commands similar to a subset available in
-the emacs editor.
+The
+.Ar emacs
+mode uses commands similar to a subset available in
+the
+.Xr emacs 1
+editor.
With emacs-mode enabled, special keys can be used to modify the text
in the buffer using the control key.
.Pp
@@ -1865,13 +1883,16 @@
from the user's login directory in the password file
.Pq Xr passwd 5 .
This environment variable also functions as the default argument for the
-cd built-in.
+.Ic cd
+built-in.
.It Ev PATH
The default search path for executables.
See the above section
.Sx Path Search .
.It Ev CDPATH
-The search path used with the cd built-in.
+The search path used with the
+.Ic cd
+built-in.
.It Ev LANG
The string used to specify localization information that allows users
to work with different culture-specific and language conventions.
>Unformatted: