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

Re: Another possible slink goal (multipackages users profile)



Martin Schulze <joey@kuolema.Infodrom.North.DE> writes:

>    Therefore I believe that we should elaborate a mechanism that can be
>    used for all shells. This could be /etc/profile.d/ containing scripts
>    or fragments. It could alternatively contain some data that will be
>    evaluated and changed into code that can be read by the used shell.

No no no no. This is wrong wrong wrong wrong wrong.

Programs should not require any environment variables for a reasonable
configuration. A user should be able to run ``env - program'' and have it
behave in the default fashion.

The right way to solve broken programs which insist on depending on
environment variables is to write a simple wrapper script which sets default
values for the needed environment variables.

sh even provides a convenient syntax for this use:

 ${variable-default} 

so for example:

 CLASSPATH=${CLASSPATH-"/usr/share/.../classes.zip"} java "$@"

runs java with a default value of CLASSPATH if non is provided.


greg


--  
To UNSUBSCRIBE, email to debian-devel-request@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org


Reply to: