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

Wrong Error? #3136

Open
2 of 4 tasks
matthewpersico opened this issue Feb 4, 2025 · 1 comment
Open
2 of 4 tasks

Wrong Error? #3136

matthewpersico opened this issue Feb 4, 2025 · 1 comment

Comments

@matthewpersico
Copy link

For bugs

  • Rule Id (if any, e.g. SC1000): SC2154, SC2154
  • My shellcheck version (shellcheck --version or 'online'): 0.10.0
  • I tried on shellcheck.net and verified that this is still a problem on the latest commit
  • It's not reproducible on shellcheck.net, but I think that's because it's an OS, configuration or encoding issue

For new checks and feature suggestions

Here's a snippet or screenshot that shows the problem:

#!/bin/bash

    do_on_exit END

    END()
    {
        kill "$tailpid" 2>/dev/null
        kill "$zenitypid" 2>/dev/null
    }

Here's what shellcheck currently says:

In bin/mailxmon line 14:
        kill "$tailpid" 2>/dev/null
        ^-------------------------^ SC2317 (info): Command appears to be unreachable. Check usage (or ignore if invoked indirectly).


In bin/mailxmon line 15:
        kill "$zenitypid" 2>/dev/null
        ^---------------------------^ SC2317 (info): Command appears to be unreachable. Check usage (or ignore if invoked indirectly).

Here's what I wanted or expected to see:

Line 7	SC2154: tailpid is referenced but not assigned.
Line 8	SC2154: zenitypid is referenced but not assigned.

Looks like I am getting the wrong error using

$ shellcheck --version
ShellCheck - shell script analysis tool
version: 0.10.0
license: GNU General Public License, version 3
website: https://www.shellcheck.net

$ uname -a
Linux dev-10-34-32-2 4.18.0-553.32.1.el8_10.x86_64 #1 SMP Mon Dec 2 06:32:20 EST 2024 x86_64 x86_64 x86_64 GNU/Linux

@wileyhy
Copy link

wileyhy commented Feb 4, 2025 via email

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