How to fix a scp or rsync failure due to an echo in .bashrc?
Did you ever had the following issue with scp:
protocol error: unexpected <newline>
Or with rsync:
rsync error protocol incompatibility
Well, it happened to us and the reason is an echo
command in the ~/.bashrc
file!
There are two ways to fix it:
- remove the echo command, but it was there on purpose, right?
- Add the following section to your
~/.bashrc
file:
if [[ $- != *i* ]] ; then
# shell is non-interactive - do a silent return
return
fi
And, the problems go away. Neat trick, no?
Comments
comments powered by Disqus