On Wed, Feb 13, 2002 at 08:02:03PM +0100, Reinhard Foerster wrote: > > Ok, allen Shells wird man es nie recht machen koennen. Ein Eintrag in > > /etc/environment und diese ggf. aus der shellspezifischen rc sourcen sieht > > mir aktuell jedoch nach der saubersten Methode aus. > > Soweit ich es verstanden habe ist /etc/environment nicht dazu gedacht, von > den shells gesourced zu werden. genau, dazu haben die shells ihre eigenen $HOME/.$SHELL oder globalen configurationen > Das Ding sollte eigentlich schon von > login, ssh, xdm usw. verarbeitet werden (also bevor die jeweilige shell > startet). Nur so kann es vom Format her shellunabhängig bleiben. > ? Welches ding nun ? Im grunde ist es recht einfach, moechtest du eine variable deinem kompletten system bekannt machen dann -> environment[1] ( z.b. das LANGenv ) nachteil ein relativer overhead, der ueberall mitgeschleppt wird. Moechtest du einer bestimmten routine eine variable beibringen die unter einem bestimmten user laufen soll, macht es sinn in $HOME/.profile ( bei bash etc. ) oder $HOME/.$SHELLrc Soll nun allen usern, variablen beigebracht werden dann nach /etc/profile[2] oder /etc/$SHELLrc ( z.B. dein prompt ) [1]environment File Purpose Sets up the user environment. Description The /etc/environment file contains variables specifying the basic environment for all processes. When a new process begins, the exec subroutine makes an array of strings available that have the form Name=Value. This array of strings is called the environment. Each name defined by one of the strings is called an environment variable or shell variable. The exec subroutine allows the entire environment to be set at one time. Environment variables are examined when a command starts running. [2]profile File Purpose Sets the user environment at login time. Description The $HOME/.profile file contains commands that the system executes when you log in. The .profile also provides variable profile assignments that the system sets and exports into the environment. The /etc/profile file contains commands run by all users at login. After the login program adds the LOGNAME (login name) and HOME (login directory) variables to the environment, the commands in the $HOME/.profile file are executed, if the file is present. The .profile file contains the individual user profile that overrides the variables set in the profile file and customizes the user-environment profile variables set in the /etc/profile file. The .profile file is often used to set exported environment variables and terminal modes. The person who customizes the system can use the mkuser command to set default .profile files in each user home directory. Users can tailor their environment as desired by modifying their .profile file. Naerrische Gruesse amu
Attachment:
pgpeV1uNeUJ6B.pgp
Description: PGP signature