0

Hi All

I have created a script which will email output if the file contains data, this works.
But when the file contains 0 data, it tries to email but hangs, when i hit ctrl D, it ask for Cc: address, i then cancel this then it emails me out.
Anyway i can get it to stop hanging and waiting for user intervention???

if [ $filesize -gt 0 ]
then
mailx -s "$subject $day" $destination < $filename
else
mailx -s "$subject2 $day" $destination
fi

2
Contributors
4
Replies
5
Views
10 Years
Discussion Span
Last Post by masijade
0

Hi

I tried that but it doesnt seem to work probably, as i had data in $filename, but it just ran echo "No Data" | mailx -s "$subject2 $day" $destination. For some reason it didnt pickup the data??


if [ $filesize -gt 0 ]
then
mailx -s "$subject $day" $destination < $filename
else
print "no date" | mailx -s "$subject2 $day" $destination
fi
+ [ 0 -gt 0 ]
+ print no date
+ mailx -s There are no Failed/Terminated jobs

0

Sorry it worked, being stupid i had the $filesize variable doing the work before the data came in.
Many thanks for your help masijade. :-)

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.