I'd like to instruct bash to use a special method to perform completion on certain directory names. For example, bash would call a program of mine to perform completion if a path starts with "$$", and perform completion normally otherwise.
Is this at all possible? How would you implement it?
Bounty: I'd really appreciate an answer to that question. The goal is to allow autojump to complete paths for all commands when the user starts them with a certain prefix. So for example when copying a file from a far directory, you could type:
cp $$patern + <Tab>
and autojump would complete
cp /home/user/CompliCatedDireCTOry/long/path/bla/bla
and you would just have to add where you want to put the file. Of course I can use ott's comment to add it to a few specific commands, but if anyone has a better idea, I'd be very grateful.