4 ms·
I'm in the camp of using <input X|Y|Z >output The point of this syntax is that I can readily replace it with F() { X|Y|Z } <input F >output
by jxy 3y ago
I'm in the camp of using
<input X|Y|Z >output
The point of this syntax is that I can readily replace it with
F() { X|Y|Z }
<input F >output
- iforgotpassword 3y agoSince I like spaces around stuff I started putting two spaces after the infile at some point. < infile x | y | z > outfile I just didn't like how the filename was so close to the command name ;)
- CBLT 3y agoI'm in this camp as well, starting with input file redirection just makes so much sense to me. </proc/0/environ xargs -0 I also don't tend to want enormous volumes of text in my terminal scrollback so I generally view files or pipe verbose commands to `less`, then when I find what I want to send to the terminal I use the `|` less command to pipe it to `cat`. Or to grab just a few lines for my later reference: kubectl get po/my-pod -o yaml | less /* find the lines I'm interest in */ -N |^sed -n 34,35p
- bloopernova 3y agoThis is by far the best explanation I've read for using that method. Thank you!
- adityaathalye 3y agoOh `F()`. I should use redirection more with my Bash functions, and add it to my list (pun intended) of functional tricks [1]. [1] https://evalapply.org/posts/shell-aint-a-bad-place-to-fp-part-2-functions-as-unix-tools/ https://evalapply.org/posts/shell-aint-a-bad-place-to-fp-par...