-t FD (conditional operator)

true if FD is a file descriptor, which is opened on a terminal.

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 ist eine Bash IDE mit Unterstützung für -tprobieren Sie es aus!
© 2020–2024 Joachim Ansorg
Impressum
Datenschutz
Rechtliches