I assume that this is the change intending for this to be sourceable?  I have not been able to do so in either bash or python so far.  (When I try to source it in python, I get the following complaint:
/bin/sh: 86: ./baxter.sh: Bad substitution
readlink: missing operand
Try `readlink --help' for more information.
basename: missing operand
Try `basename --help' for more information.
/bin/sh: 100: ./baxter.sh: Syntax error: redirection unexpected
)