Translate a Shell script into Windows Batch file
Posted: 2016-10-04T09:41:58-07:00
Hi
Would you please assist me to turn this shell script (kindly written by fmw42) into a batch file:
cd
cd desktop/test1
imgname="rose"
arr=(`ls ${imgname}*.png`)
numimg=${#arr[*]}
num=`echo "scale=0; $numimg/2" | bc`
for ((i=0; i<num; i++)); do
j=$((2*i+1))
k=$((j+1))
convert ${imgname}$j.png ${imgname}$k.png +append ../test2/${imgname}${j}_${k}.png
done
cd
My intent is to drag and drop a number of images (or a folder containing images? this still confuses me)
into the batch file, so that images are joined two by two (side by side).
Note: i will be absent for a couple of days, so please do not be offended if I do not reply promptly...
Would you please assist me to turn this shell script (kindly written by fmw42) into a batch file:
cd
cd desktop/test1
imgname="rose"
arr=(`ls ${imgname}*.png`)
numimg=${#arr[*]}
num=`echo "scale=0; $numimg/2" | bc`
for ((i=0; i<num; i++)); do
j=$((2*i+1))
k=$((j+1))
convert ${imgname}$j.png ${imgname}$k.png +append ../test2/${imgname}${j}_${k}.png
done
cd
My intent is to drag and drop a number of images (or a folder containing images? this still confuses me)
into the batch file, so that images are joined two by two (side by side).
Note: i will be absent for a couple of days, so please do not be offended if I do not reply promptly...