
if [ "$1" = "" ]; then
	echo "Usage: ./addPassword <UserName> <prevPassword> <newPassword> <passwd file>"
	exit
fi



param=`grep "\"\<$1\>" $4`



if [ "$param" = "" ]; then
	echo "ERROR"
	exit 1
else
	echo "Param already present";
	echo "Replacing.."
	echo "/\"$1\"/ s/\"$2\"/\"$3\"/" > /tmp/cmd_p
	sed -i -f /tmp/cmd_p $4
        rm -f /tmp/cmd_p 
fi
