$TTY
–
Current TTY
$TTY
contains the name of the associated TTY if there’s one.
Links
Examples
- Print TTY and idle time
- Output:
1 2 3
echo $TTY sleep 5 echo TTY idle time: ${TTYIDLE}s
1 2
/dev/pts/3 TTY idle time: 5s
BashSupport Pro is a Zsh IDE with support for $TTY – try it now!