summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoraaron <aaron@openbsd.org>2000-01-22 12:46:30 +0000
committeraaron <aaron@openbsd.org>2000-01-22 12:46:30 +0000
commit6d7173c4193ce1da984bdb33008d91e906bfa0ef (patch)
treed2260847586d11f3a1b8830f801b36a8a56fa286
parentUse .Er macro when referring to errno error names. (diff)
downloadwireguard-openbsd-6d7173c4193ce1da984bdb33008d91e906bfa0ef.tar.xz
wireguard-openbsd-6d7173c4193ce1da984bdb33008d91e906bfa0ef.zip
Add a couple of useful examples.
-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