I am trying to run execlp
with find ... -exec ...
, and the find
program consistently tells me:
find: missing argument to `-exec'
What could be wrong? When I run find with these arguments on my shell, it succeeds.
My function calls follow (after looking at related SO threads, I have tried several arrangements of the argmuments):
execlp("find","find","/home/me","-exec","/usr/bin/stat", "{}", "\\;",NULL);
execlp("find","find","/home/me","-exec","/usr/bin/stat", "'{}'", "\\;",NULL);
execlp("find","find","/home/me","-exec","/usr/bin/stat", "{}", "';'",NULL);
execlp("find","find","/home/me","-exec","/usr/bin/stat {} \\;",NULL);