I'm trying to check if a file size is less than 9999bytes, but I have no idea why it breaks right here..
if compgen -G "$jdir0/"*.srt then for f in "$jdir0"/*.srt do jsubtitle="$(basename $f)" filesize=$(du -b "$jdir0/$jsubtitle" | cut -f1) if [ "$filesize" -lt 9999 ] then echo "less" fi #line 443 if [ $filesize -gt 10000 ] then......etc,etc... **line 443: syntax error near unexpected token `fi'**
I've checked The variable $filesize, and it contains only numbers, no spaces, I've also tried without " " around the variable $filesize (and 9999) in the if statement. I've also tested double [[, but no..
This is statement is inside another if statement inside a "for f in.." loop, but that shouldn't affect this?