0

I have a bash script which simply activate a python virtualenv and execute a python script.

#!/bin/bash
. /usr/local/bin/utils.sh
. /home/fold/.bash_profile
set -eu -o pipefail

script_name=main_ETL
script_file="/srv/scripts/${script_name}.py"
log_file="/srv/scripts/logs/${script_name}.log"

set +u
source /srv/python/virtualenvs/bin/activate
set -u

log "Starting..." | tee -a ${log_file}
python "$script_file"
log "Execution completed" | tee -a ${log_file}

I save the standard output of crontab execution in a file. Cron job get executed correctly but first line of file is always :

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

How can i fix this and make that warning/error disappear?

Rui F Ribeiro
  • 55,929
  • 26
  • 146
  • 227
  • 1
    set TERM variable : $TERM is read and interpreted by the terminfo system. terminfo also refers to the database of terminal descriptions which you can find on most systems in /usr/share/terminfo. $TERM must match one of the entries in that database. There was also an older library called termcap which had fewer capabilities, but terminfo has replaced it. In modern systems, terminfo is part of the ncurses library. – francois P May 07 '19 at 09:28
  • 1
    you can set in in bashrc profile or in each scripts – francois P May 07 '19 at 09:31
  • 1
    Do you use `tput` in `/usr/local/bin/utils.sh` or `/home/inrisalto/.bash_profile`? If you can modify the script that contains `tput`, maybe you can use a condition to skip the `tput` command if the shell is not interactive. – Bodo May 07 '19 at 09:38
  • Also see my answer at [linux + tput: No value for $TERM and no -T specified](https://unix.stackexchange.com/a/517549/100397) – roaima May 07 '19 at 11:28

0 Answers0