The above is pretty much all that is wrong with the following script:
Code:
#!/bin/bash
notee="Downloaded with GNU cUrl 7.47.0."
echo "Please enter the name of the picture file to use."
read -er newname
echo "Please enter (or paste) the URL on which the file is located."
read -er fg
echo "$fg"
curl -k --progress-bar -O -R $fg
date0=$(date "+%A %B %d, %Y")
drape1=${fg##*/}
echo "$drape1"
exiv2 -M"set Xmp.xmpRights.WebStatement $1" --keep "$drape1"
exiv2 -M"set Exif.Image.DocumentName $1" --keep "$drape1"
exiftool -fast5 -overwrite_original_in_place -P -q -Instructions="Downloaded $date0" -SpecialInstructions="Downloaded $date0" "$drape1" 2>/dev/null
exiftool -fast5 -overwrite_original_in_place -P -q -XMP-acdsee:Notes="$notee" -IPTC:EditStatus="$notee" "$drape1" 2>/dev/null
echo "$newname"
mv "$drape1" "$newname"
echo "File $drape1 is now called $newname."
shellcheck finds this error:
Code:
In /home/steve/bin/jericurl line 9:
curl -k --progress-bar -O -R $fg
^-- SC2086: Double quote to prevent globbing and word splitting.
Copied and pasted to stdout, a value assigned to the variable works without the quotes on either side, and gives the
curl: no URL specified! error with them.
The problem is likely something quite simple, but I can't puzzle out what it might be.
Carver