Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 03 Jul 2018 04:02:56 +0000
From:      bugzilla-noreply@freebsd.org
To:        bugs@FreeBSD.org
Subject:   [Bug 229481] find(1) fails to expand {} with preceding/following non-whitespace, as specified by man page
Message-ID:  <bug-229481-227@https.bugs.freebsd.org/bugzilla/>

next in thread | raw e-mail | index | archive | help

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: bugs@FreeBSD.org
          Reporter: stilezy@gmail.com

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.


Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-229481-227>