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

>| is not seen often, warning could be more helpful, is understood only after reading up on the operator #3133

Open
3 of 4 tasks
smoe opened this issue Jan 28, 2025 · 0 comments

Comments

@smoe
Copy link

smoe commented Jan 28, 2025

For bugs

  • Rule Id (if any, e.g. SC1000): SC2188
  • My shellcheck version: 0.10.0 and online
  • 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
halmsg="somefile"
>|$halmsg

Here's what shellcheck currently says:

Line 3	SC2188: This redirection doesn't have a command. Move to its command (or use 'true' as no-op).

Here's what I wanted or expected to see:

Is "true >| $halmsg" what you wanted to write to very explicitly empty that file and override a potential noclobber?

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

1 participant