From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: zsh-workers-request@euclid.skiles.gatech.edu Received: from euclid.skiles.gatech.edu (list@euclid.skiles.gatech.edu [130.207.146.50]) by coral.primenet.com.au (8.7.5/8.7.3) with ESMTP id IAA02741 for ; Wed, 6 Nov 1996 08:38:16 +1100 (EST) Received: (from list@localhost) by euclid.skiles.gatech.edu (8.7.3/8.7.3) id QAA00756; Tue, 5 Nov 1996 16:30:10 -0500 (EST) Resent-Date: Tue, 5 Nov 1996 16:15:57 -0500 (EST) From: "Bart Schaefer" Message-Id: <961105131929.ZM5724@candle.brasslantern.com> Date: Tue, 5 Nov 1996 13:19:29 -0800 In-Reply-To: Nate Johnston "Re: Mailpath notification message" (Nov 5, 3:13pm) References: Reply-To: schaefer@nbn.com X-Mailer: Z-Mail (4.0b.820 20aug96) To: Nate Johnston , zsh-users@math.gatech.edu Subject: Re: Mailpath notification message MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Resent-Message-ID: <"Txi29.0.a6.DwwVo"@euclid> Resent-From: zsh-users@math.gatech.edu X-Mailing-List: archive/latest/492 X-Loop: zsh-users@math.gatech.edu X-Loop: zsh-workers@math.gatech.edu Precedence: list Resent-Sender: zsh-workers-request@math.gatech.edu On Nov 5, 3:13pm, Nate Johnston wrote: } Subject: Re: Mailpath notification message } } Quite a while ago, there was a person asking how to string long lines into } his MAILPATH. This is (approximately) what was written as an answer, } perhaps by Mr. Stephenson (if I remember truly). Nope, it was me. } setopt magic_equal_subst # for `export foo=~/bar` } function export() { EXPORT=${1%%\=*} ; typeset -Ux $* } } function +() { eval builtin export ${EXPORT}=\$\{$EXPORT\}:\$1 } } # some stuff snipped } export MAILPATH= "~/mail/in/inbox?Mail in folder 1" } + "~/.samizdat/in/inbox?Mail in filder 2" } # more snipped } unfunction export + } } This used to work for me. Now however, I get the message that the second } one (~/.samizdat..etc) is not an identifier. The first export has to look like a real variable assignment: export MAILPATH="~/mail/in/inbox?Mail in folder 1" + "~/.samizdat/in/inbox?Mail in filder 2" It was never supposed to work with spaces after the `=' sign; that it ever did was because of poor parsing in eariler versions of zsh. Also, putting quotes around the leading `~' protects that from expansion even with magic_equal_subst set, so the eventual value of the variable is: ~/mail/in/inbox?Mail in folder 1:~/.samizdat/in/inbox?Mail in filder 2 Which I *think* works for $MAILPATH but would not work for $PATH etc. It would be better to say (note position of the quotes): export MAILPATH=~/mail/in/inbox"?Mail in folder 1" + ~/.samizdat/in/inbox"?Mail in filder 2" Finally, what's a filder? ;-> -- Bart Schaefer Brass Lantern Enterprises http://www.well.com/user/barts http://www.nbn.com/people/lantern