- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - Linux
- >
- Re: SSH session: "tput: No value for $TERM and no ...
Operating System - Linux
1820271
Members
3178
Online
109622
Solutions
Forums
Categories
Company
Local Language
юдл
back
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Discussions
Forums
Forums
Discussions
юдл
back
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Blogs
Information
Community
Resources
Community Language
Language
Forums
Blogs
Go to solution
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-10-2010 09:43 AM
тАО09-10-2010 09:43 AM
During an ssh batchmode ssh session I encounter this message which I've been unable to suppress which is sent only to the session screen:
tput: No value for $TERM and no -T specified
This is one example of the command, variants attempted:
ssh -q -o "BatchMode yes" $HOSTNAME ls | grep $STRING > /dev/null 2>&1)
The message string only appears on few nodes - and always the same nodes - out of a 100 or so. I cannot alter any settings on these nodes I am establishing the SSH connection to. I would just like to suppress the message.
Any suggestions ?
tput: No value for $TERM and no -T specified
This is one example of the command, variants attempted:
ssh -q -o "BatchMode yes" $HOSTNAME ls | grep $STRING > /dev/null 2>&1)
The message string only appears on few nodes - and always the same nodes - out of a 100 or so. I cannot alter any settings on these nodes I am establishing the SSH connection to. I would just like to suppress the message.
Any suggestions ?
Solved! Go to Solution.
3 REPLIES 3
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-10-2010 10:33 AM
тАО09-10-2010 10:33 AM
Solution
A SSH command line that specifies a remote command will normally run in "non-interactive mode". One of the consequences is that no pseudo-TTY will be assigned for the connection in the remote host.
This happens because /etc/profile, ~/.profile or some other login script on those nodes contains a tput command that is executed unconditionally - even if the session does not have a TTY associated with it. (The HP-UX default login scripts have had this issue for ages.)
The true fix would be to find the tput commands on those nodes and make them conditional. For example, on sh, ksh, bash and other Bourne-style shells, you could replace the command:
tput
with:
tty -s && tput
This will run the tput command only if the session is interactive and has a TTY assigned. ("tput" is a terminal initialization/configuration command, so running it when there is no TTY makes no sense anyway.)
If you cannot modify the login scripts on the remote nodes, a workaround is to tell SSH to request a TTY even if the session will be non-interactive: add the option "-t" to the ssh command line. For example:
ssh -tq -o "BatchMode yes" ...
If you run this command from crontab or some other non-interactive context, there won't be a local TTY either. In that case, you will need "-tt" instead of "-t" to implement the workaround:
ssh -ttq -o "BatchMode yes" ...
MK
This happens because /etc/profile, ~/.profile or some other login script on those nodes contains a tput command that is executed unconditionally - even if the session does not have a TTY associated with it. (The HP-UX default login scripts have had this issue for ages.)
The true fix would be to find the tput commands on those nodes and make them conditional. For example, on sh, ksh, bash and other Bourne-style shells, you could replace the command:
tput
with:
tty -s && tput
This will run the tput command only if the session is interactive and has a TTY assigned. ("tput" is a terminal initialization/configuration command, so running it when there is no TTY makes no sense anyway.)
If you cannot modify the login scripts on the remote nodes, a workaround is to tell SSH to request a TTY even if the session will be non-interactive: add the option "-t" to the ssh command line. For example:
ssh -tq -o "BatchMode yes" ...
If you run this command from crontab or some other non-interactive context, there won't be a local TTY either. In that case, you will need "-tt" instead of "-t" to implement the workaround:
ssh -ttq -o "BatchMode yes" ...
MK
MK
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-10-2010 11:07 AM
тАО09-10-2010 11:07 AM
Re: SSH session: "tput: No value for $TERM and no -T specified:
Your diagnosis is entirely correct. The remote host's bashrc does in fact contain code as you describe. I put in "t" switch and it worked without receiving the unwanted message.
Thanks.
Thanks.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-10-2010 11:13 AM
тАО09-10-2010 11:13 AM
Re: SSH session: "tput: No value for $TERM and no -T specified:
Question was answered fully.
The opinions expressed above are the personal opinions of the authors, not of Hewlett Packard Enterprise. By using this site, you accept the Terms of Use and Rules of Participation.
Company
Learn About
News and Events
Support
© Copyright 2025 Hewlett Packard Enterprise Development LP