The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

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



Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Error checking a file from previous file size stuck1 Shell Programming and Scripting 2 12-06-2007 08:39 AM
Checking file size of zip file skwyer UNIX for Dummies Questions & Answers 2 10-11-2007 11:51 AM
Checking BLOCK Size shahnazurs SUN Solaris 1 06-21-2007 03:36 PM
checking size of the first line in a log file kiran1112 Shell Programming and Scripting 19 03-22-2007 02:46 PM
Checking file size jkuchar747 UNIX for Dummies Questions & Answers 2 03-02-2005 02:34 PM

 
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #1 (permalink)  
Old 09-06-2005
ssmith001 ssmith001 is offline
Registered User
  
 

Join Date: Aug 2005
Posts: 25
Help with checking file size

I need to check the size of a log file. If the size is anything but zero, I need to send an email. I'm using this syntax:

SIZE=0
VAR1=`wc -c $DIRNAME/$FILENAME1 | awk -F" " '{print $1}' `

echo $VAR1
if [ $VAR1 -ne $SIZE ]
then
do something such as send an email
fi


I know that the file is indeed blank, but the VAR1 variable has a size = 8192. Any ideas as to what the problem is? Is there a better way to do this?

Thanks in advance.
 

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 05:47 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0