- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - Linux
- >
- stdin: is not a tty
Categories
Company
Local Language
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
Discussions
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
Community
Resources
Forums
Blogs
- 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
11-17-2005 06:08 PM
11-17-2005 06:08 PM
stdin: is not a tty
When I send commands remotely over ssh to some Linux servers I get a message printed to stderr -- "stdin: is not a tty”. I don't want to see this message, but I want to see any other error messages printed to stderr (I want to know if I for example make a typo). So I don't want to use “2>/dev/null” at the end as it will hide all of the the stderr.
So, what is the best way to avoid the "stdin: is not a tty” message?
For example:
[user@server1 user]$ ssh server2 uptime
5:47pm up 35 days, 16:42, 0 users, load average: 3.78, 3.23, 3.72
stdin: is not a tty
I can add "-t" to ssh to force pseudo-tty allocation, and that will take care of the "stdin: is not a tty” message, but then I get another message that I don't want: “Connection to server2 closed.”
For example:
[user@server1 user]$ ssh -t server2 uptime
5:49pm up 35 days, 16:44, 1 user, load average: 3.92, 3.51, 3.76
Connection to server2 closed.
I also tried playing with the mesg command, but that didn’t seem to make any difference.
Any ideas?
TIA,
Ross
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-17-2005 07:16 PM
11-17-2005 07:16 PM
Re: stdin: is not a tty
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-18-2005 02:23 AM
11-18-2005 02:23 AM
Re: stdin: is not a tty
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-18-2005 02:31 AM
11-18-2005 02:31 AM
Re: stdin: is not a tty
Example 1 -- typo in command, a "command not found" message is printed to stderr:
[user@server1 user]$ ssh -tq server2 uptimme
bash: uptimme: command not found
Example 2 -- command syntax is ok and execution completes successfuly; prints result to stdout:
[user@server1 user]$ ssh -tq server2 uptime
7:25am up 4 days, 19 min, 1 user, load average: 10.62, 9.97, 7.86
Thanks,
Ross
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-18-2005 02:34 AM
11-18-2005 02:34 AM
Re: stdin: is not a tty
Solution to the issue was to use both -t and -q:
-q --> Quiet mode. Causes all warning and diagnostic messages to be suppressed.
-t --> Force pseudo-tty allocation.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-19-2008 06:09 AM
03-19-2008 06:09 AM
Re: stdin: is not a tty
Try run this one
-----
#!/bin/bash
TEST1=`pwd > /tmp/test1.txt`
TEST2=`ssh -tq brazil03 "cd /home/fsf/tmp/script && pwd" > /tmp/test2.txt`
TEST1B=`cat /tmp/test1.txt`
TEST2B=`cat /tmp/test2.txt`
if [ $TEST1B = $TEST2B ]; then
echo WORK!!!!!!!
echo $TEST1B
echo $TEST2B
else
echo DOES NOT WORK!!!!!
echo $TEST1B
echo $TEST2B
fi
exit 0
-----
What is different?
When a do not use "-tq" ssh option, it work properly.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-19-2008 06:13 AM
03-19-2008 06:13 AM