I have an xml file which I'm trying to minimise using a bash script.
After removing any indentation, some part of the file looks like this:
<layer name       ="dotted_line"
align      ="topleft"
edge       ="topleft"
handcursor ="false"
keep       ="true"
url        ="%SWFPATH%/include/info_btn/dotted_line.png"
zorder     ="15"
/>
I'd like to remove any empty spaces before and after the equal sign, so it'd look like:
<layer name="dotted_line"
align="topleft"
edge="topleft"
handcursor="false"
keep="true"
url="%SWFPATH%/include/info_btn/dotted_line.png"
zorder="15"
/>
Any ideas how can achieve this?
Thanks
sed -i s/\ *=\ */=/g filename
Regards
This should work
sed 's/\s*=\s*/=/g' inputFile
                        If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With