BASH complete-filename & menu-complete together


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers BASH complete-filename & menu-complete together
# 1  
Old 01-06-2009
BASH complete-filename & menu-complete together

Hi,

Does anyone know how to make BASH provide a list of possible completions on the first tab, and then start cycling through the possibilites on the next tab?

Right now this is what I have in my .bashrc:
bind "set show-all-if-ambiguous on"
bind \\C-o:menu-complete
This allows file-name completion on the first TAB and cycling through the names using CTRL-o, but if I try to assign menu_complete to TAB, then it overrides the file-complete mode and no longer shows the list of files first.

(BTW, this is the default filename completion behaviour in ZSH. I'm trying to replicate it in BASH).

Thanks,
Mithu
This User Gave Thanks to Mithu For This Post:
 
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Access a complete flow with CURL + bash shell

Hello Experts , I have an use case which needed your help . I have been using google for 2 days buy couldn`t succed , i believe i can get the help here. Here is my use case to run on bash shell 1. Access an URL -- in script , it will be mentioned as inputURL 2. Once i accessed the URL... (5 Replies)
Discussion started by: radha254
5 Replies

2. Shell Programming and Scripting

Access a complete flow with CURL + bash shell

Hello Experts , I have an use case which needed your help . I have been using google for 2 days buy couldn`t succed , i believe i can get the help here. Here is my use case to run on bash shell 1. Access an URL -- in script , it will be mentioned as inputURL 2. Once i accessed the URL... (1 Reply)
Discussion started by: radha254
1 Replies

3. Shell Programming and Scripting

How to add a status once a step is complete on the header part of a menu?

Hi Guru's, i am creating a script that will update menu of either complete or failed. #!/bin/bash choice=0 while do echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo "" echo " ###############################################" echo " # Choose... (3 Replies)
Discussion started by: reignangel2003
3 Replies

4. Shell Programming and Scripting

Bash script parallel tasks and command to wait untill complete?

Hello, im having bash script with while *** command1 && command2 && command3 && done i want to ask how i can prevent overloading server, by waiting untill all commands complete? any low resources intensive command like "wait" - i dont know if exist? (2 Replies)
Discussion started by: postcd
2 Replies

5. Red Hat

Bash: menu-complete and reverse

Hi, In the archives I found this: And this works fine. $if mode=vi "\C-0-": digit-argument TAB: menu-complete "\e But what I want is to reverse this. So I want that tab does reverse menu completion and shift tab does normal menu completion. Can anyone help me with this? Thanks (0 Replies)
Discussion started by: ozkanb
0 Replies

6. Shell Programming and Scripting

Based on the first & last timestamp of the file, need to calculate the time taken to complete

Below is the sample file: 287 DEBUG syndesis.pb.util.ITraceManager - syOID=ELntNetwork:1005Mon Oct 15 17:18:21 IST 2012 <ELClientManagerenEmsSession() > Setting Java Properties 287 DEBUG syndesis.pb.util.ITraceManager - syOID=ELntNetwork:1005Mon Oct 15 17:18:21 IST 2012... (1 Reply)
Discussion started by: ashok.kumar
1 Replies

7. HP-UX

Anybody wants to help a complete Noob?

Hello there, first post here so go easy on me! :D I just aquired an old HP 9000 Dclass d220 server, all I know is that it's running HP-UX, and it appears to boot fine (I see the modules loading, etc..) Now, I have been an MS guy all my life (yeah I know, make fun of me), so I really have no... (9 Replies)
Discussion started by: Marvio
9 Replies

8. Programming

Help me complete my code.

Ok, so I have done the 'mathematical part' just I am not sure where to put them in and how to get them to return answers. public class Main { public static void main(String args) { } //Part A. //1&2- Computes the sum andproduct of all of the elements of the array a. ... (5 Replies)
Discussion started by: HardyV2
5 Replies

9. Shell Programming and Scripting

Please complete this program.

Hi All, I need some help to complete the below script, after executing below script blank lines are coming, but i am expecting 4 digit numeric no. Please solve the issue ASAP. function portno { while (true) do random=`echo $RANDOM | cut -c 1-4` port=`netstat -a | grep -c $random` ... (5 Replies)
Discussion started by: sridhusha
5 Replies
Login or Register to Ask a Question
Path::Dispatcher::Cookbook(3pm) 			User Contributed Perl Documentation			   Path::Dispatcher::Cookbook(3pm)

NAME
Path::Dispatcher::Cookbook - A cookbook for Path::Dispatcher RECIPES
How can I change the path delimiter from a space ' ' to a slash '/'? When importing the Path::Dispatcher::Declarative sugar, specify the "token_delimiter" option for the "default" group. package My::Dispatcher; use Path::Dispatcher::Declarative -base, -default => { token_delimiter => '/', }; Or define a subclass of Path::Dispatcher::Declarative with a "token_delimiter" method: package Web::Dispatcher::Maker; use base 'Path::Dispatcher::Declarative'; use constant token_delimiter => '/'; package My::Dispatcher; use Web::Dispatcher::Maker -base; How can I do rule chaining (like in Catalyst)? You can use a "chain" rule approximate chaining behavior: package MyDispatcher; use Path::Dispatcher::Declarative -base; under show => sub { chain { print "Displaying "; }; on inventory => sub { print "inventory: "; ... }; on score => sub { print "score: "; ... }; }; package main; MyDispatcher->run("show inventory"); # "Displaying inventory: ..." MyDispatcher->run("show score"); # "Displaying score: ..." How can I configure tab completion for shells? First add a dispatcher rule for generating completions based on the path. Here we name it _gencomp, so that if the user types "app _gencomp hel" it will print out the various completions of "hel". on qr/^_gencomps*(.*)/ => sub { my $prefix = shift->pos(1); $prefix = "" if !defined($prefix); print "$_ " for dispatcher->complete($prefix); }; Then tell your shell about how to use _gencomp. For zsh it might look like this (replace "APP" with your binary name): /usr/share/zsh/site-functions/_APP: #compdef APP typeset -a APP_completions APP_completions=($($words[1] _gencomp $words[2,-1])) compadd $APP_completions For bash it might look like this: /etc/bash_completion.d/APP.bash: function _APP_() { COMPREPLY=($($1 _gencomp ${COMP_WORDS[COMP_CWORD]})) } complete -F _APP_ APP perl v5.12.4 2011-08-30 Path::Dispatcher::Cookbook(3pm)