如何在Cygwin上安装/启用pcregrep?

如何在Cygwin上安装/启用pcregrep?,cygwin,pcregrep,Cygwin,Pcregrep,我正在尝试使用pcregrep,正如在Cygwin上的顶部答案中指定的那样。我的环境是Win7 64位,运行Cygwin v1.7.20(0.266/5/3) 使用cygcheck-p pcregremp我得到: Found 6 matches for pcregrep libpcre-devel-8.37-1 - libpcre-devel: Perl Compatible Regular Expressions library development (installed binaries

我正在尝试使用pcregrep,正如在Cygwin上的顶部答案中指定的那样。我的环境是Win7 64位,运行Cygwin v1.7.20(0.266/5/3)

使用
cygcheck-p pcregremp
我得到:

Found 6 matches for pcregrep
libpcre-devel-8.37-1 - libpcre-devel: Perl Compatible Regular Expressions library development (installed binaries and support files)
libpcre-devel-8.37-2 - libpcre-devel: Perl Compatible Regular Expressions library development (installed binaries and support files)
pcre-debuginfo-8.37-1 - pcre-debuginfo: Debug info for pcre (installed binaries and support files)
pcre-debuginfo-8.37-2 - pcre-debuginfo: Debug info for pcre (installed binaries and support files)
pcre-8.37-1 - pcre: Perl Compatible Regular Expressions utilities (installed binaries and support files)
pcre-8.37-2 - pcre: Perl Compatible Regular Expressions utilities (installed binaries and support files)
我已经尝试使用中的安装pcregrep的说明,但是
补丁
似乎不是cygwin安装的一部分。本教程是通过这两个与我的问题相同的问题找到的: 然后,引用它们,让它们出现在相关问题部分。显示它可以存在于cygwin中,但尝试为其运行手册页会导致:

$ man pcregrep
No manual entry for pcregrep
pcregrep的库似乎存在于我的cygwin安装中,但我不知道如何编译/提取/使它们能够访问该实用程序。当我尝试运行它时,我从bash获得标准命令notfound响应:

$ pcregrep
-bash: pcregrep: command not found
所以我的问题是:我在cygwin做什么才能使用pcregrep


我不知道如何继续,我有成千上万的日志文件要处理,我需要能够找到三行,每行之间的行数,这些行中字符串的组成和上面的“标题”行告诉我正确的传感器类型信息(一个日志中可能有多个传感器数据,我必须使用一组特定的传感器数据)。如果我不知道如何安装pcregrep(这似乎非常适合此工作),我将用数据询问基本问题。

您的
cygcheck-p
查询表明这三个包中提到了
pcregrep
。确认
pcreep.exe
二进制文件在
pcre
包中可用:您不必编译任何东西


使用Cygwin安装程序,
setup-x86.exe
(对于32位Cygwin)或
setup-x86_64.exe
(对于64位Cygwin),您可能首先使用它来安装Cygwin,以便在“选择软件包”时安装软件包第一步,在文本类别中找到
pcre
,单击新列中的循环图标,直到出现版本号,然后完成安装。如果您不再有安装程序,可以从下载。

感谢您的回复,有空时我会看一看。我早就用另一种方式解决了我原来的问题nner。我早就料到了,是的。我昨天想自己使用
pcregrep
,这个未回答但经过表决的问题让我担心这会相当困难。结果证明这是可行的,所以我决定将其记录下来,以便下一个问题出现。