1 |
this might qualify to be added to the bash ebuild. might want to vote and |
2 |
see if enough people like it first. unless its already implemented in |
3 |
gentoo? |
4 |
|
5 |
---------------------------- Original Message ---------------------------- |
6 |
Subject: BASH feature: directory jumping w/o 'cd' |
7 |
From: "Walsh, Matt" <matt.walsh@×××××.com> |
8 |
Date: Tue, March 9, 2004 6:59 pm |
9 |
To: bug-bash@×××.org |
10 |
-------------------------------------------------------------------------- |
11 |
|
12 |
This improvement will save you three keystrokes, but they're 3 |
13 |
keystrokes you type a whole lot for no reason at all. Yes, I'm talking |
14 |
about the keystrokes 'c-d-(space)' |
15 |
|
16 |
I was a big fan of the old '4DOS' utility for DOS. One of my favorite |
17 |
features was where from a command line you could simply type a |
18 |
directory, and it would go there. I.e., instead of typing |
19 |
|
20 |
cd \Windows |
21 |
|
22 |
You, in 4DOS could just type |
23 |
|
24 |
\Windows |
25 |
|
26 |
In BASH, if you try this, it simply complains that "___ is a directory". |
27 |
In other words, it's a distinct unhandled case. Why not use this case for |
28 |
something useful? |
29 |
|
30 |
So, I made some mods to bash to make this in fact work like it did in |
31 |
4DOS. You only have to patch one file, 'execute_cmd.c' |
32 |
|
33 |
I threw together this web page with more details. |
34 |
http://www.mattwalsh.com/twiki/bin/view/Main/BashDirectoryJumpPatch |
35 |
|
36 |
I think users will find it addictive; I did with 4DOS and now it's like |
37 |
falling in love again. |
38 |
|
39 |
If it you find a hole in this scheme please let me know. The only thing I |
40 |
can think of is that some scripts might be sloppy and simply check to see |
41 |
if a directory exists in this really backwards way. The code |
42 |
changes were actually very simple. If it looks ok I'll submit a patch to |
43 |
the BASH mailing list. |
44 |
|
45 |
--matt Walsh |
46 |
|
47 |
|
48 |
<<bash_dirchange.patch>> |
49 |
_______________________________________________ |
50 |
Bug-bash mailing list |
51 |
Bug-bash@×××.org |
52 |
http://mail.gnu.org/mailman/listinfo/bug-bash |
53 |
|
54 |
|
55 |
|
56 |
-- |
57 |
dabozz@××××××××××××.org |