Hi mates, i need a bit of help...
i writing a script for monitoring a users that connecting a machine...
but i have a error when execute this script...
i want detect when more a 1 users is connected, send a mail...but i try write first part, detect for more of 1 user...
this is script...a very tiny script...
Code:
#!/usr/bin/bash
function num { who | wc -l; }
if [ $num > 2]; then
echo "La cantidad de usuarios es inferior a 2"
else
echo "La cantidad de usuarios conectados es `num`"
fi
echo $num
And this is the output.
Code:
bash-2.03$ prueba
.//prueba: 2: No such file or directory
La cantidad de usuarios conectados es 3
why responding whit this error?
.//prueba: 2: No such file or directory