#!/bin/sh
# ps2psgz.sh
# Check links in current directory that point to *.ps files, to see whether 
# the PS file has been gzipped.  If it has, change the link to point to 
# the .ps.gz file instead.

for file in `ls *.ps`
do
    if [ -r /cdf/pub/$file ]; then
	# link is OK, leave it alone
	echo "File $file is still PS."
    elif [ -r /cdf/pub/${file}.gz ]; then
	ln -sf /cdf/pub/${file}.gz $file
	echo Link for file $file converted to ${file}.gz
    else
	echo Did not find $file or ${file}.gz
    fi
done

