From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 9044 invoked from network); 13 Mar 2004 06:41:17 -0000 Received: from sunsite.dk (130.225.247.90) by ns1.primenet.com.au with SMTP; 13 Mar 2004 06:41:17 -0000 Received: (qmail 21075 invoked by alias); 13 Mar 2004 06:41:07 -0000 Mailing-List: contact zsh-users-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 7168 Received: (qmail 21058 invoked from network); 13 Mar 2004 06:41:06 -0000 Received: from localhost (HELO sunsite.dk) (127.0.0.1) by localhost with SMTP; 13 Mar 2004 06:41:06 -0000 X-MessageWall-Score: 0 (sunsite.dk) Received: from [167.160.213.139] by sunsite.dk (MessageWall 1.0.8) with SMTP; 13 Mar 2004 6:41:6 -0000 Received: from moonbase.zanshin.com (IDENT:schaefer@localhost [127.0.0.1]) by moonbase.zanshin.com (8.12.11/8.12.11) with ESMTP id i2D6f5JA020197 for ; Fri, 12 Mar 2004 22:41:05 -0800 Received: (from schaefer@localhost) by moonbase.zanshin.com (8.12.11/8.12.11/Submit) id i2D6f549020196 for zsh-users@sunsite.dk; Fri, 12 Mar 2004 22:41:05 -0800 Received: (from schaefer@localhost) by candle.brasslantern.com (8.11.6/8.11.6) id i2D6f0s28749; Fri, 12 Mar 2004 22:41:00 -0800 X-Authentication-Warning: candle.brasslantern.com: schaefer set sender to schaefer@closedmail.com using -f From: Bart Schaefer Message-Id: <1040313064100.ZM28748@candle.brasslantern.com> Date: Sat, 13 Mar 2004 06:41:00 +0000 In-Reply-To: Comments: In reply to Thorsten Kampe "named directory expansion on strings" (Mar 13, 4:29am) References: X-Mailer: Z-Mail (5.0.0 30July97) To: zsh-users@sunsite.dk Subject: Re: named directory expansion on strings MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Envelope-Sender: On Mar 13, 4:29am, Thorsten Kampe wrote: } } Is there a way to perform "named directory" expansion on strings? Sort of. See "print" in "man zshbuiltins" and look at the -D option. } Something like "autonamedirs" and the "%~" in the prompt... } } % file=/etc/foo } % ETCDIR=/etc } % echo `bar#!$whatever($file)` I take it that the stuff in backticks is something that you just made up to represent an arbitrary cryptic zsh incantation? } ~ETCDIR/foo You'd never get that in this particular example. "ETCDIR" has six letters, plus the tilde makes seven. "/etc" has four letters. Zsh always chooses whichever one is shorter. If you did % setopt auto_name_dirs % file=/etc/foo % E=/etc % print -D $file Then you'd get ~E/foo because ~E has only two letters.