0

My code is:

execvp(command, args);

args is char* args[]

command is char* command

for example for ls -l, command is ls and args is -l but why after executing

execvp(command, args)I get only result of ls not ls -l??

Sara
  • 2,308
  • 11
  • 50
  • 76

1 Answers1

2

The argument list also contains the name of the program. Make sure that your args array contains both "ls" and "-l".

Kevin Grant
  • 5,363
  • 1
  • 21
  • 24