Bash Shell Scripting - Dialog form variables -


so, took shell scripting , i'm developing address book.

for user insert contact made form:

form=$(dialog                                      \     --title "inserir"                              \     --form  ""                                     \     0 0 0                                          \     "nome:"      1 1    "$nome"     1 10 20 0      \     "morada:"    2 1    "$morada"   2 10 20 0      \     "telefone:"  3 1    "$telefone"     3 10 20 0  \     "e-mail:"    4 1    "$mail"     4 10 20 0      \   2>&1 1>&3) 

and want insert values through mysql query. saw somewhere had use, instance:

form[$1] 

in order access variable $nome. however, comment 2008. easiest way access variables?

thank you!

ifs=$'\n' read -r -d '' nome morada telefone mail < <( dialog ... ) 

unlike dialog ... | { read; ... } (which scopes variables read subshell), approach puts dialog in subshell, , variables in main shell -- more convenient.


Comments

Popular posts from this blog

Email notification in google apps script -

c++ - Difference between pre and post decrement in recursive function argument -

javascript - IE11 incompatibility with jQuery's 'readonly'? -