From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Mike Newsgroups: gmane.emacs.help Subject: Re: OT: emacs-style variables (etc) in the headers? Date: Mon, 27 Dec 2004 18:17:50 GMT Message-ID: References: <1cXzd.3978$Rb3.3396@fe07.lga> NNTP-Posting-Host: deer.gmane.org X-Trace: sea.gmane.org 1104171552 30760 80.91.229.6 (27 Dec 2004 18:19:12 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Mon, 27 Dec 2004 18:19:12 +0000 (UTC) Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Mon Dec 27 19:19:06 2004 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1CizST-0007gT-00 for ; Mon, 27 Dec 2004 19:19:06 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.33) id 1CizdH-0003sO-BH for geh-help-gnu-emacs@m.gmane.org; Mon, 27 Dec 2004 13:30:15 -0500 Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!cyclone.bc.net!HSNX.atgi.net!cyclone-sf.pbi.net!216.196.98.144!border2.nntp.dca.giganews.com!nntp.giganews.com!elnk-atl-nf1!newsfeed.earthlink.net!atl-c03.usenetserver.com!news.usenetserver.com!hwmnpeer01.phx!hwmedia!hw-poster!fe07.lga.POSTED!53ab2750!not-for-mail Original-Newsgroups: gnu.emacs.help User-Agent: slrn/0.9.7.4 (Linux) Original-Lines: 51 Original-X-Trace: pikkdiabbdefphapchpagdjgidhnmpapjmbdmimphmiebkpnmpcikphidmjlhdnllmgobgdicjfaaahjkkafbcndocllkpmjdiecidfjmhnhnjdjebmfibneanegnhchbcfagklmibllijll Original-NNTP-Posting-Date: Mon, 27 Dec 2004 11:17:50 MST Original-Xref: shelby.stanford.edu gnu.emacs.help:127544 Original-To: help-gnu-emacs@gnu.org X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: main.gmane.org gmane.emacs.help:23005 X-Report-Spam: http://spam.gmane.org/gmane.emacs.help:23005 In article , Peter Dyballa wrote: > > Am 27.12.2004 um 17:59 schrieb Mike: > >> Is there an algorithm somewhere to detect the script >> is really a script and not a binary file, what the comment >> character is, and some standard way to include these variables >> and such in files? > > Yes: RTFMs. > > The UNIX file command can test what kind of file it is. It might be > useful to extend file's magic file by some extra entries. The standard > way to include these variables should be GNU Emacs. > > (What about a side project that documents what you've discovered?) > Below are the comments at the start of the program I'm working on. I currently have 20+ boxes with 20+ different configurations. The program I've started is intended to run on each server and maintain a consistent configuration. Mike #!/usr/bin/perl # $Id$ # $Log$ # maintain a consistent configuration on the local server # see if cvs is installed # check that ~/.cvspass and ~/.cvsrc exist # load the config file # see if the $cfgdir exists (else mkdir $cvsdir, then cvs co -d $cfgdir unixcfg) # execute chdir $cfgdir ; cvs update # log the output of the cvs update # examine all files in $cfgdir # if file in $cfgdir/$file is newer than /$file # extract any code snippets from the header of $cfgdir/$file # execute any pre-snippets # install the file # execute any post-snippets # update the log with the output of the snippets # loop # if asked, use the pod formatting on the files # determine the difference between documentation, snippets, and the rest of the file # (should this be a separate script?)