setting env vars

David A. Bandel david
Mon May 17 11:44:16 PDT 2004


On Mon, 10 Feb 2003 11:40:25 -0500 (EST)
Net Llama! <netllama at linux-sxs.org> wrote:

> I've got a two pronged question regarding environmental variables
> (under bash):
> 
> 1) Is it possible to use env vars for things like IP addresses &
> hostnames in files in /etc/hostname & /etc/hosts?
> 2) If so, where would be the best place to set them, so that they are
> identified at bootup?

One of us is extremely confused.

Environment variables are meant for users and/or programs.  They create
and/or modify interactions between userland programs (including the
shell) launched by a user (or possibly by the system on behalf of the
user) and the system itself. That is, they modify how/what the
user/program "sees" while executing a program or command. The system
doesn't have any environment variables because it doesn't need them. 
And /etc/hostname, et. al., are not executable programs to be run or
interpreted by anyone, they are system references.

What are you trying to do?  Because either you're trying to use
something for a purpose it wasn't designed for, or you're using the
wrong terms for the question.

To answer your question, though, it is possible during boot to modify
the contents of system reference files (/etc/hosts, /etc/resolv.conf,
etc.).  DHCPCD changes /etc/resolv.conf for one.

Ciao,

David A. Bandel
-- 
Focus on the dream, not the competition.
		Nemesis Racing Team motto
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : http://mail.linux-sxs.org/pipermail/linux-users/attachments/20030210/f9ceb0ed/attachment.pgp


More information about the Linux-users mailing list