Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pgrep: should show an error message if pattern is longer than 15 chars and there's no match #121

Open
cakebaker opened this issue Jul 14, 2024 · 2 comments
Labels
bug Something isn't working pgrep

Comments

@cakebaker
Copy link
Contributor

The original pgrep shows an error message if the specified pattern is longer than 15 chars whereas our pgrep doesn't.

$ pgrep 123456789012345
$ pgrep 1234567890123456
pgrep: pattern that searches for process name longer than 15 characters will result in zero matches
Try `pgrep -f' option to match against the complete command line.

$ cargo run pgrep 123456789012345
$ cargo run pgrep 1234567890123456
@cakebaker cakebaker added bug Something isn't working pgrep labels Jul 14, 2024
@Krysztal112233
Copy link
Collaborator

Krysztal112233 commented Jul 14, 2024

Does this need to be made compatible with GNU as well? Maybe it would be better to set an extra flag (such as --extended-pattern) as an extension of the uutils implementation?

@cakebaker
Copy link
Contributor Author

Hm, it looks like this error only shows up if there is no match. If there is a match, there is no such error message:

$ pgrep pool_workqueue_release
3

So this means an extra flag doesn't make much sense.

It's a low-prio bug. I'm not sure whether we should fix it in our code or adapt the procps test suite accordingly when we run their test suite against our code.

@cakebaker cakebaker changed the title pgrep: should show an error message if pattern is longer than 15 chars pgrep: should show an error message if pattern is longer than 15 chars and there's no match Jul 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working pgrep
Projects
None yet
Development

No branches or pull requests

2 participants