![]() |
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !! |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| check if file is empty | stolz | Shell Programming and Scripting | 8 | 03-22-2009 11:15 PM |
| How to check for empty file in Perl? | deepakwins | UNIX for Dummies Questions & Answers | 1 | 03-04-2008 03:00 PM |
| Check for empty string | rahman_riyaz | Shell Programming and Scripting | 12 | 01-24-2008 03:13 AM |
| How can I make the for command check to see if a file is empty before executing? | chrchcol | Shell Programming and Scripting | 3 | 07-29-2006 04:14 AM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
How to check if a file is empty?
Hi Masters.....
I have problem !!! I need to check number of records in a file and if it is zero or file is empty i need to do some task. if [Zero record]; then echo "File s empty" else echo "Not empty" fi so how to check this condition. I used wc -l < filename.txt => 1 for zero records same result with- awk '{n++}' END '{print n}' filename.txt if [ ! -s file ] => this condition is also not working out. Can any one help me out in this please.... ![]() |
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|