Shell Scripts
Shell Scripts
r=`expr $num % 2`
if test $r = 0
then
echo "The Number is EVEN...!!"
else
echo "The Number is ODD...!!"
fi
i=1
f=1
while [ $i -le $n ]
do
f=`expr $f \* $i`
i=`expr $i + 1`
done
echo "-------------------------------"
echo ".... Factorial of $n = $f ...."
echo "-------------------------------"
# (03) Compare Two Files and Sort out into Unique Data
echo "Enter First File Name ? "
read f1
echo "Enter Second File Name ? "
read f2
sort $f1 $f2 | uniq -d
while [ $n -gt 0 ]
do
rem=`expr $n '%' 10`
rev=`expr $rev '*' 10 + $rem`
n=`expr $n '/' 10`
done
echo "The Reverse of $a is.. $rev"
if test $rev = $a
then
echo "Yes..!! $a is a Palindrome... :)"
else
echo "No..!! $a is NOT a Palindrome... :("
fi
echo ""