[CentOS] /etc/bashrc help!

Tue Apr 19 21:40:08 UTC 2011
Nicolas Thierry-Mieg <Nicolas.Thierry-Mieg at imag.fr>

Roland Roland wrote:
>
>    Dear all,
>
> i've appended the below to /etc/bashrc it works like a charm with ssh
> connections though SFTP sessions fail since the below is being sent to
> the intiator.
> any way of limiting the below to none sftp sessions? or any other idea
> for it to work?

I have the following in a bashrc for this same reason, it works fine:

# print a fortune in new interactive terminals
# the test for $PS1 (value of the prompt) makes sftp work
if [ -n "$PS1" ] ; then
     fortune ; echo
fi