From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 20596 invoked from network); 25 Jan 2009 10:42:02 -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; 25 Jan 2009 10:42:02 -0000 Received-SPF: none (ns1.primenet.com.au: domain at sunsite.dk does not designate permitted sender hosts) Received: (qmail 2539 invoked from network); 25 Jan 2009 10:41:56 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 25 Jan 2009 10:41:56 -0000 Received: (qmail 24502 invoked by alias); 25 Jan 2009 10:41:53 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 26428 Received: (qmail 24491 invoked from network); 25 Jan 2009 10:41:53 -0000 Received: from bifrost.dotsrc.org (130.225.254.106) by sunsite.dk with SMTP; 25 Jan 2009 10:41:53 -0000 Received: from mail-ew0-f16.google.com (mail-ew0-f16.google.com [209.85.219.16]) by bifrost.dotsrc.org (Postfix) with ESMTP id D35C980271F0 for ; Sun, 25 Jan 2009 11:41:50 +0100 (CET) Received: by ewy9 with SMTP id 9so412343ewy.21 for ; Sun, 25 Jan 2009 02:41:50 -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:content-type :content-transfer-encoding:message-id; bh=IHToyQJYhIxmvWiGfHhLZvkowBB0u1petMleYMAeiO0=; b=DCeUdqcubYXG65Z0XBm1y6FOVMIOI/0f02es2bjCOv2Zby4HfzH/XdOtBoB+y0lKPc AS26m3vgyDUkAv3EhSd3gw+hbBaJRwur6CY5KtwS1ptSBQvArXdTlNmxqFy8qXPIJ69v e9BNY1WwlT46INp9ZrOg45xTFw785GMHZt7sE= 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 :content-type:content-transfer-encoding:message-id; b=kmL6nPUBsHWZ+qwbCii7NrmXq8VzxUChK3N/yCm+CQvzCcgwus+Cv1qs+4k9SqX2AT H8aAk3cqRT7gz2ir9Y5Ihn8xFn1bsquTOIqb1gCZIwdMsAxFqDvZSh1gBqs09+O4ua5A 33eT1hvJn9hRiPYcXYl/9YLozxj9hh8iZaUoY= Received: by 10.210.61.11 with SMTP id j11mr1230589eba.60.1232880109761; Sun, 25 Jan 2009 02:41:49 -0800 (PST) Received: from cooker.localnet (ppp91-77-239-56.pppoe.mtu-net.ru [91.77.239.56]) by mx.google.com with ESMTPS id 5sm2070965eyf.27.2009.01.25.02.41.48 (version=TLSv1/SSLv3 cipher=RC4-MD5); Sun, 25 Jan 2009 02:41:49 -0800 (PST) From: Andrey Borzenkov To: zsh-workers@sunsite.dk Subject: Re: sourcing a sh file in zsh Date: Sun, 25 Jan 2009 13:41:37 +0300 User-Agent: KMail/1.11.0 (Linux/2.6.29-rc2-1avb; KDE/4.1.96; i686; ; ) References: <200901251156.04815.arvidjaar@gmail.com> <2d460de70901250225g37845bftbbf4b87f12997a7c@mail.gmail.com> In-Reply-To: <2d460de70901250225g37845bftbbf4b87f12997a7c@mail.gmail.com> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="nextPart1480187.FgHoKgcIf2"; protocol="application/pgp-signature"; micalg=pgp-sha1 Content-Transfer-Encoding: 7bit Message-Id: <200901251341.44463.arvidjaar@gmail.com> X-Virus-Scanned: ClamAV 0.92.1/8900/Sun Jan 25 03:40:27 2009 on bifrost X-Virus-Status: Clean --nextPart1480187.FgHoKgcIf2 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 13:25:34 Richard Hartmann w= rote: > On Sun, Jan 25, 2009 at 09:56, Andrey Borzenkov =20 wrote: > > Actually you can always do > > > > foo=3D$(<<-\HERE > > function foo { > > ... > > } > > HERE) > > emulate -c sh $foo > > The problem with that is that it's not immediately apparent that this > function is intended to be executed in a different emulation. > Bart's suggestion is a lot easier to read for a third party and will > thus create less errors. > I asked already - why would you want to create non-zsh function inline=20 in zsh script? Anyway, if you really need it emulate -? sh -c "${$(<<-\HERE function foo { =2E.. } HERE )}" --nextPart1480187.FgHoKgcIf2 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) iEYEABECAAYFAkl8QeIACgkQR6LMutpd94wLSACeLJAmIykUuKRDhD+7z01J4QdB o3QAoJ5oQTyD9Qj8rW3HyS8NhFkvpRf7 =4M72 -----END PGP SIGNATURE----- --nextPart1480187.FgHoKgcIf2--