if-then এর ব্যবহার – শেল প্রোগ্রামিং-এ

#!/bin/sh

#count the number of files in current directory, and check if the number is equal to or greater than or less than 26

#NOF represents number of files

NOF=`ls -l | wc -l`

if [ $NOF -eq 26 ]
then
echo “No of files and directories is equal to 26”
fi

if [ $NOF -gt 26 ]
then
echo “No of files is greater than 26”
fi

if [ $NOF -lt 26 ]
then
echo “No of files is less than 26”
fi

exit