Help - Search - Members - Calendar
Full Version: Ldapsearh command is braking my balls!!!...not litterally
Linuxhelp > Support > Technical Support
cvs
ok so i need to search from a .txt file around 5000 numbers in a 1.2 gb data base so im usisng this command:




ldapsearch -h PL0 -x -D "cn=****************,dc=ok,dc=com" -w "***************" -s one -b "dc=imsi,ou=identities,dc=ok,dc=com" IMSI=%s -f iphfives.txt IMSI | grep 'IMSI: '

The idea is to print all the IMSI numbers that match my search how ever each time i try to run it it takes a lot of time and doesnt print anyting at all, then i tried to run it with only the ldap command and no grep


ldapsearch -h PL0 -x -D "cn=*********,dc=ok,dc=com" -w "********" -s one -b "dc=imsi,ou=identities,dc=ok,dc=com" IMSI=%s -f iphfives.txt IMSI

The command runs but shows the complete result and not only the imsi

# filter: IMSI=123456789101234
#
# 123456789101234, imsi, identities, ok.com
dn: IMSI=123456789101234,dc=imsi,ou=identities,dc=ok,dc=com
IMSI:123456789101234


i tried to save the result in a file so i tried to run this


ldapsearch -h PL0 -x -D "cn=*******,dc=ok,dc=com" -w "*********" -s one -b "dc=imsi,ou=identities,dc=ok,dc=com" IMSI=%s -f iphfives.txt IMSI > results.txt

The results.txt file is run but the there is nothing saved inside it

Can anybody please explain me what am i doing wrong? why the grep from the first command is not running why is the file created "results.txt" but bothing is inside.

And why is the second command running ok and showing output but i cant save it.

I hope you guys here can help me

BR
Robert83
Hi

the mistake is this :

ldapsearch -h PL0 -x -D "cn=****************,dc=ok,dc=com" -w "***************" -s one -b "dc=imsi,ou=identities,dc=ok,dc=com" IMSI=%s -f iphfives.txt IMSI | grep 'IMSI: '

grep 'IMSI: ' <----

use

grep IMSI , you don't Need ' '

Greetings
Robert
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2017 Invision Power Services, Inc.