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

php - Wordpress website dashboard page or post editor content is not showing but front end data is showing properly -

javascript - Get parameter of GET request -

javascript - Twitter Bootstrap - how to add some more margin between tooltip popup and element -