set path

hi
how do i change the default PATH in my system.
i log in as root, and i have .profile file in my / directory. ive put the PATH=.:/usr.......... statement, but that doesnt seem to be working
i also wanted to know why exactly we need the profile file in etc?

To change PATH for all users - you would make the change to /etc/profile

To change the PATH for one user - you would make the change to the account's .profile in that account's home directory.

Post exactly what you put in the .profile - there may be a syntax error OR start a new session to see if the changes work.

heres the .profile file in /:
/usr/bin/bash
export PATH=.:/usr/sfw/bin:/etc:/usr/bin:/usr/ucb:/usr/sbin:/usr:/usr/ccs/bin

Suggest that you get rid of that '.' in the path. It is a security risk. Especially when you have it as the first entry in the path.

tried that... still cant get my path stmt to work...

Is your profile actually like

/usr/bin/bash
export PATH=.:/usr/sfw/bin:/etc:/usr/bin:/usr/ucb:/usr/sbin:/usr:/usr/ccs/bin

Remove the first line from the above two. What is happening here is that the /usr/bin/bash is getting executed and you get your shell. Then, when you exit from the shell, the rest of your profile is executed. So the PATH is getting set, but only after you have actually finished working in your shell.

dude my comp just seems to hate me...
even thats not workin...
onr more thing... in the JAVA desktop env. (im using solaris 10) tried changing the default command... tried using sh, bash bu to no avail... (if i leave it blank, the console doesnt accept chars)