File: fixpaths

package info (click to toggle)
libcdk-perl 4.9.10-1
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 884 kB
  • ctags: 411
  • sloc: perl: 6,419; makefile: 33; sh: 27
file content (34 lines) | stat: -rwxr-xr-x 674 bytes parent folder | download | duplicates (6)
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