Hi,
I am going to write a script. It will check if any file size greater than 10k, assumed. If yes, it will print out the result. If no, it will print out NOK.
The command is as follow:
Code:
find /var/log/jboss-apps/test -type f -size +10k
My script look as follow:
Code:
#!/bin/sh
result=$(find /var/log/jboss-apps/test -type f -size +10k)
echo RESULT=$result
if [[ $result -z ]]; then
echo OK
else
echo NOK
fi
But I got error:
Code:
RESULT=/var/log/jboss-apps/test/server.log.2013-10-24
./test.sh: line 10: conditional binary operator expected
./test.sh: line 10: syntax error near `-z'
./test.sh: line 10: `if [[ $result -z ]]; then'