DISPLAY FILE TYPE

SOURCE CODE:
read i
if [ -f $i ]
then
echo “ It is an ordinary file ”
elif [ -d $i ]
then
echo “ It is a directory file ”
else
echo “ It does not exist  ”
fi

OUTPUT:
[examuser35@localhost Jebastin]$ sh type.sh
a
It is a directory file
[examuser35@localhost Jebastin]$ sh big.sh
It is an ordinary file
[examuser35@localhost Jebastin]$ sh i.sh
It does not exist
Previous
Next Post »

If you still didn't find what you're looking for, you can search this website below: