Hi,
I am newbie to Solaris and system administration in general, and I have a couple of questions about files in my HOME directory.
When I perform ls -la, I get the following list of files:
drwxr-xr-x 7 XXXYYY staff 17 Aug 24 07:31 .
drwxr-xr-x 7 root root 7 Jul 31 10:13 ..
-rw------- 1 XXXYYY staff 5145 Aug 23 12:44 .bash_history
-rw-r--r-- 1 XXXYYY staff 68 Aug 1 10:59 .bash_login
-rw-r--r-- 1 XXXYYY staff 280 Jul 31 10:13 .bashrc
drwxr-xr-x 6 XXXYYY staff 10 Aug 23 06:51 .hudson
drwxr-xr-x 3 XXXYYY staff 3 Aug 1 11:15 .m2
-rw-r--r-- 1 XXXYYY staff 611 Jul 31 10:13 .profile
drwx------ 2 XXXYYY staff 3 Jul 31 10:20 .ssh
drwx------ 3 XXXYYY staff 3 Jul 31 14:40 .sunw
...
-rw-r--r-- 1 XXXYYY staff 1039 Jul 31 10:13 local.cshrc
-rw-r--r-- 1 XXXYYY staff 988 Jul 31 10:13 local.login
-rw-r--r-- 1 XXXYYY staff 1002 Jul 31 10:13 local.profile
This week-end, I found out that I could not access 'svcadm' may be because my path was missing /usr/sbin/. I am getting the bash shell when I log in (echo $SHELL returns /usr/bin/bash).
I have been doing some reading on the Internet and it seems like:
i) local.cshrc is the shell start-up initialization file for the C shell, correct? If yes, it is not executed because I am under bash, correct?
ii) local.login is the login initialization file for the C shell, correct? If yes, it is not executed because I am under bash, correct?
iii) local.profile is the shell start-up initialization for the Bourne and Korn shells, correct? If yes, it is not executed because I am under bash, correct?
iv) What is the '.profile' file exactly? In my case, it exports a couple of variables and defines the default prompt. Is this file executed when I log in?
v) What is the '.bashrc' file exactly? It define the default prompt in my case. Is this file executed when I log in?
vi) '.bash_login' is a file I had to create as part of installation instructions for Maven. It exports the Maven path and adds it to the PATH variable. This file is obviously executed when I log in, because without it, I cannot run Maven from anywhere.
My question is: is there a way to export those variables for everyone who logs in? If yes, how should I proceed?
vii) '.bash_history' contains the list of commands I have been using recently. I have no questions about it.
viii) When I echo $PATH, I get
/usr/local/maven/bin:/usr/bin
which fits perfectly with what I am doing in .bash_login. It seems that only .bash_login is executed when I am logging in? Is this correct? Or are other default files executed too?
Thanks,
JVerstry
---------- Post updated at 07:24 PM ---------- Previous update was at 05:28 PM ----------
I have found a link (Bash env settings problems - comp.unix.solaris | Google Groups) which helped me answering some of my question. I have also performed a couple of tests.
/etc/profile is first executed, then .bash_login.
.profile is not executed, because .bash_login exists and is readable.
Since my .profile file contains:
export PATH=/usr/gnu/bin:/usr/bin:/usr/X11/bin:/usr/sbin:/sbin
this explains why I could not access svcadm.
JVerstry