Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [select]

`select` is a `bash` builtin to create menus for (console-only) user interaction. For GUI-based interaction, see `dialog` (note: non-standard in various distros).

2
votes
2answers
84 views

Bash ignoring SIGINT trap when 'select' loop is running

When i use 'trap' combined with select loop, namely when i try to hit CTRL+C to break out while options are displayed, it will just print ^C in terminal. If i remove 'trap' from script it will ...
0
votes
1answer
27 views

Backspace in select loop

When i use select loop to create a list of options, if i make a mistake during the prompt and want to hit backspace, it doesnt erase the character but displays ^H instead of it. I know in "read" i ...
0
votes
1answer
50 views

Lack of a text input field in zenity file selector

I have Debian 9 with xfce and installed zenity to use it to select directory paths. I use it in this way zenity --file-selection --directory The GUI selector looks as below. It has not the text ...
1
vote
0answers
39 views

Bash menu from screen -ls data

Given the screen data There are screens on: 27454.world-of-dragons_SERVER (07/05/2018 04:38:56 PM) (Attached) 6223.potato-wod_SERVER (07/05/2018 10:16:12 AM) (Attached) ...
-1
votes
2answers
6k views

select all text in vi to copy and past in windows

How can I select all text in vi so that I can copy it, and then paste it in notepad on my windows server. I have a file with 3,000 lines in it. I cannot use FTP so I need to copy the text in the ...
1
vote
2answers
1k views

Bash scripting - exiting submenu

Running into an issue with exiting a submenu. Check it out: function submenu { select submenu1 in "Submenu 1" "Submenu 2" "Submenu 3" "Exit to main menu"; do case $submenu1 in "Submenu 1"...
13
votes
4answers
1k views

bash: whitespace-safe procedural use of find into select

Given these file names: $ ls -1 file file name otherfile bash itself does perfectly fine with embedded whitespace: $ for file in *; do echo "$file"; done file file name otherfile $ select file in *;...
4
votes
3answers
10k views

bash - How can I re-display selection menu after a selection is chosen and performed

I am making a tool script for my theme with 2 functions: Check for update, reinstall theme So here is the code for selection menu: PS3='Choose an option: ' options=("Check for update" "Reinstall ...
-2
votes
1answer
3k views

Unix shell scripting select and case statement

1) i want to write unix script which is like this echo "Do u want to check application logs ???" select opt in Yes No do case $opt in "Yes") commmands ;; "No") break ...
0
votes
2answers
3k views

What is causing the “syntax error near unexpected token `do'” and how can I fix it?

I keep getting this error: ./install.sh ./install.sh: line 28: syntax error near unexpected token `do' ./install.sh: line 28: ` do' When running this code (a work in progress): # ...
0
votes
1answer
466 views

Skip for loop iteration depending on response to inner select

I have the following bash script, which iterates through all the images in a directory and attempts to determine the date and time it was created using exif. If the exif information is not available, ...
2
votes
2answers
89 views

How do I write a bash script that will let users choose the value of the MIRROR environment variable?

I am presently in the process of writing a Bash function that when invoked will ask users to choose from a list of Sabayon's mirrors, but I would like it if each option could include info on the ...
8
votes
1answer
4k views

Can I change how select options are displayed?

I'm working with select and case in bash. I currently have nine options, which makes a nice, tidy, 3x3 grid of options, but it displays like so: 1) show all elements 4) write to file 7) ...
0
votes
1answer
1k views

How to select read/write time and again? [closed]

This program only waits one time and I don't understand why. Actually, I don't think this question should be put on hold as off-topic. #include <stdio.h> #include <sys/types.h> #include &...
2
votes
1answer
911 views

How to force bash to start at index 0 with select output?

Well, even some less-experienced bash users would know meanwhile about the fact that bash arrays would always start with index 0. However, select will always do its own thing, as the following example ...
3
votes
2answers
3k views

Creating Menu list and Executing the Task

I was given the the Task to create a menu in Linux but it appears it's not coming out great. When I select something I want to be able to perform that task then go back to the main menu when I finish. ...
1
vote
1answer
2k views

bash script select menu

I've many notes gleaned from the web and have written bash scripts to manage them. I've some scripts working that depend on select to make menus. Question: in a nested menu context, is it possible ...
7
votes
2answers
14k views

Using `select` command to print a menu in Bash

I am trying to implement a simple menu using the select command. The script (for testing purposes) is as follows: #!/bin/bash echo "*******************" PS3='Select an option and press Enter: ' ...