Date: Thu, 10 Mar 2016 22:45:09
From: kamaraju kusumanchi <raju.mailinglists@gmail.com>
To: "debian-user@lists.debian.org" <debian-user@lists.debian.org>,
tlikonen@iki.fi
Subject: Re: cd as much as possible
Resent-Date: Fri, 11 Mar 2016 03:45:45 +0000 (UTC)
Resent-From: debian-user@lists.debian.org
On Thu, Mar 10, 2016 at 2:11 AM, Teemu Likonen <tlikonen@iki.fi> wrote:
I don't know about zsh but here's a sh/bash function:
mycd() {
local dir=$1
while ! cd -- "$dir"; do
dir=$(dirname -- "$dir")
done
}
This is exactly what I wanted. Thanks. It works in zsh too.
raju