debug: enclosed while,do,done;
debug: take basename .. 'stat -c %c $file' includes dir;