$Id: README,v 1.8 2002/03/25 11:33:44 peter Exp $ dteq peter@dataloss.nl http://www.dataloss.nl/software/dteq/ dteq executes a database query and reports the output based on a template. It's useful for auto-generating authentication databases, nameserver configs, whatever you can come up with. Drivers for mySQL databases and cdb files are available. Read INSTALL for compilation and installation instructions. I will start explaining the usage with some examples: bash$ mysqlteq 'select login,uid,gid from users' 'User $ has uid $ and gid $' \ User john has uid 10875 and gid 100 User peter has uid 12929 and gid 100 User sabri has uid 2231 and gid 100 ... and so on bash$ mysqlteq 'select login,passwd,uid,gid,realname,homedir,shell from users' \ ':' john:hashgoeshere1:10875:100::/home/guest/john:/dev/null peter:hashgoeshere2:12929:100::/home/users/peter:/usr/local/bin/bash sabri:hashgoeshere3:2231:100::/home/users2/sabri:/usr/local/bin/bash ... and so on These two examples show the two main modes of operation: - numbered templates: one $ for every variable - unnumbered templates: inserted in between every variable. (future versions of mysqlquery will support more flexible syntax). You can also use mysqlquery for updating queries like UPDATE and INSERT. If you do, the template will be ignored (I suggest using a very simple one like ':' because it will still be parsed once). Example: bash$ mysqlteq ':' 'DELETE FROM users WHERE login="john"' 1 The '1' is the number of rows affected. For authentication, it uses a file in your homedir called .mysqlteqrc or .pgsqlteqrc that should look like hostname username password database The cdb driver needs no authentication, and takes two query arguments: the filename and the key. Example: bash$ cdbteq /var/qmail/control/ip/tcp.smtp.cdb 127. '[$]' [+RELAYCLIENT=] Have fun!