SCP/SFTP Brain Fart

Oliver Fromme olli at lurza.secnetix.de
Thu Jun 19 15:04:46 UTC 2008


Tony Holmes wrote:
 > > It seems that your shell profile executes stty(1) even
 > > for non-interactive shells.  That is wrong.  Make sure
 > > that you shell profiles and rc files do not call stty
 > > or produce any output for non-interactive sessions.
 > > Such output confuses scp.
 > 
 > So obvious!
 > 
 > The offender:
 > 
 > .login
 > 
 > stty erase ^H
 > 
 > This was a carry over from ages ago when my chosen terminal s/w didn't
 > support the backspace mapping.

Ah, so you use csh or tcsh.  The execution of profiles is
somewhat broken in (t)csh, there is no separation between
interactive and non-interactive shells.

You can keep the stty statement in your .login file if you
put it int oa conditional, like this:

if ($?prompt) then
        stty erase ^H
endif

That works because the variable $prompt is unset for non-
interactive (t)csh sessions.

Best regards
   Oliver

-- 
Oliver Fromme, secnetix GmbH & Co. KG, Marktplatz 29, 85567 Grafing b. M.
Handelsregister: Registergericht Muenchen, HRA 74606,  Geschäftsfuehrung:
secnetix Verwaltungsgesellsch. mbH, Handelsregister: Registergericht Mün-
chen, HRB 125758,  Geschäftsführer: Maik Bachmann, Olaf Erb, Ralf Gebhart

FreeBSD-Dienstleistungen, -Produkte und mehr:  http://www.secnetix.de/bsd

"The last good thing written in C was
Franz Schubert's Symphony number 9."
        -- Erwin Dieterich


More information about the freebsd-net mailing list