[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: -execdir '{}' \; vs -execdir '{}' +
From: |
Andreas Metzler |
Subject: |
Re: -execdir '{}' \; vs -execdir '{}' + |
Date: |
Sat, 3 Feb 2018 14:41:21 +0100 |
User-agent: |
Mutt/1.9.3 (2018-01-21) |
On 2018-02-03 Андрей Веселов <address@hidden> wrote:
> # cd test
> # ls -1
> file1
> file2
> file3
> # find . -type f -exec echo -n '{}' +
> ./file1 ./file3 ./file2
> # find . -type f -exec echo -n '{}' \;
> ./file1./file3./file2
> # find . -type f -execdir echo -n '{}' +
> ./file1./file3./file2
> # find . -type f -execdir echo -n '{}' \;
> ./file1./file3./file2
> It's seems that with -execdir '+' is the same as ';' and a command run once
> for each file. strace output gives the same conclusion.
> # find --version
> find (GNU findutils) 4.4.2
[...]
This was fixed about 7 years ago:
* Major changes in release 4.5.10, 2011-05-11
[...]
#29949: find -execdir does not change working directory
[...]
** Performance changes
The find program will once again build argument lists longer than 1
with "-execdir ...+". The upper limit of 1 argument for execdir was
introduced as a workaround in findutils-4.3.4. The limit is now
removed, but find still does not issue the maximum possible number of
arguments, since an exec will occur each time find encounters a
subdirectory (if at least one argument is pending).
cu Andreas
--
`What a good friend you are to him, Dr. Maturin. His other friends are
so grateful to you.'
`I sew his ears on from time to time, sure'