jalal wrote:
On Wed 17 November 2004 16:57, Rhugga wrote:
I noticed something with the bash shell recently (might be old and just never really noticed it before)
If I have 3 files in a directory, such as follows:
file_1.tar file_2.tar file_3.tar.gz
If I type 'gzip -df file' and then hit TAB to start path completion, it knows to select the file_3.tar.gz because it is the only file with a *.gz extension. (I am assuming) Just curious where this new functionality was implemented. Is this done to bash itself or via some other mechanism?
I am looking to do something like this for some code I am writing...
Thx, cc
Take a look in: /etc/profile.d/complete.bash
Also, try 'man bash' and search for 'completion' for the rules that are used to complete a word.
HTH jalal
Why does no one ever hint to 'info bash'? In this case, it's much more convenient than the plain old man page. And if there's no specific info node, at least it comes up with the man page anyway. No offense meant, I just note that here and in other lists the supplicant is usually told to use 'man foo' where info would be better. KK