I made sure that TERM was defined in the .bashrc.
However, when running ssh in batch mode I get:
$ ssh pc-lab7 "echo $TERM; echo $0"
TERM environment variable not set.
linux
-bash
If I run ssh in interactive mode, I do not see this error.
How can I eliminate this error message?
Use of -t
option to ssh allocates tty
-t Force pseudo-tty allocation. This can be used to execute arbitrary
screen-based programs on a remote machine, which can be very useful,
e.g. when implementing menu services. Multiple -t options force tty
allocation, even if ssh has no local tty.
I finally found the reason for this annoying "TERM environment variable not set" warning.
It turned out that when the ssh is executing in batch mode without an interactive user, a call to 'clear' command in a startup script will yield this error.
Commenting out the 'clear' line in the script fixed the issue for me.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With