Unix mail marks

cat >marks.txt

mailid marks

cse3e41 51

cse3e32 43

cse3e35 48

EXIT

cat > mailmarks.sh

i=2

line=`head  -$i  marks.txt|tail -1`

until(echo $line|grep -q “EXIT”)

do

mailid=`echo $line|cut -d ” ” -f  1`

marks=`echo $line|cut  -d ” ” -f  2`

echo “Marks obtained :: $marks”>.temp

mail $mailid  -s “marks”  <.temp

i=`expr  $i + 1`

line=`head  -$i  marks.txt|tail -1`

done

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s