bash - sed vs line with spaces -


have such file execute

exec java -dcom.sun.management.jmxremote=true \           -dcom.sun.management.jmxremote.port=12345 \           -djava.rmi.server.hostname=127.0.0.1 \           -dcom.sun.management.jmxremote.authenticate=false \           -jar somefile.jar 

the question how change ip using of sed?

for in-place change

sed -i 's/127\.0\.0\.1'/new_ip/' file 

for copy, can use

sed -i 's/127\.0\.0\.1'/new_ip/' file > new_file 

Comments

Popular posts from this blog

python - Selenium remoteWebDriver (& SauceLabs) Firefox moseMoveTo action exception -

html - How to custom Bootstrap grid height? -

Ansible warning on jinja2 braces on when -