From 894d8eb522f88bb2c0c9136d86a1836116856a8d Mon Sep 17 00:00:00 2001 From: Michael Kerrisk Date: Mon, 14 Jul 2008 19:40:42 +0000 Subject: [PATCH] Move example into proper EXAMPLE section. --- man3/wordexp.3 | 50 +++++++++++++++++++++++++------------------------- 1 file changed, 25 insertions(+), 25 deletions(-) diff --git a/man3/wordexp.3 b/man3/wordexp.3 index 0c4151dd3..c65c3986d 100644 --- a/man3/wordexp.3 +++ b/man3/wordexp.3 @@ -20,7 +20,7 @@ .\" Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111, .\" USA. .\" -.TH WORDEXP 3 2008-06-14 "" "Linux Programmer's Manual" +.TH WORDEXP 3 2008-07-14 "" "Linux Programmer's Manual" .SH NAME wordexp, wordfree \- perform word expansion like a posix-shell .SH SYNOPSIS @@ -80,30 +80,6 @@ More precisely, it does not free its argument, but it frees the array .I we_wordv and the strings that points to. -.SS Example -First a small example. -The output is approximately that of "ls [a-c]*.c". -.LP -.nf -#include -#include -#include - -int -main(int argc, char **argv) -{ - wordexp_t p; - char **w; - int i; - - wordexp("[a-c]*.c", &p, 0); - w = p.we_wordv; - for (i=0; i < p.we_wordc; i++) - printf("%s\en", w[i]); - wordfree(&p); - exit(EXIT_SUCCESS); -} -.fi .SS "The string argument" Since the expansion is the same as the expansion by the shell (see .BR sh (1)) @@ -209,6 +185,30 @@ and are provided in glibc since version 2.1. .SH "CONFORMING TO" POSIX.1-2001 +.SH EXAMPLE +The output of the following example program +is approximately that of "ls [a-c]*.c". +.LP +.nf +#include +#include +#include + +int +main(int argc, char **argv) +{ + wordexp_t p; + char **w; + int i; + + wordexp("[a-c]*.c", &p, 0); + w = p.we_wordv; + for (i=0; i < p.we_wordc; i++) + printf("%s\en", w[i]); + wordfree(&p); + exit(EXIT_SUCCESS); +} +.fi .SH "SEE ALSO" .BR fnmatch (3), .BR glob (3)