Bug 163869 - Commands piped to ssh result in warning message when they include 'exit'
Commands piped to ssh result in warning message when they include 'exit'
Product: Red Hat Enterprise Linux 4
Classification: Red Hat
Component: openssh (Show other bugs)
i386 Linux
medium Severity low
: ---
: ---
Assigned To: Tomas Mraz
Brian Brock
Depends On:
  Show dependency treegraph
Reported: 2005-07-21 14:28 EDT by Dave Fogarty
Modified: 2007-11-30 17:07 EST (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2005-07-22 05:57:55 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Dave Fogarty 2005-07-21 14:28:09 EDT
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.10) Gecko/20050720 Fedora/1.0.6-1.1.fc3 Firefox/1.0.6

Description of problem:
When I echo a command and pipe it to ssh everything normally works fine.  However, when that command contains an 'exit' statement, I get this error:

TERM environment variable not set.

When I test using a set -x, it seem to be related to the "clear" command in .bash_logout.

This applies to Fedora Core 3, RHES3, and RHES4 but NOT RHES2.1.

Version-Release number of selected component (if applicable):
openssh-3.9p1-8.RHEL4.4 bash-3.0-19.2

How reproducible:

Steps to Reproduce:
1. echo 'exit 0' | ssh -T localhost

Actual Results:  [doughnut@shoe ~]$ echo 'exit 0' | ssh -T localhost
TERM environment variable not set.
[doughnut@shoe ~]$ echo 'set -x ; exit 0' | ssh -T localhost
+ exit 0
++ clear
TERM environment variable not set.
[doughnut@shoe ~]$

Expected Results:  Commands that don't involve exit work like expected:

[doughnut@shoe ~]$ echo 'set -x ; sleep 0' | ssh -T localhost
+ sleep 0
[doughnut@shoe ~]$

Additional info:

Our RHES2.1 box works fine.  The clear is there, but no warning:

[doughnut@shoe ~]$ echo 'set -x ; exit 0' | ssh -T brie
+ exit 0
++ clear
[doughnut@shoe ~]$
Comment 1 Tomas Mraz 2005-07-22 05:57:55 EDT
The difference between RHEL2.1 and newer releases are probably in that the
warning was not issued by the clear program in the older release. However it
doesn't make much sense to run the clear binary anyway.

Use: echo "set -x; exit 0" | ssh localhost bash

This way the bash invoked from ssh is not a login shell and the unnecessary
clear command is not issued when exiting.

Note You need to log in before you can comment on or make changes to this bug.