[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
abortar "case in esac"
From: |
mundojovem |
Subject: |
abortar "case in esac" |
Date: |
Wed, 25 Jan 2006 19:47:33 -0000 |
User-agent: |
eGroups-EW/0.82 |
ola pessoal!
Nescessito um luz no final do tunel, vejam parte do script abaixo:
*****************************************************
#!/bin/bash
until [ "$OK" ]
do
Opcao=$(dialog --stdout --menu 'Escolha:' 0 0 0 \
1 "Nome" \
2 "" \
X "Sair")
[ $? -eq 1 ] && Opcao="Z"
case "$Opcao"
in
1) IP=$( dialog --stdout --inputbox 'Digite o Nome' 0 0 ) &&
[ $? -eq 1 ] && (*1)?????????????????
clear
OK=
;;
2)
.......
;;
X)
clear
OK=1
stty intr ^C
exit
;;
Z)
clear
OK=
;;
*)
clear
echo " "
dialog --backtitle "ALTERNATIVA INVALIDA" \
--cr-wrap \
--title 'ERRO' \
--msgbox "Deve escolher alternativa valida!!!" \
17 55 &&
OK=
clear
;;
esac
done
exit
*****************************************************
PROBLEMA: A dialog inputbox tem os botoes OK e CANCEL, como aborta o
"case" se o usuario esclolher cancel (*1) --> [ $? -eq 1 ] && (*1)?? e
voltar para as opções (Opcao) de escolha.
jah tentei assim:
------> [ $? -eq 1 ] && ${0} *** VAI PARA A OPÇÃO MAS DÁ ERRO AO SAIR
------> [ $? -eq 1 ] && break *** DÁ ERRO
------> [ $? -eq 1 ] && exit *** ABORTA O ESCRIPT
Se alguem poder me ajudar agradeço desde jah.
Jorge Luiz
- abortar "case in esac",
mundojovem <=