联盟域名:www.cn-dos.net 论坛域名:www.cn-dos.net/forum DOS,代表着自由开放与发展,我们努力起来,学习FreeDOS和Linux的自由开放与GNU精神,共同创造和发展美好的自由与GNU GPL世界吧!
find /n ".*" abc.txt|sed 's/aa/bb'|gawk '{print aa++ "\t" $0}'
(find /n ".*" abc.txt|sed 's/aa/bb'|gawk '{print aa++ "\t" $0}')>>abcd.txt
Originally posted by lxmxn at 2008-8-30 11:14 AM: 语法有错吧,CMD 里面用 gawk 需要用双引号。 何况你这些命令的组合无非是处理字符串,用 gawk 就足够了。
D:\lxmxn\work\Other\tests>type test.txt welcome to "DOS union" D:\lxmxn\work\Other\tests>sed "s/\"/#/g" "test.txt welcome to #DOS union# D:\lxmxn\work\Other\tests>sed "s/\x22/#/g" test.txt welcome to #DOS union# D:\lxmxn\work\Other\tests>sed --version GNU sed version 4.0.7 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. D:\lxmxn\work\Other\tests>