[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
erro " too many arguments" ???
From: |
bossonaroesao06 |
Subject: |
erro " too many arguments" ??? |
Date: |
Thu, 29 Nov 2007 15:20:27 -0000 |
User-agent: |
eGroups-EW/0.82 |
Sou iniciante e, shell e to fazendo um script que verifica se minha
internet ta pingando e escreve isso em um arquivo de log.
Aparentemente ta correto mas encontrei o seguinte erro ao executar:
[root@localhost ~]# ./teste.sh
./teste.sh: line 4: [: too many arguments
Olha o script:
#!/bin/bash
respA=$(ping -c 1 200.204.0.10 | grep "1 received")
dt=$(date)
if [ -z $respA ]
then
echo "nao esta respondendo em : $dt" >> /root/log.txt
else
echo "esta respondendo em : $dt" >> /root/log.txt
fi
exit
Por que deu esse erro na linha do IF?
Obrigado
- erro " too many arguments" ???,
bossonaroesao06 <=