From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 29744 invoked from network); 27 Jan 2009 00:51:49 -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=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; 27 Jan 2009 00:51:49 -0000 Received-SPF: none (ns1.primenet.com.au: domain at sunsite.dk does not designate permitted sender hosts) Received: (qmail 58644 invoked from network); 27 Jan 2009 00:51:43 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 27 Jan 2009 00:51:43 -0000 Received: (qmail 22234 invoked by alias); 27 Jan 2009 00:51:38 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 26456 Received: (qmail 22223 invoked from network); 27 Jan 2009 00:51:37 -0000 Received: from bifrost.dotsrc.org (130.225.254.106) by sunsite.dk with SMTP; 27 Jan 2009 00:51:37 -0000 Received: from fg-out-1718.google.com (fg-out-1718.google.com [72.14.220.155]) by bifrost.dotsrc.org (Postfix) with ESMTP id A880E80271F0 for ; Tue, 27 Jan 2009 01:51:34 +0100 (CET) Received: by fg-out-1718.google.com with SMTP id e21so3533550fga.37 for ; Mon, 26 Jan 2009 16:51:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=CK99bd75yahZHmOjSHfu1kCTqlbekhgmPwYNbJjSMao=; b=RLDSNtA1LInLy9eVij1Fxlk5NQxJRQEO0Gf4nIrvcJkGD3cWec1lsZMx2i/KCS+DDK +UA8EUOm5Bk10IP9UAQJJLFcJqdb9SGPIk+X8nmEn6ZtmB/z7K/XL12wHkJ1JRDwcfcP lSFxtBRRhPm95zjIlTx96uEUAMIrCThfn64Zk= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=tMCnQehnkofd6lCzhZUr/ib3rTXypVjiDF9PdlocaektZkGiEBmdXbHyeuMfVzlZGn jJGDrdJJVw3I2DMlyWvHgeJ3vx3HaoArGJuQ7UopkXzJlxmLu5lHDLaPhK2UGCMX0JBg YUd1OSoiRA+Wo2zjyISKBP8Wn1sezjdsXdiSM= MIME-Version: 1.0 Received: by 10.181.141.18 with SMTP id t18mr2501075bkn.205.1233017494110; Mon, 26 Jan 2009 16:51:34 -0800 (PST) In-Reply-To: <20090126230713.GA18017@redoubt.spodhuis.org> References: <200901251156.04815.arvidjaar@gmail.com> <2d460de70901250225g37845bftbbf4b87f12997a7c@mail.gmail.com> <200901251341.44463.arvidjaar@gmail.com> <20090126230713.GA18017@redoubt.spodhuis.org> Date: Tue, 27 Jan 2009 01:51:34 +0100 Message-ID: <2d460de70901261651t40f934aam21068aeaea262775@mail.gmail.com> Subject: Re: sourcing a sh file in zsh From: Richard Hartmann To: zsh-workers@sunsite.dk Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.92.1/8905/Mon Jan 26 18:29:36 2009 on bifrost X-Virus-Status: Clean On Tue, Jan 27, 2009 at 00:07, Phil Pennock wrote: > What I do like with the > setopt approach is that there's a way for zsh to test if this is > currently the case. > > Eg, for bash/zsh portability, you could do: > if [[ -n $ZSH_VERSION && -o sticky_options ]] > since both support [[ conditional ]] and both support -o as a unary > prefix test (both using it for testing shell options). emulate could simply set $ZSH_STICKY to 'sh' or something similar could happen. It would give more information than a simple [[ -o sticky_options ]] and tie into existing mechanisms just as nicely. Richard