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
ifhas to be delimited by a companionfimarking 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
ifhas to be delimited by a companionfimarking the end of the if block."
O caminho certo:
In bash there isn't such a thing [as dangling else ambiguity], as every
ifhas to be delimited by a companionfimarking the end of the if block.