0

After quite a bit of Google searching I can't seem to find the answer. What does the -t do in the context of this code?

if [ ! -t 1 ]
then
    SCRIPTLOG=$LOG_DIR/$SCRIPT.log
    exec >>$SCRIPTLOG 2>&1
    chmod 644 $SCRIPTLOG
fi
Pablo
  • 13,271
  • 4
  • 39
  • 59
Josh
  • 341
  • 5
  • 26
  • This didn't answer my question directly at all, but it did give me information I needed to search and provide my own answer. – Josh Sep 24 '19 at 18:32
  • 1
    Do a `help test` in the bash console – Pablo Sep 24 '19 at 18:32
  • See also [Unix & Linux](https://unix.stackexchange.com/questions/389495/what-does-t-1-check) – Benjamin W. Sep 24 '19 at 18:43
  • `[` is shorthand for the command `test`. So you can do `man test` to see the `test` command's manual where all of these flags are listed. – JNevill Sep 24 '19 at 18:53

0 Answers0