Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!


Click here to return to the 'Convert 10.3x LDAP database to UNIX passwd file' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Convert 10.3x LDAP database to UNIX passwd file
Authored by: kps on Aug 03, '04 02:54:18PM

#!/bin/sh

HN=localhost
DB=/NetInfo
FS='RecordName Password UniqueID PrimaryGroupID RealName NFSHomeDirectory UserShell'

{ dscl $HN -list "$DB/Users" | sed "s,.*,read $DB/Users/& $FS,"; echo quit; } |
	dscl -q $HN |
	sed -e '/^read/d' -e '/^quit/d' -e 's/^[^:]*: //' |
	rs -e -C: 0 7 |
	sed -e 's/:$//'
The dscl author(s) need to be beaten half to death with a copy of Software Tools for (a) not recognizing the end of input, and (b) echoing the commands.

[ Reply to This | # ]