macAddress=$(/sbin/ifconfig eth0 2>nil | grep 'HWaddr' | sed 's/.*HWaddr //' | sed 's/ :*//' | sed 's/:/-/g' | tr A-Z a-z | sed 's/\s//g')
sed -i "s/.../$macAddress" filename
sed -i 's/something/others/' filename means replace somthing to others in filename,replacement will work once,if you add 'g' ,it will replace all matched words in file.
tr A-Z a-z translate capital letter to lowercase
sed 's/\s//g' \s means space, g means globle
' and " are different , ' ' means simple string,do not transfer anything,"" means maybe variable in string,will trransfer first.