From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 7182 invoked from network); 29 Oct 1997 16:52:57 -0000 Received: from math.gatech.edu (list@130.207.146.50) by ns1.primenet.com.au with SMTP; 29 Oct 1997 16:52:57 -0000 Received: (from list@localhost) by math.gatech.edu (8.8.5/8.8.5) id LAA03450; Wed, 29 Oct 1997 11:47:15 -0500 (EST) Resent-Date: Wed, 29 Oct 1997 11:45:57 -0500 (EST) Message-Id: <199710291646.RAA02780@hydra.ifh.de> To: ramos@ih4ess.ih.lucent.com, zsh-users@math.gatech.edu (Zsh users list) Subject: Re: Perl replacement challenge In-reply-to: "ramos@ih4ess.ih.lucent.com"'s message of "Wed, 29 Oct 1997 10:19:56 MET." <199710291619.KAA11548@ihnns581.ih.lucent.com> Date: Wed, 29 Oct 1997 17:46:58 +0100 From: Peter Stephenson Resent-Message-ID: <"V7WUe.0.Zq.4XsLq"@math> Resent-From: zsh-users@math.gatech.edu X-Mailing-List: archive/latest/1115 X-Loop: zsh-users@math.gatech.edu X-Loop: zsh-workers@math.gatech.edu Precedence: list Resent-Sender: zsh-workers-request@math.gatech.edu ramos@ih4ess.ih.lucent.com wrote: > I have a very simple and effective solution: > > # Use "kshdot some_ksh_script" instead of ". some_ksh_script" > > kshdot() { source =(ksh -c ". $* 1>&2; senv") } > > Where 'senv' is the following Perl script: > ... As a minimal modification which omits the Perl script, how about kshdot() { setopt allexport localoptions source =(ksh -c ". $* 1>&2; typeset +x _ PWD; typeset -x") } This lists exported variables directly from ksh, which quotes them where necessary; also it unexports _ and PWD (this does not reach back to the calling zsh of course) so they don't appear in the list. Since ksh doesn't put the `export' in front, you can use `allexport'; that only lasts for the length of the function. But remember you can make emulate local to a function. You might get away with something like kshdot() { emulate ksh; setopt localoptions; . $*; } at least for some of the scripts. -- Peter Stephenson Tel: +49 33762 77366 WWW: http://www.ifh.de/~pws/ Fax: +49 33762 77413 Deutsches Elektronen-Synchrotron --- Institut fuer Hochenergiephysik Zeuthen DESY-IfH, Platanenallee 6, 15738 Zeuthen, Germany.