The convert command accept both the input file name and the output file name as arguments:
Code:
convert input-file [options] output-file
Most likely the first image has been converted and the output has been overwritten onto the second image and so on. Hence to process multiple files better to use a for loop, like this:
Code:
for file in *.JPG
do
convert "$file" -quality 80 "$file"
done
Moreover you don't need to apply the mogrify command before processing with convert, since you can use the -resize option of convert to achieve the same result.