NCI-CGR / IlluminaSequencingAnalysis

All Illumina Sequencing Related project from Xin will be recorded in this repo
0 stars 0 forks source link

CustomizedQC: unexpected warning email "tput: No value for $TERM and no -T specified" #15

Open lxwgcool opened 3 years ago

lxwgcool commented 3 years ago

Phenomenon

Get the warning email when corntab job been processed. The warning email is below:

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
tput: No value for $TERM and no -T specified
tput: No value for $TERM and no -T specified

Reason

Here is the comments from Biowulf administrator

The problem is these lines in your .bashrc:

#Set Color
export LS_COLORS=$LS_COLORS:'*.pro=00;35'
green=$(tput setaf 2)
red=$(tput setaf 1)
blue=$(tput setaf 4)
bold=$(tput bold)
reset=$(tput sgr0)
export PS1='\[$red\]\u@\[$green\]\h\[$reset\]:\[$blue\]\w\[$reset\]\$ '

The tput commands only make sense in the context of an interactive shell. They make no sense from a cron job. 

Solution

(1) remove ". ~/.bashrc" In crontab job (2) add "source /etc/profile.d/modules.sh" in my wrapper script.