
CODE: [Copy to clipboard]这样一串命令,如果把重定向输出 >>abcd.txt 加到行首,则它会和到第一个abc.txt的后面去,成了第一条命令的输出。 而放到整行的末尾又会出问题,会被当成最后一条命令的输入文件产生错误。find /n ".*" abc.txt|sed 's/aa/bb'|gawk '{print aa++ "\t" $0}'
CODE: [Copy to clipboard](find /n ".*" abc.txt|sed 's/aa/bb'|gawk '{print aa++ "\t" $0}')>>abcd.txt
| Quote: | |
|
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>
| 欢迎光临 中国DOS联盟论坛 (http://cndos.fam.cx/forum/) | Powered by Discuz! 2.5 |