I run this code in cron using open(OFH,">$logFH"), and got the first line in the output file with no garbage. But open(OFH,">>$logFH"), gives me garbage at the beginning of the line. However it does NOT give garbage when running it from the command line. Can anybody help???
tt.pl
tt.sh
cron
output file
tt.pl
Code:
#!/usr/bin/perl
system('clear');
use strict;
use lib '/home/ejaggers/Perl/Lib';
use UtilityLibrary;
my $dir = '/home/informix/Primero';
my $logFH = $dir . "/ecj";
open(OFH,">>$logFH");
my $today = `date`;
print OFH "SQL Start: $today";
tt.sh
Code:
#!/usr/bin/ksh
. /etc/profile.d/set_informix.sh
. /etc/profile.d/perl5lib.sh
DIR=/home/informix/Primero
perl $DIR/tt.pl $LOG
cron
Code:
18 16 * * 1-5 ./Primero/tt.sh ecj >> ./Primero/ecj 2>&1
output file
Code:
SQL Start: Mon Aug 24 16:15:01 CDT 2009
^[[H^[[JSQL Start: Mon Aug 24 16:18:01 CDT 2009