gpt4 book ai didi

grep - 使用 grep 过滤 Doxygen 输出

转载 作者:行者123 更新时间:2023-12-04 18:19:18 27 4
gpt4 key购买 nike

我想用 grep 过滤 doxygen 警告,以抑制某些参数的未记录参数警告。我正在尝试这个:

doxygen doxycfgfile | grep -v "parameter x"

但是,这似乎对输出绝对没有影响。不包含 parameter x 的行被压制也不是所有其他行。输出似乎完全相同。

我正在使用 tcsh。

最佳答案

这可能是因为未记录的参数警告消息被写入标准错误 (stderr),而不是标准输出 (stdout)。使用管道( | ),您只需将标准输出管道传输到 grep的输入。

你可以尝试做类似的事情

doxygen doxycfgfile |& grep -v "parameter x"

来自 advanced bash scripting guide :

If |& is used, the standard error of command1 is connected to command2's standard input through the pipe; it is shorthand for 2>&1 |.



请注意,这是在 Bash 4 中添加的,因此对于早期版本,您将使用 2>&1 |代替 |& .

或者,您可以使用类似的东西摆脱标准错误输出
doxygen doxycfgfile 2>/dev/null

这个 answer在 askubuntu 上是我答案的来源。

关于grep - 使用 grep 过滤 Doxygen 输出,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11009769/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com