On Sat, 2006-01-21 at 16:21 -0700, Paul R. Ganci wrote:
According to the man page for htdbm:
NAME htdbm - Manipulate DBM password databases
SYNOPSIS <snipped>
htdbm -l [ -TDBTYPE ]
<snipped>
-l Print each of the usernames and comments from the database
on stdout.
yet when I execute htdbm I am finding that the output of the command is going to stderr not stdout. I have proved this by trying the following two commands:
$ htdbm -l -TDB passwords > junk; wc junk Dumping records from database -- ./passwords Username Comment <snipped>
0 0 0 junk
$ /usr/bin/htdbm -l -TDB ./passwords >&junk; wc junk 28 37 1034 junk
Note in the first command the output still goes to the screen despite the stdout redirect with ">". In the second command line I added the "&" ito redirect stderr to the file. This time note that there is no htdbm output to the screen and that the file junk now contains the expected data. This is clearly a bug. Does anyone know of a work around to this problem or where I can find a RPM for dbmmanage?
It may or may not be a bug (it does what you say, but I am not smart enough about it to know if it is a bug or a feature), but this is part of the main httpd (apache) rpm. So there would not be an RPM that specifically fixes this.
There are many different configure switches dealing with stderr and htdbm in apache when compiling it (we compile it exactly as they do upstream).
Doing a little bit more research, there is a switch ( -n ) that allows output to stdout ... maybe you need to use that switch if you want to get output to stdout.