I want to delete multiple images having resolution less then 228x228. For that, I wrote this shell script:
#!/bin/bash for i in $( ls ); do if [$(identify -format "%w" $i) < 228] && [$(identify -format "%h" $i) < 228]; then rm $i fi done
For some reasons, I got this output when I run it:
./del.sh: line 4: [640: command not found ./del.sh: line 4: [550: command not found ./del.sh: line 4: [315: command not found ...
Could you please tell me what's wrong in this script and how to fix it.
EDIT: Even after I added spaces after the brackets, I still got an error. It was due to the usage of
< instead of
-lt and has been fixed. Now there is no error.