setting environments

Hello,

How can I setup environments in a bash and tcsh?

I need to setup some paths and classpath.

thanks
xNYx

For each user, bash can be customized by entering non-interactive commands in $HOME/.bash_profile
Also, system-wide customization can be done in /etc/profile

I'm not sure about csh, since I never use it.

When setting your PATH make sure you add to the appropriate place in your path list....as the PATH list will be searched from start to finish to find the command you are after - so adding to your PATH may need to be at the end of at the beginning - depending if you want this directory to be searched first or last.

export PATH=/usr/bin/new_directory:$PATH (will add to start of path list)

export PATH=$PATH:/usr/bin/new_directory(will add to end of path list)

Very important if you have a command or fucntion that is stored within two places on your system - and you want to specify which one to use.

There are two files that concern (t)csh:

/etc/csh.cshrc
and
/etc/csh.login

This is where you set up global stuff.

In each directoy, there are files like

.login

and one more ...?

OBS: Syntax for setting PATH is somewhat different:

setenv PATH "${PATH}:/moreppaths:/even/more/paths"

Also, syntax for loops and tests are different from BASH:

if ( test here ) then
....

foreach i \( spec here \)
	...
end

endif

More OBS: Do NOT let that put you off! :cool:

Atle

PS {
Good to know that people still enquire about csh.
It really is a good and simple shell for scripting.
}