This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
function choose_from_menu() { | |
local prompt="$1" outvar="$2" | |
shift | |
shift | |
local options=("$@") cur=0 count=${#options[@]} index=0 | |
local esc=$(echo -en "\033") # cache ESC as test doesn't allow esc codes | |
printf "$prompt\n" | |
while true |