Re: Make and Edit database

"David Phillips" <[email protected]> Thu, 10 Jul 2003 19:51:35 -0500
Newsgroups gmane.comp.djb.cdb
Message-ID <008d01c34746$9474ef00$0201a8c0@brinstar>
Paul Jarc writes:
> Edit passwd.in however you like, and then run cdbmake when you're
> ready to update the database.  The input format is a bit hard to edit
> by hand, since you have to get the lengths right.  You may find it
> more convenient to edit a file containing lines like "b1ff:p455w0rd",
> and then use a Perl script or whatever to produce
> "+4,8:b1ff->p455w0rd" from that.  Remember that cdbmake's input must
> end with an empty line.

awk -F: '
{
  do {
    print "+" length($1) "," length($2) ":" $1 "->" $2
  } while (getline)
  print ""
}'

-- 
David Phillips <[email protected]>
http://david.acz.org/