The one text file I give it to read, ASCII text (
file command and "cat -e" both verify the line endings are right), gives me
echo lines like
It's not recognizing ":" as the field separator.
And it's not just my choice of separators. I've tried
, and
^ with equal lack of success.
The script is below.
Code:
#!/bin/bash
SAVEIFS=$IFS
IFS=$(echo -en "\n\b")
set +xv
function gettext () {
echo -e "What annotations file will I be using?"
read -er thelist
#Allowing for, and correcting, the trailing space in interactive mode
if [[ "$thelist" ]]; then
capfile1=${thelist% *}
else
capfile1=$thelist
fi
}
gettext
while IFS=":" read -r file1 cate
do echo -ne "$file1\n$cate\n"
exiftool -fast5 -overwrite_original_in_place -q -P -IPTC:Category="$cate" -XMP:Category="$cate" "$file1"
echo -ne "Written:\tCATEGORY"
done<"$capfile1"
IFS=$SAVEIFS
So what is it that I, my installed ShellCheck, and SC online aren't seeing?
Carver