Quote:
Originally Posted by
incredible
Why cant you shorten it this way?
CORE_FILE="/var/core/core*"
OLD=0
find {CORE_FILE} -mtime ${OLD} -exec rm {} \;
Wouldn't be very wise to do it like this.
The wildcard (*) will be interpreted by the shell.
Suppose there are a few hunderd core files present, the effective find command will be
find /var/core/core0001 /var/core/core0002 /var/core/core003 ............. -mtime 0 -exec rm {} \;
This will result in an enormous CPU load.
Never use wildcards in a find command unless you either escape (\) them or put them withing single quotes (')
In the reply of "era" are the proper directions to handle something like this.