Skip to content
koalaman edited this page Sep 25, 2016 · 3 revisions

Some finds don't have a default path. Specify '.' explicitly.

Problematic code:

find -type f

Correct code:

find . -type f

Rationale:

When not provided a search path, GNU and Busybox find will use a default path of ., the current directory.

On POSIX, macOS/OSX, FreeBSD, OpenBSD and NetBSD, it will instead result in an error.

Explicitly specifying a path works across all implementations, and is therefore preferred.

Exceptions:

None.

ShellCheck

Each individual ShellCheck warning has its own wiki page like SC1000. Use GitHub Wiki's "Pages" feature above to find a specific one, or see Checks.

Clone this wiki locally