/usr/bin/grokevt-dumpmsgs is in grokevt 0.4.1-7.
This file is owned by root:root, with mode 0o755.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 | #!/usr/bin/python
# This script dumps the contents of message databases built by grokevt-ripdll.
#
# Copyright (C) 2006-2007 Timothy D. Morgan
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation version 2 of the
# License.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# vi:set tabsize=4:
# $Id: grokevt-dumpmsgs 105 2007-03-29 01:00:17Z tim $
import sys
import os
import anydbm
import grokevt
def usage():
sys.stderr.write("USAGE:\n")
sys.stderr.write(" %s <MESSAGE_DB1> [<MESSAGE_DB2> ...]\n\n"\
% os.path.basename(sys.argv[0]))
sys.stderr.write("grokevt-dumpmsgs dumps the contents of message databases\n")
sys.stderr.write("built previously by grokevt-ripdll.\n")
if len(sys.argv) < 2:
usage()
sys.exit(os.EX_USAGE)
for dbfile in sys.argv[1:]:
if not os.access(dbfile, os.R_OK):
sys.stderr.write("ERROR: DB file could not be read.")
sys.exit(1)
db = anydbm.open(dbfile, 'r')
if grokevt.template_encoding == grokevt.output_encoding:
for key in db.keys():
print '%s,%s' % (key, grokevt.quoteString(db[key], '\\,"'))
else:
for key in db.keys():
msg = db[key].decode(grokevt.template_encoding)
msg = grokevt.quoteString(msg.encode(grokevt.output_encoding,'replace'),
'\\,"')
print '%s,%s' % (key, msg)
db.close()
|