I am trying to write a code to do the below.
1: Get all the directory names from input line into a string (Number of directory inputs could vary)
2: For all the tiff files in those directories montage the images (using imagemagick) with the same names and save it in the main folder or given folder.
I want to combine two or more images (depending on the number of directories in the command line input). Each directory has image outputs with same name to the other directory. I wanna combine files with the same names from given directories
The code I wrote is below but its not passing $name as variable to montage command. What am I doing wrong here? Any help would be greatly appreciated.
for arg in "$@"; do #
n1=$arg
fname+=$n1"\${name} " #Get all the directory names in a string with $name at the end. for eg: Baseline/$name
done
echo $fname
for n in $arg/*.tif; do
name="$(basename "$n")"
name1=$(echo "$name" | cut -f 1 -d '.')
montage -tile 3x3 $fname name1.png
exit
done
