gpt4 book ai didi

bash - sh 和 bash 中 pgrep 的区别

转载 作者:行者123 更新时间:2023-11-29 09:09:32 25 4
gpt4 key购买 nike

这是一个测试:

$ bash -c "pgrep -f novalidname"
$ sh -c "pgrep -f novalidname"
11202

为什么 pgrepsh 运行时给出输出? (据我所知,我的计算机上没有名为 novalidname 的进程)

最佳答案

这可能是一个时间问题,pgrep 发现自己,因为您使用 -f 发出它并且 novalidname 出现在命令中线。尝试使用 -l 来确认。

关于bash - sh 和 bash 中 pgrep 的区别,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31772778/

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