diff -Naur oprofile-0.9.5.orig/utils/opcontrol oprofile-0.9.5/utils/opcontrol
--- oprofile-0.9.5.orig/utils/opcontrol	2009-08-17 21:08:09.000000000 -0400
+++ oprofile-0.9.5/utils/opcontrol	2009-08-17 21:12:38.000000000 -0400
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!/bin/bash
 #
 # opcontrol is a script to control OProfile
 # opcontrol --help and opcontrol --list-events have info
@@ -1964,7 +1964,8 @@
 if test -z "$OPDIR"; then
 	BINDIR="/usr/bin"
 	OPCONTROL=`$BINDIR/which $0`
-	OPDIR=`$BINDIR/dirname $OPCONTROL`
+	DIRNAME=`which dirname`
+	OPDIR=`$DIRNAME $OPCONTROL`
 fi
 
 PATH=$OPDIR:/usr/local/bin:/usr/local/sbin:/bin:/sbin:/usr/bin:/usr/sbin
