Find that whether the file is exixt or not
echo "Enter the file name"
read f
if [ !e $f]
then
echo "Sorry $f file does not exist"
else
echo "File exist"
fi
Program to calculate the factorial of any number
echo "Enter a number"
read a
f=1
i=1
while [ $i -le $a ]
do
f=` expr $f \* $i`
i=` expr $i +1`
done
echo "Factorialof $n is" $f
Program to create the login page
clear
c=1
while [ $c -lt 4 ]
do
echo "enter user name:"
read uname
echo "enter password:"
stty -echo
read pass
stty echo
if [ $uname = "admin" -o $uname = "ADMIN" ]
then
if [ $pass = "root" -o $pass = "ROOT" ]
then
sh smenu.sh
exit
else
echo "INCORRECT PASSWORD"
c=`expr $c + 1`
fi
else
echo "INCORRECT USER NAME"
c=`expr $c + 1`
fi
done