Task

Demonstrate how to check whether the output device is a terminal or not.



Related task

   Check input device is a terminal


#!/bin/sh
 
if [ -t 1 ]
then
   echo "Output is a terminal"
else
   echo "Output is NOT a terminal" >/dev/tty
fi