Re: Avoiding spooling to empty files
From: joel garry <joel-garry_at_home.com>
Date: Fri, 30 Jan 2009 15:25:10 -0800 (PST)
Message-ID: <0df88486-f87d-4388-a92e-726394539258_at_y23g2000pre.googlegroups.com>
On Jan 30, 2:50 pm, CenturionX <darwinbaldr..._at_gmail.com> wrote:
> Thanks David
>
> I actually did the corrections. But i need the file zero lenght when
> there is no data to spool. Do you know a way to do that. Be generate a
> zero-lenght file or not generated it at all.
>
> Thanks.
Date: Fri, 30 Jan 2009 15:25:10 -0800 (PST)
Message-ID: <0df88486-f87d-4388-a92e-726394539258_at_y23g2000pre.googlegroups.com>
On Jan 30, 2:50 pm, CenturionX <darwinbaldr..._at_gmail.com> wrote:
> Thanks David
>
> I actually did the corrections. But i need the file zero lenght when
> there is no data to spool. Do you know a way to do that. Be generate a
> zero-lenght file or not generated it at all.
>
> Thanks.
Well, are you sure you want this? Here's one hint:
$ echo " " > xx
$ if [ `find . -size 1c -name xx` ]
> then echo "yes"
> else echo "no"
> fi
no
$ echo "" > xx
$ if [ `find . -size 1c -name xx` ]
> then echo "yes"
> else echo "no"
> fi
yes
$ echo "\c">xyz
$ ll xyz
-rw-rw-rw- 1 jeg users 0 Jan 30 15:25 xyz
Do what you want instead of echo.
jg
-- _at_home.com is bogus. http://www3.signonsandiego.com/stories/2009/jan/30/1b30kyocera005624-kyocera-lay-250-sd-cell-division/?uniontribReceived on Fri Jan 30 2009 - 17:25:10 CST