.\" Copyright (c) 2003 Andries Brouwer (aeb@cwi.nl)
.\"
+.\" %%%LICENSE_START(GPLv2+_DOC_FULL)
.\" This is free documentation; you can redistribute it and/or
.\" modify it under the terms of the GNU General Public License as
.\" published by the Free Software Foundation; either version 2 of
.\" GNU General Public License for more details.
.\"
.\" You should have received a copy of the GNU General Public
-.\" License along with this manual; if not, write to the Free
-.\" Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111,
-.\" USA.
+.\" License along with this manual; if not, see
+.\" <http://www.gnu.org/licenses/>.
+.\" %%%LICENSE_END
.\"
.TH WORDEXP 3 2008-07-14 "" "Linux Programmer's Manual"
.SH NAME
The field
.I we_wordv
is a
-.I char **
+.I "char\ **"
that points to the array of words found.
The field
.I we_offs
its argument, but it frees the array
.I we_wordv
and the strings that points to.
-.SS "The string argument"
+.SS The string argument
Since the expansion is the same as the expansion by the shell (see
.BR sh (1))
of the parameters to a command, the string
contains a word that starts with an unquoted comment character #,
then it is unspecified whether that word and all following words
are ignored, or the # is treated as a non-comment character.
-.SS "The expansion"
+.SS The expansion
The expansion done consists of the following stages:
tilde expansion (replacing ~user by user's home directory),
variable substitution (replacing $FOO by the value of the environment
.LP
Field splitting is done using the environment variable $IFS.
If it is not set, the field separators are space, tab and newline.
-.SS "The output array"
+.SS The output array
The array
.I we_wordv
contains the words found, followed by a NULL.
-.SS "The flags argument"
+.SS The flags argument
The
.I flag
argument is a bitwise inclusive OR of the following values:
.TP
.B WRDE_UNDEF
Consider it an error if an undefined shell variable is expanded.
-.SH "RETURN VALUE"
+.SH RETURN VALUE
In case of success 0 is returned.
In case of error
one of the following five values is returned.
and
.BR wordfree ()
are provided in glibc since version 2.1.
-.SH "CONFORMING TO"
+.SH CONFORMING TO
POSIX.1-2001.
.SH EXAMPLE
The output of the following example program
char **w;
int i;
- wordexp("[a-c]*.c", &p, 0);
+ wordexp("[a\-c]*.c", &p, 0);
w = p.we_wordv;
for (i = 0; i < p.we_wordc; i++)
printf("%s\en", w[i]);
exit(EXIT_SUCCESS);
}
.fi
-.SH "SEE ALSO"
+.SH SEE ALSO
.BR fnmatch (3),
.BR glob (3)
+.SH COLOPHON
+This page is part of release 3.65 of the Linux
+.I man-pages
+project.
+A description of the project,
+and information about reporting bugs,
+can be found at
+\%http://www.kernel.org/doc/man\-pages/.