-t FD (conditional operator)
true
if FD is a file descriptor, which is opened on a terminal.
Links
Examples
- Different ways to test if a file descriptor is opened on a terminal:
1 2 3 4
test -t 1 && echo "stdout opened on terminal" [ -t 1 ] && echo "stdout opened on terminal" # Bash [[ -t 1 ]] && echo "stdout opened on terminal"
BashSupport Pro is a Bash IDE with support for -t – try it now!