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

Receive udp packets in android gstreamer -

php - Extract Text from HTTP referer -

matplotlib - PYTHON: Annotate boxes disapear dependant on range -