So most importantly I’d add -F to the LESS environment variable. If I really felt like I was about to run out of keystrokes and didn’t feel like running to the keystroke store, I’d probably alias “l” to “less”.
That aside, you can use a hammer to push a screw into wood. You can use a screwdriver to beat a nail into a board. You can use a board to drive a dowel through a plank. The job gets done either way.
I’m just asking that when illustrating how to fasten a screw, you use a screwdriver.
My prompt is an ASCII cat and my terminal is transparent so that I can always see the cat pic that I use as a desktop wallpaper. Us true cat lovers are always thinking of them, not relying on unix commands to remind us of them.
Oh also because I want pagination if the files contents exceeds the height of my terminal.
The end result is that the contents of the file ends up in the STDOUT.
For your other examples, if you use a hammer to push a screw into wood, it won’t be secure and it damages the wood. Using a board to drive a dowel through a plank might work in a pinch, but it is easier to use a hammer.
What is the bad thing that happens if you use cat for its side effect rather than to concatenate?
I do not agree with the premise that there needs to be a negative repercussion to doing something before we look at examining the behavior.
I guess I could do some serious gymnastics and reach for something like “when a text file is longer than your terminal scrollback and you cat it, you lose history that you may have been expecting to reference”.
Many of the sort of examples I’m referencing involve spawning subshells needlessly, forking/execing when it’s not actually needed, opening file descriptors that otherwise wouldn’t have been opened. We’re in an interesting bit of the tech timeline here where modern computing power makes a lot of this non-impactful performance wise, but we also do cloud computing where we literally pay for CPU cycles and IOPS.
I guess I’m just a fan of following best practices to the extent practical for your situation, and ensuring that the examples used to inform/teach others show them the proper way of doing things.
No bad things happen when I pour a Hefe into a Pilsner glass either, but now the Germans are coming for me.
Thanks for the explanation, I was wondering if it had to do with CPU cycles.
I guess I’ll continue to use cat for short files to sdout and less for longer files, if there is no actual repercussion. It’s just such a common “don’t do this” topic I was wondering if there was a good reason not to.
I think the beer in the “wrong” glass might be an apt metaphor – it might be fancier to use a specific glass, knowing the history, appreciating the golden color of the beer, (it might also affect the head on the pour? Idk) but there is also nothing wrong with drinking it out of a normal glass.
Edit: I’ve never used view, but I have a distant memory of once using more instead of less.
Why would you do “less -F <file>” when “cat <file>” is easier to type, and reminds you of cats?
So most importantly I’d add
-F
to theLESS
environment variable. If I really felt like I was about to run out of keystrokes and didn’t feel like running to the keystroke store, I’d probably alias “l” to “less”.That aside, you can use a hammer to push a screw into wood. You can use a screwdriver to beat a nail into a board. You can use a board to drive a dowel through a plank. The job gets done either way.
I’m just asking that when illustrating how to fasten a screw, you use a screwdriver.
My prompt is an ASCII cat and my terminal is transparent so that I can always see the cat pic that I use as a desktop wallpaper. Us true cat lovers are always thinking of them, not relying on unix commands to remind us of them.
Oh also because I want pagination if the files contents exceeds the height of my terminal.
I guess I still don’t understand why?
The end result is that the contents of the file ends up in the STDOUT.
For your other examples, if you use a hammer to push a screw into wood, it won’t be secure and it damages the wood. Using a board to drive a dowel through a plank might work in a pinch, but it is easier to use a hammer.
What is the bad thing that happens if you use cat for its side effect rather than to concatenate?
I do not agree with the premise that there needs to be a negative repercussion to doing something before we look at examining the behavior.
I guess I could do some serious gymnastics and reach for something like “when a text file is longer than your terminal scrollback and you cat it, you lose history that you may have been expecting to reference”.
Many of the sort of examples I’m referencing involve spawning subshells needlessly, forking/execing when it’s not actually needed, opening file descriptors that otherwise wouldn’t have been opened. We’re in an interesting bit of the tech timeline here where modern computing power makes a lot of this non-impactful performance wise, but we also do cloud computing where we literally pay for CPU cycles and IOPS.
I guess I’m just a fan of following best practices to the extent practical for your situation, and ensuring that the examples used to inform/teach others show them the proper way of doing things.
No bad things happen when I pour a Hefe into a Pilsner glass either, but now the Germans are coming for me.
Thanks for the explanation, I was wondering if it had to do with CPU cycles.
I guess I’ll continue to use cat for short files to sdout and less for longer files, if there is no actual repercussion. It’s just such a common “don’t do this” topic I was wondering if there was a good reason not to.
I think the beer in the “wrong” glass might be an apt metaphor – it might be fancier to use a specific glass, knowing the history, appreciating the golden color of the beer, (it might also affect the head on the pour? Idk) but there is also nothing wrong with drinking it out of a normal glass.
Edit: I’ve never used
view
, but I have a distant memory of once usingmore
instead ofless
.deleted by creator