10-05-04 08:01 AM
2004-10-4, 22:16(+00), Chris F.A. Johnson:
> On 2004-10-04, Gabriella wrote:
>
> I use zrm; it can be a function or a standalone script:
>
> zrm() {
> for f in "$@"
for f
is more portable
> do
> if [ ! -s "$f" ] ## if the file is empty
> then
> rm "$f"
rm -- "$f"
You may also want to check that the file is a regular file:
if [ -f "$f" ] && [ \! -L "$f" ] && [ ! -s "$f" ]
> fi
> done
> }
>
> zrm *
or zrm ./*
With zsh:
rm ./*(.L0)
--
Stephane
[ Post a follow-up to this message ]
|