Hi,
I have an application that reads lot of files during the day. Some times these files are null, so the application fails.
I need to create a script that deletes these null files. Unfortunately file names contain space so I'm having problem when using for or if.
To see file space usage, I use wc -c.
An example of filename is: ASDAD 12313 dadf.msg
Files reside in different directories, but all under the same structure.
I tried with someting like this:
find . -name *.msg -exec wc -c {} \;
this returns two colums:
bytes files
980 ./elabdir/aa/dcmtconnection/25e 10f5166 -775d.msg
0 ./elabdir/ab/dcmtconnection/13e 2f51678 -835d.msg
but now I need to use if and for to check if bytes=0 then remove. how can I do this?
Thanks in advance.
I have an application that reads lot of files during the day. Some times these files are null, so the application fails.
I need to create a script that deletes these null files. Unfortunately file names contain space so I'm having problem when using for or if.
To see file space usage, I use wc -c.
An example of filename is: ASDAD 12313 dadf.msg
Files reside in different directories, but all under the same structure.
I tried with someting like this:
find . -name *.msg -exec wc -c {} \;
this returns two colums:
bytes files
980 ./elabdir/aa/dcmtconnection/25e 10f5166 -775d.msg
0 ./elabdir/ab/dcmtconnection/13e 2f51678 -835d.msg
but now I need to use if and for to check if bytes=0 then remove. how can I do this?
Thanks in advance.