I have a customized prompt with colors (using tput) and every time I start a non-interactive session in the server I get a bunch of errors.
For instance if I start a non-interactive session like this:
ssh root@hostname6 "echo 'hello' ; echo $TERM"
The output I get is:
hello
xterm
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
tput: No value for $TERM and no -T specified
tput: No value for $TERM and no -T specified
stdin: is not a tty
So the $TERM variable has a value even when the session is non-interactive.
What condition do I have to detect so that when I start a non-interactive shell the prompt customization part is omited??