diff --git a/SC2185.md b/SC2185.md new file mode 100644 index 0000000..5029930 --- /dev/null +++ b/SC2185.md @@ -0,0 +1,24 @@ +## Some finds don't have a default path. Specify '.' explicitly. + +### Problematic code: + +```sh +find -type f +``` + +### Correct code: + +```sh +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. \ No newline at end of file