shelldap
changeset 105 e7e850a1540c
parent 104 b60189929c4b
child 106 94d941f13a5a
equal deleted inserted replaced
104:b60189929c4b 105:e7e850a1540c
   240 
   240 
   241 =over 4
   241 =over 4
   242 
   242 
   243 =head2 cat
   243 =head2 cat
   244 
   244 
   245 Display an LDIF dump of an entry.  Globbing is supported.  Specify
   245 Display LDIF dump of an entry. Globbing is supported. Specify either full DN, or a RDN.
   246 either the full dn, or an rdn.  For most commands, rdns are local to the
   246 RDNs are local to the current search base ('cwd' in shell terms). If RDN is '.' or missing,
   247 current search base. ('cwd', as translated to shell speak.)  You may additionally
   247 it defaults to the current search base.
   248 add a list of attributes to display.  Use '+' for server side attributes.
   248 You may additionally add a list of attributes to display (e.g. use '+' for operational
       
   249 attributes or provide a specific space-separated list). Default list of attributes is ['*']
       
   250 and this default list can be changed using 'attributes' config key or --attributes cmdline
       
   251 option.
   249 
   252 
   250     cat uid=mahlon
   253     cat uid=mahlon
   251     cat ou=*
   254     cat ou=*
   252     cat uid=mahlon,ou=People,dc=example,o=company
   255     cat uid=mahlon,ou=People,dc=example,o=company
   253     cat uid=mahlon + userPassword
   256     cat uid=mahlon + userPassword
   259 =head2 cd
   262 =head2 cd
   260 
   263 
   261 Change directory.  Translated to LDAP, this changes the current basedn.
   264 Change directory.  Translated to LDAP, this changes the current basedn.
   262 All commands after a 'cd' operate within the new basedn.
   265 All commands after a 'cd' operate within the new basedn.
   263 
   266 
   264     cd                  change to 'home' basedn
   267     cd                  change to 'home' (binddn if any, or basedn)
   265     cd ~                change to the binddn, or basedn if anonymously bound
   268     cd ~                change to 'home' (binddn if any, or basedn)
   266     cd -                change to previous node
   269     cd -                change to previous node
   267     cd ou=People        change to explicit path below current node
   270     cd ou=People        change to explicit path below current node
   268     cd ..               change to parent node
   271     cd ..               change to parent node
   269     cd ../../ou=Groups  change to node ou=Groups, which is a sibling
   272     cd ../../ou=Groups  change to node ou=Groups, which is a sibling
   270                         to the current node's grandparent
   273                         to the current node's grandparent
   271 
   274 
   272 Since LDAP doesn't actually limit what can be a container object, you
   275 Since LDAP doesn't limit what can be a container object, you can 'cd' into
   273 can actually cd into any entry. Many commands then work on '.', meaning
   276 any entry. Many commands then work on '.' or default to '.', meaning
   274 "wherever I currently am."
   277 "wherever I currently am."
   275 
   278 
   276     cd uid=mahlon
   279     cd uid=mahlon
   277     cat .
   280     cat .
       
   281     cat
   278 
   282 
   279 =head2 clear
   283 =head2 clear
   280 
   284 
   281 Clear the screen.
   285 Clear the screen.
   282 
   286 
   283 =head2 copy
   287 =head2 copy
   284 
   288 
   285 Copy an entry to a different dn path.  All copies are relative to the
   289 Copy an entry to a different DN path.  All copies are relative to the
   286 current basedn, unless a full dn is specified.  All attributes are
   290 current basedn unless a full DN is specified.  All attributes are
   287 copied, then an LDAP moddn() is performed.
   291 copied and then an LDAP moddn() is performed.
   288 
   292 
   289     copy uid=mahlon uid=bob
   293     copy uid=mahlon uid=bob
   290     copy uid=mahlon ou=Others,dc=example,o=company
   294     copy uid=mahlon ou=Others,dc=example,o=company
   291     copy uid=mahlon,ou=People,dc=example,o=company uid=mahlon,ou=Others,dc=example,o=company
   295     copy uid=mahlon,ou=People,dc=example,o=company uid=mahlon,ou=Others,dc=example,o=company
   292 
   296 
   333 
   337 
   334  Show values for various runtime variables.
   338  Show values for various runtime variables.
   335 
   339 
   336 =head2 grep
   340 =head2 grep
   337 
   341 
   338 Search for arbitrary LDAP filters, and return matching dn results.
   342 Search for arbitrary LDAP filters, and return matching DN results.
   339 The search string must be a valid LDAP filter.
   343 The search string must be a valid LDAP filter.
   340 
   344 
   341     grep uid=mahlon
   345     grep uid=mahlon
   342     grep uid=mahlon ou=People
   346     grep uid=mahlon ou=People
   343     grep -r (&(uid=mahlon)(objectClass=*))
   347     grep -r (&(uid=mahlon)(objectClass=*))
   431 you'll just get a referral.  It would be nice if shelldap automatically
   435 you'll just get a referral.  It would be nice if shelldap automatically
   432 tried to follow it.
   436 tried to follow it.
   433 
   437 
   434 For now, it only makes sense to connect to a master if you plan on doing
   438 For now, it only makes sense to connect to a master if you plan on doing
   435 any writes.
   439 any writes.
       
   440 
       
   441 Add ability for command definitions in cmd_map to contain default
       
   442 arguments passed to functions.
       
   443 
       
   444 Then add ability to define custom commands/aliases in config file.
       
   445 
       
   446 Split 'inspect' into separate commands, one working on files/entries,
       
   447 and one working on objectclasses. This way, autocompleter for both commands
       
   448 will be reasonable, unlike now.
   436 
   449 
   437 =head1 BUGS / LIMITATIONS
   450 =head1 BUGS / LIMITATIONS
   438 
   451 
   439 There is no support for editing binary data.  If you need to edit base64
   452 There is no support for editing binary data.  If you need to edit base64
   440 stuff, just feed it to the regular ldapmodify/ldapadd/etc tools.
   453 stuff, just feed it to the regular ldapmodify/ldapadd/etc tools.
  1384 	#'passwd'  => [ undef ],
  1397 	#'passwd'  => [ undef ],
  1385 	##'clear'   => [ undef ],
  1398 	##'clear'   => [ undef ],
  1386 	#'env'     => [ undef ],
  1399 	#'env'     => [ undef ],
  1387 	#'help'    => [ undef ],
  1400 	#'help'    => [ undef ],
  1388 	#'mkdir'   => [ undef ],
  1401 	#'mkdir'   => [ undef ],
  1389 	#'inspect' => [ undef ],
  1402 	'inspect' => [ undef, 'comp_inspect' ],
  1390 
  1403 
  1391 	'id'      => [ 'whoami' ],
  1404 	'id'      => [ 'whoami' ],
  1392 	'ls'      => [ 'list',   'comp_cwd' ],
  1405 	'ls'      => [ 'list',   'comp_cwd' ],
  1393 	'search'  => [ 'grep',   'comp_cwd' ],
  1406 	'search'  => [ 'grep',   'comp_cwd' ],
  1394 	'vi'      => [ 'edit',   'comp_cwd' ],
  1407 	'vi'      => [ 'edit',   'comp_cwd' ],