#! /bin/bash

nagyg_maths=/home/nagyg/Maths/2004

# determine all ASCII files

echo "Determining all ASCII files"

cd $nagyg_maths/pkg
files=""
for i in $( find ) ;
do
    a=$( file -i $i | grep text/plain )
    if [  "$a" != "" ]; then
	files="$files $i"
    fi	
done


# turn all ASCII files but loops_manual.txt to UNIX format

echo "Turning all ASCII files but loops_manual.txt to UNIX format"
for i in $files ;
do
    dos2unix $i &> /dev/null
done
unix2dos loops/doc/loops_manual.txt &> /dev/null

# chmod clean_docus, make_docus, pack 

echo "Change mode for clean_docus, make_docus and pack"
chmod 	uog+x \
	loops/etc/make_docus \
	loops/etc/clean_docus \
	loops/etc/pack 

