Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow pipes in commands #7

Closed
wants to merge 2 commits into from
Closed

Allow pipes in commands #7

wants to merge 2 commits into from

Conversation

theomega
Copy link
Contributor

The current implementation does not allow to specify pipes as commands.

So watch 'ls | grep txt' fails, even worse without a clear error-message:

waitpid(): No child processes
exit: 1

This comes from the fact that the old watch implementation uses the system function to execute the commands. This function uses a shell which handles the pipes. execvp does not support pipes in its commands, you would have to set them up by yourself.

The following patch changes some things:

  • Per default execute thru system
  • Add a -x/--exec flag which switches back to the old behaviour
  • Output a correct error-message on execvp errors.

This makes watch more usable and more compliant to the original implementation.

@tj
Copy link
Owner

tj commented Dec 12, 2011

haha good call with system, I didn't even think about pipelines for some reason. I'll check it out tomorrow

@tj tj closed this in be22d2a Dec 17, 2011
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants