Program :- To print all prime numbers between m & n.

echo Enter the limits
read ll ul
echo prime numbers in between $ll and $ul
while [ $ll -lt $ul ]
do
n=`expr $ll – 1`
m=2
flag=1
while [ $m -le $n ]
do
k=`expr $ll % $m`
if [ $k -eq 0 ]
then
flag=0
break
fi
m=`expr $m + 1`
done
if [ $flag -eq 1 ]
then
echo $ll
fi
ll=`expr $ll + 1`
done
Output:

Enter the limits
۵ ۲۱

Prime numbers in between 5 and 21
۵
۷
۱۱
۱۳
۱۷
۱۹