Making dynamic choices. Help! Whiptail, Bashscript Making dynamic choices. Help! Whiptail, Bashscript unix unix

Making dynamic choices. Help! Whiptail, Bashscript


I'm assuming the problem is that you need duplicated name pairs for whiptail and you aren't sure how to get from your list to there?

In which case something like this might work better:

read -ra array <<<$(ifconfig -a | awk '!/^ / && NF {print $1; print $1}')whiptail --title Networking --menu "select your choice" 16 78 5 "${array[@]}"

Read this page for why you want to use the read -a construct.