I'm trying to implement real time scanning on cPanel server.

When I use the following script,

#Maximum file size to scan in bytes that's set to 10MB
if [ "$UPLOAD_SIZE" -le "$MAXSIZE" ]; then
/usr/bin/clamdscan --remove --quiet --no-summary "$1"

Output shows,

line 4: [: : integer expression expected
  • 2
    Bash has ((...)) for arithmetics. Use if ((upload_size < maxsize)); then ...; fi Also don't use UPPERCASE for normal variable names. Jul 14, 2017 at 10:13

1 Answer 1


Looks to me like your $UPLOAD_SIZE is unset (or empty or non-numeric), that's why you get an error. What you probably want is declaring it before comparing if it is lesser than something, which you haven't done.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .