Live data from Hacker News

Bash Configurations Demystified

dghubble.com

1–10 of 22 posts

Re: Bash Configurations Demystified

#4
post #3
post #2

See " rel="nofollow">http://blog.flowblok.id.au/2013-02/shell-startup-scripts.htm... , the most comprehensive overview I've encountered to date.

^ broken link.

http://blog.flowblok.id.au/2013-02/shell-startup-scripts.htm...

Edit: Not that I recommend the resource, just fixed the link for you.

Re: Bash Configurations Demystified

#5
post #3
post #2

See " rel="nofollow">http://blog.flowblok.id.au/2013-02/shell-startup-scripts.htm... , the most comprehensive overview I've encountered to date.

^ broken link.

It has to do with the fact that the GP put the URL in and HN assumed the trailing > was part of the URL. Just remove the trailing > in the URL and it'll work.

Alternatively reproduced here without the '>': http://blog.flowblok.id.au/2013-02/shell-startup-scripts.htm...

Re: Bash Configurations Demystified

#6
What's the reason for all the files, and why do I care whether my shell is a login or non-login? To me, no matter where I get my shell from (whether VT, SSH, gnome-terminal), I want all my aliases, settings and nice terminal colors to be there.

Re: Bash Configurations Demystified

#7

What's the reason for all the files, and why do I care whether my shell is a login or non-login? To me, no matter where I get my shell from (whether VT, SSH, gnome-terminal), I want all my aliases, settings and nice terminal colors to be there.

The point of a separate login shell script is so you can have login banners telling you useful information about the system when you're initially logging in, but not when you just do something like run bash or su.

In ubuntu that's stuff like the load average of the machine or whether or not there are packages that need to be upgraded.

Re: Bash Configurations Demystified

#8
Programs like RVM add a .bash_profile file so you should be sure to append [[ -s ${HOME}/.profile ]] && source ${HOME}/.profile to the added .bash_profile file.

You can also rename .profile to .bash_profile on Ubuntu and Debian. All other distros that I've encountered set up .bash_profile by default.

Re: Bash Configurations Demystified

#9

What's the reason for all the files, and why do I care whether my shell is a login or non-login? To me, no matter where I get my shell from (whether VT, SSH, gnome-terminal), I want all my aliases, settings and nice terminal colors to be there.

Because when you run a script in a shell you don't want the script printing out the message of the day and messing with things. Say for example you want to create a new shell with LD_LIBRARY_PATH and PATH that are different than you set them when you login. If you always start a login shell your .profile is always run and you always reset your paths.
Post reply on HN