Hi,

I wrote a script to check if the last file has correct filename.

using `ls -rt |tail -2` I retrieve the $filename to be 2001.07.18.14.data
and using my script, I calculate the $myfile using the date cmd.
and $myfile also gives me 2001.07.18.14.data

As can be seen above, both $filename and $myfile are same, but it fails when
I test using the ($myfile eq $filename) operator in the script.

Any suggestions?




--------------------------------------------------
chomp( ($filename) = `ls -rt | tail -1` );

#date
chomp($mon=`date +%m`);
chomp($hour=`date +%H`);
chomp($day=`date +%d`);
chomp($min=`date +%M`);
chomp($year=`date +%Y`);
$curseq=$hour*4;
$myfile= "$year.$mon.$day.$curseq.data\n";
print "$myfile";

if ($myfile eq $filename){ 
   print "The last file has correct filename : $myfile\n";
  } 
--------------------------------------------

Rgds
Arvind

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to