Shell pipes and in-place insanity
fakedrake.github.io
Shell pipes and in-place insanity
1–10 of 16 posts
Re: Shell pipes and in-place insanity
#2The vision is a souped-up 64-bit modern C64.
Linux wants to be a mainframe.
Re: Shell pipes and in-place insanity
#3The shell sets up the pipe and file redirections for each process in the pipeline, then lets them go. It has no control over when the child processes read or write. It could be a race condition, but it's written in such a way that it appears that the file will get truncated before it can be read virtually 100% of the time.
Re: Shell pipes and in-place insanity
#4Monospace fonts, black on white, at default sizes, are your best bets.
Re: Shell pipes and in-place insanity
#5Also, see `sponge` from `moreutils` (http://kitenet.net/~joey/code/moreutils/):
$ man sponge
...
sponge reads standard input and writes it out to the specified file.
Un‐like a shell redirect, sponge soaks up all its input before opening the output file.
This allows constructing pipelines that read from and write to the same file.Re: Shell pipes and in-place insanity
#6 [0] https://www.gnu.org/software/bash/manual/bashref.html#Pipelines
[1] https://www.gnu.org/software/bash/manual/bashref.html#ListsRe: Shell pipes and in-place insanity
#7That was a contrived example. The shell sets up the pipe and file redirections for each process in the pipeline, then lets them go. It has no control over when the child processes read or write. It could be a race condition, but it's written in such a way that it appears that the file will get truncated before it can be read virtually 100% of the time.
Re: Shell pipes and in-place insanity
#8NB: If you're going to use CSS styling for code examples, choose foreground and background colors, as well as text sizes, which are actually legible. Monospace fonts, black on white, at default sizes, are your best bets.
Please make these sorts of choices again in the future!
Re: Shell pipes and in-place insanity
#9NB: If you're going to use CSS styling for code examples, choose foreground and background colors, as well as text sizes, which are actually legible. Monospace fonts, black on white, at default sizes, are your best bets.
Re: Shell pipes and in-place insanity
#10NB: If you're going to use CSS styling for code examples, choose foreground and background colors, as well as text sizes, which are actually legible. Monospace fonts, black on white, at default sizes, are your best bets.
Um... I see almost-black Courier New on off-white, at 13px and a slightly increased line-height. That seems fine to me.
The code examples are all but unreadable.
http://i.imgur.com/ogS9yat.png
Here's a quick improvement for legibility. I'm not claiming a thing of beauty.
http://i.imgur.com/mW880fB.png
My general style guidelines are included here: