#!/usr/pkg/bin/perl # # token2path - converts a INN outgoing file containing a list # of tokens into a list of paths # $Id$ if ($#ARGV != -1) { $INFILE = $ARGV[0]; $OUTFILE = $ARGV[1]; } else { die "Usage: token2path infile outfile" } open(IN,"<$INFILE") || die "Cannot open $INFILE"; while() { $_ =~ s/\n//g; push(@List,$_) } close(IN); # convert tokens to article paths open(OUT,">>$OUTFILE") || die "Cannot open $OUTFILE"; foreach $token (@List) { $path = `/usr/pkg/inn/bin/sm -i '$token'`; $path =~ s/\:\ /\//g; print OUT "$path" } close(OUT);