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.
In `zsh` (and most non-Bourne derived shells), when a (or *all* depending on the shell) *glob* doesn't expand, the command is aborted.

`$(do_something to find filenames)` is not a glob, but you can make it become one by appending a glob qualifier in `zsh`:

```
 find $(do_something to find filenames)(#q) -print0...

```

Above, that `(#q)` (an empty glob qualifier, so does nothing otherwise) is appended to the last word resulting of the splitting of the output of `do_something to find filenames`, so the command will be aborted if that command produces no (or blank) output, but also if that last word (and that last word only) doesn't resolve to an existing path. You can make it apply to every word resulting of that splitting (so that the command be aborted if any of those words doesn't resolve to an existing file) with:

```
 find ${^$(do_something to find filenames)}(#q) -print0...

```