#!/bin/csh

set PARTITURDIR = /sun1/schiel/bas/SI1000/doc/partitur

# set verbose # debugging

# Actually do the argument parsing here

while ( "$1" != "" )
        switch ("$1")
        case *=*:
                set key = `echo "$1" | cut -d= -f1`
                set val = `echo "$1" | cut -d= -f2`
                eval "set $key "= \'"$val"\'
                unset key val
                shift
                breaksw
        default:
                break
        endsw
end

# end option parser

foreach file ( $PARTITURDIR/ck/* $PARTITURDIR/ht/* )
    mkdir ~beringer/$file:h:t
    mkdir /raid/r31/PD1/par/$file:h:t
    grep "MAU:" $file:r.par | sed 's/\&/<p:>/g' | gawk -f /sun1/beringer/autoseg/mau2par.awk > ! /sun1/beringer/$file:h:t/$file:t.final
    cat $file:r.par  | grep -v 'MAU'|cat - /sun1/beringer/$file:h:t/$file:t.final > /raid/r31/SI1000/par/$file:h:t/$file:t
end


