Why cant i delete blank lines?

I have a sed pipeline:

myVar=$(cat $FILE | sed -n '/regex/,/regex/{/regex/d;p}' | sed -n '/regex/!p' | sed -e s/[^:]*:// | sed /regex/,+8d \
 )

sed '/^$/d'
sed '/./!d'

And i've tried to add that in a different order rather then just on the end..Why isnt it deleting all the blank lines? Btw, my file really didnt have very much blank lines to begin with..

sed '/^ *$/d'

With or w/o spaces it really just doesnt want to.

You should not pipe one sed into the next. Put all your sed statements together into one script.

Your blank lines might consist of non-printing characters, maybe spaces and/or tabs.

To find out you could display the file using "od -ax" and have a look at the hex codes of your characters.

If it is only tabs and blanks (aka "whitespace") then use the following expression (replace "<b>" with a blank and "<tab>" with a literal tab char):

sed '/^[<b><tab>]*$/d'

I hope this helps.

bakunin