I created a simple script in bash language to do cleaning of the recycle bin in Ubuntu.
here is the script "recycle.sh"
#!/bin/bash
PUBLIC_PATH="/home/fileserv/.recycle/Public"
##### Clean public recycle folder
if [ !$(ls $PUBLIC_PATH | wc -l) -eq 0 ]; then
/bin/rm -R $PUBLIC_PATH/*
fi
But when I run # ./recycle.sh
I encounter thise error:
./recycle.sh: line 4: [: !1: integer expression expected
Can somebody explain why? Any solutions to make it work?
!1
is not an integer, put a space in there, or better yet just use-ne
for not equal to. – 123 Jul 16 '15 at 10:38