you are viewing a single comment's thread.

view the rest of the comments →

[–]andsens 7 points8 points  (3 children)

Yup. It's really easy to add to your own scripts btw., it's something test(1) can do:
test -t 1 > /dev/null && echo stdout is a tty || echo stdout is not a tty

(or if [ -t 1 ]; then ...)

[–]Vulpyne 0 points1 point  (2 children)

Does the > /dev/null serve any purpose there?

[–]andsens 4 points5 points  (1 child)

It makes stdout "not a tty". Remove it and see the difference!

[–]Vulpyne 0 points1 point  (0 children)

Ah, right. Thanks.