Tag Info

New answers tagged

0

Why did you make MYPARAMS a string and not an array? Since MYPARAMS is a string like --checklist "" 15 40 5 "foo1" " " off, the shell command line whiptail $MYPARAMS results in whiptail being called with the arguments --checklist, "" (a string consisting of two double quotes), 15, 40, 5, "foo1", ", ", and off. When you leave a variable expansion unquoted, ...


0

Not a very desirable solution, but you can use eval: eval whiptail $MYPARAMS I suspect the problem is the quoting. You can however construct MYPARAMS as an array, and it will work as expected: #! /bin/bash MYARRAY=($(./program.sh -l | awk '{print $1;}')) MYPARAMS=( --checklist "" 15 40 5 ) i=0 while [[ $i -lt ${#MYARRAY[@]} ]] do MYPARAMS+=( ...



Top 50 recent answers are included