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

Using redirection with entr #99

Closed
malcolmsailor opened this issue Sep 9, 2022 · 2 comments
Closed

Using redirection with entr #99

malcolmsailor opened this issue Sep 9, 2022 · 2 comments

Comments

@malcolmsailor
Copy link

The > operator isn't working with entr in the way I expect it to. E.g., if I run

ls foo | entr -p echo doo > bar

Each time I modify foo, 'doo' is appended to bar, rather than overwriting its contents (i.e., what I expect >> to do). I suspect this has something to do with some subtle shell behavior that eludes me. Is there a way to get the same result as the usual > redirection?

Thanks for a great tool!

@eradman
Copy link
Owner

eradman commented Sep 10, 2022

Glad entr has been useful to you!

If you want pipes and other redirection to act as a single command, start a shell:

ls foo | entr -p sh -c 'doo > bar'

or

ls foo | entr -p -s 'doo > bar'

@malcolmsailor
Copy link
Author

Fantastic, thanks!

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

No branches or pull requests

2 participants