in reply to Need help deleting *.bak files

You could do it this way, it won't be harmful as unlink won't delete directories so it will always be a file that ends with .bak extension.

unlink glob '/emc/cccadm/scripts/perl/etc-test/*.bak';

Replies are listed 'Best First'.
Re^2: Need help deleting *.bak files
by ikegami (Patriarch) on Jan 19, 2010 at 15:39 UTC
    That's not recursive like the OP's code. It also limits the ability to report errors when you pass more than one file name to unlink.