From bad@ora.de Mon Jun 19 19:06:52 1995 Received: from orade.ora.de by metronet.com with SMTP id AA29796 (5.67a/IDA1.5hp for ); Mon, 19 Jun 1995 14:05:34 -0500 Return-Path: Received: (bad@localhost) by orade.ora.de (8.6.12/8.6.4) id VAA15821 for wjm@metronet.com; Mon, 19 Jun 1995 21:06:52 +0200 From: bad@ora.de (Christoph Badura) Message-Id: <199506191906.VAA15821@orade.ora.de> Subject: Re: Update for perlinfo/scripts archive To: wjm@metronet.com (Bill Middleton) Date: Mon, 19 Jun 1995 21:06:52 +0200 (MET DST) In-Reply-To: <199506152021.AA08969@metronet.com> from "Bill Middleton" at Jun 15, 95 03:21:01 pm X-Mailer: ELM [version 2.4 PL23] Content-Type: text Content-Length: 5055 Status: OR Bill Middleton wrote: > Sure, thanks. Just mail me the latest shar, and the path (if possible) > to the current location in the archive. The path was http://www.metronet.com/1/perlinfo/scripts/dbase/dbmtools.shar Here it is: #! /bin/sh # This is a shell archive. Remove anything before this line, then unpack # it by saving it into a file and typing "sh file". To overwrite existing # files, type "sh file -c". You can also feed this as standard input via # unshar, or by typing "sh 'dbdump' <<'END_OF_FILE' X: #!/usr/bin/perl Xeval 'exec /usr/bin/perl -S $0 ${1+"$@"}' X if $running_under_some_shell; X#!/usr/local/bin/perl X Xrequire 'getopts.pl'; Xrequire 'uvtdb.pl'; X X$options = 'd'; X X&Getopts($options); X X$debug = 1 if $opt_d; X X$dbname = $ARGV[0]; X Xdie "Database \"$dbname\" doesn't exist" if !&dbexists($dbname); X Xdbmopen(db, $dbname, 0664) || die "Couldn't dbmopen \"$dbname\""; X Xforeach $key sort(keys %db) { X print "$key\t$db{$key}\n"; X} Xdbmclose(db); Xexit; END_OF_FILE if test 453 -ne `wc -c <'dbdump'`; then echo shar: \"'dbdump'\" unpacked with wrong size! fi chmod +x 'dbdump' # end of 'dbdump' fi if test -f 'dbfetch' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'dbfetch'\" else echo shar: Extracting \"'dbfetch'\" \(583 characters\) sed "s/^X//" >'dbfetch' <<'END_OF_FILE' X: #!/usr/bin/perl Xeval 'exec /usr/bin/perl -S $0 ${1+"$@"}' X if $running_under_some_shell; X#!/usr/local/bin/perl X Xrequire 'getopts.pl'; Xrequire 'uvtdb.pl'; X X$usage = "dbfetch database key...\n"; X X$options = 'd'; X X&Getopts($options); X X$debug = 1 if $opt_d; X X&usage unless $#ARGV >= 0; X X$dbname = shift @ARGV; X Xdie "Database \"$dbname\" doesn't exist" if !&dbexists($dbname); X Xdbmopen(db, $dbname, 0664) || die "Couldn't dbmopen \"$dbname\""; X Xwhile ($key = shift @ARGV) { X print "$key\t$db{$key}\n"; X} Xdbmclose(db); X Xexit 0; X Xsub usage { X print STDERR "usage: ", $usage; X exit 1; X} X END_OF_FILE if test 583 -ne `wc -c <'dbfetch'`; then echo shar: \"'dbfetch'\" unpacked with wrong size! fi chmod +x 'dbfetch' # end of 'dbfetch' fi if test -f 'dbload' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'dbload'\" else echo shar: Extracting \"'dbload'\" \(404 characters\) sed "s/^X//" >'dbload' <<'END_OF_FILE' X: #!/usr/bin/perl Xeval 'exec /usr/bin/perl -S $0 ${1+"$@"}' X if $running_under_some_shell; X#!/usr/local/bin/perl X Xrequire 'getopts.pl'; Xrequire 'uvtdb.pl'; X X$options = 'd'; X X&Getopts($options); X X$debug = 1 if $opt_d; X X$dbname = shift @ARGV; X Xdbmopen(db, $dbname, 0664) || die "Couldn't dbmopen \"$dbname\""; X Xwhile (<>) { X chop; X ($key, $value) = split(/\t/); X $db{$key} = $value; X} Xdbmclose(db); Xexit; END_OF_FILE if test 404 -ne `wc -c <'dbload'`; then echo shar: \"'dbload'\" unpacked with wrong size! fi chmod +x 'dbload' # end of 'dbload' fi if test -f 'dbstore' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'dbstore'\" else echo shar: Extracting \"'dbstore'\" \(557 characters\) sed "s/^X//" >'dbstore' <<'END_OF_FILE' X: #!/usr/bin/perl Xeval 'exec /usr/bin/perl -S $0 ${1+"$@"}' X if $running_under_some_shell; X#!/usr/local/bin/perl X Xrequire 'getopts.pl'; Xrequire 'uvtdb.pl'; X X$usage = "dbstore database [ key value ]...\n"; X X$options = 'd'; X X&Getopts($options); X X$debug = 1 if $opt_d; X X&usage unless $#ARGV >= 0; X X$dbname = shift @ARGV; X Xdbmopen(db, $dbname, 0664) || die "Couldn't dbmopen \"$dbname\""; X Xwhile ($#ARGV >= 1) { X $key = shift @ARGV; X $value = shift @ARGV; X $db{$key} = $value; X} Xdbmclose(db); X Xexit 0; X Xsub usage { X print STDERR "usage: ", $usage; X exit 1; X} X END_OF_FILE if test 557 -ne `wc -c <'dbstore'`; then echo shar: \"'dbstore'\" unpacked with wrong size! fi chmod +x 'dbstore' # end of 'dbstore' fi if test -f 'uvtdb.pl' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'uvtdb.pl'\" else echo shar: Extracting \"'uvtdb.pl'\" \(218 characters\) sed "s/^X//" >'uvtdb.pl' <<'END_OF_FILE' X# X# libary functions to handle databases X# $Id$ X# X X# X# check wether given database exists X# Xsub dbexists { X local($dbname) = @_; X if (!-f ($dbname . ".pag") || !-f ($dbname . ".dir")) { X return 0; X } X return 1; X} X X1; END_OF_FILE if test 218 -ne `wc -c <'uvtdb.pl'`; then echo shar: \"'uvtdb.pl'\" unpacked with wrong size! fi # end of 'uvtdb.pl' fi echo shar: End of shell archive. exit 0 -- Christoph Badura Work +49 228 97024-36 O'Reilly/International Thomson Verlag Home +49 721 606137 HotJava -- NeWS in you Web browser