The UNIX and Linux Forums  


Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com




View Single Post in the UNIX and Linux Forums - Click on the Thread or Permalink to View Entire Thread -->
  #1 (permalink)  
Old 10-26-2005
forevercalz forevercalz is offline
Registered User
  
 

Join Date: Sep 2005
Posts: 74
how to test for file existence using file size?

ok im doing this in a normal shell. i need to check the file in the script. how should i write the if else statment?


if the filesize contains 0kb then it will echo out file contains nothing
else if the script contains more than 0kb then it will echo out file exist.


any one care to help? thanks ! im new to unix scripting..