From 0403a47f48f5f7b4e8ffe28f863d8ae2d2836e8d Mon Sep 17 00:00:00 2001 From: Dylan Araps Date: Sat, 15 Feb 2020 16:08:42 +0200 Subject: [PATCH] docs: update --- README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 6765de4..5214e58 100644 --- a/README.md +++ b/README.md @@ -477,15 +477,15 @@ $ lines ~/.bashrc This works by passing the output of the glob to the function and then counting the number of arguments. -**CAVEAT:** When the glob does not match anything (empty directory or no matching files) it is not expanded and the function returns `1`. - **Example Function:** ```sh count() { # Usage: count /path/to/dir/* # count /path/to/dir/*/ - printf '%s\n' "$#" + [ -e "$1" ] \ + && printf '%s\n' "$#" \ + || printf '%s\n' 0 } ```