Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 22 Mar 2023 04:48:47 +0000
From:      bugzilla-noreply@freebsd.org
To:        bugs@FreeBSD.org
Subject:   [Bug 270394] find(1): doesn't pass all files to the -exec utility
Message-ID:  <bug-270394-227-FAM9seLONQ@https.bugs.freebsd.org/bugzilla/>
In-Reply-To: <bug-270394-227@https.bugs.freebsd.org/bugzilla/>
References:  <bug-270394-227@https.bugs.freebsd.org/bugzilla/>

next in thread | previous in thread | raw e-mail | index | archive | help
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D270394

Li-Wen Hsu <lwhsu@FreeBSD.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |lwhsu@FreeBSD.org

--- Comment #1 from Li-Wen Hsu <lwhsu@FreeBSD.org> ---
I think this could be "works as intended."

The shell command will receive the first file path as $0 and the reset will=
 be
assigned to $@.

So if find(1) found three files as `x/a x/b x/c`, the shell command will
receive them as:

$0 =3D x/a
$@ =3D x/b x/c

And:

$ find x -type f -exec sh -c 'echo "files=3D$@"' {} +
files=3Dx/c x/a

$ find x -type f -exec sh -c 'echo "files=3D$0"' {} +
files=3Dx/b

$ find x -type f -exec sh -c 'echo "files=3D$0 $@"' {} +
files=3Dx/b x/c x/a

The GNU find(1) has the same behavior.

--=20
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-270394-227-FAM9seLONQ>