HP UX:如何在find()函数中使用-or和operator

时间:2012-01-17 10:25:26

标签: find hp-ux

我正在尝试使用HP UX上的find()获取文件列表

LD_PRELOAD = "`find ./lib/ -type f \( -name \*boo\* -or -name \*foo\* -and -not -name \*zoo\* \)`"

和HP UX控制台告诉我-or / -and / -not运算符不好。

同时这个东西在linux redhat上正常工作......

我该怎么办?

1 个答案:

答案 0 :(得分:1)

尝试省略减号并将其全部大写?

-name * boo * OR -name * foo * AND NOT -name * zoo *

或者,或者,安装GNU find,这样你的脚本就可以在两个平台上运行而无需修改。