Help with shell script

Hi guys, I am trying to write a shell script that will grab the computers serial number and put it into one of the 4 text fields of the apple remote desktop sharing window. I want it to be a logon script so I don’t have to run around to all 100 + macs and do this manually. I modified a script I found on the web. It’ll get the serial and send it to an ftp site. The file I want to modify is in the Library folder at the root of the hard drive. The file is called com.apple.remotedesktop.plist there are 4 fields in there called text1, text2, text3, text4 each one has a value, the value field would be where the serial number goes. So for example the script would grab the serial and put it in the value field for text1. I’ll post the script I modified and perhaps someone could assist me in doing what i want to do based on the existing script. Thanks in advance.

#! /bin/sh
echo “Changing to home directory…”
cd ~
echo “Setting hostname variable…”
echo “Creating text file…”
touch MacName.txt
echo “Writing hostname to file…”
echo MacName > ~/MacName.txt
echo “Writing return carriage to file…”
echo “” >> ~/MacName.txt
echo “Writing grepped Serial Number and Machine Name to file…”
system_profiler SPSoftwareDataType | grep “Computer Name” >> ~/MacName.txt
system_profiler SPHardwareDataType | grep “Serial Number” >> ~/MacName.txt
echo “FTPing the file…”
curl -T ~/MacName.txt -u username:password ftp://ftp.yourftpsite.com
#echo “Removing original text file…”
#rm ~/$MAC_NAME.txt
echo “Complete!”