-
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathmensagemErro
More file actions
executable file
·34 lines (26 loc) · 699 Bytes
/
mensagemErro
File metadata and controls
executable file
·34 lines (26 loc) · 699 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#!/bin/bash
#
# mensagemErro (Shell Script)
#
# Objetivo: Função para formatar a mensagem de erro dos programas
# da biblioteca shell script.
#
# Para uma descrição mais detalhada desta biblioteca, consulte:
# https://github.com/Dirack/Shellinclude/wiki/mensagemErro.sh
#
# Site: https://www.geofisicando.com
#
# Versão 1.1
#
# Programador: Rodolfo A. C. Neves 19/05/2019
#
# email (manutenção): rodolfo_profissional@hotmail.com
#
# Licença: Software de uso livre e código aberto.
exibirMensagemErroProgramaFormatada(){
NOME_PROGRAMA="$1"
NUMERO_ERRO="$2"
MENSAGEM_ERRO="$3"
echo -e "\033[31m$NOME_PROGRAMA: ERRO($NUMERO_ERRO): $MENSAGEM_ERRO\033[m"
exit "$NUMERO_ERRO"
}