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

Filter by
Sorted by
Tagged with
0
votes
0answers
27 views

Need Help to use GREP and FIND Combinated to parse a texte file and move files

Here is my goal: I have a list of files name (with .mp3 extension) inside a text file, and I want, launching a small terminal command, to copy the files in my folder (the files that matches names ...
0
votes
1answer
121 views

Bash script selecting folder

I am trying to list all the directory latest modified folder first using select, but I am stuck. Let's say I have: Folder1 ThisIsAnotherDir Directory New Directory This IS not_Same Directory When I ...
1
vote
1answer
264 views

select would indicate pipe is readable when there's no data in pipe and write end is closed?

I am reading The Linux Programming Interface. From 63.2.3 When Is a File Descriptor Ready?, it says: Correctly using select() and poll() requires an understanding of the conditions under which a ...
0
votes
0answers
40 views

Xed : highlight selected text occurences?

I'm using Gnome Xed text editor. Is there a way to auto select all occurrences of currently selected-text across the document. If Xed cant do it, what other linux text editor can do it ? How ?
0
votes
1answer
124 views

How to display different directory content with Bash select command?

So far I have found some examples of Bash select function usage with logical constructed options or Asterisk one (i.e select s in *). This last one lists all actual directory content. So I would like ...
0
votes
1answer
32 views

How to use select to choose from x files, that contain lists, needed to run set of commands against, in this case curl

I have about 100 lists of URLs used for health checking (200, 300,400,500) but cannot figure out the terminology to ask the question. In advance, I apologize. I want to use a list to choose on of ...
1
vote
3answers
131 views

TMOUT within script file misbehaves for the select command. How to fix it?

UPDATE - looks like this is something peculiar with bash 4.3.42 as it works fine with 4.3.46. Leaving this post for those who run into the same issue in future. When I run this command in bash ...
1
vote
0answers
270 views

bash “select” menu script goes into an infinite loop when I close my terminal session

I've got a simple bash menu script that works almost perfect. But for some reason, if I don't exit out of the script using the "Exit" option OR by using CTRL+C BEFORE I close my terminal window, then ...
4
votes
2answers
726 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
120 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
171 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 ...
2
votes
0answers
95 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
17k 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
3k 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"...
12
votes
4answers
2k 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 *;...
8
votes
4answers
16k 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
4k 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
4k 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
691 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
111 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 ...
9
votes
1answer
5k 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
1k 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. ...
2
votes
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 ...
12
votes
2answers
24k 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: ' ...