what is the source file for sh
This machine has sh as the shell default. Where is the source file for this shell? I only have .bashrc under my directory. How do I have it sourced automatically at login in?
|
sh is normally /bin/sh
Try which sh to check The login sequence starts with /etc/profile, then calls your local .bashrc and/or .bash_profile. You default shell is set in your entry in /etc/passwd; it's the last field. |
Quote:
I did see this block in /etc/profile: test -r /etc/bash.bashrc && . /etc/bash.bashrc if test "$is" = "bash" -a -z "$_HOMEBASHRC" ; then # loop detection readonly _HOMEBASHRC=true test -r $HOME/.bashrc && . $HOME/.bashrc fi However, my shell is not bash, how to ask sh to source .bashrc by itself? |
If /bin/sh is a link to /bin/bash (as is common) then bash, invoked as sh, will not source ~/.bashrc but ~/.profile as explained here (scroll down to the "Invoked with name sh" section).
The output of /bin/ls -l /bin/sh would show whether /bin/sh is a link to /bin/bash. |
Quote:
I have this in my ~/.bash_profile to show dirs in color export CLICOLOR=1 export LSCOLORS=ExFxCxDxBxegedabagacad However everytime I log in, it never works until I source the .bash_profile manually. Should I generate a .profile and put these in it, so if will get sourced by itself? |
Quote:
|
All times are GMT -5. The time now is 01:46 PM. |