相关文章推荐
留胡子的电影票  ·  Install and Set Up ...·  1 月前    · 
听话的灌汤包  ·  项目场景:pytorch ...·  1 年前    · 
大方的烤地瓜  ·  ANR源码分析之Service ...·  1 年前    · 
Collectives™ on Stack Overflow

Find centralized, trusted content and collaborate around the technologies you use most.

Learn more about Collectives

Teams

Q&A for work

Connect and share knowledge within a single location that is structured and easy to search.

Learn more about Teams

When you say you want it to return a particular number, are you referring to the exit status? If so:

[[ -z `find /this/is/a/path/ -name core.*` ]]

And since you only care about a yes/no response, you may want to change your find to this:

[[ -z `find /this/is/a/path/ -name core.* -print -quit` ]]

which will stop after the first core file found. Without that, if the root directory is large, the find could take a while.

Heh, I was thinking, "To set the exit status." But yeah, duh, the test already does that, it's totally unnecessary, good catch. – Alex Howansky Jun 29, 2011 at 21:42

Thanks for contributing an answer to Stack Overflow!

  • Please be sure to answer the question. Provide details and share your research!

But avoid

  • Asking for help, clarification, or responding to other answers.
  • Making statements based on opinion; back them up with references or personal experience.

To learn more, see our tips on writing great answers.