I'd like to change the IP address in this string with some user input:
rmi.sceduling.service.url=rmi\://192.168.0.19\:1199/ScedulingService
The code should also work if there is no address:
rmi.sceduling.service.url=
It should also be portable, at least to Solaris.
The code I am using at the moment:
value=`grep 'rmi' application.properties \
| awk -F":" '{print $2}' \
| awk -F"\'" '{print $1}'
| cut -d '/' -f 3-5 `
sed -e "s/$value/$host_ip/g" application.properties > file.tmp \
&& mv file.tmp application.properties