From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 17968 invoked from network); 11 Oct 2007 14:05:11 -0000 X-Spam-Checker-Version: SpamAssassin 3.2.3 (2007-08-08) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00 autolearn=ham version=3.2.3 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by ns1.primenet.com.au with SMTP; 11 Oct 2007 14:05:11 -0000 Received-SPF: none (ns1.primenet.com.au: domain at sunsite.dk does not designate permitted sender hosts) Received: (qmail 70200 invoked from network); 11 Oct 2007 14:05:05 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 11 Oct 2007 14:05:05 -0000 Received: (qmail 1819 invoked by alias); 11 Oct 2007 14:04:59 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 23935 Received: (qmail 1806 invoked from network); 11 Oct 2007 14:04:58 -0000 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by sunsite.dk with SMTP; 11 Oct 2007 14:04:58 -0000 Received: (qmail 69690 invoked from network); 11 Oct 2007 14:04:58 -0000 Received: from banki.eumelnet.de (HELO uucp.gnuu.de) (83.246.114.63) by a.mx.sunsite.dk with SMTP; 11 Oct 2007 14:04:53 -0000 Received: by uucp.gnuu.de (Postfix, from userid 10) id 9D6AC48802D; Thu, 11 Oct 2007 16:04:52 +0200 (CEST) Received: from news by alea.gnuu.de with local (Exim 4.63) (envelope-from ) id 1IfyDY-0006eo-Vn for zsh-workers@sunsite.dk; Thu, 11 Oct 2007 15:36:49 +0200 To: zsh-workers@sunsite.dk Path: not-for-mail From: =?UTF-8?Q?J=C3=B6rg?= Sommer Newsgroups: local.mailinglist.zsh Subject: Re: expand-and-quote-alias Date: Thu, 11 Oct 2007 13:36:48 +0000 (UTC) Message-ID: References: <20071011095924.0f3afcc0@news01> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Trace: alea.gnuu.de 1192109808 25574 192.168.0.5 (11 Oct 2007 13:36:48 GMT) X-Complaints-To: usenet@alea.gnuu.de User-Agent: slrn/0.9.8.1pl2 (Debian) Sender: news Hallo Peter, Peter Stephenson wrote: > You can safely set the whole alias to something along these lines, > alias ls='\ls --color -lA' > say (a single "\" is enough to inhibit alias expansion). > > With a little more work you can make _expand_alias do that. You probably > want to base it on the latest version from the archive since there was a > bug that it used to remove quoting (although that doesn't quite impinge on > the problem in question). Care is needed since if the alias expansion > starts with a special character you definitely don't want to add a > backslash. > > With even more effort you can split it into words, see if the first word > is the same as the original first word, and only add the backslash in that > case. This is non-invasive enough to be worth applying to the archive. > Here's the complete result. It's not perfect but it handles normal > cases like the present one. Thanks, it works like a charm. Really cool. bye, Jörg. -- “UNIX was not designed to stop people from doing stupid things, because that would also stop them from doing clever things.” (Doug Gwyn)