Hi, I have two sets of image files. Both sets have names A to Z but set 1 ends with .cdt.png and set 2 ends with .matrix.png. I want set 1 to match with set 2 if the names match (i.e. A.cdt.png will match with A.matrix.png) and with the convert image tool (program for images), it will merge the two images into one image file (i.e. one file with the two A images).
The code that I have been working with is indicated below but the problem is that I cannot get it to work. Maybe there is an alternative way of doing this.
for f in *.cdt; do var=`echo "$f" | sed 's/\.cdt$//'`; convert +append $var.cdt.png $var.matrix.png $var_merged.png; done
ls -lth
total 304K
-rw-rw-r-- 1 User User 36K Jun 29 05:13 cinama5d_2.JPG
-rw-rw-r-- 1 User User 261K Jun 29 05:13 cinama5d_1.JPG
convert cinama5d_2.JPG cinama5d_1.JPG +append new_cinema.JPG
$ ls -lth
total 596K
-rw-rw-r-- 1 User User 286K Jul 25 06:16 new_cinema.JPG
-rw-rw-r-- 1 User User 36K Jun 29 05:13 cinama5d_2.JPG
-rw-rw-r-- 1 User User 261K Jun 29 05:13 cinama5d_1.JPG