Skip to main content
added 2 characters in body
Source Link

A hassle-free solution consists of using the command tty -s.
This command returnreturns either 0 or 1.

if tty -s; then
    echo "I am on a TTY"
else
    echo "I am NOT on a TTY"
fi

p.s.: I do not have access to other UNIX man pages. I can guarantee that it works on LinuLinux.

A hassle-free solution consists of using the command tty -s.
This command return either 0 or 1.

if tty -s; then
    echo "I am on a TTY"
else
    echo "I am NOT on a TTY"
fi

p.s.: I do not have access to other UNIX man pages. I can guarantee that it works on Linu.

A hassle-free solution consists of using the command tty -s.
This command returns either 0 or 1.

if tty -s; then
    echo "I am on a TTY"
else
    echo "I am NOT on a TTY"
fi

p.s.: I do not have access to other UNIX man pages. I can guarantee that it works on Linux.

added 91 characters in body
Source Link

A hassle-free solution consists of using the command tty -s.
This command return either 0 or 1.

if tty -s; then
    echo "I am on a TTY"
else
    echo "I am NOT on a TTY"
fi

p.s.: I do not have access to other UNIX man pages. I can guarantee that it works on Linu.

A hassle-free solution consists of using the command tty -s.
This command return either 0 or 1.

if tty -s; then
    echo "I am on a TTY"
else
    echo "I am NOT on a TTY"
fi

A hassle-free solution consists of using the command tty -s.
This command return either 0 or 1.

if tty -s; then
    echo "I am on a TTY"
else
    echo "I am NOT on a TTY"
fi

p.s.: I do not have access to other UNIX man pages. I can guarantee that it works on Linu.

Source Link

A hassle-free solution consists of using the command tty -s.
This command return either 0 or 1.

if tty -s; then
    echo "I am on a TTY"
else
    echo "I am NOT on a TTY"
fi