1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34
|
#!/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
|