[ale] read config file from shell script

michael d. ivey ivey at gweezlebur.com
Tue Nov 30 18:01:02 EST 1999


On Tue, Nov 30, 1999 at 05:38:32PM -0500, Nick Lucent wrote:
> Im writing a set of scripts to automatically a: determine my IP (dhcp), then
> update /etc/hosts accordingly (change IP and domain), and b: perform other
> scripted functions depending on that IP (change netscapes proxy etc). My
> question is, how do I read a config file in the format of
> HOME=192.168.1
> WORK=15.23.126

If you're going to have them in this format, just source the file from 
within your script, and then reference them as $HOME and $WORK.  Be
sure not to clobber any variables other scripts feed you.  This is how
the Red Hat initscripts work.

-- 
-- michael d. ivey, chief thinker  --- <ivey at gweezlebur.com> -----------
------ gweezle bur poetry manufacturing  <http://gweezlebur.com> -------
------------------------------------------------------------------------
"Try to relax and enjoy the crisis."               -- Ashleigh Brilliant






More information about the Ale mailing list