.bash_profile can create hell

Jonas Norlander jonorland at gmail.com
Mon Jun 16 20:47:27 UTC 2008


2008/6/16 Willy K. Hamra <w.hamra1987 at gmail.com>:
> for the last hour i was having hell with my computer, every time i type
> my password in the login screen (kdm) and hit enter, x restarts. i can
> log in in console normally, but not graphically, i searched a lot using
> windows to no avail, but then i remembered i edited $HOME/.bash_profile
> last time i was using linux (as instructed by some tutorial), i can
> mount my ext3 partitions in windows, so decided to take a look at the
> file, and found it wrong, there was "ls" in its begining and end,
> somehow i typed something wrong in konsole, so i went back to linux,
> logged in in console and renamed the file, and voila, i can login
> graphically.
> now this makes me wonder, first, what effect does a bash settings file
> have on kde? secondly, can it be that serious as to f*** up a system?!
>
> --
> Willy K. Hamra
> Manager of Hamra Information Systems
> Co. Manager of Zeina Computer & Billy Net
>

Hi!

I don't really agree that your system was fucked up, you could still
log in and the fix was not that hard. If you mess with the login
scripts and make an error the consequence can be fatal regardless what
OS you running.

Many program will use a shell-scripts to execute programs or
manipulate your environment and so do KDE and it's programs.
What i don't understand is why KDM want to read your .bash_profile?
Bash (and other Bourne-shells i guess) will read and execute commands
from one of ~/.bash_profile, ~/.bash_login, or ~/.profile only if it
is running as an interactive login shell and why KDM would want an
interactive login shell i have no idea. Perhaps some other know?

In any case it looks like Ubuntu uses the ~/.profile file and if you
add a ~/.bash_profile your ~/.profile will not be read and the
~/.profile is sourcing your ~/.bashrc so you will loose important
settings.

/ Jonas




More information about the kubuntu-users mailing list