r/commandline • • Nov 11 '20

cat

Post image
1.0k Upvotes

28 comments sorted by

8

u/zoonose99 Nov 11 '20

so weird that you would change the subtitles on a macro image, that's going to bother me all day

6

u/fcktheworld587 Nov 11 '20

People are downdooting you, have an updoot. Sorry to fuck with your OCD, man. Formatting shit can be annoying. I know when I take notes, half my time is spent formatting them in such a way that it doesn't drive me nuts.

3

u/zoonose99 Nov 11 '20

I'm glad you see I wasn't being critical of your post, just venting

48

u/thisbenzenering Nov 11 '20

that | key is fantastic!

8

u/[deleted] Nov 11 '20 edited Feb 22 '24

I like to go hiking.

5

u/thisbenzenering Nov 11 '20

do you have an example? I don't think I have played with soundcard commands before

13

u/[deleted] Nov 11 '20 edited Feb 22 '24

I love listening to music.

5

u/thisbenzenering Nov 11 '20

that is some crazy stuff!

Thanks!

1

u/ychaouche Nov 12 '20

pacat file. Source : link above

21

u/GuybrushThreepwo0d Nov 11 '20

Cool. Now, how do I read a shell script? Because all those weird pipes into sed and awk with strange regexes become really hard to comprehend really quickly.

23

u/mikek3 Nov 11 '20

Not meant to understood. It's there only for you to curse the guy who wrote it and force you to write a new one. Also without comments.

9

u/GuybrushThreepwo0d Nov 11 '20

As is tradition

9

u/Griffun Nov 11 '20
#comments

9

u/GuybrushThreepwo0d Nov 11 '20

Ok. Let me rephrase. How do I read someone else's scripts? :/

7

u/Griffun Nov 11 '20

10+ years in and I'm still working on that. Short of huffing spray-paint in the network closet, I'm not sure that I have any advice to give there. Also, don't huff spray-paint in the network closet. Do that shit outside. Think of the equipment!

1

u/[deleted] Nov 13 '20

Spraypaint? Why when there alre already cleaners you can huff?

Or you couldj ust go with the ballmer method and crack open the jack danials.

2

u/deux3xmachina Nov 11 '20 edited Nov 11 '20

If you don't understand how certain commands work, check their manual pages by running, for example, man sed. If you need help learning things like regex, check out https://regex101.com.

Additionally, you can always run scripts like sh -vx /path/to/script to get more information regarding what variables resolve to and why certain paths are taken (assuming it uses control flow statements like if and case).

Also also, don't be afraid to take some snippets and try running them in your shell. There's no substitute for learning by doing, tutorials and docs are great to demystify what's happening, but nothing solidifies that knowledge by doing it yourself.

2

u/kn0xchad Nov 12 '20

The detailed documentation for sed can be invoked using info sed. I personally just pipe it to less.

P.S. info sucks.

1

u/[deleted] Nov 11 '20

You can't. I can barely comprehend my own. As I'm writing it!

1

u/fecal-butter Feb 20 '23

Ask chatgpt

2

u/[deleted] Nov 11 '20

trick question: pray you wrote it yourself or pray there’s a comment somewhere

0

u/[deleted] Nov 11 '20

[deleted]

9

u/fcktheworld587 Nov 11 '20 edited Nov 11 '20

I feel like redirecting cat is reasonable content for an intro to Linux course. Always remember that roughly 10% of the general population is of a low enough IQ that it's illegal to induct them into the army.

6

u/nomenMei Nov 11 '20

Yeah but redirecting cat to a file called "cat" is going to confuse the shit out of anyone that doesn't know how cat or redirection works

4

u/fcktheworld587 Nov 11 '20

True. Perhaps I fall under the category of the 10% I mentioned...

1

u/Marta_McLanta May 04 '21

i'm a noob. what does this do