[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Need clarification about /etc/environment



Hi,

I need some explanation about /etc/environment. Here is what I have
found out:

- Seems to originate from the AIX world.
- Contains NAME=VALUE pairs exclusively. Some literature even says no
  comments allowed.
- Is _NOT_ a shell script fragment for _any_ shell
- Is evaluated for example by pam_env, causing "NAME=\VALUE" to be
  parsed into the environment variable NAME with a value starting with
  an actual backslash
- If (wrongly) sourced from a shell script, "NAME=\VALUE" will be
  parsed into the environment variable NAME with a value starting with
  V.
- Virtually every shell script I have seen simply sources the file
  instead of properly parsing it.
- There is no man page for it in Debian, nor seems there to be any
  documentation mentioning that file.
- /etc/environment does not seem to belong to any package.

What is the canonical way of handling /etc/environment? I don't want
to simply source the file in my init.d script to fix bug #158981,
since I now know this is wrong.

Is there any example code to parse /etc/environment into environment
variables with proper quote handling and such, or can I manually
invoke the code from pam_env to do so?

Which Package deserves the bug report for the missing manpage?

Greetings
Marc

-- 
-------------------------------------- !! No courtesy copies, please !! -----
Marc Haber          |   " Questions are the         | Mailadresse im Header
Karlsruhe, Germany  |     Beginning of Wisdom "     | Fon: *49 721 966 32 15
Nordisch by Nature  | Lt. Worf, TNG "Rightful Heir" | Fax: *49 721 966 31 29



Reply to: