int wordexp(const char *words, wordexp_t *pwordexp, int flags);
void wordfree(wordexp_t *pwordexp);
words cannot contain an unquoted newline or any of the following special characters:
| & ; < >
except in the context of command substitution.
words may also not contain unquoted parentheses or braces,
except in the context of command or variable substitution.
If words contains an unquoted comment character (#)
that begins a token,
The caller must allocate the storage pointed to by pwordexp;
The flags argument controls the behavior of
Appends words to those generated by previous
wordexp()calls with the same pwordexp argument.
Use the we_offs member of pwordexp to specify the number of null pointers to add to the beginning of the we_wordv member of pwordexp. In other words, the we_wordv member points to we_offs null pointers, followed by wordc word pointers, followed by a null pointer.
Fail if command substitution is requested.
The pwordexp argument was passed to a previous successful
wordexp()call, and has not been passed to wordfree(). The result is the same as if the application called wordfree()followed by wordexp()without WRDE_REUSE.
Do not redirect the standard error stream. Normally,
wordexp()redirects any output on the standard error stream generated when executing utilities during command substitution to /dev/null.
Report an error on an attempt to expand an undefined shell variable.
Contains a bitwise-OR value that controls the behavior of
Points to a wordexp_t structure that contains the expanded words.
Points to the string on which word expansion is to be performed.
An unquoted metacharacter appeared in the wrong place.
There was an undefined environment variable reference with the WRDE_UNDEF flag set.
Command substitution was requested with the WRDE_NOCMD flag set.
The process ran out of memory.
There was a sh syntax error.
PTC MKS Toolkit for Professional Developers
PTC MKS Toolkit for Professional Developers 64-Bit Edition
PTC MKS Toolkit for Enterprise Developers
PTC MKS Toolkit for Enterprise Developers 64-Bit Edition
PTC MKS Toolkit 10.3 Documentation Build 39.