1
The question here is very simple!
Here is a variable:
arquivo="\"Item 1\" 'A' off \"Item 2\" 'B' off \"Item 3\" 'C' off \"Item 4\" 'D' off \"Item 5\" 'E' off \"Item 6\" 'F' off"
Note that the length of the variable contains the options for each check button.
Quotation marks should be escaped like this:
\"Item 1\"
Below this an excerpt that needs from a list length check:
echo $arquivo | xargs Xdialog --stdout --separate-output --radiolist 'Seu Texto Aqui' 0 0 0
RESULT:
Instead of writing the options in a variable to dynamically popular to
Xdialog
, need to use a file as input to populate.
EXAMPLE:
cat /tmp/arquivo.txt | xargs Xdialog --stdout --separate-output --radiolist 'Seu Texto Aqui' 0 0 0
FILING CABINET:
\"Item 1\" 'A' off \"Item 2\" 'B' off \"Item 3\" 'C' off \"Item 4\" 'D' off \"Item 5\" 'E' off \"Item 6\" 'F' off
PRINT SCREEN:
In the manual of xargs
, I found this information that I think is the solution to the question:
$ man xargs ... --arg-file=arquivo -a arquivo Leia itens do arquivo em vez da entrada padrão. Se você usar isso opção, stdin permanece inalterado quando os comandos são executados. De outros- sábio, stdin é redirecionado de /dev/null. ...
I tried to implement it. but it didn’t work.
References
1- https://www.linuxquestions.org/questions/slackware-14/dialog-radiolist-with-list-from-file-to-choose-not-working-930774/
2- Checklist and Dialog with external file - Shell Script
3- https://aurelio.net/shell/dialog