test for ! -t 1 instead of -t 1