Re: Is there a way to let find return non-zero when nothing is found?

2019-11-11 Thread Stephane Chazelas
2019-11-11 17:45:03 +0800, Peng Yu: > Hi, > > Sometimes, I'd like to know whether there is nothing found. Is there a > way to let find return none-zero when nothing is found? Thanks. [...] If using -print, you can pipe to grep '^' if find ... | grep '^'; then echo "find found something, see li

Re: Is there a way to let find return non-zero when nothing is found?

2019-11-11 Thread Eric Blake
On 11/11/19 3:45 AM, Peng Yu wrote: Hi, Sometimes, I'd like to know whether there is nothing found. Is there a way to let find return none-zero when nothing is found? Thanks. Not built in to find directly, but you can emulate it via a number of means, such as having find touch a witness file

Is there a way to let find return non-zero when nothing is found?

2019-11-11 Thread Peng Yu
Hi, Sometimes, I'd like to know whether there is nothing found. Is there a way to let find return none-zero when nothing is found? Thanks. -- Regards, Peng