First test, I have placed one heic photo in a test directory, opened 'Konsole' in that directory and tried your scrips, both have the same output.
$ #!/bin/bash
for file in $(ls *.heic | awk '{ print substr($1,1,length($1)-5); }')
do
convert -quality 96 $file.heic $file.jpg
done
convert: no decode delegate for this image format `HEIC' @ error/constitute.c/ReadImage/504.
convert: no images defined `2021-01-02_12-25-13_324.jpg' @ error/convert.c/ConvertImageCommand/3258.
$ #!/bin/bash
for f in *.heic; do convert "$f" -quality 96 "${f%.heic}.jpg"; done
convert: no decode delegate for this image format `HEIC' @ error/constitute.c/ReadImage/504.
convert: no images defined `2021-01-02_12-25-13_324.jpg' @ error/convert.c/ConvertImageCommand/3258
ImageMagick is already installed on this spare laptop.
I also tried opening the test photo with 'ImageMagick' and that also gave error message of ''no decode delegate for this image format''
I do not know what I'm doing with konsole and scrips. Help.