#!/bin/sh
# $Id: fixpaths,v 1.1 2002/07/24 23:00:32 tom Exp $
#
# Run this script to update the paths in scripts under the current directory
# which have perl's pathname, so they can be run in your configuration.
#
PERL=`which perl`
TEXT="#!$PERL -w"
for name in `find . -type f -print`
do
	case $name in
	*~)	;;
	*)
		head=`head -1 $name`
		case $head in #(vi
		\#!*perl*) #(vi
			echo process $name
			if test "$TEXT" != "$head" ; then
				echo "...updating "
				rm -f ${name}~
				mv ${name} ${name}~
				sed -e "s@$head@$TEXT@" ${name}~ >${name}
				chmod +x ${name}
			else
				echo "...unchanged"
			fi
			;;
		*)
			# echo ignored $name
			;;
		esac
		;;
	esac
done
