Learner
Learner

Reputation: 31

Shell script to python script convertion

As i am new to python and ldap, please hep me convert the below shell code into python(version 2.6.6).

can some pls explain what this below shell code does and what is the use of -b option here

Shell code :

ldapsearch -x -h ldap.bbc.network.lcl -p 3477 -b "DC=bbc,DC=network,DC=lcl" -D "CN=LDAP\, Mine,OU=Resource Accounts,OU=Enterprise,DC=bbc,DC=network,DC=lcl" -w f2oH@LQ^911 "center=1234"

Upvotes: 1

Views: 104

Answers (1)

Saleh
Saleh

Reputation: 1931

To find out what each option does, take a look at the man page of command, here.

As stated there:

-b searchbase Use searchbase as the starting point for the search instead of the default.

To run the command via python interpreter you can use structures like this:

For more info visit this Q/A.

Upvotes: 1

Related Questions