[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

RE: Tool for changing ips in all needed config files...



On 2003-12-04 10:15:13 +0000 Michael Forster <forster@fmi.uni-passau.de> wrote:

Hi,

listbot@gmx.de wrote:
is there a tool to change all occurences of a servers ip-address?

in bash:

for file in /etc/*; do
  perl -pi -e "s/12.34.56.78/23.34.45.56/ $file;"
done
 ^^^ wouldn't be *QUITE* right ;)

the $file should be in a seperate set of "", so perl -pi -e "s/12.34.56.78/23.34.45.56/sg;" "$file"

and the reason to put $file in ", as we all know, is for those odly named files that some how manage to get on the system with odd characters in 'em ;)

Cheers,

Brett.



Reply to: