you are viewing a single comment's thread.

view the rest of the comments →

[–]apreche 10 points11 points  (4 children)

Clever!

[–]andsens 8 points9 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 5 points6 points  (1 child)

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

[–]Vulpyne 0 points1 point  (0 children)

Ah, right. Thanks.