How to find whether the given absolute path is a file or directory?

# This Shell script identifies whether the below absolute path is a file or directory

filePath=/tmp/Shell_Script/sample_scripts/script.sh

if [ -f ${filePath} ]
then
        echo $filePath is a File
elif [ -d ${filePath} ]
then
        echo $filePath is a Directory
fi

Search