Skip to content

Option to give non-zero exit code in precense of file system errors #1638

Description

@VRehnberg

I'd like to use fd for checking for presence of stale file handles. Currently I can do:

fd . /path/to/nfs/mount/ --show-errors -X true 2> /dev/stdout | grep -qv "Stale file handle"

to get a command with a non-zero exit code in presence of such file system errors. However, having to output all the paths makes this much slower than running quietly.

Ideally one or more of the following alternatives should work.

1 Output errors even when rest is silenced --show-errors -q

fd . /path/to/nfs/mount/ --show-errors -q | grep -qv "Stale file handle"

2 When there are file system errors output a non-zero exit code

fd . /path/to/nfs/mount/ -q

3 Option to give non-zero exit code in presence of file system errors

fd . /path/to/nfs/mount/ --raise-error -q

would either exit with non-zero exit code on first file system error or after everything if there was any file system error.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions