0

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 ?

j0k
  • 22,600
  • 28
  • 79
  • 90
Alexander.Iljushkin
  • 4,519
  • 7
  • 29
  • 46

1 Answers1

1

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.

synthesizerpatel
  • 27,321
  • 5
  • 74
  • 91
  • Thank you bro, that was helpfult suggestion. The fact of a matter is that i dont have admin rights to install new features on the company's server – Alexander.Iljushkin Jan 17 '12 at 13:14
  • Well, did removing the dash and uppercasing the booleans work at least? The hpux find man page seems to think so... – synthesizerpatel Jan 17 '12 at 14:15
  • Yes, mate, thank you very much indeed :) This worked perfectly :) BTW I've read man pages for find() on that server and there were no any words about uppercase operators. This could be caused by my inattention, bro. But thank you :) – Alexander.Iljushkin Jan 18 '12 at 05:45