From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 18279 invoked from network); 31 Jan 2005 16:25:31 -0000 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by ns1.primenet.com.au with SMTP; 31 Jan 2005 16:25:31 -0000 Received: (qmail 6854 invoked from network); 31 Jan 2005 16:25:25 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 31 Jan 2005 16:25:25 -0000 Received: (qmail 20965 invoked by alias); 31 Jan 2005 16:24:53 -0000 Mailing-List: contact zsh-users-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 8440 Received: (qmail 20950 invoked from network); 31 Jan 2005 16:24:52 -0000 Received: from unknown (HELO a.mx.sunsite.dk) (130.225.247.88) by sunsite.dk with SMTP; 31 Jan 2005 16:24:52 -0000 Received: (qmail 5152 invoked from network); 31 Jan 2005 16:24:16 -0000 Received: from mtiwmhc12.worldnet.att.net (204.127.131.116) by a.mx.sunsite.dk with SMTP; 31 Jan 2005 16:24:12 -0000 Received: from [10.0.1.3] (h-66-167-77-226.snvacaid.dynamic.covad.net[66.167.77.226]) by worldnet.att.net (mtiwmhc12) with SMTP id <2005013116240811200qqq8qe> (Authid: wgscott); Mon, 31 Jan 2005 16:24:08 +0000 Mime-Version: 1.0 (Apple Message framework v619.2) Content-Transfer-Encoding: 7bit Message-Id: <5ced8dfb84fe26e20350095da48dd44d@chemistry.ucsc.edu> Content-Type: text/plain; charset=US-ASCII; format=flowed To: L:ZSH-users From: William Scott Subject: odd recursion Date: Mon, 31 Jan 2005 08:24:09 -0800 X-Mailer: Apple Mail (2.619.2) X-Spam-Checker-Version: SpamAssassin 3.0.2 on a.mx.sunsite.dk X-Spam-Level: X-Spam-Status: No, score=-2.6 required=6.0 tests=BAYES_00 autolearn=ham version=3.0.2 X-Spam-Hits: -2.6 Hi Everyone: I stumbled onto something that makes me realize there is a lot to zsh I don't understand. I've resolved the problem, but I still don't understand it. The problem comes about if I first define an alias for a command and then a posix function for the same command. Issuing the command after doing this results in a recursion and my system freezes up if I am not quick with the control-C key. I am using zsh on OS X v. 10.3. This happens at least with zsh v. 4.1.1 and the current 4.2.3. Just to be sure, I issue these commands first: unalias ls unalias lf unfunction ls unfunction lf alias lf='command ls -Fa' lf () { command ls --color=auto -lh ${*} | egrep "^d" command ls --color=auto -lh $* 2>& - | egrep -v "^d|total " } Then use lf. It looks like some sort of recursion happens, even though I don't see logically what it is, and I have prefixed ls with "command" in each case. The ONLY cure I found (apart from not doing this) is to use function lf { commands } syntax instead of posix syntax. Then it all works. The bash to zsh book gave me the impression that the two syntaxes are now equivalent. Clearly that impression is wrong. Thanks for any insights. Bill