Quantcast
Channel: UNIX and Linux Forums
Viewing all articles
Browse latest Browse all 16232

sed one Liner option -e

$
0
0
Hi,

I have the following command.(Delete all trailing blank lines at the end of a file.)

Code:

sed -e :a -e '/^\n*$/{$d;N;ba' -e '}'
I don't understand the logic of this command and also I don't understand why -e is used.
Can you please let me know the logic of this command and why three -e are used


Famous Sed One-Liners Explained, Part III: Selective Deletion of Certain Lines and Special Applications - good coders code, great reuse
here you can find the basic explanation for this command which i am not able to understand (82nd question)

Thank You

Viewing all articles
Browse latest Browse all 16232

Trending Articles