Why did you add basename? The whole point of using which is to get the full path to the executable, because backticks are unstable in whether they use the same shell as the one you're in (and therefore might have a different PATH).