Topic "small fix for login fortunes, etc"

Author Message
conty

Guest


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:

Code:

# 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 Very Happy
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 24993
Location: Prague, Czechia
You should read F.A.Q. to learn cause of your problems and also to learn that your solution is not the right one Smile
_________________
Martin Prikryl
conty

Guest


I lose Embarassed

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

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? Smile

sorry for wasting time, delete please. Mad
Advertisements

You can post new topics in this forum






Search Site

What is WinSCP?

It is award-winning SFTP client, SCP client, FTPS client and FTP client integrated into one software program for file transfer to FTP server or secure SFTP server. [More]

And it's free!

Donate

About donations

$9   $19   $49   $99

About donations

Recommend

WinSCP Privacy Policy

WinSCP License