~nabijaczleweli/voreutils

ad1a498d8e5f7f0f63a62c9b5b2aa0fe62c2310f — наб a month ago 104fd7f
HISTORYise echo.1. Proof echo.1, link.1, unlink.1, and sync.1
3 files changed, 178 insertions(+), 2 deletions(-)

M man/echo.1
M man/link.1
M man/sync.1
M man/echo.1 => man/echo.1 +176 -0
@@ 30,3 30,179 @@ Otherwise, the newline character is written after all
if no errors (like the output exceeding its quota) were encountered while writing, otherwise
.Sy 1
and a diagnostic is issued.
.
.Sh SEE ALSO
.Xr printf 1
.
.Sh STANDARDS
Conforms to
.St -p1003.1-2008 ;
backslashes in
.Ar string Ns s
and first-argument
.Fl n
are implementation-defined \(em this implementation handles them compatibly with
.At v7 .
.
.Sh HISTORY
.\" Copied from Unix Programmer's Manual 2nd ed, v4man, PWB/UNIX, CB-UNIX, verified against unix72
Appeared, fully-formed, in the second edition of the UNIX Programmer's Manual as
.Xr echo I :
.Bl -tag -compact -offset Ds -width ".Li DESCRIPTION"
.It Li NAME
.Li "echo  --  echo arguments"
.It Li SYNOPSIS
.Li "\z\(ule\z\(ulc\z\(ulh\z\(ulo [ arg\d1\u ... ]"
.It Li DESCRIPTION
.Li "\z\(ule\z\(ulc\z\(ulh\z\(ulo writes all its arguments in order as a line on the standard output file. "
.Li "It is mainly useful for producing diagnostics in command files."
.It Li OWNER
.Li doug
.El
.Pp
.At v4
notes that
.D1 Em Echo No with no arguments does not print a blank line.
in the
.Sx BUGS
section, but this is seemingly incongruent with
.At v2
.Nm ,
which does yield and empty line for no arguments, but always adds a space after each argument.  \" according to unix72, either way; it uses a binary unsourced echo
Either way, it's impossible to verify anymore.
.Pp
.At v5
sees a C implementation, and a removal of that
.Sx BUGS
stanza \(em the arguments are separated by single spaces and end with a newline.
.Pp
.At v7
adds newline-suppressing
.Pf first-argument- Fl n
behaviour.
This is inherited by
.Bx 3 ,
and remains unchanged in the
.Bx .
.Pp
.Tn PWB/UNIX
1.0, based on
.At v6 ,
additionally sees
.Sq Sy \en ,
.Sq Sy \ec
which
.Qq terminates Em echo No without a newline ,
and
.Sq Sy \e0 Ns Em N ,
writing the
.Qq octal number Em N .
.Pp
.Tn CB-UNIX
2.1
additionally recognises
.Sq Sy \eb ,
.Sq Sy \ef ,
.Sq Sy \er ,
.Sq Sy \et ,
.Sq Sy \e\e ,
and phrases the octal escape as
.Sq Sy \e Ns Em n ,
described as
.Qq the 8-bit character whose Tn ASCII No code is the 1-, 2- or 3-digit octal number Em n , No which must start with a zero ;
this is the same as the
.Tn PWB/UNIX
one, but just more confusing.
.Pp
It also notes that if the final argument ends with a space, that space, as well as the terminating newline, is removed
\(em this is described as equivalent to
.Sy \ec ,
but
.Sy \ec
just
.Xr exit 2 Ns s .
.Pp
.Tn CB-UNIX
was, among others, the basis for
.At III ,
where it first saw light outside of AT&T.
It sees the same
.Nm ,
except that the final-space behaviour is nowhere to be found.
.Pp
.At V.2
also recognises
.Sq Sy \ev .
.Pp
.At V.4
handles
.Fl n
as the first argument, which replaces the final newline with a space.
.Pp
.At V.2
and
.At V.3
both provide
.Nm
.Xr sh 1
built-ins, equivalent to their stand-alone
.Nm Ns s
(under
.Tn CB-UNIX ,
the built-in is
.Nm fecho ,
and
.Qq its output cannot be redirected as easily as that of Em echo ) .
.Pp
.At V.4
also ships
.At v7
.Nm
under
.Pa /usr/ucb
(this is a Solarisism).
Its built-in depends on
.Va ucb_builtins :
.Bd -literal -compact -offset indent
/*
 * The following flag is set to true if /usr/ucb is found in the path
 * before /usr/bin. This value is checked when exectuing the echo and test
 * built-in commands. If true, the command behaves as in BSD systems.
 */
.Ed
If set, it uses inlined
.At v7
.Nm ,
otherwise the
.At V.3
built-in
.Em except
on i386, where it also handles
.Fl n Ns -as-first-argument ,
but doesn't leave a trailing space
.Pq like At v7 , unlike At V.4 .
.\" It also ships the KornShell, but it's ksh, and therefore absolutely nuts. Also a separate moral entity.
.Pp
.Tn X/Open No Portability Guide Issue\~2 Pq Dq Tn XPG Ns \^2  \" .St -xpg2
standardises
.At V.3
.Nm
verbatim.
As the two major implementations were irreconcilable,
.St -p1003.2-92
standardised the most base-line
.At v2 Ns -style
.Nm ,
and specifies implementation-defined behaviour if any of the
.Ar string Ns s
contain a
.Sq Sy \e
or if the first argument is
.Fl n ,
instead creating
.Xr printf 1
as a portable alternative, with
.Cm %b
mirrorring
.At V.3
escape handling.

M man/link.1 => man/link.1 +1 -1
@@ 15,7 15,7 @@
.Sh DESCRIPTION
Creates
.Ar new ,
pointing to the same file as
which is the same file as
.Ar existing .
.Pp
Equivalent to running

M man/sync.1 => man/sync.1 +1 -1
@@ 9,7 9,7 @@
.Nd flush kernel caches
.Sh SYNOPSIS
.Nm
.Op Fl d Ns | Ns Fl f
.Op Fl d Ns \&| Ns Fl f
.Oo Ar file Oc Ns …
.
.Sh DESCRIPTION