开发者

Why do I keep getting the error "The syntax of the command is incorrect"

Can someone explain to me why this command reports "The syntax of the command is incorrect."? The first part runs fine by itself, so I know it's not that. And the second part looks to be correct according to help find

C:\Program Files\Apache开发者_开发知识库 Software Foundation\Apache2.2\logs>type error.log ^| find /C "2010"

I was wondering if it might have to do with line endings in the file, but even something as simple as this gives me the same error:

C:\Program Files\Apache Software Foundation\Apache2.2\logs>echo "Test1" > test.log

C:\Program Files\Apache Software Foundation\Apache2.2\logs>echo "Test2" >> test.log

C:\Program Files\Apache Software Foundation\Apache2.2\logs>echo "Test3" >> test.log

C:\Program Files\Apache Software Foundation\Apache2.2\logs>type test.log
"Test1"
"Test2"
"Test3"

C:\Program Files\Apache Software Foundation\Apache2.2\logs>type test.log ^| find /C "test"
The syntax of the command is incorrect.

C:\Program Files\Apache Software Foundation\Apache2.2\logs>type test.log ^| find /C "Test"
The syntax of the command is incorrect.


You need to supply the filename to the find command:

find /C "test" test.log

or

type test.log | find /C "test"

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜