Thanks at the magic starts in the universe, the solucion its simple :-P
check that especific part of the code:
Quote:
Originally Posted by soppy
Code:
1) dialog --title "Directory" --backtitle "$version" --inputbox "Plese type the directory EX: '/home/root'\n\n *NOTE: Do not provide the trailing '/'" 10 60 2> /tmp/decision
2) location=`cat /tmp/decision`
3) case $? in ..... bla bla bla
|
OK the code in 1) work great! retun 0 (if click on OK) , return 1 (click on cancel) , return 255 (if press scape) so "$?" are good set (y) :-)
lets si what do code 2) its execute a "cat" instruction and like all instruction it sets "$?" acording to the success of that instruction that actuali is "0" (because cat /tmp/decision work whitnout any problem)
so you go to 3) you check for "$?" that is ALLWAIS "0" because you reset "$?" to 0 for calling "cat" instruction.
Who to SOLVE???
1) dialog --title "Directory" --backtitle "$version" --inputbox "Plese type the directory EX: '/home/root'\n\n *NOTE: Do not provide the trailing '/'" 10 60 2> /tmp/decision
3) case $? in ..... bla bla bla
2) location=`cat /tmp/decision`
CHECK FIRST THE RETURN OF THE DIALOG FUNCTION AND AFTER THAT OBTEIN THE location variable
Saludos Guillermo