Bash function in .profile kills X

:date: 2012-11-29
:tags: bash, script
:category: computing

I just wanted to define a bash function in my ".profile" file, so that I get it everytime I log-in.
So far so good, but then when I tried a login, X died immediately and restarted gdm. Weird what one small function has caused :)
Thanks to the guy in "askubuntu" site, with his words the problem was:

POSIX sh does not allow functions to be exported, but bash does.
~/.profile is sourced by a POSIX shell, not bash.
It's also rather pointless to export functions since only bash can read and use them.
Just put the functions in ~/.bashrc

ref: http://askubuntu.com/questions/26367/