Running script from BBEdit/TextWrangler gives "tput: No value for $TERM and no -T specified" If I write a script in BBEdit/TextWrangler, e.g.

#!/usr/bin/env python
print 1234


and choose "Run" from the #! menu, I get this in a new document:

1234
tput: No value for $TERM and no -T specified
tput: No value for $TERM and no -T specified
tput: No value for $TERM and no -T specified


How do I get rid of those 3 extra lines?
The solution is to enclose any use of tput in .bash_profile within a test for interactive shell, i.e.:

if [[ $- == *i* ]]; then
  #tput command
  #tput command
  #tput command
  #etc
fi