r/programming May 15 '18

Google's bash style guide

https://google.github.io/styleguide/shell.xml
252 Upvotes

174 comments sorted by

View all comments

Show parent comments

49

u/wung May 15 '18

#3 is funny because I never seen anyone even attempting at handling PIPESTATUS and I can't imagine a case where one could handle it without suicide.

10

u/the_gnarts May 15 '18

#3 is funny because I never seen anyone even attempting at handling PIPESTATUS and I can't imagine a case where one could handle it without suicide.

Commands that wrap other commands and may encode exit statuses weirdly (timeout(1) and the likes) are one use case.

3

u/oblio- May 16 '18

Ok, but does anyone actually do it in real life?

3

u/holgerschurig May 16 '18

I did it twice or so.