Differences between revisions 1 and 2
Revision 1 as of 2005-01-11 09:08:12
Size: 1896
Editor: anonymous
Comment:
Revision 2 as of 2005-01-11 09:12:02
Size: 2421
Editor: anonymous
Comment:
Deletions are marked like this. Additions are marked like this.
Line 29: Line 29:
As mentioned before, [~''.bash_initshared http:''/people.debian.org/~zugschlus/wiki.debian.net/Zg2ShellStartup/.bash_initshared] is invoked both by ~''.bash_profile and ~''.xsession-local, and is thus the place for init stuff that should be present both in console/ssh logins and in X sessions.

Noteworthy functions include:

 * Proxy settings from /etc/use-proxy and ~/.use-proxy are pulled in, if the files are present
 * ~/.ssh/authorized_keys is automatically built
 * ~/.ssh/config is automatically built

== ~/.ssh ==

Zugschlus' Shell Startup Magic

.bashrc

My [http://people.debian.org/~zugschlus/wiki.debian.net/Zg2ShellStartup/bashrc .bashrc] file mainly sets environment variables, defines aliases and shell functions.

Noteworthy features include:

  • sources /etc/bashrc if that file exists
  • sets umask 002 if the default group has the same name as the account name, 022 otherwise
  • Adds more directories to $PATH, but only if they actually exist
  • Tries to detect if running in a script(1) process, omitting color and other control characters in various parts of the environment, including ls and the shell prompt
  • Sets the user prompt to have a different color than the root prompt, using portable functions to work on nearly all terminal types.

.bash_profile

My [http://people.debian.org/~zugschlus/wiki.debian.net/Zg2ShellStartup/.bash_profile .bash_profile] file sources some other startup files and prints some system operating data.

Noteworthy features include:

  • Sources ~.profile, ~.bashrc, ~/.bash_initshared, if present.

  • Invokes df -h, free, and w, avoiding error messages on systems without /proc mounted or in chroot environments.
  • Prints ~/.motd, if present, allowing system local reminders to be displayed.

.xsession-local

This file is not strictly a shell startup file, but I'll document it here as well since it does things quite similiar to the shell startup files.

When logging in to an X session, no login shell is invoked, thus preventing some initialization from happening. To avoid this issue, /etc/X11/Xsession.d/60xfree86-common_user-xsession-local (See [http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=252592 #252592]) invokes ~.xsession-local, which in my environment adds ~.my/bin to the PATH and sources ~.bash_initshare, as my ~.bash_profile does as well.

.bash_initshared

As mentioned before, [~.bash_initshared http:''/people.debian.org/~zugschlus/wiki.debian.net/Zg2ShellStartup/.bash_initshared] is invoked both by ~.bash_profile and ~.xsession-local, and is thus the place for init stuff that should be present both in console/ssh logins and in X sessions.

Noteworthy functions include:

  • Proxy settings from /etc/use-proxy and ~/.use-proxy are pulled in, if the files are present
  • ~/.ssh/authorized_keys is automatically built
  • ~/.ssh/config is automatically built

~/.ssh