On 12 Jan 2022, acn said the following...
Am 11.01.22 schrieb MeaTLoTioN@1337:1/101 in TQW_LINUX:
Hallo Meatlotion,
Hej Anna =)
While you are totally right that the latter is much shorter and might also be quicker, you have to _know_ and _remember_ that grep is able
to count on its own.
Yes, you are correct, you do have to _know_ and _remember_ that grep can do this, there are others too that can count... I was only using grep as an example as it's probably the most common useless use of cat that I can think of, and it happened to be that exact thing on a video I was watching.
I have also been thinking that when on the CLI doing something interactively, it might be that you "cat somefile", then just up arrow into the last command and add a " | grep something" and build a command. I guess that's ok, but when scripting it's just bad form in my opinion to do something like that, although I'm pretty sure I have done that in scripts myself without thinking.
Another gripe I have, more aesthetics of a command over function, is adding spaces either side of the pipe, I would rather;
somecommand arg1 arg2|grep something|awk '{print $1}'
vs
somecommand arg1 arg2 | grep something | awk '{ print $1 }'
You may laugh, I guess I am too reading this back, but when I "CLI" having spaces with pipes just makes me feel so wrong lol.
I know someone who won't even have blank lines in scripts, I feel that's taking
it a little too far, but at the same time I get it.
Also, I'm a double-space guy and not a tab guy :P
Oh well, welcome to the inner workings of my head hahaha
---
|14Best regards,
|11Ch|03rist|11ia|15n |11a|03ka |11Me|03aTLoT|11io|15N
|07ÄÄ |08[|10eml|08] |
15ml@erb.pw |07ÄÄ |08[|10web|08] |15www.erb.pw |07ÄÄÄ¿ |07ÄÄ |08[|09fsx|08] |1521:1/158 |07ÄÄ |08[|11tqw|08] |151337:1/101 |07ÂÄÄÙ |07ÄÄ |08[|12rtn|08] |1580:774/81 |07ÄÂ |08[|14fdn|08] |152:250/5 |07ÄÄÄÙ
|07ÄÄ |08[|10ark|08] |1510:104/2 |07ÄÙ
... Honk if you love peace and quiet!
--- Mystic BBS v1.12 A47 2021/12/13 (Linux/64)
* Origin: thE qUAntUm wOrmhOlE, rAmsgAtE, uK. bbs.erb.pw (1337:1/101)