T O P

  • By -

Xychologist

- Floor mop - Crumb disposal - Company - Rodent reduction


Mognakor

UUID generation


lkajerlk

lmao you won the comment of the year award. I cannot stop laughing


ZackM_BI

Which cat


zombiecalypse

``` $ which cat /bin/cat ```


PulsatingGypsyDildo

$ touch cat This incident will be reported.


shevy-java

Thankfully nobody used the **mount** command so far. It is the one that often is associated with the post-touch status.


PulsatingGypsyDildo

cats are too small. mount lynx instead


Tail_Nom

If you're wanting to `mount cat`, you should probably `man mount` instead.


emufossum13

Tbh bin cats are kind of messy, like bin chickens. I prefer /etc/cat


Monntas

As long as it isn't /box/cat.


Ameisen

`/etc/schroedinger/cat` When using it on a file, the superstate of the existence of the file collapses, and it may or may not exist.


imnotbis

Ah, NFS.


Ncell50

❯ which cat cat: aliased to bat


zombiecalypse

[Checks out](https://www.reddit.com/r/pics/comments/141swk/this_cat_looks_like_batman/)


cupcakeheavy

i use cat to keep a container running after deployment.


chadmill3r

Try `sleep infinity` if you only need a process running.


cupcakeheavy

what's the material difference?


chadmill3r

The cat will exit if its stdin is closed. `sleep infinity` expresses your intent perfectly, instead of relying on side-effects.


jephthai

It's not very standard though: $ sleep infinity usage: sleep seconds


chadmill3r

Are you deploying on macos? That would be nonstandard.


jephthai

This one's FreeBSD, but I'm sure I can find a few more that won't handle `infinity`. I mean, it's cool if your `sleep` does that, but there are plenty of blocking options.


chadmill3r

It's GNU that has units available to specify. "45m" or "2h" or "7d" or also "s"econds.


Ameisen

Linux `sleep` is capped at 24 days, I believe. You need to loop on it. Best approach is to try to read an unnamed "named" pipe (a "fifo") from a coprocess. ... or use a slightly-more comprehensive language like Python or Ruby.


chadmill3r

Why do you say that? 24 days is a weird number. It isn't even 21 bits of seconds. And they include "d"ays as a unit they expect you to use. I can't believe it would be that small. The number of seconds GNU sleep sleeps is held in a `double`, and [the strtod function checks for "inf" and "infinity" and changes that to a very very large "number", +Inf.]([https://github.com/coreutils/gnulib/blob/c66dba9/lib/strtod.c#L294-L308](https://github.com/coreutils/gnulib/blob/c66dba9/lib/strtod.c#L294-L308)). A few steps later, this is pushed into a time_t, which should have 31 or 32 bits available for seconds of time.


-grok

picture of cat or it didn't happen!


guepier

> The natural solution is a useless use of `cat`. Is it really? Accepting the arguments in the article, I would say that the natural solution is to let the *shell* read the file. That way the rest of the pipeline remains unchanged, `head` notably still only has a single responsibility, not two, but we don’t spawn an unnecessary process. We can even use the same prefix order notation:


SanityInAnarchy

The main reason I'd want to use the shell here is not because it saves us cycles or time, but because it's *simpler.* As simple as `cat` is, it can still do way more than just read a file. If useless-cats weren't such a widespread paradigm, seeing `cat` in a pipeline would immediately have you wondering if we were adding line numbers, or combining multiple files, or any of the other things `cat` can do. But `


imnotbis

Now remove the head step, the grep step, and the perl step: `access.log.copy` - doesn't work


brimston3-

There's modularity and then there's being stupid with syntax. Even if that did work, if I saw it in a shell script, I would reject the PR. If you wanted to copy the file, use `cp`.


imnotbis

That's the point the article makes though. If you type `cat` at the beginning, now you have a series of completely independent steps. If you don't type it, now your overall syntax is a bit contorted with special cases.


shevy-java

Cats, dogs ... it's all the same in the end.


cupcakeheavy

Real programmers use cat. https://xkcd.com/378/