From a1a83b248230f1bb7c267024c8c26a94d1e3d376 Mon Sep 17 00:00:00 2001 From: koalaman Date: Sun, 25 Sep 2016 12:31:58 -0700 Subject: [PATCH] Created SC2185 (markdown) --- SC2185.md | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 SC2185.md 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