tre agrep通过gnuwin32 - newb得不到tre agrep的输出

时间:2014-10-03 00:17:36

标签: windows gnuwin32 agrep

不可否认,之前我没有在* nix上使用agrep,所以这可能只是我的一个新错误,而不是旋转一个* nix框并在那里玩,我想我可能会先问这里的聪明人。

我在我的Windows机器上通过gnuwin32安装了tre agrep - 二进制文件似乎正在工作 - 我得到一些帮助输出和错误输出,但我似乎无法获得任何有意义的匹配输出。

我的测试文件:testing.txt

testing customer
random client name
super
super pty ltd
testing trust
testing

我获得任何类型输出的唯一时间是使用此行:

agrep.exe "^" .\testing.txt

输出:

ÿþt

"测试"的其他简单测试没有给我输出:

agrep.exe "testing" .\testing.txt

有人可以告诉我我做错了什么,或者更具体地说是如何做对的? :)

谢谢!

1 个答案:

答案 0 :(得分:0)

您有一个无法处理agrep的BOM前缀unicode文本文件。将文件编码更改为ansi或尝试

type .\testing.txt | agrep "^"