3 # Replace all shell script headers with
4 if [ $# -ne 1 -o ! -d "$1" ]; then
5 echo "Usage: `basename $0` <dir>"
7 echo "Replaces all occurrences of #!/bin/sh with #!/usr/xpg4/bin/sh inside a directory tree."
13 echo "Usage: inlineReplace <string1> <string2> <file1> .. <filen>"
15 echo "Replaces all occurrences of string1 by string2 in files."
16 echo "(replacement of sed -i on those systems that don't support it)"
26 if grep "$FROMSTRING" "$f" >/dev
/null
29 sed -e "s@$FROMSTRING@$TOSTRING@g" "${f}"_bak
> "$f"
35 find $1 -type f
-print | \
37 inlineReplace
'^#\!/bin/sh' '#\!/usr/xpg4/bin/sh' "$f"