Free Web Hosting | Web Hosting | Free Web Space | Web Hosting

Home

# This script is used to display the message to the specified client for

# thier birthday, or wedding day.

# It is checked in Unix Sparc version in DRS6000 mini.

#*************************************************************

# Author G. Pradeep

#*************************************************************

cls

while true; do

cls

echo "#****************************************************************

#

#******* A birthday/Wedding anniversary Greetint to the user

#

#*****************************************************************

#

# Author G. Pradeep. pradeep@ipath.net.in

#

#*****************************************************************

a=`date '+ %b %d'`

b=`egrep "$a" tt`

c=`echo $b | tr -s " "" "| cut -f4 -d " "`

n=`echo $b | tr -s " "" "| cut -f3 -d " "`

echo "$c"

if [ `expr $c==W` ]

then

echo "Happy Wedding Anniversary MR " $n

else

echo "Happy Birthday MR " $n

fi

#****************************************************************

#

#******* A birthday/Wedding anniversary Greetint to the user

#

#*****************************************************************

#

# Author G. Pradeep. pradeep@ipath.net.in

#

#*****************************************************************

a=`date '+ %b %d'`

b=`egrep "$a" tt`

c=`echo $b | tr -s " "" "| cut -f4 -d " "`

n=`echo $b | tr -s " "" "| cut -f3 -d " "`

echo "$c"

if [ `expr $c==W` ]

then

echo "Happy Wedding Anniversary MR " $n

else

echo "Happy Birthday MR " $n

fi

#****************************************************************

#

#******* A birthday/Wedding anniversary Greetint to the user

#

#*****************************************************************

#

# Author G. Pradeep. pradeep@ipath.net.in

#

#*****************************************************************

a=`date '+ %b %d'`

b=`egrep "$a" tt`

c=`echo $b | tr -s " "" "| cut -f4 -d " "`

n=`echo $b | tr -s " "" "| cut -f3 -d " "`

echo "$c"

if [ `expr $c==W` ]

then

echo "Happy Wedding Anniversary MR " $n

else

echo "Happy Birthday MR " $n

fi

_[4H_[10C_[1m 1. Add _[0m "

echo "_[6H_[10C_[1m 2. Edit _[0m "

echo "_[8H_[10C_[1m 3. View _[0m "

echo "_[10H_[10C_[1m 4. Exit _[0m "

echo "_[12H_[10C_[5m Enter Your Choice _[0m : _[7m _[0m"

echo "_[12H_[32C_[7m\c"

read choice

echo "_[0m"

cls

case $choice in

1)

while true ; do

echo "_[4H_[10C Name in full : _[7m _[0m "

echo "_[6H_[10C Date Of Birth : _[7m _[0m"

echo "_[8H_[10C Sex [M/F] : _[7m _[0m"

echo "_[10H_[10C Marital Status [B/M] : _[7m _[0m"

echo "_[12H_[10C Wedding Date : _[7m _[0m"

echo "_[14H_[10C Save / Save&Quit / Cancel / Quit [S/W/C/Q] : _[7m _[0m"

echo "_[4H_[35C_[7m\c"

read name

echo "_[6H_[35C_[7m\c"

read dob

echo "_[8H_[35C_[7m\c"

read sex

echo "_[10H_[35C_[7m\c"

read mstat

#if [ -z $mstat ]; then

if [ $mstat = 'M' ]; then

echo "_[12H_[35C_[7m\c"

read mdate

else

mdate='nill'

fi

#fi

echo "_[14H_[55C_[7m\c"

read sub_choice

echo "_[0m"

#if [ -z $sub_choice ]; then

if [ $sub_choice = 'S' -o $sub_choice = 's' ]; then

echo $name

chkname=`egrep -c '$name' master_data`

echo $chkname

read me

if [ -z $chkname ]

then

echo "Sorry this name already exists"

read me

fi

echo $name'|'$dob'|'$sex'|'$mstat'|'$mdate >> master_data

else

if [ $sub_choice = 'Q' -o $sub_choice = 'q' ]; then

break

fi

if [ $sub_choice = 'W' -o $sub_choice = 'w' ]; then

echo $name'|'$dob'|'$sex'|'$mstat'|'$mdate >> master_data

break

fi

fi

#fi

done

;;

3)

cls

lines=`cat master_data|wc -l`

echo "_[4H_[10C_[1m Name Date Of Birth Sex Marital Status Marriage Date _[0m "

counter=2

while [ $counter -le $lines ]

do

name=`cat master_data|head -$counter | tail -1 | cut -d '|' -f1`

dob=`cat master_data|head -$counter | tail -1 | cut -d '|' -f2`

sex=`cat master_data|head -$counter | tail -1 | cut -d '|' -f3`

mstat=`cat master_data|head -$counter | tail -1 | cut -d '|' -f4`

if [ $sex = 'M' -o $sex = 'm' ]

then

sex='Male'

else

sex='Female'

fi

if [ $mstat = 'B' -o $mstat = 'b' ]

then

mstat='Bachelor'

else

mstat='Married'

dom=`cat master_data|head -$counter | tail -1 | cut -d '|' -f5`

fi

echo "_[$counterH_[3C$name _[$counterH_[3C$dob_[$counterH_[3C$sex_[$counterH_[3C$mstat_[$counterH_[4C$dom"

dom=

counter=`expr $counter + 1`

done

read chr

;;

4)

exit

;;

*)

exec de

esac

done

 

Home