I generally agree with your response. My only slight irritation is with how you wrote out the Python code. It looks a bit...uglier? and more verbose than it needs to be, especially compared to the others. This looks better to me:
from commands import getoutput
if getoutput('which bash') == '/bin/bash':
do_stuff()
Although if your goal is to determine if e.g. bash is located in /bin, then I would do:bash:
if [ -e '/bin/bash' ];
then
do_stuff
fi
(I don't know Ruby.)Python:
import os.path
if os.path.exists('/bin/bash'):
do_stuff()
I know I'm just splitting hairs. :)