Você marcou isso como bash; Eu recebo "erro de sintaxe: final inesperado do arquivo" se eu não fechar o interior if
.
O referenciado SO Q diz:
In bash there isn't such a thing as every
if
has to be delimited by a companionfi
marking the end of the if block.
que pode ser entendido de duas maneiras:
O caminho errado:
In bash there isn't such a thing as: "every
if
has to be delimited by a companionfi
marking the end of the if block."
O caminho certo:
In bash there isn't such a thing [as dangling else ambiguity], as every
if
has to be delimited by a companionfi
marking the end of the if block.