Monday, May 21, 2007

Remove Zero Length and Core Files With Inline Script

Here's a C shell inline script to remove zero length and core files. This particular script removes these files from the esofthub directory. Here's an example.

#csh
# foreach zero_core(/home/esofthub/*)
? if (-z $zero_core || `basename $zero_core` == "core") then
? rm $zero_core
? endif
? end

Just find zero length files (per request)

#csh
# foreach zero_core(/home/esofthub/*)
? if (-z $zero_core) then
? rm $zero_core
? endif
? end

No comments: