small fix for login fortunes, etc

Advertisement

conty
Guest

small fix for login fortunes, etc

When connecting to ssh, I have "fortune" in my .bashrc, which prints a little fortune. However winscp chews on this, because it makes the initial packet(s) too big and complains. Trivial fix is to check the type of terminal through environment variable in script, like:

# Fix for winscp
if [ "$TERM" != "dumb" ]; then
    fortune
fi

(putty and openssh emulate xterm, should work for other clients also - try "echo $TERM" to see)

Now winscp works and I get my fortunes in putty and so on. why winscp needs to launch bash at all, I don't know, maybe weirdness in ssh protocol, hah. anyway, hope that helps someone out :D

Reply with quote

Advertisement

conty
Guest

I lose :oops:

I always wondered the difference between .bash_profile and .bashrc, I get it now.. you learn something every day, I guess :?

ps error message contains suggestion that .profile prints the message (the faq says .profile isn't executed for non-interactive), which made me think .bashrc and .bash_profile are the other way around. argh. maybe make it link to the faq? :)

sorry for wasting time, delete please. :x

Reply with quote

Advertisement

You can post new topics in this forum