Question: I want to call use `find` on some filenames.

```
find $(do_something to find filenames) -print0 | xargs -r0 ls -ld

```

This breaks if `$(do_something to find filenames)` returns nothing: The find-command starts to do recursive search.

Is there a way to tell find to do nothing if it gets no explicit filename/dirname as argument?

Answer: 
How about doing this:

```
paths=$(do_something to find filenames)
if [ "$paths" ]; then
    find "$paths" ...
fi

```

This works independent from the `find` implementation.

Note that `find "$paths"` with more than a single path name causes problems.
If the path names do not contain spaces, you may use: `find $paths`, otherwise, a working alternative is this function:

```
dofind() {
    set -f
    set -- $(do_something to find filenames)
    if [ $# -gt 0 ]; then
        find "$@" ...
    fi
    set +f
}

```

It disables file globbing and then uses `set --` to set the shells arg vector. This works with any POSIX shell.
You can give `find` an extra, non-existant directory to start from:

```
find " " $(do_something to find filenames) -print0 | xargs -r0 ls -ld

```

To make this tidy, drop `find`'s error output:

```
find " " $(do_something to find filenames) -print0 2>/dev/null | xargs -r0 ls -ld

```

(but then you won't notice if another error occurs...).

When `do_something to find filenames` outputs filenames, `find` will complain about `" "` but will still process the rest of the command line. When no filenames are output, `find` will again complain about `" "` but won't add its default `.`.