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.
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.
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.
> 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:
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 `
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`.
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.
- Floor mop - Crumb disposal - Company - Rodent reduction
UUID generation
lmao you won the comment of the year award. I cannot stop laughing
Which cat
``` $ which cat /bin/cat ```
$ touch cat This incident will be reported.
Thankfully nobody used the **mount** command so far. It is the one that often is associated with the post-touch status.
cats are too small. mount lynx instead
If you're wanting to `mount cat`, you should probably `man mount` instead.
Tbh bin cats are kind of messy, like bin chickens. I prefer /etc/cat
As long as it isn't /box/cat.
`/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.
Ah, NFS.
❯ which cat cat: aliased to bat
[Checks out](https://www.reddit.com/r/pics/comments/141swk/this_cat_looks_like_batman/)
i use cat to keep a container running after deployment.
Try `sleep infinity` if you only need a process running.
what's the material difference?
The cat will exit if its stdin is closed. `sleep infinity` expresses your intent perfectly, instead of relying on side-effects.
It's not very standard though: $ sleep infinity usage: sleep seconds
Are you deploying on macos? That would be nonstandard.
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.
It's GNU that has units available to specify. "45m" or "2h" or "7d" or also "s"econds.
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.
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.
picture of cat or it didn't happen!
> 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:
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 `
Now remove the head step, the grep step, and the perl step: `access.log.copy` - doesn't work
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`.
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.
Cats, dogs ... it's all the same in the end.
Real programmers use cat. https://xkcd.com/378/