jww*_*jww 9 windows command-line find cmd.exe
我正在尝试编写一个 Windowscmd.exe
脚本来计算aes
从命令行编译程序后出现的次数。它只是一个审计/质量保证脚本,以确保我们得到我们所期望的。
当我在findstr
没有管道的情况下使用时,它似乎工作正常:
cryptopp-5.6.3>dumpbin /disasm Win32/cryptlib/Debug/rijndael.obj | findstr aes
000000C1: 66 0F 3A DF C0 00 aeskeygenassist xmm0,xmm0,0
00000206: 66 0F 3A DF C0 00 aeskeygenassist xmm0,xmm0,0
00000345: 66 0F 38 DB 04 81 aesimc xmm0,xmmword ptr [ecx+eax*4]
00000366: 66 0F 38 DB 04 81 aesimc xmm0,xmmword ptr [ecx+eax*4]
0000039F: 66 0F 38 DB 04 81 aesimc xmm0,xmmword ptr [ecx+eax*4]
00000078: 66 0F 38 DC C8 aesenc xmm1,xmm0
000000AB: 66 0F 38 DC C8 aesenc xmm1,xmm0
...
Run Code Online (Sandbox Code Playgroud)
一旦我通过管道将结果find /c
用于计算出现次数,事情就会爆炸。不仅没有find
按预期工作,它还设法打破了正在进行的findstr
命令。
cryptopp-5.6.3>dumpbin /disasm Win32/cryptlib/Debug/rijndael.obj | findstr aes | find /c aes
FIND: Parameter format not correct
FINDSTR: Write error
Run Code Online (Sandbox Code Playgroud)
根据find /?
:
If a path is not specified, FIND searches the text typed at the prompt
or piped from another command.
Run Code Online (Sandbox Code Playgroud)
如何将 的输出通过管道findstr
传输到 的输入find
?
小智 18
我能够直接用这个语法做我需要做的事情:
find.exe """Find This""" *.log
Run Code Online (Sandbox Code Playgroud)
使用三重双引号,我认为其中 2 个被 POSH 消耗,留下单引号供 FIND 查看..这对我在 Server 2012 R2 上工作得很好..
归档时间: |
|
查看次数: |
53721 次 |
最近记录: |