Live data from Hacker News

Shell pipes and in-place insanity

fakedrake.github.io

11–16 of 16 posts

Re: Shell pipes and in-place insanity

#11
post #9

Earlier quoted context omitted.

Um... I see almost-black Courier New on off-white, at 13px and a slightly increased line-height. That seems fine to me.

The body text is approximately legible size, but low contrast. 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: https://news.ycombinator.com/item?id=6996064#up_6998399

I see your point about the larger fonts but I have used the sunburn theme for a while in my editor (not anymore thought in favor of slightly customized naquadah[1] ) and I feel quite a bit more comfortable reading code in familiar coloring. I chose this color scheme because sunburn dark is quite popular.

[1] http://rvfblog.wordpress.com/2011/03/07/using-naquadah-theme...

Re: Shell pipes and in-place insanity

#12

Earlier quoted context omitted.

The body text is approximately legible size, but low contrast. 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: https://news.ycombinator.com/item?id=6996064#up_6998399

I see your point about the larger fonts but I have used the sunburn theme for a while in my editor (not anymore thought in favor of slightly customized naquadah[1] ) and I feel quite a bit more comfortable reading code in familiar coloring. I chose this color scheme because sunburn dark is quite popular. [1] http://rvfblog.wordpress.com/2011/03/07/using-naquadah-theme...

I still find it very difficult to read. Even expanding the font size isn't sufficient.

Re: Shell pipes and in-place insanity

#13

Earlier quoted context omitted.

I see your point about the larger fonts but I have used the sunburn theme for a while in my editor (not anymore thought in favor of slightly customized naquadah[1] ) and I feel quite a bit more comfortable reading code in familiar coloring. I chose this color scheme because sunburn dark is quite popular. [1] http://rvfblog.wordpress.com/2011/03/07/using-naquadah-theme...

I still find it very difficult to read. Even expanding the font size isn't sufficient.

That's a pity.

Perhaps your color vision is now at the point where you should consider loading an accessibility stylesheet into your browser. I don't look forward to the day when I am required to do this, but I do know that it will inevitably arrive.

Re: Shell pipes and in-place insanity

#14

Earlier quoted context omitted.

I still find it very difficult to read. Even expanding the font size isn't sufficient.

That's a pity. Perhaps your color vision is now at the point where you should consider loading an accessibility stylesheet into your browser. I don't look forward to the day when I am required to do this, but I do know that it will inevitably arrive.

I use Stylebot to modify sites' CSS.

1188 stylesheets and counting.

Re: Shell pipes and in-place insanity

#15
post #9

Earlier quoted context omitted.

Um... I see almost-black Courier New on off-white, at 13px and a slightly increased line-height. That seems fine to me.

The body text is approximately legible size, but low contrast. 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: https://news.ycombinator.com/item?id=6996064#up_6998399

Huh, this is what I see: https://i.imgur.com/fcNfpM3.png

It seems that some of the stylesheets are broken for HTTPS. Note that this is not https-everywhere breaking the site; simply switch the URL to https://, and you will see what I see.

Re: Shell pipes and in-place insanity

#16
post #3

That 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.

You are right I should have clarify that. thank you

I'm not sure if it's actually a race; it probably depends on how bash is implemented. But this prints what is expected:

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. :)

Post reply on HN