#change to the program directory dir=${0%/*} if [ "$dir" = "$0" ]; then dir="." fi cd "$dir" #get the network name name=`uname -n` #replace @brokername@ in template with this name sed s/@brokername@/$name/g ../conf/clustered-template.xml > ../conf/clustered.xml #start activemq with updated file ./activemq xbean:file:../conf/clustered.xml