Welcome to DU! The truly grassroots left-of-center political community where regular people, not algorithms, drive the discussions and set the standards. Join the community: Create a free account Support DU (and get rid of ads!): Become a Star Member Latest Breaking News Editorials & Other Articles General Discussion The DU Lounge All Forums Issue Forums Culture Forums Alliance Forums Region Forums Support Forums Help & Search

Computer Help and Support

In reply to the discussion: select menus. [View all]

usonian

(19,142 posts)
1. If it's really simple (textual) you can do it in shell scripts.
Fri Mar 29, 2024, 05:57 PM
Mar 2024

Using the cursor is more complicated (been there, done that) and requires curses and termcap stuff. There may be packages that encapsulate that, but it would take time to look up.

Here are two quick finds:

https://linuxconfig.org/how-to-create-a-selection-menu-using-the-select-statement-in-bash-shell

to get a screen like this:

Choose one:
1) file1
2) file2
3) file3
#? 1
You selected file1

More complex stuff at askubuntu.com (only try the simple stuff, please)
https://askubuntu.com/questions/1705/how-can-i-create-a-select-menu-in-a-shell-script


NOTE: Apple changed the default shell to zsh in recent releases (Ventura and newer? ), so if you want good old bash shell, you have to change your login.

Recommendations

0 members have recommended this reply (displayed in chronological order):

Latest Discussions»Help & Search»Computer Help and Support»select menus.»Reply #1