Using sed to replace properties

I found myself wanting to replace some values in a property file using a bash shell script. The easiest way of doing that is by utilizing sed. I ended up doing the following to replace a value in the properties file (well actually it was the AIA installation response file, but the idea is exactly the same).

sed -ie s/^PROPERTYNAME=.*/PROPERTYNAME=VALUE/ PROPERTY_FILE

Below is an example:

sed -ie s/^hostname=.*/hostname=techblog.moerks.dk/ server.properties

Constructing replacements this way is a nice way of replacing property values as it is not dependent or special tags or anything like that.