Skip to main content

Questions tagged [select]

`select` is a keyword in the syntax of the Korn shell language (and other Korn-like shells such as `zsh` or `bash`) used to create menus for terminal user interaction. For creating TUI-based menus and other dialogs in shell scripts, see `whiptail`/`dialog` or `zenity` for GUI ones.

0 votes
1 answer
169 views

Why does a Bash script with select exit without input when reading from stdin?

I'm working on a Bash script that optionally accepts input from stdin and then presents the user with a selection menu using select. The issue arises when the script is provided data via stdin—the ...
jesse_b's user avatar
  • 41.6k
3 votes
4 answers
3k views

How do I select an array to loop through from an array of arrays?

#!/usr/bin/bash ARGENT=("Nous devons économiser de l'argent." "Je dois économiser de l'argent.") BIENETRE=("Comment vas-tu?" "Tout va bien ?") aoarrs=("${...
John Smith's user avatar
0 votes
1 answer
36 views

how to write a commant for output of a particular group?

Reading file prod1.tpr, VERSION 2019.6 (single precision) Reading file prod1.tpr, VERSION 2019.6 (single precision) Select a group of reference atoms and a group of molecules to be ordered: Group ...
PRAMOD KUMAR's user avatar
0 votes
2 answers
423 views

when read buffer size is 2048, it work , but buffer size is 48 or other number, write call will be blocked, why?

#include <stdio.h> #include <stdlib.h> #include <string.h> #include <sys/select.h> #include <fcntl.h> #include <unistd.h> int main(int argc, char* argv[]){ if(...
zhenfei ren's user avatar
2 votes
2 answers
900 views

select from a constructed list of strings with whitespace?

I trying to create a list of strings with spaces in, that I want to choose between in a select - something like this: sel="" while read l do sel=$(printf "%s '%s'" "$sel&...
j4nd3r53n's user avatar
  • 779
1 vote
1 answer
74 views

Selecting from various media using awk shell script

I have made a simple backup program for my bin folder. It works. Code and resultant STDOUT below. Using rsync to copy from local ~/bin folder to a /media/username/code/bin folder. The code works fine ...
Dee's user avatar
  • 33
0 votes
1 answer
827 views

Why plus 1 is needed in select system call?

From man select : int select(int nfds, fd_set *readfds, fd_set *writefds, fd_set *exceptfds, struct timeval *timeout); nfds should be set to the highest-numbered file descriptor in any of ...
whisper's user avatar
  • 11
2 votes
1 answer
9k views

Getting the first/last/nth result from a jq select result

I am trying to find a way to pipe the result of my current script into another command which will leave me with just the last result of the array I get in my select here: jq -r --arg name "$1&...
dschib's user avatar
  • 51
0 votes
2 answers
227 views

Select command showing options without question

Select command is showing options without displaying question. It is displaying question after a choice is made. I have a function as shown below in a script. function start_AppNode { # Define ...
Anil_4_Tibco_Java's user avatar
3 votes
2 answers
11k views

How to select a word under cursor?

For all text editor or application I'm using, I want to select a word under cursor using keyboard shortcut. How can I do it? I tried look around I didn't find anything helpful.
Swapnil's user avatar
  • 271
0 votes
1 answer
2k 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 ...
KpDean's user avatar
  • 3
3 votes
2 answers
3k 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 ...
Rick's user avatar
  • 1,257
0 votes
0 answers
381 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 ?
sten's user avatar
  • 103
2 votes
1 answer
601 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 ...
artu-hnrq's user avatar
  • 317
0 votes
1 answer
45 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 ...
Stryker Cain's user avatar

15 30 50 per page