There are two commands that can be really helpful when scripting operations that involve filenames and paths. The first of these is dirname: dirname can be used to return the directory portion of a path. The second is basename: basename can be used to output the file name portion of a path. For our first example, let’s say that we have an output of /var/db/shadow/hash/850F62CD-966C-43A7-9C66-9F9E6799A955, which we know contains the encrypted password for a given user. To just see the UUID here would be done using the following extremely basic incantation of basename: basename /var/db/shadow/hash/850F62CD-966C-43A7-9C66-9F9E6799A955 Basename can also be used to trim output. For example, let’s say we didn’t need…
-
-
Mac OS X: Trusted Binding
In Directory Access, click Services and authenticate. Then select LDAPv3 in the list of services, then click Configure. Net, select the server configuration of interest, then click Edit. Or click on the plus icon and type in the name of the server and click on Bind. When prompted, enter the name of the computer and the name and password of an LDAP directory domain admin account. Next, click on the OK button bind.