3 ms·
Also, '< file.txt | ...' does not work as well. Not sure if its well researched.
by blueflow 8y ago
Also, '< file.txt | ...' does not work as well. Not sure if its well researched.
- egwynn 8y agoYeah my eyebrow went up at that one too…
- ben509 8y agoWhich is surprising since "research" here means pasting it into a terminal... Maybe they meant `cat file.txt | while ...`? Even then, you never want to do that when you're reading because elements of a pipeline are run in subshells. The usual idiom is: while cond; do thing done < input > output It's also the problem with cheatsheets: the underlying idea in bash is that compound statements are like mini programs, so they have file handles that can be redirected. That doesn't come through a cheatsheet very well.