Output NamingVariable for Multiple Files in Bash Script
1
vote
1
answer
167
views
I have a script I've created that will pad a series of Jpgs, create a subdirectory in the working directory, move the padded Jpgs to the subdirectory, change to the subdirectory, and then use Imagemagick's convert command to overlay a single transparent .gif over the padded images. All but the last step works. If I run this script on one Jpg file it works correctly. But when I try it on multiple Jpgs it will only semi-work on one Jpg and not the others. I assume that I'm not using the correct naming variable in the last command, but I'm having no luck finding the correction.
Bash script:
#!/bin/bash
if yad \
--image "dialog-question" \
--title "Alert" \
--button=gtk-yes:0 \
--button=gtk-no:1 \
--text "Have you resized JPGs?"
then
convert *.jpg "$i" -bordercolor black -border 120x0 "pad$i.jpg"
mkdir -p ./padded; mv pad*.jpg $_
cd padded
cp /home/mastergif/ggg.gif /home/test/padded
convert ggg.gif *.jpg "$i" -background black -gravity center -compose dstover -composite $i*.jpg
exec bash
else
exit 1
fi
Asked by whitewings
(2527 rep)
Mar 25, 2016, 06:27 AM
Last activity: Sep 2, 2016, 06:19 PM
Last activity: Sep 2, 2016, 06:19 PM