The UNIX and Linux Forums  

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 here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
What the command to find out the record length of a fixed length file? tranq01 UNIX for Dummies Questions & Answers 9 15 Hours Ago 01:04 PM
how to convert Fixed length file to delimited file. satyam_sat Shell Programming and Scripting 7 04-02-2008 11:41 PM
convert XML file into Text file(fixed length) ram2s2001 Shell Programming and Scripting 0 11-02-2005 10:28 PM
Sed working on lines of small length and not large length thanuman UNIX for Dummies Questions & Answers 3 04-15-2005 03:12 AM
creating a fixed length output from a variable length input r1500 Shell Programming and Scripting 2 12-03-2003 10:09 AM

Reply
 
Submit Tools LinkBack Thread Tools Search this Thread Display Modes
  #1  
Old 06-16-2005
Registered User
 

Join Date: Jun 2005
Posts: 3
File length

I need to be able to get the length of a specific file. If the file length <> 0, then I need to email it to an address.

I tried this:

if [`wc -c "$DSDIR/non_reporting_stores.txt"` -ne 0]
then
(cat $DSDIR/non_reporting_stores.txt) | mail -s "Daily Non Reporting Stores" xyz@xysz.com

fi

which gave me a syntax error that it could not find the ]

DSDIR is /tmp

How DO I do this?

Thanks
JPS
Reply With Quote
Forum Sponsor
  #2  
Old 06-16-2005
vgersh99's Avatar
Moderator
 

Join Date: Feb 2005
Location: Boston, MA
Posts: 3,029
Code:
[ -s "$DSDIR/non_reporting_stores.txt" ] && mailx -s "Daily Non Reporting Stores" < "$DSDIR/non_reporting_stores.txt"
Reply With Quote
Google The UNIX and Linux Forums
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes




All times are GMT -7. The time now is 05:04 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008. All Rights Reserved.Ad Management by RedTyger Visit The Complex Event Processing Blog

Content Relevant URLs by vBSEO 3.2.0