View Single Post
Old 29-Nov-2007, 03:05 AM   #2 (permalink)
Anilrgowda
Administrator
 
Anilrgowda's Avatar

Posts: 18,715
Join Date: Jan 2006
Rep Power: 10 Anilrgowda is on a distinguished road

IM:
Default Re: List of files that exclude some files

>>>find . -name '*.jpg' \! -exec bash -c 'test -f `expr substr "$0" 1 \( length "$0" - 4 \)`.mod' {} \; -print
It might be overkill to call bash for each jpg found using exec, especially when there are many jpgs...

@OP, in bash, for one directory. I leave you to find a way for recursive.

for i in *.[jm][op][gd]
do
prefix=${i%%.*}
if [ -f ${prefix}.jpg -a -f ${prefix}.mod ];then
continue
else
echo "$i" #do your image processing here.
fi


------------------


Anilrgowda is offline   Reply With Quote