Re: cd as much as possible

2016-03-19 Thread kamaraju kusumanchi
> > NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE > > > IMPORTANT: debian is famous for having like 5 different "delete all /tmp/ > files" in it's startup scripts (boot time, runlevel) > > you might very well NOT wish to keep any of your hard sweat in a place that > might by surprise be automatically de

Re: cd as much as possible

2016-03-15 Thread Jens Bauer
Hi Kamaraju. If I understand this correctly, then this is a kind of traversal - but only for a single directory. That should be a fairly easy thing to do. for file in tmp/*; do [ -d file ] echo "folder: $file" done ... only get those names you're interested in ... for file in tmp/issue-?*;

Re: cd as much as possible

2016-03-11 Thread Teemu Likonen
Jude DaShiell [2016-03-11 07:01:00-05] wrote: > The find command probably can handle this maybe in a shorter form. I > don't know as much syntax of that command as I'd like otherwise this > could probably written in a single line of code. "Probably", "maybe" and "I don't know"? Note that the ori

Re: cd as much as possible

2016-03-11 Thread Jude DaShiell
On Thu, 10 Mar 2016, kamaraju kusumanchi wrote: Date: Thu, 10 Mar 2016 22:45:09 From: kamaraju kusumanchi To: "debian-user@lists.debian.org" , tliko...@iki.fi Subject: Re: cd as much as possible Resent-Date: Fri, 11 Mar 2016 03:45:45 + (UTC) Resent-From: debian-user@lists.

Re: cd as much as possible

2016-03-10 Thread kamaraju kusumanchi
On Thu, Mar 10, 2016 at 1:48 AM, Jens Bauer wrote: > Hi Kamaraju. > > Yes, it's possible. You could for instance write a bash function, which would > do it. > But why would you want to do that ? I have the following directory structure tmp/issue-1 tmp/issue-5 tmp/issue-13 ... where the issue n

Re: cd as much as possible

2016-03-10 Thread kamaraju kusumanchi
On Thu, Mar 10, 2016 at 2:11 AM, Teemu Likonen 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 wan

Re: cd as much as possible

2016-03-09 Thread Teemu Likonen
kamaraju kusumanchi [2016-03-10 00:35:33-05] wrote: > Is it possible to change the behaviour of the "cd" command or have a > new command which works like cd but with an extra feature so that it > goes into the directory as deep as possible. > > For example, if I do > cd a1/a2/a3/a4 > > If all th

cd as much as possible

2016-03-09 Thread kamaraju kusumanchi
Is it possible to change the behaviour of the "cd" command or have a new command which works like cd but with an extra feature so that it goes into the directory as deep as possible. For example, if I do cd a1/a2/a3/a4 If all the directories are present, we cd into a1/a2/a3/a4. If all the direc