[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: cd as much as possible



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
-- 
Kamaraju S Kusumanchi | http://raju.shoutwiki.com/wiki/Blog


Reply to: