|
|||||||
|
|
|
![]() |
|
|
Strumenti |
|
|
#1 |
|
Senior Member
Iscritto dal: Feb 2003
Città: Formia
Messaggi: 1545
|
bash
Volevo fare questo script
#!/bin/sh # File="/home/mino/ControlloUtenti/statoutenti.txt" #controllo gli utenti collegati who > $File #mi restiuisce il numero di righe NumeroUtenti ='cat $File | wc -l' echo "--> " $NumeroUtenti utentiamm="2" if ["$utentiamm" -eg "$NumeroUenti" ];then echo 'utenti collegati 2 mandare un mail' fi exit 0 quando lo lancio mi da questo --> ./controlloutenti.sh: line 10: [2: command not found dove sbaglio... |
|
|
|
|
|
#2 |
|
Senior Member
Iscritto dal: Jan 2001
Città: Milano
Messaggi: 5707
|
Occhio agli spazi.
Codice:
#!/bin/sh # File="/tmp/statoutenti.txt" #controllo gli utenti collegati who > $File #mi restiuisce il numero di righe NumeroUtenti=$(cat $File | wc -l) echo "--> " $NumeroUtenti utentiamm="2" if [ "$utentiamm" == "$NumeroUtenti" ];then echo 'utenti collegati 2 mandare un mail' fi exit 0 bash è una merd@ come sintassi. |
|
|
|
|
|
#3 |
|
Senior Member
Iscritto dal: Feb 2003
Città: Formia
Messaggi: 1545
|
grazie funziona
|
|
|
|
|
| Strumenti | |
|
|
Tutti gli orari sono GMT +1. Ora sono le: 14:36.


















