Return code is "0" though the command fails.

The return code is "0" though the command fails. How to get a return code of "1" for this command when it fails or modify the command to get the right return code?

On HP UNIX

#-------- SCRIPT ----
#!/bin/ksh
find /opt/oracle/oroem/product/10.2.0.4/rdbms/audit/ \( -name "*.aud" \) -mtime +1 -exec rm -f {} \;
echo "Return Error Code" $?

------------------OUTPUT-------------
> b.sh
rm: /opt/oracle/oroem/product/10.2.0.4/rdbms/audit/ora_12289.aud not removed. Permission denied
Return Error Code 0

The return you get (0) is from find(1). To obtain the return code from rm(1) you could try running the command in a for loop.

$ for f in $(find......); do echo $f; rm -f $f; echo $?; done

That will fail if any filenames contain spaces.

Your suggestion works.
Thank You.