The argument to -exec
is typically the stuff between the -exec
and the \;
I would first try putting a space between the {}.contents
and the \;
but I didn't test it to see what might be going on
for your other point, it's probably easier to alter the starting point for find
than meddle with the -exec
clause. I suggest something like below, recalling that $OLDPWD
is the old working directory from prior to the last cd
(at least in bash it is, in tsch it is $owd
)
cd targetdirectory; find $OLDPWD -type f -name "*.zip" -exec unzip {} -d {}.contents /;
You could embellish it by adding a ; cd $OLDPWD
at the end to return you to your starting point if you wanted