xt_strshellcpy(3)

NAME
xt_strshellcpy() - Expand a string containing shell metacharacters

LIBRARY
#include <xtend/string.h>
-lxtend

SYNOPSIS
int     xt_strshellcpy(char *dest, const char *src, size_t dest_len)

ARGUMENTS
src:        String containing meta-characters
dest:       Expanded string
dest_len:   Size of destination array

DESCRIPTION
xt_strshellcpy() expands a string containing shell meta-characters, usually a shell command, as a Unix shell would do before execution. This is useful if you want to avoid spawning an unnecessary shell process, such as when using fork(2) and exec(3) directly instead of using system(3). Currently supports: ~/: process owner's home directory $: environment variable

RETURN VALUES
0 on success, -1 if expansion did not fit in dest_len

SEE ALSO
sh(1)