3 ms·
You can put shell file redirections such as "< file" at the beginning of the line. In bash, type: < /etc/resolv.conf grep nameserver (That < is not a prom
by samsquire 3y ago
You can put shell file redirections such as "< file" at the beginning of the line.
In bash, type:
< /etc/resolv.conf grep nameserver
(That < is not a prompt, that's the less than symbol)
- tolciho 3y agoSometimes you can prefix with "< file". Sometimes, not so much. < /etc/passwd while IFS= read line || [ -n "$line" ]; do printf '%s\n' "$line"; done Meanwhile, in ZSH... Meanwhile, in languages that do not need IFS= and || [ -n "$line" ] checks...
- kzrdude 3y agoNice, I learned something and thank you
- ilyt 3y agoaliasing c to cat still requires less keystrokes
- antonvs 3y agoBut in a multi-step pipe, that’s still asymmetric and to me, less natural as a result. cat f | grep nameserver | otherproc… …is more consistently compositional.