From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 10291 invoked from network); 12 Feb 1999 20:18:00 -0000 Received: from sunsite.auc.dk (130.225.51.30) by ns1.primenet.com.au with SMTP; 12 Feb 1999 20:18:00 -0000 Received: (qmail 102 invoked by alias); 12 Feb 1999 20:17:26 -0000 Mailing-List: contact zsh-users-help@sunsite.auc.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 2137 Received: (qmail 92 invoked from network); 12 Feb 1999 20:17:20 -0000 Comments: ( Received on ftpbox.mot.com from client pobox2.mot.com, sender schrof@cig.mot.com ) Message-Id: <199902122018.PAA29284@po_box.cig.mot.com> Date: Fri, 12 Feb 1999 14:17:14 -0600 From: "Larry P . Schrof" To: zsh-users@sunsite.auc.dk Subject: Setting paths with ~'s in values. Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 0.95.1i I have many different machine that I have accouts on, so I conditionally set my path with the following in my .zshenv ... --- # Generate a nice-looking path, including only directories that exist. for t_path in "${(f)$(<${HOME}/.zpaths)}" do if [[ -d $t_path ]] then PATH=${PATH}:${~t_path} fi done PATH=${PATH[2,-1]} # Nuke the leading ':' --- .zpaths is a file that contains one directory per line. It starts with the following entries: ~/bin ~/loc/bin ~/loc/X11R6/bin ... >>From the man page, I was under the impression that putting the ~ before the variable would expand the '~' in each of those paths. Apparently, it does not. I could probably make a variable substituion from '~' to ${HOME}, but it seems like there should be a more elegant way to do it. Obiously, I don't want to explicitly enter the full path of ${HOME} in .zpaths. Suggestions? Thanks - Larry