shellcheck icon indicating copy to clipboard operation
shellcheck copied to clipboard

POSIX find

Open aeiplatform opened this issue 2 years ago • 3 comments

For new checks and feature suggestions

  • [x] https://www.shellcheck.net/ (i.e. the latest commit) currently gives no useful warnings about this
  • [x] I searched through https://github.com/koalaman/shellcheck/issues and didn't find anything related

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

#!/bin/sh
find . -readable

Here's what shellcheck currently says:

Nothing.

Here's what I wanted or expected to see:

Line 2:
find . -readable
       ^-- SCXXXX Operand "-readable" is not defined in POSIX standard.

The Open Group

aeiplatform avatar May 25 '23 05:05 aeiplatform

If so, then we would need to be consistent and check all other commands for non POSIX switches. Out of my head comes recursive grep, ie. grep -r which is widely used but not documented in the POSIX standard.

I don't believe we should go down this route. There are useful switches that are not described in POSIX.

danielcft avatar Aug 15 '24 22:08 danielcft

This could be an opt-in lint. See also #2902.

Ordoviz avatar Aug 22 '24 18:08 Ordoviz

duplicate of #2406.

e-kwsm avatar Oct 19 '25 08:10 e-kwsm