Technical information on this site may be out of date : no updates since 2015

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

February 18 2010 : posted under drupal linux drush bash

The drush script which provides command line access to drupal functionality emits an error message when run as a cron job

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

# If it is not exported determine and export the number of columns.
if [ -z $COLUMNS ]; then
  export COLUMNS=$(tput cols)
fi

I presume drush uses this information to calculate layout of output.

However when running as a cron job COLUMNS is not set and tput gives the above error.

To resolve this specify a COLUMNS value in your cron job, setting an appropriate size for viewing in email

cron now runs the following for me.

#!/bin/bash

cd /var/www/mysite/public_html

COLUMNS=80 /home/me/bin/drush cron