How will you remove blank lines from a file using sed and grep? ( blank line contains nothing or only white spaces).
I run the below commands of sed and grep but grep isn't giving output as desired. Why?
sed '/^[ \o11]*$/d' blank
grep -v "^[ \o11]*$" blank
(there is a space before tab in character class)
The above sed command gave desired result but not grep. Why?
Also, I am fix at one more place. As, tab is 011 (octal) but in my system the zero of 011 is accepting as o (alphabetic) instead of numeral zero. If I give numeral zero, it won't work. Is it O.K.? A few days back by mistake a system file got deleted becz of which link count is not showing properly. Can this be a reason for the above problem.
I suppose it is because of the way you quote. You should probably single-quote the grep-expression as well as you did with the sed-expression.
You don't need either representation of tabs, as you can enter them directly when you use single-quotes to protect these characters (replace "<spc>" and "<tab>" with literal spaces/tabs when enering the following):