I have a German keyboard where I have to type Shift-7 to get the "/" char. I frequently miss the shift key and type path names starting with a 7. Is is possible to configure bash to replace "7etc" with "/etc" when I hit tab? How is it done?
Not an answer to your question but certainly a resolution may be to use the CDPATH environmental variable.
This is used similarly to the PATH Env Vairable ie a colon seperated list of directories. Whenever you cd to a directory if the directory does not exist in your cwd then all the directories in CDPATH are checked.
Hope that this helps
remember to include "." as the first entry in CDPATH, otherwise you can only cd into dirs in your current directory by prefixing with ./!!
There is a feature called programmable completion that comes with bash. It has no handler for a completion_not_found condition which would be similar to the command_not_found handler of the command completion. Once, I've read abount the Bash completion library which, among other enhancements, comes with this handler and the ability to replace pretyped text for the sake of a fuzzier completion. The project looks a bit stale though.