From mboxrd@z Thu Jan 1 00:00:00 1970 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 NAA05112 for ; Fri, 9 Aug 1996 13:17:41 +1000 (EST) Received: (from list@localhost) by euclid.skiles.gatech.edu (8.7.3/8.7.3) id XAA21506; Thu, 8 Aug 1996 23:13:40 -0400 (EDT) Resent-Date: Thu, 8 Aug 1996 23:06:43 -0400 (EDT) From: "Bart Schaefer" Message-Id: <960808200651.ZM10843@candle.brasslantern.com> Date: Thu, 8 Aug 1996 20:06:51 -0700 In-Reply-To: Benjamin Drago ".zshenv file syntax: spanning lines with comments" (Aug 8, 7:22pm) References: <199608090022.TAA14251@ruiner.hc.ti.com> Reply-To: schaefer@nbn.com X-Mailer: Z-Mail (4.0b.702 02jul96) To: Benjamin Drago , zsh-users@math.gatech.edu Subject: Re: .zshenv file syntax: spanning lines with comments MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Resent-Message-ID: <"dKMpf2.0.XE5.3jg2o"@euclid> Resent-From: zsh-users@math.gatech.edu X-Mailing-List: archive/latest/348 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 Aug 8, 7:22pm, Benjamin Drago wrote: } Subject: .zshenv file syntax: spanning lines with comments } } current version: } } export PATH=/home/$USER/bin/$OSTYPE:/home/$USER/bin:/usr/local/bin:/opt/gnu/bin:/usr/bin:/usr/sbin:/usr/X11R6/bin:/vol/local/$OSTYPE/bin } } what I would like to do: } } export PATH=/home/$USER/bin/$OSTYPE: # arch dependent binaries } /home/$USER/bin: # arch independent scripts } /usr/local/bin: # local apps } /opt/gnu/bin: # gnu tools } ... Why are you using `/home/$USER' instead of `~' ? How about this: ----- snip ----- 8< ---- snip ----- setopt magic_equal_subst # for `export foo=~/bar` function export() { EXPORT=${1%%\=*} ; typeset -Ux $* } function +() { eval builtin export ${EXPORT}=\$\{$EXPORT\}:\$1 } export PATH=/home/$USER/bin/$OSTYPE # arch dependent binaries + /home/$USER/bin # arch independent scripts + /usr/local/bin # local apps + /opt/gnu/bin # gnu tools + ... unfunction export + ----- snip ----- 8< ---- snip ----- Now you can even do stuff like: export PATH=~/bin/$OSTYPE # arch dependent binaries + ~/bin # arch independent scripts case $OSTYPE in sun*) + $OPENWINHOME/bin # openwindows applications + /usr/ccs/bin # compiler tools + /opt/bin # optional packages ;; *) + /usr/bin/X11 # X11 applications ;; esac + /usr/local/bin # local apps + /opt/gnu/bin # gnu tools + ... I like that so much I might even rewrite my own .zshenv ... -- Bart Schaefer Brass Lantern Enterprises http://www.well.com/user/barts http://www.nbn.com/people/lantern New male in /home/schaefer: >N 2 Justin William Schaefer Sat May 11 03:43 53/4040 "Happy Birthday"