#!/bin/sh # script to copy files from one dir to a second having the `.pc' extension # and then to convert all the ascii files to PC format #<,RW,PH,DS,TH,TT,D2,ED,E2,DS,D9,D8,D1,DA,A1,IM> if [ $# -lt 1 ] || [ ! -d "$1" ] || [ -d $1.pc ] then echo "Usage: $0 directory" echo "directory.pc can not already exist" exit 1 fi umask 002 cp -rp $1 $1.pc chmod +w $1.pc cd $1.pc pwd #add .ftc to tuning curve files for ff in [0-9][0-9][0-9][0-9][0-9] do mv $ff $ff.ftc done # for ss in `file * | sed -n " # /:.*text/b text # /:.*script/b text # /:.*commands/b text # d # :text # s/:.*//p # " # ` #for ss in rw ph ds th tt d2 ed e2 ds d9 d8 d1 da a1 im ftc for ss in a1 c0 c1 c2 ct cl cc cli d1 d2 d2 ds d9 d8 da ed e2 ftc \ h2 hd im in km lv n1 p2 pt ph q2 rf rw sc sd ss th tt zx do for nn in *.$ss do if [ ! -f $nn ]; then continue; fi tr < $nn > tmpfile '\015' '\012' && mv tmpfile $nn addcr $nn done done rm ,* # cp ../$1/*.rt .