Commit edbe1805 authored by Carla Goncalves Ourofino's avatar Carla Goncalves Ourofino
Browse files

Corrige: parâmetros extras estavam sendo considerados "sga_name"

Chamada corrigida:
./sgad.sh multiplo.cfg --sga_name=chuva valorqlqr
Erro que acontecia:
* Chamava o script considerando "valorqlqr" como sga_name.
Correção nesse commit:
* Aparece erro de "invalid argument" e interrompe a execução.

[SOMA-3827][SOMA-4176]
parent 1fcf4384
......@@ -7,6 +7,12 @@ logsdir="logs"
logfile="logs/sgad_${timestamp}.log"
usage() {
echo "usage: $0 [configfile] [options]"
echo "Available options are:"
echo " --sga_name SGA name to get config from a multiple config file"
}
POSITIONAL="" # String para salvar argumentos passados ao comando
while [ $# -gt 0 ] # Percorre todos argumentos
do
......@@ -22,12 +28,16 @@ do
;;
--*)
echo "$0: unrecognized option '$1'"
echo "Available options are:"
echo " --sga_name SGA name to get config from a multiple config file"
usage
exit 1
;;
*)
POSITIONAL="${POSITIONAL} $1"
if [ -n "$POSITIONAL" ]; then
echo "$0: invalid argument '$1'"
usage
exit 1
fi
POSITIONAL="$1"
shift
;;
esac
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment