mr5ingh
September 19, 2016, 3:39pm
1
Hi Everyone, I am new to this forum and to scripting�
I was wondering if somebody could provide me a real quick solution to a command/script I need.
The following command :
phonesearch -h 123.24.33.149 -p 389 -D 'uid=dgiumuser,ou=ServicePlatform,c=ca' -b 'o=mobile,c=ca' -w "Cr4cH3L3c4Sh" -x 'pan=6457533296'|grep ppdProcIndicator
gives me:
phone_simple_bind: Success
ppdProcIndicator: N
Issue is I have 180 Pans to check.
When I run this command for 4 of the pans as an example:
for i in '5148474296' '4333341472' '5147155558' '4135387001'
do phonesearch -h 172.25.33.119 -p 389 -D 'uid=dgiumuser,ou=ServicePlatform,c=ca' -b 'o=mobile,c=ca' -w "Cr4cH3L3c4Sh" -x 'pan=$i' | grep ppdProcIndicator | grep ppdProcIndicator
done
I get:
phone_simple_bind: Success
phone_simple_bind: Success
phone_simple_bind: Success
phone_simple_bind: Success
Doesn�t seem to perform the grep.
Any help or advice very much appreciated.
mr5ingh:
Hi Everyone, I am new to this forum and to scripting...
I was wondering if somebody could provide me a real quick solution to a command/script I need.
The following command :
phonesearch -h 123.24.33.149 -p 389 -D 'uid=dgiumuser,ou=ServicePlatform,c=ca' -b 'o=mobile,c=ca' -w "Cr4cH3L3c4Sh" -x 'pan=6457533296'|grep ppdProcIndicator
gives me:
phone_simple_bind: Success
ppdProcIndicator: N
Issue is I have 180 Pans to check.
When I run this command for 4 of the pans as an example:
for i in '5148474296' '4333341472' '5147155558' '4135387001'
do phonesearch -h 172.25.33.119 -p 389 -D 'uid=dgiumuser,ou=ServicePlatform,c=ca' -b 'o=mobile,c=ca' -w "Cr4cH3L3c4Sh" -x 'pan=$i' | grep ppdProcIndicator | grep ppdProcIndicator
done
I get:
phone_simple_bind: Success
phone_simple_bind: Success
phone_simple_bind: Success
phone_simple_bind: Success
Doesn't seem to perform the grep.
Any help or advice very much appreciated.
In addition to using double-quotes instead of single-quotes as vgersh99 suggested, note that you only need one grep (not two that are marked in red above in your script).
mr5ingh
September 19, 2016, 5:34pm
4
Fantastic...thank you for the swift reply.
---------- Post updated at 05:34 PM ---------- Previous update was at 05:33 PM ----------
The double grep was a typo!