January 2004
Intermediate to advanced
368 pages
7h 25m
English
To begin seeing how to work with NetInfo, here's a straightforward script that allows you to easily interface with the NetInfo database through the nireport utility.
#!/bin/sh # listmacusers - Simple script to list users in the Mac OS X NetInfo database. # Note that Mac OS X also has an /etc/passwd file, but that's # used only during the initial stages of boot time and for # recovery bootups. Otherwise, all data is in the NetInfo db. fields="" while getopts "Aahnprsu" opt ; do case $opt in A ) fields="uid passwd name realname home shell" ;; a ) fields="uid name realname home shell" ;; h ) fields="$fields home" ;; n ) fields="$fields name" ;; p ) fields="$fields passwd" ;; r ) fields="$fields realname" ;; ...
Read now
Unlock full access