![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Forum Rules | FAQ | Contribute | Members List | Arcade | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts here. |
|
|
||||
| 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 |
|
|
Submit Tools | LinkBack | Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
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 |
| Forum Sponsor | ||
|
|
|
#2
|
||||
|
||||
|
Code:
[ -s "$DSDIR/non_reporting_stores.txt" ] && mailx -s "Daily Non Reporting Stores" < "$DSDIR/non_reporting_stores.txt" |
||||
| Google The UNIX and Linux Forums |