Bug 26922: Regression tests
[koha.git] / misc / exportauth.pl
blobc036b17063acac46060eb53c9ff3d303880d6d1c
1 #!/usr/bin/perl
2 ## This script allows you to export a rel_2_2 bibliographic db in
3 #MARC21 format from the command line.
6 use strict;
7 #use warnings; FIXME - Bug 2505
8 BEGIN {
9 # find Koha's Perl modules
10 # test carefully before changing this
11 use FindBin;
12 eval { require "$FindBin::Bin/kohalib.pl" };
15 use Koha::Script;
16 use C4::Context;
17 use C4::Biblio;
18 use C4::Auth;
19 my $outfile = $ARGV[0];
20 open(my $fh, '>', $outfile) or die $!;
21 my $dbh=C4::Context->dbh;
22 #$dbh->do("set character_set_client='latin5'");
23 $dbh->do("set character_set_connection='utf8'");
24 #$dbh->do("set character_set_results='latin5'");
25 my $sth=$dbh->prepare("select marc from auth_header order by authid");
26 $sth->execute();
27 while (my ($marc) = $sth->fetchrow) {
28 print $fh $marc;
30 close($fh);