
Microsoft Windows XP [Version 5.1.2600]
(C) Copyright 1985-2001 Microsoft Corp.
C:\Test>type a.txt
aaa
bbb
ccc
C:\Test>sed "/^$/{:a;N;s/^\n$/;\n\n/;ta}" a.txt
aaa
;
bbb
;
ccc
C:\Test>sed --version
GNU sed version 4.1.4 (DJGPP port 2005-04-01 (r2))
Copyright (C) 2003 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE,
to the extent permitted by law.
| 欢迎光临 中国DOS联盟论坛 (http://cndos.fam.cx/forum/) | Powered by Discuz! 2.5 |