I need to duplicate and rename an image using a list of SKU codes from a spreadsheet as the unique name for each image. I have used the script from this answer Automate Duplicating and Renaming Images. I removed the filename line and changed "$line-$filename" to "$line". It works almost as expected but adds a ? to the end of every file, so it isn't saving as a .png, rather it saves as a .png?.
How do I get rid of the question mark...is there a simple fix to the script below or is it an issue with the txt file of SKU codes? Is it an encoding issue? Thank you so much.
#!/bin/bash
file=$1
prefixes=$2
while read line
do
cp $file "$line"
done < $prefixes