#include <xtend/string.h>
-lxtend
int strshellcpy(char *dest, const char *src, size_t dest_len)
src: String containing meta-characters
dest: Expanded string
dest_len: Size of destination array
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
0 on success, -1 if expansion did not fit in dest_len