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
No output when run in a loop. #474
Comments
Why are you calling |
that's a good question. I didn't know there was a difference |
Might be, might not be. Do you have some sort of |
I'm using OSX and zsh, it is case insensitive I believe. I just tried LS and that works and ack doesn't change the behavior. |
On Linux and other Unixoid systems there is a difference between lowercase and uppercase command. |
The Mac HFS+ filesystem is case-insensitive, by default I believe, so that explains that. |
I think it has something to do with this line: https://github.com/petdance/ack2/blob/dev/Ack.pm#L47 $is_filter_mode = -p STDIN; This evaluates to 1 (true) when STDIN is from a pipe. Because of this, ack expects data to search from STDIN. |
So this is our old nemesis "figuring out if we're filtering or not". |
Redirecting stdin from a file works as expected but piping from another command returns immediately as if nothing was found.
while read -r line; do Ack "$line"; done < search_terms
finds the search terms listed in the file.
cat search_terms | while read -r line; do Ack "$line"; done;
returns immediately.
The text was updated successfully, but these errors were encountered: