You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@httpd.apache.org by Doug MacEachern <do...@opengroup.org> on 1997/07/22 20:37:26 UTC

Re: another thing for dbmmanage

Brian Behlendorf <br...@hyperreal.org> wrote:

> An "import" command which would read stdin and build a dbm file,
> with the format of stdin being the same as the output of the "view"
> command.  So you could do things like
> 
>   oldmachine[1]> dbmmanage userbase view > portablefile
>   newmachine[1]> cat portablefile | dbmmanage userbase import
> 
> to translate a platform-specific DBM file between machines.

okay, adding this to the last version I sent will do the trick:

sub dbmc::import {
    while(defined($_ = <STDIN>) and chomp) {
	dbmc->add(($key,$value) = split / = /);
    }
}

hmm, maybe the format of `view' should be $key:$value, the same
text-file format that mod_auth understands, then `import' could be
used to import existing .htpasswd text-files too.

-Doug