Ubuntu 10.10 logout immediately after login

Since the last few days I was perplexed with a weird issue. Ubuntu 10.10 logged me out as soon as I entered the login credentials. It did appear to try to login, but I couldn’t see the messages. Turns out — it was because of a few ‘conflicting’ entries I had made in .bashrc and .bash_profile files. I commented everything out, and got through without any hassle!