DOC HOME SITE MAP MAN PAGES GNU INFO SEARCH PRINT BOOK
 

wordexp(5)


wordexp -- word-expansion utilities

Synopsis

   #include <wordexp.h>

Description

The wordexp header declares the type wordexp_t which includes the following members:

size_t we_wordc
The number of words that have been matched by words.
char **we_wordv
This is a pointer to a list of expanded words.
size_t we_offs
Slots to be reserved. These are found at the beginning of
 
we_wordv .

 size_t  we_wordc
 char  **we_wordv
 size_t  we_offs
wordexp takes the argument flags. This argument is the bitwise inclusive OR of the flags that are listed below:

WRDE_APPEND
To words previously obtained,append new words.
WRDE_DOOFFS
A count of the null-pointers that should prepend to we_wordv.
WRDE_NOCMD
If there is a request for command substitution then fail.
WRDE_REUSE
Due to a successful call to wordexp, the pwordexp
 
argument has been passed to it but has not been passed to
 
wordfree. The result would be the same if a call had first
 
been made by the application to wordfree and then to
 
wordexp without using WRDE_REUSE.
WRDE_SHOWERR
The redirection of stderr to /dev/null should not occur.
WRDE_UNDEF
If the expansion of a shell variable that has not been defined is
 
attempted then an error is reported.

 WRDE_APPEND
 WRDE_DOOFFS
 WRDE_NOCMD
 WRDE_REUSE
 WRDE_SHOWERR
 WRDE_UNDEF
Error return values have the following constants defined:

WRDE_BADCHAR
One of the unquoted characters below is found in words
 
in an irrelevant context:
 
<newline> | & ; < > ( ) {}
WRDE_BADVAL
Attempting to reference shell variables that haven't been
 
defined when WRDE_UNDEF is set in flags.
WRDE_CMDSUB
Requesting command substitution when WRDE_NOCMD was set
 
in flags
WRDE_NOSPACE
Memory allocation attempt failure
WRDE_NOSYS
Function not supported by this implementation.
WRDE_SYNTAX
This is a syntax error in the shell such as an odd number of
 
brackets or strings that are unterminated.

 WRDE_BADCHAR
 WRDE_BADVAL
 WRDE_CMDSUB
 WRDE_NOSPACE
 WRDE_NOSYS
 WRDE_SYNTAX
The following functions are declared:
   int wordexp(const char *words,wordexp_t *pwordexp,int flags);
   

void wordfree(wordexp_t *pwordexp);


© 2004 The SCO Group, Inc. All rights reserved.
UnixWare 7 Release 7.1.4 - 25 April 2004