Changeset 28663

Show
Ignore:
Timestamp:
20.11.2013 18:22:16 (6 years ago)
Author:
ak19
Message:

Fixing it up so the number of commandline arguments and the way they're handled match txt2db (gdb version).

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • main/trunk/greenstone2/bin/script/txt2jdb.pl

    r28662 r28663  
    3434 
    3535# Save you having to type in the mouthful: 
    36 cat file.txt | java -cp $GSDLHOME/lib/java/jdbm.jar:$GSDLHOME/bin/java/JDBMWrapper.jar Txt2Jdb jdbm-file.jdb 
     36(cat file.txt |) java -cp $GSDLHOME/lib/java/jdbm.jar:$GSDLHOME/bin/java/JDBMWrapper.jar Txt2Jdb jdbm-file.jdb 
    3737# 
    3838# for Unix, or 
    3939# 
    40 type file.txt | java -cp %GSDLHOME%\lib\java\jdbm.jar;$GSDLHOME\bin\java/\DBMWrapper.jar Txt2Jdb jdbm-file.jdb 
     40(type file.txt |) java -cp %GSDLHOME%\lib\java\jdbm.jar;$GSDLHOME\bin\java/\DBMWrapper.jar Txt2Jdb jdbm-file.jdb 
    4141# 
    4242# for Windows. 
     
    5555use File::Basename; 
    5656 
    57 if (scalar(@ARGV)< 1) { 
     57if (scalar(@ARGV) != 1) { 
    5858    my ($progname,$dir) = &File::Basename::fileparse($0); 
    5959 
     
    7777} 
    7878 
    79 #&util::envvar_prepend("CLASSPATH",$jdbm_jar); 
    80 #&util::envvar_prepend("CLASSPATH",$jdbmwrapper_jar); 
    81  
    82 my $cmd = ($ENV{'GSDLOS'} =~ m/windows/) ? "type" : "cat"; 
    83 $cmd .= " $ARGV[0] | java -cp \"$classpath\" Txt2Jdb ".$ARGV[1]; 
     79my $cmd = "java -cp \"$classpath\" Txt2Jdb ".$ARGV[0]; 
    8480 
    8581if (system($cmd)!=0) {