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

SC2009 recommends away from a POSIX way to a non-POSIX way #2606

Open
1 task done
ghost opened this issue Oct 14, 2022 · 4 comments
Open
1 task done

SC2009 recommends away from a POSIX way to a non-POSIX way #2606

ghost opened this issue Oct 14, 2022 · 4 comments

Comments

@ghost
Copy link

ghost commented Oct 14, 2022

For bugs

Shellcheck currently recommends to use pgrep instead of ps | grep. That's fine... if one's on a system with pgrep, but pgrep is not POSIX and not everyone has pgrep (for example AIX).

See also #2449 in which SC2012 does the same.

I'm not sure what the project's stance is recommending the user away from POSIX. I'm inclined to think it should not, particularly if one is targeting /bin/sh or /bin/ksh, but at the very least the wiki should make a note that the error should be ignored if POSIX compliance is important or if the target system lacks the command/option.

@bmarwell
Copy link

Hi, I see the same issue and need to deactivate it every single time. Thanks to @tim78245 for opening up.
I agree that moving away from posix to a non-standard-tool is not a good recommendation, especially when all other suggestions try to push you to moving to POSIX standards. ;-)

@SuperSandro2000
Copy link

You can globally disable certain checks.

@bmarwell
Copy link

I know. But I have to do it in every ci script I write. So I still have to do it multiple times, once for each source code repository.

@bmarwell
Copy link

Any update on this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants