On Mon, 10 Feb 2003, David A. Bandel wrote: > On Mon, 10 Feb 2003 11:40:25 -0500 (EST) > Net Llama! <[EMAIL PROTECTED]> 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.
What i'm trying to do is put something like this in (for example) /etc/hosts: $IPADDR $HOSTNAME and then set $IPADDR=192.168.0.3 and $HOSTNAME=foo.bar.com is this possible? -- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lonni J Friedman [EMAIL PROTECTED] Linux Step-by-step & TyGeMo http://netllama.ipfox.com _______________________________________________ Linux-users mailing list [EMAIL PROTECTED] Unsubscribe/Suspend/Etc -> http://www.linux-sxs.org/mailman/listinfo/linux-users
