Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I'm on my phone at the moment, but I did something similar except avoided the counting. I have a shell function called `ct` for "climb tree" where you specify the name of the directory you want to climb to; calling it will place you in the first directory above cwd whose name matches the argument and in addition I wrote a bash completion module for it so I only have to type minimal characters. I'll post the source for both shortly.


Here's the script for ct:

http://pastebin.com/M1k1WL88

Looks like I wrote the tab-completion script on my work machine. I don't have access to it right now, but if I remember when I do have access I'll pastebin that as well.


This is awesome! You are awesome! :-)


Here's the tab completion script:

http://pastebin.com/mR8y1Rks

Note it's the only tab completion script I've written, and it's probably a hack :P


Thanks for following up. I think I'm going to play with this later this week.


No worries. Just throw them both in your .bashrc and you should be good to go.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: