Take the 2-minute tour ×  I convert images in a directory named
foo to bar by like this.  $ mkdir bar $ mogrify -path bar
-negate foo/*.png  Is there option in Imagemagick that create a
folder with -path option, if it not exist.  share|improve this
question mkdir -p /path/to/bar makes parents only as needed. – 
justbrowsing Sep 15 '13 at 22:13 I asked about option of mogrify
not option of mkdir. –  Tetsu Sep 15 '13 at 22:20  1 Answer 1
up vote 2 down vote accepted   To take arguments from the
mogrify command, and do other actions based on their content,
you can "override" the program with a function of your own, then
pass the original arguments on to the function:     [[ $1 ==
"-path" ]] && [[ ! -d $2 ]] && mkdir "$2"     mogrify "$@"  To
use it, just replace mymog wherever you would use mogrify:
mymog -path bar -negate foo/*.png  The function tests to see if
the first argument is -path. If so, it goes on to test if the
second argument is not an existing directory. If it is not, then
it creates that directo