Pular para o conteúdo principal

Questão de Sistemas Operacionais — Unix — CESGRANRIO 2013

Sistemas OperacionaisUnix
Código
cg001187
Banca
CESGRANRIO
Órgão
IBGE
Ano
2013
Nível
Superior
Cargo
Analista - Suporte Operacional
O interpretador de comandos bash do sistema UNIX permite a verifcação do status do encerrramento do último comando ou função executado no script. Um exemplo de trecho de código fonte que verifica o valor desse status é
  1. Aif [ $@ -eq 1 ]; then exit; fi
  2. Bif [ $* -eq 1 ]; then exit; fi
  3. Cif [ $? -ne 0 ]; then exit; fi
  4. Dif [ $# -ne 0 ]; then exit; fi
  5. Eif [ $$ -ne 1 ]; then exit; fi
Revelar gabarito e comentário

GabaritoC — if [ $? -ne 0 ]; then exit; fi

Link permanente: /questoes/cg001187