From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 22541 invoked from network); 21 Jun 2000 16:40:11 -0000 Received: from sunsite.auc.dk (130.225.51.30) by ns1.primenet.com.au with SMTP; 21 Jun 2000 16:40:11 -0000 Received: (qmail 5803 invoked by alias); 21 Jun 2000 16:39:54 -0000 Mailing-List: contact zsh-users-help@sunsite.auc.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 3197 Received: (qmail 5795 invoked from network); 21 Jun 2000 16:39:52 -0000 From: "Bart Schaefer" Message-Id: <1000621163937.ZM31284@candle.brasslantern.com> Date: Wed, 21 Jun 2000 16:39:37 +0000 In-Reply-To: <20000622015151.A6048@localhost> Comments: In reply to Shao Zhang "Re: [OT] export http_proxy" (Jun 22, 1:51am) References: <20000616023433.A7142@localhost> <20000622015151.A6048@localhost> <20000622021256.A6423@localhost> In-Reply-To: <20000622021256.A6423@localhost> Comments: In reply to Shao Zhang "Re: [OT] export http_proxy" (Jun 22, 2:12am) X-Mailer: Z-Mail (5.0.0 30July97) To: Shao Zhang , ZSH Mail List Subject: Re: [OT] export http_proxy MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii On Jun 22, 1:51am, Shao Zhang wrote: } Subject: Re: [OT] export http_proxy } } Bart Schaefer [schaefer@brasslantern.com] wrote: } > On Fri, 16 Jun 2000, Shao Zhang wrote: } > } > case ${${(M)$(ifconfig ppp0):#addr:*}#addr:} in } > 192.168.68.1) export HTTP_PROXY=192.168.68.215;; } > 192.168.86.9) typeset +x HTTP_PROXY; unset HTTP_PROXY;; } > and-so-on) export HTTP_PROXY=and-so-forth;; } > esac } } Thanks again. This is my perfect solution. Putting an extra line } killall -USR2 zsh in the ip-up script made it all happen. } } Also, I am just wondering, are all these features unique to zsh, or } other shells have got them as well? All Bourne-shell-like shells have the "trap" command. As far as I know, zsh is the only one that uses magically-named TRAPxxx functions. Csh-like shells generally handle only INT and TERM signals, and then only in scripts, not interactively. On Jun 22, 2:12am, Shao Zhang wrote: } } Now, this fails when I open up a new xterm, is there anyway to allow } all the zsh process to share certain shell variables? Why not simply execute the trap handler code (e.g. the "case" above) in your .zshenv file, to set the variable properly as each shell starts? -- Bart Schaefer Brass Lantern Enterprises http://www.well.com/user/barts http://www.brasslantern.com Zsh: http://www.zsh.org | PHPerl Project: http://phperl.sourceforge.net