URL: <https://savannah.gnu.org/bugs/?56855>
Summary: find -printf %h gives an empty string for the root directory '/' Project: findutils Submitted by: tavianator Submitted on: Tue 03 Sep 2019 03:56:18 PM UTC Category: find Severity: 3 - Normal Item Group: None Status: None Privacy: Public Assigned to: None Originator Name: Originator Email: Open/Closed: Open Discussion Lock: Any Release: 4.7.0 Fixed Release: None _______________________________________________________ Details: This is just https://savannah.gnu.org/bugs/?50259#comment13, but I thought it deserved its own report. https://git.savannah.gnu.org/cgit/findutils.git/commit/?id=855dbdadbf75ca1f08f3e1c7c6811670e952d906 even documents that %h should give the dirname of the path, but: $ find / /tmp -maxdepth 0 -printf '[%h]\n' [] [] $ dirname / / $ dirname /tmp / %h giving the empty string can be a problem if you are using -printf to output paths for processing by some other command, for example. _______________________________________________________ Reply to this item at: <https://savannah.gnu.org/bugs/?56855> _______________________________________________ Message sent via Savannah https://savannah.gnu.org/