Put the output from a dialog box into a bash variable:
termux-dialog outputs data in json format so we need to parse that. One way is to use jq which needs to be installed: apt install jq -y
Then because we're going to pipe the output into jq we'll need to enclose everything in double quotes before assiging to a variable. This is is a good example:
myvariable="$(termux-dialog -t "Please enter some text" | jq '.text' -r)"
To test this has worked:
echo "$myvariable"
And you should see what you had entered has been assigned to "myvariable"
khansaad1275 commentedon Mar 24, 2020
Grate ,it's working but can you please tell us how we can use checkbox and radio buttons?