Open System Services Library Calls Reference Manual (G06.28+, H06.05+)

OSS Library Calls (w - z) wordexp(3)
Pointers to the words that were in the structure pointed to by pwordexp before
the call, in the same order as before.
Pointers to the new words generated by the latest call, in the speci
ed order.
The count returned in the structure pointed to by pwordexp is the total number of words
from all of the calls.
The application should not modify the pwordexp parameter between the calls.
The WRDE_NOCMD ag is provided for applications that, for security or other reasons, want
to prevent a user from executing shell commands. Disallowing unquoted shell special characters
also prevents unwanted side effects such as executing a command or writing to a le.
Unless WRDE_SHOWERR is set in the ags parameter, the wordexp() function redirects the
standard error le to /dev/null for any utilities executed as a result of command substitution
while expanding the words parameter. If WRDE_SHOWERR is set, the wordexp() function
can write messages to the standard error le if syntax errors are detected during expansion of the
words parameter.
RETURN VALUES
If no errors are encountered while expanding the words parameter, the wordexp() function
returns the value 0 (zero). If an error occurs, it returns a nonzero value indicating the error.
NOTES
If you use this function on a word that specifes the local / (slash) root directory, the expansion
includes the /G and /E directories. Actions appropriate for local OSS les under / often are not
appropriate for local Guardian les or for any les on other HP NonStop server nodes.
The UTILSGE environment variable that governs shell utility behavior can be used to test or
recommend whether use should include Guardian les or les on remote HP NonStop server
nodes. Note that UTILSGE settings are only advisory for functions; changing the variable value
does not affect function behavior. Refer to the environ(5) reference page either online or in the
Open System Services System Calls Reference Manual for more information about UTILSGE.
ERRORS
If any of the following conditions occurs, the wordexp() function returns the corresponding
nonzero constant, which is dened in the wordexp.h header le.
WRDE_BADCHAR
One of the unquoted characters |, &, ;, <, >, parenthesis, or braces appears in the
words parameter in an inappropriate context.
WRDE_BADVAL
A reference was made to an undened shell variable when the WRDE_UNDEF
ag is set in the ags parameter.
WRDE_CMDSUB
Command substitution was requested when the WRDE_NOCMD ag is set in
the ags parameter.
WRDE_EOPEN
The popen( ) function returned an error. Check the errno value returned by that
function call.
527187-007 Hewlett-Packard Company 855