diff --git a/sc2/subst b/sc2/subst index d8615ba63..aa6329475 100755 --- a/sc2/subst +++ b/sc2/subst @@ -1,7 +1,15 @@ -#!/bin/bash -#!/usr/bin/bash +#!/bin/sh # Substitute a string in many files. By Serge van den Boom, 20020826 +# We need bash functionality. Executing bash with the shebang won't be +# portable as the location of bash differs. +SHELLFILE="$_" +case "$SHELLFILE" in + sh|*/sh) + exec bash "$0" "$@" + ;; +esac + if [ $# -eq 0 ]; then { echo "subst: substitute a string in a lot of files."