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 -

How to get the ip address of VM and use it to configure SSH connection dynamically in Ansible -

javascript - Get parameter of GET request -