Using sed in bash to remove whitespace
Hi, I'm new to sed and need to be able to use it in a bash script to remove whitespace from some html code. I've got a variable called regionWholeLine in my script:
(because the forum automatically deletes them I have to represent whitepace with ....)
.................................................<strong>Asia-Pacific</strong><br />
so I used the following code:
regionWholeLine="`echo "$regionWholeLine" | sed -e :a -e 's/^[ .............. ]*<strong/<strong /'`"
However, it doesn't seem to work and I've no idea why, because elsewhere in my script I use similar code to do exactly the same thing:
titleWholeLine="`echo "$titleWholeLine" | sed -e :a -e 's/^[ ......... ]*<td class/<td class/'`"
works on:
.......................................................<td class="title">
Any ideas why I'm having problems?
Thanks,
~James~
|