#!/bin/bash

walk_dir () {
    shopt -s nullglob dotglob

    for pathname in "$1"/*; do
        if [ -d "$pathname" ]; then
	    echo "directory ${pathname}"
	    find $pathname -iname '*.png' | sort > $pathname/list-emoji-png.txt
	    montage -density 150 -quality 70  @$pathname/list-emoji-png.txt -geometry 400x400+3+3 -set label '%f' -tile 10x $pathname/AAA-list.jpg
            walk_dir "$pathname"
        else
	    echo "file name ${pathname}"
        fi
    done
}

DIR=.

walk_dir "$DIR"

