Sed - An Introduction and Tutorial by Bruce Barnett
发布时间:2021-01-25 14:11:33 所属栏目:Linux 来源:网络整理
导读:http://www.grymoire.com/unix/sed.html Quick Links - NEW table border="1" tr Sed Pattern Flags /tr tr td a href="http://www.grymoire.com/unix/Sed.html#uh-6"gt;/g?- Global/td /tr tr td a href="http://www.grymoire.com/unix/Sed.html#uh-10a"gt;
Removing comments and blank lines takes two commands. The first removes every character from the "#" to the end of the line,and the second deletes all blank lines: sed -e 's/#.*//' -e '/^$/ d' A third one should be added to remove all blanks and tabs immediately before the end of line: sed -e 's/#.*//' -e 's/[ ^I]*$//' -e '/^$/ d' (编辑:晋中站长网) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |