Hmm It's just that I saw this example
Code:
#include <unistd.h>
int ret;
char *cmd[] = { "ls", "-l", (char *)0 };
char *env[] = { "HOME=/usr/home", "LOGNAME=home", (char *)0 };
...
ret = execve ("/bin/ls", cmd, env);
The man pages says
Code:
int execve(const char *path, char *const argv[], char *const envp[]);
So the correct use for me would be
Code:
char *cmd[] = { "rm", "/tmp/cenas/*.*", (char *)0 };
char *env[] = { "HOME=/usr/home", "LOGNAME=home", (char *)0 };
execve("/bin/sh", cmd, env);
I'm confused about the env part