Also, 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. [0] https://www.gnu.org/software/bash/manual/bashref.html#Pipelines
[1] https://www.gnu.org/software/bash/manual/bashref.html#ListsThe 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.
echo "1\n2\n3\n4\n" > numbers && cat numbers | { sleep 1 && cat > numbers && cat numbers ; }
That's not exactly the same (because the redirection for cat #2 now happens in a subshell), but it shows that this is basically racy. :)
Monospace fonts, black on white, at default sizes, are your best bets.
Please make these sorts of choices again in the future!
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: