Is the following code correct:
char * cmd="ls -l"; /* Unix command used for listing */
char * spCmd;
spCmd = strtok(cmd , " ");/* it divides the cmd in to tokens */
execvp(spCmd[0] , spCmd);
the output of this code is to execute command that is written in cmd ?
if there are any good solution plz provide them here?thanx
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!