From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 10450 invoked from network); 25 Jan 2009 18:27:09 -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; 25 Jan 2009 18:27:09 -0000 Received-SPF: none (ns1.primenet.com.au: domain at sunsite.dk does not designate permitted sender hosts) Received: (qmail 32629 invoked from network); 25 Jan 2009 18:27:03 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 25 Jan 2009 18:27:03 -0000 Received: (qmail 27219 invoked by alias); 25 Jan 2009 18:26:55 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 26434 Received: (qmail 27209 invoked from network); 25 Jan 2009 18:26:54 -0000 Received: from bifrost.dotsrc.org (130.225.254.106) by sunsite.dk with SMTP; 25 Jan 2009 18:26:54 -0000 Received: from flock1.newmail.ru (flock1.newmail.ru [82.204.219.207]) by bifrost.dotsrc.org (Postfix) with SMTP id E961880271F0 for ; Sun, 25 Jan 2009 19:26:50 +0100 (CET) Received: (qmail 455 invoked from network); 25 Jan 2009 18:26:51 -0000 Received: from unknown (HELO cooker.localnet) (arvidjaar@newmail.ru@91.77.130.222) by smtpd.newmail.ru with SMTP; 25 Jan 2009 18:26:51 -0000 From: Andrey Borzenkov To: zsh-workers@sunsite.dk Subject: Re: sourcing a sh file in zsh Date: Sun, 25 Jan 2009 21:26:29 +0300 User-Agent: KMail/1.11.0 (Linux/2.6.29-rc2-1avb; KDE/4.1.96; i686; ; ) References: <200901251156.04815.arvidjaar@gmail.com> <090125042011.ZM25084@torch.brasslantern.com> In-Reply-To: <090125042011.ZM25084@torch.brasslantern.com> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="nextPart3683587.CA8PJvveGa"; protocol="application/pgp-signature"; micalg=pgp-sha1 Content-Transfer-Encoding: 7bit Message-Id: <200901252126.46188.arvidjaar@newmail.ru> X-Virus-Scanned: ClamAV 0.92.1/8901/Sun Jan 25 11:10:36 2009 on bifrost X-Virus-Status: Clean --nextPart3683587.CA8PJvveGa Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline On 25 =D1=8F=D0=BD=D0=B2=D0=B0=D1=80=D1=8F 2009 15:20:09 Bart Schaefer wrot= e: > > } Yes, I am more and more inclined to make it "-c ..." ... OK to > commit? > > I think so. > Committed.=20 > } If you are defining function in a *zsh* script, why not simply > define it } as *zsh* function? > > emulate sh > # ... > emulate zsh -c "${$(<<\HERE > function ... > HERE)}" > # ... > > Yeah, that's a bit contrived. Hmm ... not convinced by this example but I realize now that if sticky=20 emulation is going to be implemented, it could be useful to define=20 sticky *zsh* function in zsh script. I still believe using option is the most simple and straightforward way=20 to do it. For external script library (which is unaware of zsh in any=20 case) it is simple emulate sh -c "setopt sticky_emulation; source /my/shell/library.sh" and zsh script can obviously do setopt sticky_emulation function zsh_func { ... } unsetopt sticky_emulation --nextPart3683587.CA8PJvveGa Content-Type: application/pgp-signature; name=signature.asc Content-Description: This is a digitally signed message part. -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (GNU/Linux) iEYEABECAAYFAkl8rtgACgkQR6LMutpd94whlQCeMsuyiW+UWM5wMr9JwzQ8BMWy fTAAoLQG8qEIAZRlb16KBiOeLAqjRdQp =y3b3 -----END PGP SIGNATURE----- --nextPart3683587.CA8PJvveGa--