Find + sed did not replaced IPs, any idea why?
Hello, this command:
Code:
find /home/vps/$VMID/etc -type f -print0 | xargs -0 sed -i 's|$OLDIP|$NEWIP|g' am i needed to comment out the dots in ips? \. |
Hard to tell without your script...what does
Quote:
|
Also, for variable substitution use double quotes:
Code:
"s|$OLDIP|$NEWIP|g" |
Thanks, i will try this (double quotes) in next script run..
UPDATE: and it worked.. double quotes and ; at the end.... vmid is number ip is IP |
Glad it works. For anything 'sed' check this tutorial:
http://www.grymoire.com/Unix/Sed.html If you think your problem has been solved, you mark this thread as solved in the thread tools. |
All times are GMT -5. The time now is 03:04 AM. |