From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 1176 invoked from network); 16 Jan 2009 18:29:55 -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; 16 Jan 2009 18:29:55 -0000 Received-SPF: none (ns1.primenet.com.au: domain at sunsite.dk does not designate permitted sender hosts) Received: (qmail 32042 invoked from network); 16 Jan 2009 18:29:50 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 16 Jan 2009 18:29:50 -0000 Received: (qmail 15404 invoked by alias); 16 Jan 2009 18:29:46 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 26323 Received: (qmail 15387 invoked from network); 16 Jan 2009 18:29:46 -0000 Received: from bifrost.dotsrc.org (130.225.254.106) by sunsite.dk with SMTP; 16 Jan 2009 18:29:46 -0000 Received: from vms044pub.verizon.net (vms044pub.verizon.net [206.46.252.44]) by bifrost.dotsrc.org (Postfix) with ESMTP id 096EC80271F0 for ; Fri, 16 Jan 2009 19:29:41 +0100 (CET) Received: from torch.brasslantern.com ([96.238.220.215]) by vms044.mailsrvcs.net (Sun Java System Messaging Server 6.2-6.01 (built Apr 3 2006)) with ESMTPA id <0KDK004QXU1BFRJ2@vms044.mailsrvcs.net> for zsh-workers@sunsite.dk; Fri, 16 Jan 2009 12:29:40 -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 n0GITYAN022121 for ; Fri, 16 Jan 2009 10:29:35 -0800 Received: (from schaefer@localhost) by torch.brasslantern.com (8.13.1/8.13.1/Submit) id n0GITYcb022120 for zsh-workers@sunsite.dk; Fri, 16 Jan 2009 10:29:34 -0800 Date: Fri, 16 Jan 2009 10:29:34 -0800 From: Bart Schaefer Subject: Re: sourcing a sh file in zsh In-reply-to: <200901161939.54651.arvidjaar@newmail.ru> To: zsh-workers@sunsite.dk Message-id: <090116102934.ZM22119@torch.brasslantern.com> MIME-version: 1.0 X-Mailer: OpenZMail Classic (0.9.2 24April2005) Content-type: text/plain; charset=us-ascii References: <090116075615.ZM21871@torch.brasslantern.com> <200901161939.54651.arvidjaar@newmail.ru> Comments: In reply to Andrey Borzenkov "Re: sourcing a sh file in zsh" (Jan 16, 7:39pm) X-Virus-Scanned: ClamAV 0.92.1/8872/Fri Jan 16 17:55:46 2009 on bifrost X-Virus-Status: Clean [Moved to -workers] On Jan 16, 7:39pm, Andrey Borzenkov wrote: } } > You'll probably need to do something like } > } > emulate sh } > source bla.sh } } Given that most distributions have equivalence of /etc/profile.d, having } simple zsh way to do it (without scoping issues) would be nice. I'm reluctant to suggest adding options to "source", but introducing an alternate name ("zsource"?) might allow something like zsource -e sh file.sh with the obvious meaning of "turn on sh emulation while sourcing" and would otherwise behave like "source". Might need a variant that has the path-searching semantics of "." as well. Another possibility would be to extend the "emulate" command into a precommand modifier sort of thing, where arguments following the name of the emulation are treated as a command to execute. Perhaps require another option to make this active, to avoid any compatibily issue. emulate -LRE sh source file.sh (I can't decide whether the new option should be S(ource), X(ecute), or E(val), nor whether it should be upper case.) In this case the -c and -a options of "exec" might be included as well.