Sponsored Content
Operating Systems Linux Red Hat Bash: menu-complete and reverse Post 302792369 by ozkanb on Wednesday 10th of April 2013 09:03:23 AM
Old 04-10-2013
Bash: menu-complete and reverse

Hi,

In the archives I found this:

Quote:
On Wed, 01 Oct 2003 20:04:15 -0300
Herculano de Lima Einloft Neto <hlen ig com br> wrote:

>
> Hello, I would like to bind menu-complete with a -1 argument to
> something, S-TAB for instance. Is there any way to do that? Other shells
> offer reverse-menu-complete. If I could bind readline arguments..
>
> bind S-TAB:'menu-complete(-1)' - is there something like this?
>

Hi Herculano,

This is a bit of a tough one, and depends on how you have readline
configured (ie. emacs or vi mode). If you add the following to
the end of your /etc/inputrc file you should get what you want:

$if mode=vi
"\C-0-": digit-argument
TAB: menu-complete
"\e[Z": "\C-0-\t"
$else
TAB: menu-complete
"\e[Z": "\M--1\t"
$endif

"man readline" has all the details about why this works.

HTH,
Sean
And this works fine.
Code:
$if mode=vi
"\C-0-": digit-argument
TAB: menu-complete
"\e[Z": "\C-0-\t"
$else
TAB: menu-complete
"\e[Z": "\M--1\t"
$endif

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
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

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... (0 Replies)
Discussion started by: Mithu
0 Replies

2. Shell Programming and Scripting

Bash menu script

I have a main menu quit=n while do clear echo echo "1. General system information" echo "2. Hardware utilisation information" echo "3. File management" echo "4. User information" echo "5. Information on network connectivity" echo "6. Information on processes" echo "Q.Quit" ... (3 Replies)
Discussion started by: AngelFlesh
3 Replies

3. Shell Programming and Scripting

Help regarding a bash menu script

Greetings all, I'm having some trouble writing a menu drive bash script, actually coding the menu part was not difficult however its a problem with a menu option I'm having trouble with. My menu has 5 options, when the user selects the second option, they are then prompted to enter a number from... (5 Replies)
Discussion started by: Vitrophyre
5 Replies

4. Shell Programming and Scripting

How to Reverse a sentence in linux ? (bash/cshell)

hey all, If I have the given sentence. I like bobo. How could I reverse it to be : .bobo like I I am NOT talking about reversing words or characters by using rev. I am talking about reversing the whole sentence(placement of words in the given sentence). thank you. (5 Replies)
Discussion started by: eawedat
5 Replies

5. 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

6. Open Source

Bash menu not running

The perl command is not executing? I am trying to run the .pl in my cygwin home directory (C:\cygwin\home\cmccabe) using ${id}.txt.hg19_multianno.txt (located in the annovar directory) as the input file to be formatted and $FILENAME is the output file to be saved. The .pl is attached as... (8 Replies)
Discussion started by: cmccabe
8 Replies

7. UNIX for Advanced & Expert Users

How to reverse compiled bash (obfucation)?

hi guys, 10 years a go I wrote an script in bash programming and I compiled (obfuscate) it, but after 10 years I need to change some lines and remove some lines, but i do not remember what I've done. does anyone has any idea about decompile (deobfuscation) it? here is some line of my code (u... (3 Replies)
Discussion started by: mhsh0001
3 Replies

8. 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

9. 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

10. Shell Programming and Scripting

Bash Menu using zenity

Hi, I'm new to bash, and have an example menu script using Zenity. It works fine if the user enters A B or C, but if the user enters nothing, I can only figure out how to exit the script. How do I get the menu to reappear if no input is selected? The script is: title="Select example"... (2 Replies)
Discussion started by: allen11
2 Replies
tk_popup(1T)						       Tk Built-In Commands						      tk_popup(1T)

__________________________________________________________________________________________________________________________________________________

NAME
tk_popup - Post a popup menu SYNOPSIS
tk_popup menu x y ?entry? _________________________________________________________________ DESCRIPTION
This procedure posts a menu at a given position on the screen and configures Tk so that the menu and its cascaded children can be traversed with the mouse or the keyboard. Menu is the name of a menu widget and x and y are the root coordinates at which to display the menu. If entry is omitted or an empty string, the menu's upper left corner is positioned at the given point. Otherwise entry gives the index of an entry in menu and the menu will be positioned so that the entry is positioned over the given point. EXAMPLE
How to attach a simple popup menu to a widget. # Create a menu set m [menu .popupMenu] $m add command -label "Example 1" -command bell $m add command -label "Example 2" -command bell # Create something to attach it to pack [label .l -text "Click me!"] # Arrange for the menu to pop up when the label is clicked bind .l <1> {tk_popup .popupMenu %X %Y} SEE ALSO
bind(1T), menu(1T), tk_optionMenu(1T) KEYWORDS
menu, popup ATTRIBUTES
See attributes(5) for descriptions of the following attributes: +--------------------+-----------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +--------------------+-----------------+ |Availability | SUNWTk | +--------------------+-----------------+ |Interface Stability | Uncommitted | +--------------------+-----------------+ NOTES
Source for Tk is available on http://opensolaris.org. Tk 4.0 tk_popup(1T)
All times are GMT -4. The time now is 09:46 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy