Task

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



Related task

   Check output device is a terminal


#!/bin/sh
 
if [ -t 0 ]
then
   echo "Input is a terminal"
else
   echo "Input is NOT a terminal"
fi