From owner-freebsd-questions@FreeBSD.ORG Wed Nov 2 21:34:52 2005 Return-Path: X-Original-To: freebsd-questions@freebsd.org Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id A500516A41F; Wed, 2 Nov 2005 21:34:52 +0000 (GMT) (envelope-from keramida@ceid.upatras.gr) Received: from aiolos.otenet.gr (aiolos.otenet.gr [195.170.0.93]) by mx1.FreeBSD.org (Postfix) with ESMTP id B94DA43D46; Wed, 2 Nov 2005 21:34:51 +0000 (GMT) (envelope-from keramida@ceid.upatras.gr) Received: from flame.pc (aris.bedc.ondsl.gr [62.103.39.226]) by aiolos.otenet.gr (8.13.4/8.13.4/Debian-1) with SMTP id jA2LYm83009440; Wed, 2 Nov 2005 23:34:49 +0200 Received: from flame.pc (flame [127.0.0.1]) by flame.pc (8.13.4/8.13.4) with ESMTP id jA2LYi0h084757; Wed, 2 Nov 2005 23:34:44 +0200 (EET) (envelope-from keramida@ceid.upatras.gr) Received: (from keramida@localhost) by flame.pc (8.13.4/8.13.4/Submit) id jA2LYa1Y084712; Wed, 2 Nov 2005 23:34:36 +0200 (EET) (envelope-from keramida@ceid.upatras.gr) Date: Wed, 2 Nov 2005 23:34:36 +0200 From: Giorgos Keramidas To: Gary Kline Message-ID: <20051102213435.GA65754@flame.pc> References: <20051101121414.GB1051@flame.pc> <20051101185922.GB67660@thought.org> <2011CB42-5C96-4315-AD73-A17B39589CBF@secure-computing.net> <20051101222051.GA24702@thought.org> <20051102093907.GT29387@submonkey.net> <20051102200757.GA67144@thought.org> <20051102201439.GA37256@flame.pc> <20051102204235.GC67144@thought.org> <20051102204743.GA89885@flame.pc> <20051102210916.GA67760@thought.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20051102210916.GA67760@thought.org> Cc: Eric F Crist , freebsd-www@freebsd.org, Ceri Davies , freebsd-questions@freebsd.org Subject: Re: The best scripts ever (trick or treat) X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 02 Nov 2005 21:34:52 -0000 On 2005-11-02 13:09, Gary Kline wrote: >On Wed, Nov 02, 2005 at 10:47:43PM +0200, Giorgos Keramidas wrote: >>On 2005-11-02 12:42, Gary Kline wrote: >>>On Wed, Nov 02, 2005 at 10:14:40PM +0200, Giorgos Keramidas wrote: >>>>> BEGINSCRIPT >>>>> !#/bin/sh >>>>> echo "hello world" >>>>> ENDSCRIPT >>>> >>>> What happens when the script itself contains a line that starts >>>> with one of the special "markup" lines? >>> >>> AFAIK, the only markup lines this would use would be >>> the . A sh script might use the ">" or "<" >>> for redirection, but the conversion script would ignore >>> everything between >>> >>> BEGINSCRIPT >>> ENDSCRIPT >>> >>> which would make parsing straightforeward. >> >> Unless the shell script itself contains 'ENDSCRIPT' somewhere ;-) >> >> This is what I was referring to as "markup". > > Hmmm! :-) > > Okay, then what about > BEGIN_somelonghexstringthatis256byteslong > > and > > END_somelonghexstringthatis256byteslong That's an idea. A simple shar(1) archive could probably work too: flame:/home/keramida$ shar .forward # This is a shell archive. Save it in a file, remove anything before # this line, and then unpack it by entering "sh file". Note, it may # create directories; files and directories will be owned by you and # have default permissions. # # This archive contains: # # .forward # echo x - .forward sed 's/^X//' >.forward << 'END-of-.forward' X|/usr/local/bin/procmail END-of-.forward exit