How to set up argument array for execvp()?

Hey guys, I'm having trouble trying to run a command such as
[CMD=""]shasum -a 512 -b filename[/CMD]
within a program, using execvp().

For the char *const argv[] parameter of execvp() I set it to
Code:
str[0] = "-a";
str[1] = "512";
str[2] = "-b";
str[3] = name;
str[4] = 0;
but it errors saying
[CMD=""]shasum: 512: No such file or directory[/CMD]

What am I doing wrong? x(

Thanks!
 
Back
Top