script cl issue
Chuck Horst wrote on Jan 05, 2012
I am looking for a way to test if a file is empty or not in a script. I see access to see if a file exists. What would be a good way to tell if it is empty. The returned value would be used to test.
Thanks...chuck
Thanks...chuck
Mike Fitzpatrick wrote on Jan 05, 2012
See the COUNT task (similar to unix 'wc'), e.g.
count ("/dev/null") | scan (nlines, nwords, nchars, fname)
if (nchars == 0) {
# file is empty ....
}
Last post on Jan 05, 2012