#!/bin/csh # must be called in 03owlt # usage # copylong 'old-file1' 'new-file1' ... 'old-filen' 'new-filen' # where each file name is: # with a leading directory # without an .rdf suffix. # e.g. # copylong I5.2/Manifest001 sameAs/Manifest003 I5.2/premises001 sameAs/nonconclusions003 I5.2/conclusions001 sameAs/premises003 set TMPDIR=/tmp/c.$$ mkdir $TMPDIR set SED=$TMPDIR/change.sed set DOALL=$TMPDIR/script1 set MOVEALL=$TMPDIR/script2 set N=1 set OPTIONS= echo $1 switch ( $1 ) case -r: set OPTIONS=reverse shift breaksw case -n: set OPTIONS=negate shift breaksw default: endsw while ( $# > 1 ) set OLD=$1 shift set NEW=$1 shift echo mv $TMPDIR/$N $NEW.rdf >> $MOVEALL echo sed -f $SED $OLD.rdf '>' $TMPDIR/$N >> $DOALL echo "s|$OLD|DDDDD/FFFFF|g" >> $SED echo "s|$OLD:t|FFFFF|g" >> $SED echo "s|DDDDD|$NEW:h|g" >> $SED echo "s|FFFFF|$NEW:t|g" >> $SED @ N = $N + 1 end switch ( $OPTIONS ) case reverse: echo s/first/SECOND/g >> $SED echo s/second/first/g >> $SED echo s/SECOND/second/g >> $SED echo s/premiseDocument/CONCLUSIONDocument/ >> $SED echo s/conclusionDocument/premiseDocument/ >> $SED echo s/CONCLUSIONDocument/conclusionDocument/ >> $SED breaksw case negate: echo s/PositiveEntailmentTest/NEGativeEntailmentTest/ >> $SED echo s/NegativeEntailmentTest/PositiveEntailmentTest/ >> $SED echo s/NEGative/Negative/ >> $SED echo s/ConsistencyTest/INConsistencyTest/ >> $SED echo s/InconsistencyTest/ConsistencyTest/ >> $SED echo s/INConsist/Inconsist/ >> $SED breaksw endsw source $DOALL source $MOVEALL