I am calling find from a perl script like this:
my $one_file = `find $search_dir -name "\*.$refinfilebase.search" -print | head -n 1`;
If I execute it from the shell, I get no error. Also, it returns the right value to $one_file, but I get this on the prompt:
find: write error: Broken pipe
Why would that be? How can I get rid of this find: write error: Broken pipe message?
You could try this (although I did not manage to reproduce your error message using the code you posted, so perhaps this error-free version of mine might give you an error message as well…):
Here’s some sample output I got from a test run:
HTH