summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOtto Moerbeek <otto@cvs.openbsd.org>2003-11-06 19:48:56 +0000
committerOtto Moerbeek <otto@cvs.openbsd.org>2003-11-06 19:48:56 +0000
commit9d7385b3f2fd17d4f6d71b11b496e6d1525a2608 (patch)
tree903717783493e442c728ea969a0864219754f765
parente731926e99a26e9831cf6e50ba7cb12dc86ce05a (diff)
Describe non-portable extension # (comment), n (print w/o newline),
and a (byte to char). Tweaks and ok jmc@
-rw-r--r--usr.bin/dc/dc.127
1 files changed, 24 insertions, 3 deletions
diff --git a/usr.bin/dc/dc.1 b/usr.bin/dc/dc.1
index f276f74618d..3cb6be6475b 100644
--- a/usr.bin/dc/dc.1
+++ b/usr.bin/dc/dc.1
@@ -1,4 +1,4 @@
-.\" $OpenBSD: dc.1,v 1.14 2003/11/04 08:10:06 otto Exp $
+.\" $OpenBSD: dc.1,v 1.15 2003/11/06 19:48:55 otto Exp $
.\"
.\" Copyright (C) Caldera International Inc. 2001-2002.
.\" All rights reserved.
@@ -134,6 +134,21 @@ This is a shorthand for the sequence:
x y / x y %
.Ed
The division and modulus operator is a non-portable extension.
+.It Ic a
+Pop the top value from the stack.
+If that value is a number, compute the integer part of the number modulo 256.
+If the result is zero, push an empty string.
+Otherwise push a one character string by interpreting the computed value
+as an
+.Tn ASCII
+character.
+.Pp
+If the top value is a string, push a string containing the first character
+of the original string.
+If the original string is empty, an empty string is pushed back.
+The
+.Ic a
+operator is a non-portable extension.
.It Ic c
All values on the stack are popped.
.It Ic d
@@ -147,14 +162,14 @@ The initial input base is 10.
.It Ic I
Pushes the input base on the top of the stack.
.It Ic J
-Pop the top value of the stack.
+Pop the top value from the stack.
The recursion level is popped by that value and, following that,
the input is skipped until the first occurrence of the
.Ic M
operator.
The
.Ic J
-operator is a non-portable extensions, used by the
+operator is a non-portable extension, used by the
.Xr bc 1
command.
.It Ic K
@@ -190,6 +205,9 @@ The
operator is a non-portable extensions, used by the
.Xr bc 1
command.
+.It Ic n
+The top value on the stack is popped and printed without a newline.
+This is a non-portable extension.
.It Ic O
Pushes the output base on the top of the stack.
.It Ic o
@@ -327,6 +345,9 @@ since the string
is written in an array that is later popped, to reveal the array that
stored
.Ql first .
+.It Ic #
+Skip the rest of the line.
+This is a non-portable extension.
.El
.Sh EXAMPLES
An example which prints the first ten values of