in reply to system command error

One way which is a lot more efficient resource wise.

find . -name '*.std' -o -name 'ULOG.*' -mtime +9 -type -f -print | per +l -ne 'chop; unlink;'

This is a fairly standard idiom and is a published example somewhere though I don't remember where I saw it.

It would be run from the shell.

Another option is the File::Find module do do this type of stuff directly from perl.

Replies are listed 'Best First'.
Re^2: system command error (-print0)
by Aristotle (Chancellor) on Apr 04, 2003 at 10:50 UTC
    Filenames may contain newlines though.
    find . \( -name '*.std' -o -name 'ULOG.*' \) -mtime +9 -type -f -print +0 | perl -0777 -F'/\0/' -lane 'unlink @F'

    Makeshifts last the longest.