Josef Moellers
08-10-2005, 12:01 AM
Angus Comber wrote:
> Hello
>
> My past is in Windows programming (come on, don't sneer!). Program settings
> were stored in the registry. What is the approach most commonly used on
> Linux? I suspect a text .conf file but would be interested in comments.
It's often done in so-calld "rc files", named as they have an trailing
"rc", e.g. "vimrc".
If they reside in the user's home directory, they are sometimes also
referred to as "dotfiles", as they have an initial '.', so they don't
clobber up an ls output, e.g. ".vimrc".
These files contain definitions in a format most suited for your
applications.
It would be convenient if the format were
identifier=value
where value would optionionally be enclosed in quotes so a
bourne-like-shell would be able to slurp the data as well. Comments
would then be preceded by a # and they'd be on a line of their own (the
shell can live with "x=123 # initial value of x", but it makes parsing
easier).
I personally prefer a multi-tiered approach:
a system wide config file in /etc (without the dot: /etc/vimrc)
a user-specific config file in the user's home directory (~/.vimrc)
environment variables (EXINIT=...)
command line switches (-r)
--
Josef Möllers (Pinguinpfleger bei FSC)
If failure had no penalty success would not be a prize
-- T. Pratchett
> Hello
>
> My past is in Windows programming (come on, don't sneer!). Program settings
> were stored in the registry. What is the approach most commonly used on
> Linux? I suspect a text .conf file but would be interested in comments.
It's often done in so-calld "rc files", named as they have an trailing
"rc", e.g. "vimrc".
If they reside in the user's home directory, they are sometimes also
referred to as "dotfiles", as they have an initial '.', so they don't
clobber up an ls output, e.g. ".vimrc".
These files contain definitions in a format most suited for your
applications.
It would be convenient if the format were
identifier=value
where value would optionionally be enclosed in quotes so a
bourne-like-shell would be able to slurp the data as well. Comments
would then be preceded by a # and they'd be on a line of their own (the
shell can live with "x=123 # initial value of x", but it makes parsing
easier).
I personally prefer a multi-tiered approach:
a system wide config file in /etc (without the dot: /etc/vimrc)
a user-specific config file in the user's home directory (~/.vimrc)
environment variables (EXINIT=...)
command line switches (-r)
--
Josef Möllers (Pinguinpfleger bei FSC)
If failure had no penalty success would not be a prize
-- T. Pratchett