[ale] is there a bash command to include a file in /etc/hosts?

Lightner, Jeff JLightner at water.com
Thu Jul 12 09:31:59 EDT 2012


Interesting – I see 2 responses to this thread but don’t see the original question email.

If I read the title and what appears to be the original question he is asking not how to source /etc/hosts but rather how to have /etc/hosts source another file.    I don’t believe there is a way to do this.

I’m also curious as to the reason for the question.   If you’re trying to use something global for hosts definitions to be shared for multiple clients you should look at a DNS or NIS setup.   /etc/hosts is meant to be local to the system you’re on.

From: ale-bounces at ale.org [mailto:ale-bounces at ale.org] On Behalf Of Jim Kinney
Sent: Thursday, July 12, 2012 9:13 AM
To: Atlanta Linux Enthusiasts
Subject: Re: [ale] is there a bash command to include a file in /etc/hosts?


+1
On Jul 12, 2012 8:45 AM, "leam hall" <leamhall at gmail.com<mailto:leamhall at gmail.com>> wrote:
Wolf,

You can sometimes source a file in bash with the ".". That is:

  .    /etc/hosts

Note the spaces there. However, I believe that will fail as sourcing is used when files are executed. The hosts file is read on reference by programs that need it. If you are trying to keep things separated by breaking up files, have you considered using "make" to rebuild your host file if any of the component files changes?

Leam

On Thu, Jul 12, 2012 at 7:26 AM, Wolf Halton <wolf.halton at gmail.com<mailto:wolf.halton at gmail.com>> wrote:
I have tried
source /path/to/file
and
include(/path/to/file)
without success.

Wolf

--
This Apt Has Super Cow Powers - http://sourcefreedom.com
Open-Source Software in Libraries - http://FOSS4Lib.org
Advancing Libraries Together - http://LYRASIS.org
Apache Open Office Developer wolfhalton at apache.org<mailto:wolfhalton at apache.org>






_______________________________________________
Ale mailing list
Ale at ale.org<mailto:Ale at ale.org>
http://mail.ale.org/mailman/listinfo/ale
See JOBS, ANNOUNCE and SCHOOLS lists at
http://mail.ale.org/mailman/listinfo



--
Mind on a Mission<http://leamhall.blogspot.com/>


_______________________________________________
Ale mailing list
Ale at ale.org<mailto:Ale at ale.org>
http://mail.ale.org/mailman/listinfo/ale
See JOBS, ANNOUNCE and SCHOOLS lists at
http://mail.ale.org/mailman/listinfo





Athena®, Created for the Cause™

Making a Difference in the Fight Against Breast Cancer





How and Why I Should Support Bottled Water!
Do not relinquish your right to choose bottled water as a healthy alternative to beverages that contain sugar, calories, etc. Your support of bottled water will make a difference! Your signatures count! Go to http://www.bottledwatermatters.org/luv-bottledwater-iframe/dswaters and sign a petition to support your right to always choose bottled water. Help fight federal and state issues, such as bottle deposits (or taxes) and organizations that want to ban the sale of bottled water. Support community curbside recycling programs. Support bottled water as a healthy way to maintain proper hydration. Our goal is 50,000 signatures. Share this petition with your friends and family today!



---------------------------------
CONFIDENTIALITY NOTICE: This e-mail may contain privileged or confidential information and is for the sole use of the intended recipient(s). If you are not the intended recipient, any disclosure, copying, distribution, or use of the contents of this information is prohibited and may be unlawful. If you have received this electronic transmission in error, please reply immediately to the sender that you have received the message in error, and delete it. Thank you.
----------------------------------


-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.ale.org/pipermail/ale/attachments/20120712/a9df8568/attachment.html 


More information about the Ale mailing list