From: Atom Smasher <atom@smasher.org>
To: zsh-users@sunsite.dk
Subject: Re: cd to a file
Date: Mon, 23 Apr 2007 20:45:00 +1200 (NZST) [thread overview]
Message-ID: <20070423084506.16911.qmail@smasher.org> (raw)
In-Reply-To: <20070422181817.GD16598@fsst.voodoo.lan>
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.
prev parent reply other threads:[~2007-04-23 8:45 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-06-19 12:43 More zsh tricks required please zzapper
2004-06-19 13:06 ` Christian Schneider
2004-06-20 12:19 ` Julius Plenz
2004-06-21 0:38 ` Drew Perttula
2007-04-16 14:40 ` cd to a file Andy Spiegl
2007-04-16 16:00 ` Frank Terbeck
2007-04-18 1:08 ` Andy Spiegl
2007-04-21 15:12 ` Atom Smasher
2007-04-22 18:18 ` Frank Terbeck
2007-04-23 8:45 ` Atom Smasher [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20070423084506.16911.qmail@smasher.org \
--to=atom@smasher.org \
--cc=zsh-users@sunsite.dk \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.vuxu.org/mirror/zsh/
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).