From 241dc6d52dc5658fe357e0a15da0ca9e86ebecdd Mon Sep 17 00:00:00 2001 From: meep-eep Date: Mon, 3 Feb 2003 17:43:35 +0000 Subject: [PATCH] Doesn't depend on bash being in any specific location anymore. git-svn-id: svn://svn.code.sf.net/p/sc2/code/trunk@659 8092fc87-c524-0410-9efc-e669fe64eaf9 --- sc2/subst | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) 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."