From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 17035 invoked from network); 27 Oct 2006 17:29:32 -0000 X-Spam-Checker-Version: SpamAssassin 3.1.7 (2006-10-05) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.5 required=5.0 tests=AWL,BAYES_00, FORGED_RCVD_HELO autolearn=ham version=3.1.7 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by ns1.primenet.com.au with SMTP; 27 Oct 2006 17:29:32 -0000 Received-SPF: none (ns1.primenet.com.au: domain at sunsite.dk does not designate permitted sender hosts) Received: (qmail 51908 invoked from network); 27 Oct 2006 17:29:15 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 27 Oct 2006 17:29:15 -0000 Received: (qmail 6656 invoked by alias); 27 Oct 2006 17:29:06 -0000 Mailing-List: contact zsh-users-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 10908 Received: (qmail 6646 invoked from network); 27 Oct 2006 17:29:06 -0000 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by sunsite.dk with SMTP; 27 Oct 2006 17:29:06 -0000 Received: (qmail 50550 invoked from network); 27 Oct 2006 17:29:06 -0000 Received: from ka.cs.utk.edu (160.36.56.221) by a.mx.sunsite.dk with SMTP; 27 Oct 2006 17:29:03 -0000 Received: from localhost (localhost [127.0.0.1]) by ka.cs.utk.edu (Postfix) with ESMTP id 17FFD2F21C for ; Fri, 27 Oct 2006 13:29:57 -0400 (EDT) X-Virus-Scanned: by amavisd-new with ClamAV and SpamAssasin at cs.utk.edu Received: from ka.cs.utk.edu ([127.0.0.1]) by localhost (ka.cs.utk.edu [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id LhL-pAEqk80F for ; Fri, 27 Oct 2006 13:29:51 -0400 (EDT) Received: from cetus30.cs.utk.edu (cetus30.cs.utk.edu [160.36.56.112]) by ka.cs.utk.edu (Postfix) with ESMTP id 005882F213 for ; Fri, 27 Oct 2006 13:29:50 -0400 (EDT) Received: by cetus30.cs.utk.edu (Postfix, from userid 10605) id 2D3D713B3C; Fri, 27 Oct 2006 13:28:53 -0400 (EDT) Date: Fri, 27 Oct 2006 13:28:53 -0400 From: Chris Johnson To: zsh-users@sunsite.dk Subject: Self-generating zsh script Message-ID: <20061027172853.GA27684@cetus30.cs.utk.edu> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.9i In case anyone's bored on this Friday (afternoon, here), I thought I'd try writing one of those scripts whose output is itself in zsh. It appears to be working: ------------------------ #!/usr/bin/env zsh a='#!/usr/bin/env zsh\x0A\x0Aa=%s%s%s\x0A\x0Aprint -f $a \\\x27 $a \\\x27\x0A' print -f $a \' $a \' ------------------------ The assignment line is not supposed to wrap. Here's what I get when I compare the original script to the output of the script, using the handy =() substitution. $ diff self.zsh =(zsh self.zsh) $ echo $? 0 -- Chris Johnson cjohnson@cs.utk.edu http://www.cs.utk.edu/~cjohnson