configure bash completion for multiple possibilities
Hello,
Bash completion is great, but there are some features I'd like to change. One thing is the behaviour when there are lots of very similar possibilities.
E.g., my directory contains 133 files, from pubmed_result1.txt to pubmed_result133.txt
Here, one has to choose either y or n to get the completion up to "pubmed_result".
I seem to remember from a linux computer I worked on a few years ago, that pressing tab once would immediately complete as much as possible, and if one wanted to see the possibilities, one would have to press TAB again ; only two consecutive hits of TAB would trigger the question.
To stick with the example, I'd like to change this sequence :
into
Did you get what I wish to obtain ?
Does anyone know how to do this ?
You might having at least one file which starts with "p" but not followed by "u" or "ubmed_result" ( depends on the existence of files with various names).
---------- Post updated at 20:34 ---------- Previous update was at 20:29 ----------
If you are on bash you can check that easily with extglob option.
Hi,
My goal is to connect from unix server A to windows server B and call a bat file on windows.
I am able to succeed in remoting to windows and executing a command, the issue i am facing is the shell scrip is exiting without making sure of bat file success.
Can you please help me in... (4 Replies)
Heyas
For my project TUI i had prepared bash completion.
Bash-completion works, at least if i source that file manualy.
However, when i'm installing it, it wont apply, not even for new opened terminals.
Allthough i had it working once, i dont get why it doesnt work now.
<...>
+ ''
+... (0 Replies)
Heyas
I'm trying to read out a file which contains a variable and use that list to complete a bash command.
Difficult part on this is, that 2 (actualy 3) different lists are to be used, but the 'dynamic' ones from the external file dont work properly.
It only seems to work with the list... (2 Replies)
Hello
I've followed several bash-completion threads, usualy none were answered, because of obvious reasons. (of which i'm just aware since a day or a few)
Non-the-less, because i was writing scripts, i never considered it to be possible to add this functionality.
Also, because i though that... (0 Replies)
Hello
I want use bash_completion on a script but the information on the internet give me not a solution.
The scrip start with "cd" to a direction
Than the script do "ls"
Than I must give a name of a sub-direction and here I want to use <TAB>, so when I have a direction with the name
smith... (2 Replies)
Hi,
I'm having a problem with tab completion at the bash command line. For some reason, whenever I type g<tab>, the terminal will freeze up for 5-10 seconds before asking me if I want to display all 325 possibilities. I thought that maybe it's because of the high number of commands, but I have... (4 Replies)
Hi there!
I have this script which handles bookmarks. Bookmarks are basically a string that point to a certain path, e.g., project -> ~/code/projects/project.
Currently I have working completion for the bookmarks:
~ $ m p<Tab>
~ $ m project
What I want to implement now is the cd... (0 Replies)
hello,
I have been trying for a couple days to figure this out to no avail. I am converting some csh code to bash. I have converted everything except the completion code.
#bashrc (I set this alias in my bashrc)
alias test='source ${PATH}/test.sh'
#${PATH}/test.sh (returns some aliases and... (0 Replies)
I really like tcsh's:
set completion='enhanced'
because it treats underscores and dash signs the same. I don't have to reach for the shift key when trying to complete files that have underscores. As far as I know, there is nothing like this in bash.
Does such a thing exist in bash? If... (2 Replies)