Enviado em 27/11/2018 - 21:23h
Olá pessoal!
Então, estou escrevendo um longo script shell e percebi que quando abro plenamente (Quando se abre sem chamar pelo terminal) a função "if" retorna falha "not found" (Não encontrado) direcionando o teste para "else".
No "else" está a última instância do teste na qual abre o script novamente e mostra a falha "not found". Estou muito confuso, como isso é possível? Chamando pelo terminal essa falha recorrente não se manifesta.
-> Retorna falha quando aberto plenamente:
-> Não retorna falha quando chamado no terminal:
Então, estou escrevendo um longo script shell e percebi que quando abro plenamente (Quando se abre sem chamar pelo terminal) a função "if" retorna falha "not found" (Não encontrado) direcionando o teste para "else".
No "else" está a última instância do teste na qual abre o script novamente e mostra a falha "not found". Estou muito confuso, como isso é possível? Chamando pelo terminal essa falha recorrente não se manifesta.
-> Retorna falha quando aberto plenamente:
zenity --question --text="Abrir novamente o script?" --width=300 --height=100 --title="Test"
if [[ $? > 0 ]]; then
exit
else
script.sh
fi
-> Não retorna falha quando chamado no terminal:
zenity --question --text="Abrir novamente o script?" --width=300 --height=100 --title="Test"
if [[ $? > 0 ]]; then
exit
else
script.sh
fi