summaryrefslogtreecommitdiff
path: root/usr.bin
diff options
context:
space:
mode:
authorAaron Campbell <aaron@cvs.openbsd.org>2000-01-22 12:46:31 +0000
committerAaron Campbell <aaron@cvs.openbsd.org>2000-01-22 12:46:31 +0000
commit7baab6309586eda67764e44c12442894823291ca (patch)
tree87f601baa194601acab9e642b2f5098f43b6cdc7 /usr.bin
parent0a46552ab6ad5ad0dd8f93517be8d8dd71229b9f (diff)
Add a couple of useful examples.
Diffstat (limited to 'usr.bin')
-rw-r--r--usr.bin/printf/printf.111
1 files changed, 10 insertions, 1 deletions
diff --git a/usr.bin/printf/printf.1 b/usr.bin/printf/printf.1
index 1ffdebbb813..245543d7565 100644
--- a/usr.bin/printf/printf.1
+++ b/usr.bin/printf/printf.1
@@ -1,4 +1,4 @@
-.\" $OpenBSD: printf.1,v 1.7 1999/06/05 01:21:37 aaron Exp $
+.\" $OpenBSD: printf.1,v 1.8 2000/01/22 12:46:30 aaron Exp $
.\" Copyright (c) 1989, 1990 The Regents of the University of California.
.\" All rights reserved.
.\"
@@ -286,6 +286,15 @@ the actual width.
.Sh RETURN VALUES
.Nm printf
exits 0 on success or 1 on failure.
+.Sh EXAMPLES
+Convert a hexidecimal value to decimal and print it out:
+.Pp
+.D1 Ic printf \&"%d\en\&" 0x20
+.Pp
+Print the decimal representation of the character 'a' (see
+.Xr ascii 7 ) :
+.Pp
+.D1 Ic printf \&"%d\en\&" \e'a
.Sh SEE ALSO
.Xr echo 1 ,
.Xr printf 3