I want to set an env variable in a Linux shell, LOGx where x=1,2,3, or 4. If x was 1 last time then ++$x;
Shell: LOG=logname concat'ed with $x
I came u with a perl script to handle $lognum but how do I get ksh to see it; i.e.
#!/usr/bin/perl
my $logFH = '/home/informix/Primero/primero.cfg';
my $logFH = 'primero.cfg';
unless ( -s $logFH ) {
open(OFH,">$logFH");
print OFH '0';
close OFH;
}
open(IFH,$logFH);
chomp( my $lognum = <IFH> );
close IFH;
$lognum = ( ++$lognum > 4) ? 1 : $lognum;
open(OFH,">$logFH");
print OFH $lognum;
close OFH;
system("export LOGNUM=$lognum");
exit;
Shell: LOG=logname concat'ed with $x
I came u with a perl script to handle $lognum but how do I get ksh to see it; i.e.
#!/usr/bin/perl
my $logFH = '/home/informix/Primero/primero.cfg';
my $logFH = 'primero.cfg';
unless ( -s $logFH ) {
open(OFH,">$logFH");
print OFH '0';
close OFH;
}
open(IFH,$logFH);
chomp( my $lognum = <IFH> );
close IFH;
$lognum = ( ++$lognum > 4) ? 1 : $lognum;
open(OFH,">$logFH");
print OFH $lognum;
close OFH;
system("export LOGNUM=$lognum");
exit;