-1

How do I show a whiptail checklist from Array?

Roger Ramos
  • 109
  • 5
  • 1
    Welcome to U&L! While your question does have an answer already, for future reference it is generally kindly looked upon to share what you have tried and how it did not work as you intended. This both shows that you have some basic competency with the demesne of your question, and that you have already expended at least some effort in answering the question yourself. – DopeGhoti Dec 20 '17 at 21:37

1 Answers1

1

The answer is similar to this answer

Just put all array elements at once with special array index @:

value=("Choice1" "c" on "Choice2" on "" "Choice3" "" off)

whiptail --title "xx" --checklist "choose" 16 78 10 "${value[@]}"

Notice empty string inside quotes "" - this is description required by whiptail checkbox option

Roger Ramos
  • 109
  • 5