Code:
#!/bin/bash -i
SAVEIFS=$IFS
IFS=$(echo -en "\n\b")
function gettext () {
echo -e "What list will I be using?"
read -er item
#Allowing for, and correcting, the trailing space in interactive mode
if [[ $item ]]; then
capfile=${item% *}
else
capfile=$item
fi
echo "$capfile"
}
gettext
while IFS=^ read -r file1 idesc
do
echo "$file1"
exiftool -fast5 -overwrite_original_in_place -P -q -EXIF:ImageDescription="$idesc" "$file1"
echo -e "File $file1 now has an \e[42mExif Image Description.\e[0m"
done<capfile
IFS=$SAVEIFS
returns
Code:
bash: capfile: No such file or directory
Both shellcheck online and my installed version indicate no errors. I've cleared any older variables (command:
exec bash) but the error persists.
This one definitely needs another pair of eyes.
Carver
PS: No need; the "capfile" variable after
done was missing its
$.
(Someone please delete this thread. I know I did something right by posting it to the "Newbie" section; what a piker error this was!)