https://bugzilla.redhat.com/show_bug.cgi?id=1324814
--- Comment #4 from Mikolaj Izdebski <mizdebsk(a)redhat.com> ---
(In reply to Pavel Raiskup from comment #3)
(In reply to Mikolaj Izdebski from comment #1)
> While I agree that glob character should be quoted, I don't like using -exec
> for two reasons: 1) it may execute javac more than once if there are many
> .java files and
What limit (when find runs more than one command) are we talking about here?
Probably some limits given by execve()?.. if yes, that is not that important
point as we still pass all the files through execve() later on 'javac' in
your
fix.
I guess it is smallest from execve limits on systems supported by findutils.
It's not even close to limits on Linux.
Try with:
touch $(seq 100000)
find -type f -exec awk 'BEGIN{print"awk executed"}' {} +
awk 'BEGIN{print"awk executed"}' $(find -type f)
All files must be compiled in one invocation
> 2) it always returns true - it won't stop script on
compilation failure.
This sounds like find's documentation issue? See the bug 1325049. But this
point really matters, thanks. I did not know the snippet it is to be used in
scripts ...
Ah, you are right. It looks like it stops when subprocess returns non-zero and
propagates that value as its exit code -- this is what I would expect.
... then, it is still very bad shell scripting practice to do
'CMD `CMD`'
in scripts because of white spaces. In documentation which is to be C&P'ed
to
user's scripts people can think it is safe shell pattern..
Java package and class names can't contain whitespaces so it's very unlikely to
happen in practice.
The best solution I could think of is:
find -type f -name '*.java' -print0 | sed -z
"s/'/'\"'\"'/g;s/.*/'&' /" | javac
@/dev/stdin
It doesn't have execve arglist limitations, should work with any file names,
but its readability is at least questionable...
--
You are receiving this mail because:
You are on the CC list for the bug.