From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 26950 invoked from network); 26 Jan 2009 16:50:32 -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.6 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; 26 Jan 2009 16:50:32 -0000 Received-SPF: none (ns1.primenet.com.au: domain at sunsite.dk does not designate permitted sender hosts) Received: (qmail 22520 invoked from network); 26 Jan 2009 16:50:27 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 26 Jan 2009 16:50:27 -0000 Received: (qmail 12352 invoked by alias); 26 Jan 2009 16:50:23 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 26449 Received: (qmail 12335 invoked from network); 26 Jan 2009 16:50:23 -0000 Received: from bifrost.dotsrc.org (130.225.254.106) by sunsite.dk with SMTP; 26 Jan 2009 16:50:23 -0000 Received: from mail-ew0-f20.google.com (mail-ew0-f20.google.com [209.85.219.20]) by bifrost.dotsrc.org (Postfix) with ESMTP id AA32C80271F0 for ; Mon, 26 Jan 2009 17:50:19 +0100 (CET) Received: by ewy13 with SMTP id 13so717427ewy.21 for ; Mon, 26 Jan 2009 08:50:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:from:to:subject:date :user-agent:references:in-reply-to:mime-version:message-id :content-type:content-transfer-encoding:content-disposition; bh=anGVnNqPwiWDoJoaS2VTECyr6D8ZVoV9DBHDZG9kshE=; b=e4i7/MtSQMS9Rx1RGbh2ojY/nhGkNWx0mRz9m2kYYrl2GFCkMewf7LTcU56jdjOKja 0QBvwWwHuWpuWy7ocW12fVqyAb007wxuvmukkuvXYhdgT49wCGd0t+PYhvDFjg7HtAw+ nYHYSwJTAFM3a8klrEf8d7l9EoYMZZMZj4JxE= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:to:subject:date:user-agent:references:in-reply-to:mime-version :message-id:content-type:content-transfer-encoding :content-disposition; b=MaPiUNhdoXZ5+cPse0MB9nC2nVEXbuJNnasX/bAPNgKlGRqvW3UIgVfo+SaHgKX9im sQ21KToL0y+wzhfgRgHmKLQ6ry+W8GYDUj0r9dyoD2GI812T1mFu5PYtiJHT05ZuMWtU ULD7I7pCzBbFw/Zyqt1PnaGJ9F+S9DtpNDCpQ= Received: by 10.86.59.18 with SMTP id h18mr292549fga.5.1232988618794; Mon, 26 Jan 2009 08:50:18 -0800 (PST) Received: from cooker.localnet (ppp91-77-236-53.pppoe.mtu-net.ru [91.77.236.53]) by mx.google.com with ESMTPS id l19sm6893698fgb.52.2009.01.26.08.50.13 (version=TLSv1/SSLv3 cipher=RC4-MD5); Mon, 26 Jan 2009 08:50:17 -0800 (PST) From: Andrey Borzenkov To: zsh-workers@sunsite.dk Subject: Re: sourcing a sh file in zsh Date: Mon, 26 Jan 2009 19:49:52 +0300 User-Agent: KMail/1.11.0 (Linux/2.6.29-rc2-1avb; KDE/4.1.96; i686; ; ) References: <200901252126.46188.arvidjaar@newmail.ru> <090125235121.ZM16865@torch.brasslantern.com> In-Reply-To: <090125235121.ZM16865@torch.brasslantern.com> MIME-Version: 1.0 Message-Id: <200901261949.54010.arvidjaar@gmail.com> Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline X-Virus-Scanned: ClamAV 0.92.1/8904/Mon Jan 26 14:06:06 2009 on bifrost X-Virus-Status: Clean On 26 =D1=8F=D0=BD=D0=B2=D0=B0=D1=80=D1=8F 2009 10:51:21 Bart Schaefer wrot= e: > > } For external script library (which is unaware of zsh in any > } case) it is simple > } > } emulate sh -c "setopt sticky_emulation; source > /my/shell/library.sh" > > This doesn't work, does it?=20 Right, because this option does not exist. Or do you mean something=20 else? > "emulate sh -c ..." does not imply a > full setopts reset at the end of the eval, only a reset of the > emulation mode.=20 It does. This is exactly what LOCAL_OPTIONS does as well. Except=20 LOCAL_OPTIONS also preserves PRIVILEGED and RESTRICTED (which does not=20 seem to be documented btw). Initially I made this optional but changed=20 on your request :) > Also, are you implying that "emulate sh" would > implictly unset that setopt, requiring that it be re-asserted inside > the eval? > Oh, it was just saving extra unsetopt and localizing code :) > It just seems so much cleaner to wrap it all up in "emulate" in the > first place. OK; as I already said, adding extra option to emulate is really the=20 minor problem.