assistance with specific command in Bash -


i have proggram written in c

argv[0]=command; argv[1]=null;  if(strcmp(command,"ls > try.txt")) {      dup2(fd,1);      close(fd);      execvp(command,argv);      perror("execvp");      exit(1); } execvp(command,argv); perror("execvp"); exit(1); 

i want: if write ls >try.txt command work


Comments

Popular posts from this blog

authentication - Mongodb revoke acccess to connect test database -

python - GitPython: check if git is available -

How to merge four videos on one screen with ffmpeg -