[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
BASH feature: directory jumping w/o 'cd'
From: |
Walsh, Matt |
Subject: |
BASH feature: directory jumping w/o 'cd' |
Date: |
Tue, 9 Mar 2004 15:59:13 -0800 |
This improvement will save you three keystrokes, but they're 3
keystrokes you type a whole lot for no reason at all. Yes, I'm talking
about the keystrokes 'c-d-(space)'
I was a big fan of the old '4DOS' utility for DOS. One of my favorite
features was where from a command line you could simply type a
directory, and it would go there. I.e., instead of typing
cd \Windows
You, in 4DOS could just type
\Windows
In BASH, if you try this, it simply complains that "___ is a directory".
In other words, it's a distinct unhandled case. Why not use this case
for something useful?
So, I made some mods to bash to make this in fact work like it did in
4DOS. You only have to patch one file, 'execute_cmd.c'
I threw together this web page with more details.
http://www.mattwalsh.com/twiki/bin/view/Main/BashDirectoryJumpPatch
I think users will find it addictive; I did with 4DOS and now it's like
falling in love again.
If it you find a hole in this scheme please let me know. The only thing
I can think of is that some scripts might be sloppy and simply check to
see if a directory exists in this really backwards way. The code
changes were actually very simple. If it looks ok I'll submit a patch
to the BASH mailing list.
--matt Walsh
<<bash_dirchange.patch>>
bash_dirchange.patch
Description: bash_dirchange.patch
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- BASH feature: directory jumping w/o 'cd',
Walsh, Matt <=