From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 14738 invoked from network); 30 Jul 2001 11:01:47 -0000 Received: from sunsite.dk (130.225.51.30) by ns1.primenet.com.au with SMTP; 30 Jul 2001 11:01:47 -0000 Received: (qmail 1732 invoked by alias); 30 Jul 2001 11:01:05 -0000 Mailing-List: contact zsh-users-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 4077 Received: (qmail 1718 invoked from network); 30 Jul 2001 11:01:04 -0000 Message-ID: To: zsh-users@sunsite.dk (Zsh users list) Subject: =alias Date: Mon, 30 Jul 2001 12:00:22 +0100 From: Peter Stephenson There have been rumblings of discontent that equals substitution (=cmd), if it can't find an external command for which to insert the full path, instead expands aliases. For example, % alias ls='ls -F' notacommand='echo Hello' % print -l =ls =notacommand /home/pws/bin/ls echo Hello The problems are - You can't be sure what you're going to get. If you don't guard specially against aliases (in which case the expansion is not the shortcut it's supposed to be) you can get errors. - Aliases look completely different; they may not be single words and almost certainly aren't files. So it's difficult to handle both possible results in the same place. - The lookup is not only different from normal command execution, it's not even in the same order. If you have both an alias and a command, you get the command, whereas the shell would run the alias if given the same string. - Hence you can't guarantee to be able to expand a given alias that way at all. The zsh/parameter module provides specific alias lookup. The alias-lookup feature apparently appeared around 2.5. Is there anybody out there who wouldn't shout for joy if we removed the alias-lookup part of =-substitution so that it only expanded command paths? -- Peter Stephenson Software Engineer CSR Ltd., Unit 300, Science Park, Milton Road, Cambridge, CB4 0XL, UK Tel: +44 (0)1223 392070 ********************************************************************** The information transmitted is intended only for the person or entity to which it is addressed and may contain confidential and/or privileged material. Any review, retransmission, dissemination or other use of, or taking of any action in reliance upon, this information by persons or entities other than the intended recipient is prohibited. If you received this in error, please contact the sender and delete the material from any computer. **********************************************************************