#!/bin/sh # # DOCTOR TXT... Convert all .DOC files to .TXT files, in the .desc # files as well as in the actual directory. echo "Converting all #'s to .-'s...." if [ "` ls | grep '#' | wc -l`" = " 0" ] then echo "...except there aren't any." exit 0 fi echo "" for each in *#* do CONVERT=`echo $each | sed 's/#/-/'` if [ -f $CONVERT ] then echo "Oops, there's already a $CONVERT. Not changing." else echo "Renaming $each to $CONVERT..." mv $each $CONVERT DESCRIPTION=`grep $each .descs | cut -d' ' -f 2-` echo "$CONVERT $DESCRIPTION" >>.descs fi done /textfiles/ferret