HP UX: how to use -or -and operators in find() function

354 Views Asked by At

I'm trying to to get a list of files with find() on HP UX

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

and HP UX console tells me that -or / -and / -not operators are bad.

meanwhile this stuff is working normal on linux redhat...

what should I do ?

1

There are 1 best solutions below

3
On BEST ANSWER

Try omitting the minus signs and write them in all caps maybe?

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

Or, alternatively, install GNU find so your script will work on both platforms without modification.