This should be simple. I am looking to replace dns names in multiple files the search criteria are (a-z A-Z 0-9 . -) those should be all the legal charters.
SERVERNAME="someserver"
SEARCHSTRING="[a-zA-Z0-9\.\-]*"
sed -i "s|dbserver=$SEARCHSTRING|dbserver=$SERVERNAME|gI"
sed -i "s|EPG_FTP_HOST=$SEARCHSTRING|EPG_FTP_HOST=$SERVERNAME|gI"
sed -i "s|jdbc:oracle:thin:@$SEARCHSTRING:1521:oracle|jdbc:oracle:thin:@$SERVERNAME:1521:oracle|gI"
The issue that I am having is that when I comes to periods and hyphens the search string ends.
I should be replace any of the following names with a new name
system-1.someaddress.com
system-1
system
etc...
thanks in advance