File: 16_python_shebang.sh

package info (click to toggle)
bugzilla 3.0.4.1-2%2Blenny2
  • links: PTS
  • area: main
  • in suites: lenny
  • size: 4,328 kB
  • ctags: 29
  • sloc: sh: 525; makefile: 160; perl: 98
file content (17 lines) | stat: -rw-r--r-- 302 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#! /bin/sh
# Where to find Python on Debian systems.

set -e

echo "> $0 $*"

for f in `find $1 -type f`; do
	for s in '#.*!.*python.*'; do
		if grep -q "^$s" $f; then
			cp -p $f $f.new
			sed -e "s,^$s,#! /usr/bin/python,g" $f > $f.new
			diff -u $f $f.new || true
			mv -f $f.new $f
		fi
	done
done