I try to make a dialog checklist in a bash script. I have to generate options from lines of a file. I think the problem is that my entries contains spaces and so, one entry is considered by many.
Dialog give me this error:
Error: Expected 3 arguments, found only 1. Use --help to list options.
Here my code:
while read entry; do
option+=(0 "$entry" "off")
echo "$option"
done < "$tempfilelist"
dialog --backtitle "Myscript" \
--title "Mytitle" \
--checklist "Mytext" 10 70 4 "${option[@]}"
I even tried to put quotes in my loop, like this:
"'$entry'"
but no change.
and here's my file (tempfilelist):
Wed Apr 24 14:17:20 2013 20130423.maya.txt
Wed Apr 24 14:17:41 2013 maya.txt
How to get this script working?
Thanks !