From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from math.gatech.edu (euclid.skiles.gatech.edu [130.207.146.50]) by werple.net.au (8.7/8.7.1) with SMTP id KAA02017 for ; Thu, 9 Nov 1995 10:33:57 +1100 (EST) Received: by math.gatech.edu (5.x/SMI-SVR4) id AA27418; Wed, 8 Nov 1995 18:20:24 -0500 Resent-Date: Wed, 08 Nov 1995 18:17:19 -0500 Old-Return-Path: Message-Id: <199511082317.SAA29367@redwood.skiles.gatech.edu> X-Mailer: exmh version 1.6.4 10/10/95 To: zsh-workers@math.gatech.edu Subject: Re: Rationalized? aliases In-Reply-To: Your message of "Wed, 08 Nov 1995 15:57:37 EST." <9511082057.AA08200@spacely.afive> Mime-Version: 1.0 Content-Type: text/plain Date: Wed, 08 Nov 1995 18:17:19 -0500 From: Richard Coleman Resent-Message-Id: <"6b3mz.0.Ki6.tiJem"@euclid> Resent-From: zsh-workers@math.gatech.edu X-Mailing-List: archive/latest/573 X-Loop: zsh-workers@math.gatech.edu Precedence: list Resent-Sender: zsh-workers-request@math.gatech.edu > Now however, the rationalized alias output makes this not work: > > % echo $ZSH_VERSION > 2.6-beta11 > alias e="gnuclient -q" > % [[ $HOST != $HOMESYSTEM ]] && alias e="$(whence e) -h $HOMESYSTEM" > % type e > e is an alias for \''gnuclient -q'\'' -h spacely' > > This is not what I desire ('gnuclient -q' is not a valid command) - what > I want is to append "-h spacely" to the alias. How can I do this? Hmm... A quick fix for your problem is to change printaliasnode() in hashtable.c so that when the flags PRINT_WHENCE_* are present, that it will use printf (or puts) instead of printquoted(). This is exactly how it was done in beta10. But is this what we want to do? It looks natural for the output of `type' and `which' to be quoted. For `whence' it is not quite so clear which is best. Rather than changing the code of zsh for this, maybe you should just use alias e="$(whence e | tr -d \') -h" Doing things like this is what makes command substitution so cool. rc