find command giving incomplete sentence warning

Hi ,

I am adding a line in my shell scripts to delete all the old directory with the below command. On running this command it is coming out with the message
find: incomplete statement

find /ersdg3/ERS/ERS_INPUT_LOGS/RIO/rio_archive -type d -mtime +47 -exec rm -rf {}

What is wrong or missing in it.

My os sun solaris 10

Guddu

Are the following alternatives working?

find /ersdg3/ERS/ERS_INPUT_LOGS/RIO/rio_archive -type d -mtime +47 -exec rm -rf {} +
find /ersdg3/ERS/ERS_INPUT_LOGS/RIO/rio_archive -type d -mtime +47 -exec rm -rf {} \;

I tried your first option and it worked, that is the command '+' will do and in 2nd option \; will do

The find -exec primary's synopsis lines from the POSIX standard are:

exec utility_name [argument . . .] ;
exec utility_name [argument . . .] { } +

When entering the 1st form on a shell command line, you have to use \; instead of just ; because the semicolon has a special meaning to the shell. In the first form, if any argument is {} , it will be replaced by the currently matched pathname, and utility_name will be invoked with the modified argument(s). When using this form, some (but not all) find implementations will replace any occurrence of {} in an argument with the pathname; others only replace {} when those two characters are the only characters in the argument.

In the second form, the {} can only appear once and it must be the last argument before the -exec primary's terminating + operand. In this form, utility_name may be invoked with the given arguments and several matched pathnames. The number of pathnames that can be passed to the given utility will be limited by the system's setting for {ARG_MAX} (the maximum number of bytes that can be passed to a child process in its environment and argument lists). If you are processing a lot of files, only use the pathname a single time and as the last argument in the argument list, and the utility accepts multiple pathname operands, this form can be significantly more efficient.