strshellcpy(3)

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

SYNOPSIS

int 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
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)