#!/bin/sh # Runs GatherStats for all files in the directory specified as first # argument # writes the result in the file specified as second argument # RunGatherStats corpus.tag BrownStats.data # if no argumnets prints usage case $# in 1) ;; 2) ;; *) echo "Usage: $0 input_directory output_file" >&2; exit 1;; esac # First argument is the directory for .tag files BROWN=$1/???.tag # Second argument is the files for statistics # if no second argument prints at stdout OUT=$2 if [ -f $OUT ] then /usr/bin/rm $OUT fi for x in $BROWN; do # echo $x; echo `basename $x`; GatherStats $x >> $OUT done