Had the following input from a customer that was very handy so wanted to suggest it:
when you scp a file to the server it completes the copy but also responds with:
stdin: is not a tty
This is because scp runs ~/.bashrc and ~/.bashrc calls the global bashrc at /etc/bashrc. The global bashrc has commands that are only applicable if this is an interactive session and, since scp isn't an interactive session, then these commands don't run properly and result in the above error message.
To solve this I've added this to the top part of my ~/.bashrc :-
if [ $(expr index "$-" i) -eq 0 ]; then
return
fi
If it's an interactive session the $- contains "i". If $- doesn't contain an "i" then the session isn't interactive and the processing of .bashrc ends here (i.e. before it calls the global bashrc) and so no error is generated.



LinkBack URL
About LinkBacks



Reply With Quote




