https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=229481

            Bug ID: 229481
           Summary: find(1) fails to expand {} with preceding/following
                    non-whitespace, as specified by man page
           Product: Base System
           Version: 11.1-RELEASE
          Hardware: Any
                OS: Any
            Status: New
          Severity: Affects Only Me
          Priority: ---
         Component: bin
          Assignee: [email protected]
          Reporter: [email protected]

Expected behaviour (from "man find"):

"Historic implementations of the -exec and -ok primaries did not replace the
string '{}' in the utility name or the utility arguments if it had preceding or
following non-whitespace characters. This version replaces it no matter where
in the utility name or arguments it appears."


However this doesn't seem to be the case with execdir or exec. Example 1:

# /usr/bin/find . -maxdepth 1 -exec echo "(result):" {}  \;
(result): .
(result): ./dir 1
(result): ./dir 2
(result): ./dir 3

# /usr/bin/find . -maxdepth 1 -exec echo "(result):"{}  \;
(result):
(result):
(result):
(result):


However it does seem to work correctly within quotes. Example 2:

# /usr/bin/find . -maxdepth 1 -execdir echo "RENAMED_FROM_{}" \;
RENAMED_FROM_.
RENAMED_FROM_dir 1
RENAMED_FROM_dir 2
RENAMED_FROM_dir 3

-- 
You are receiving this mail because:
You are the assignee for the bug.
_______________________________________________
[email protected] mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-bugs
To unsubscribe, send any mail to "[email protected]"

Reply via email to