Theresa Arzadon-Labajo

ldapsearch syntax error

Posted by Theresa Arzadon-Labajo (tarzadon) on Apr 01 2011
Tech Stuff >> Unix-Linux
I wanted to run a search on multiple attributes.
The Red Hat Docs showed

(&(filter)(filter)(filter)...)

But, when I ran:
ldapsearch -x -ZZ servername.example.com -b"dc=example,dc=com" (&(filter1=x)(filter2=y))

I got,
-bash: syntax error near unexpected token `('

The only thing I found, was on this page, which said to enclose the filters in quotes.

So, the command looked like this:
ldapsearch -x -ZZ servername.example.com -b"dc=example,dc=com" "(&(filter1=x)(filter2=y))"

Afterwards, ldapsearch worked.

Last changed: Feb 27 2020 at 4:09 PM

Back