I'm using find to pass all directories to xargs, and the command on each dir by xargs needs to create a new directory for each, looking like dirname_a, so how can this be done?
ie
find . -type d -print0 | xargs -0 mkdir ${DIR}_a && mogrify -path ${DIR}_a -resize '1200x1200>' -quality 95 ${DIR}/*{.jpg|.JPG} {} \;
${DIR} is not working as it must be wrong
I can use
for D in ./* ; do mkdir ${D}_a && mogrify -path ${D}_a -resize '1200x1200>' -quality 95 ${D}/*{.jpg|.JPG}; done
but this won't run on either directories or files with spaces in the names, so that is why I was looking at find with xargs.