From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 19092 invoked from network); 24 Jan 2009 23:11:42 -0000 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.5 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.5 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by ns1.primenet.com.au with SMTP; 24 Jan 2009 23:11:42 -0000 Received-SPF: none (ns1.primenet.com.au: domain at sunsite.dk does not designate permitted sender hosts) Received: (qmail 99720 invoked from network); 24 Jan 2009 23:11:38 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 24 Jan 2009 23:11:38 -0000 Received: (qmail 16673 invoked by alias); 24 Jan 2009 23:11:31 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 26419 Received: (qmail 16656 invoked from network); 24 Jan 2009 23:11:30 -0000 Received: from bifrost.dotsrc.org (130.225.254.106) by sunsite.dk with SMTP; 24 Jan 2009 23:11:30 -0000 Received: from vms173005pub.verizon.net (vms173005pub.verizon.net [206.46.173.5]) by bifrost.dotsrc.org (Postfix) with ESMTP id 6406780271F0 for ; Sun, 25 Jan 2009 00:11:17 +0100 (CET) Received: from torch.brasslantern.com ([96.238.220.215]) by vms173005.mailsrvcs.net (Sun Java System Messaging Server 6.2-6.01 (built Apr 3 2006)) with ESMTPA id <0KE000EIU0EQZWE2@vms173005.mailsrvcs.net> for zsh-workers@sunsite.dk; Sat, 24 Jan 2009 17:11:16 -0600 (CST) Received: from torch.brasslantern.com (localhost.localdomain [127.0.0.1]) by torch.brasslantern.com (8.13.1/8.13.1) with ESMTP id n0ONBDKE024114 for ; Sat, 24 Jan 2009 15:11:14 -0800 Received: (from schaefer@localhost) by torch.brasslantern.com (8.13.1/8.13.1/Submit) id n0ONBDLx024113 for zsh-workers@sunsite.dk; Sat, 24 Jan 2009 15:11:13 -0800 Date: Sat, 24 Jan 2009 15:11:13 -0800 From: Bart Schaefer Subject: Re: sourcing a sh file in zsh In-reply-to: <200901241859.30029.arvidjaar@gmail.com> To: zsh-workers@sunsite.dk Message-id: <090124151113.ZM24112@torch.brasslantern.com> MIME-version: 1.0 X-Mailer: OpenZMail Classic (0.9.2 24April2005) Content-type: text/plain; charset=us-ascii References: <200901161939.54651.arvidjaar@newmail.ru> <090116102934.ZM22119@torch.brasslantern.com> <200901241859.30029.arvidjaar@gmail.com> Comments: In reply to Andrey Borzenkov "Re: sourcing a sh file in zsh" (Jan 24, 6:59pm) X-Virus-Scanned: ClamAV 0.92.1/8899/Sat Jan 24 14:06:33 2009 on bifrost X-Virus-Status: Clean On Jan 24, 6:59pm, Andrey Borzenkov wrote: } } > emulate -LRE sh source file.sh } } What about the following patch. It simply eval's any code after setting } requested emulation. As a bonus it prints current emulation if no argument } is specified. This looks a lot like what I had in mind, yes. } Neither should be of compatibility issues as emulate always } allowed exactly one argument. Agree. } Comments? I'm still undecided on (1) whether "-E" should either require or always imply -L, and (2) whether I like "-c" better, as in emulate sh -c 'source file.sh' As to (1), in what circumstances would you want to eval a command under emulation and then leave the emulation in place? If you were going to leave emulation turned on anyway, why wouldn't you write it as emulate sh source file.sh ?? (2) is a nit. Mainly it affects whether emulate accepts only one argument to be eval'd.