From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 11226 invoked from network); 23 Apr 2007 08:45:31 -0000 X-Spam-Checker-Version: SpamAssassin 3.1.8 (2007-02-13) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.5 required=5.0 tests=BAYES_00,FORGED_RCVD_HELO autolearn=ham version=3.1.8 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by ns1.primenet.com.au with SMTP; 23 Apr 2007 08:45:31 -0000 Received-SPF: none (ns1.primenet.com.au: domain at sunsite.dk does not designate permitted sender hosts) Received: (qmail 55580 invoked from network); 23 Apr 2007 08:45:22 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 23 Apr 2007 08:45:22 -0000 Received: (qmail 18810 invoked by alias); 23 Apr 2007 08:45:14 -0000 Mailing-List: contact zsh-users-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 11443 Received: (qmail 18790 invoked from network); 23 Apr 2007 08:45:13 -0000 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by sunsite.dk with SMTP; 23 Apr 2007 08:45:13 -0000 Received: (qmail 54255 invoked from network); 23 Apr 2007 08:45:13 -0000 Received: from atom.smasher.org (69.55.237.145) by a.mx.sunsite.dk with SMTP; 23 Apr 2007 08:45:08 -0000 Received: (qmail 16912 invoked by uid 1000); 23 Apr 2007 08:45:06 -0000 Message-ID: <20070423084506.16911.qmail@smasher.org> Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Date: Mon, 23 Apr 2007 20:45:00 +1200 (NZST) From: Atom Smasher In-Reply-To: <20070422181817.GD16598@fsst.voodoo.lan> MIME-Version: 1.0 OpenPGP: id=0xB88D52E4D9F57808; algo=1 (RSA); size=4096; url=http://atom.smasher.org/pgp.txt References: <20070416160051.GB28724@fsst.voodoo.lan> <20070421151225.58926.qmail@smasher.org> <20070422181817.GD16598@fsst.voodoo.lan> Subject: Re: cd to a file To: zsh-users@sunsite.dk X-POM: The Moon is Waxing Crescent (41% of Full) X-Hashcash: 1:20:0704230845:zsh-users@sunsite.dk::s6TUCCTlcbWFok3F:0000000000000 0000000000000000000000003dzA On Sun, 22 Apr 2007, Frank Terbeck wrote: >> cd() { >> ## cd to a file >> if [ 1 = "${#}" ] && [ '-' != "${1}" ] && [ \! -d "${1}" ] && [ -d "${1:h}" ] >> then >> echo "correcting \"${1}\" to \"${1:h}\"" >&2 >> builtin cd "${1:h}" >> else >> builtin cd "${@}" >> fi >> } > > This breaks things like 'cd -2', 'cd +2' or 'cd +'. ========================== i haven't used those... back to the drawing board... -- ...atom ________________________ http://atom.smasher.org/ 762A 3B98 A3C3 96C9 C6B7 582A B88D 52E4 D9F5 7808 ------------------------------------------------- Democracy, n.: A government of the masses. Authority derived through mass meeting or any other form of direct expression. Results in mobocracy. Attitude toward property is communistic... negating property rights. Attitude toward law is that the will of the majority shall regulate, whether it is based upon deliberation or governed by passion, prejudice, and impulse, without restraint or regard to consequences. Result is demagogism, license, agitation, discontent, anarchy. -- U. S. Army Training Manual No. 2000-25 (1928-1932), since withdrawn.