#!/bin/sh
#    refIndex: pickup a line from file and add the line to other file
#	$1 line number
#	$2 file
#	$3 new msg_number (   xxxx)
#	$4 file to add line
#	$5 delete src line if 'del'
/bin/sed -n "$1p" $2 | /bin/sed "s/   ..../$3/" >> $4

case "$5" in
    'del')
	/bin/sed "$1d" $2 > /tmp/pmtmp
	/bin/cp /tmp/pmtmp $2
	/bin/rm -f /tmp/pmtmp;;
esac
