What is the result you expect and what is the o/p you get? What are the input files like? And what errors, if any, do you get? Its very difficult to make a guess. What Unix runs on both servers?
The script checks a file and then writes the data rows to the new file.
The file will be like this format
Header
Data
Conut of data rows
If the data rows equals the last row in the file which is Count of data rows
then the script writes the data rows to a new file with .new extension appended to the original file.
sample output in debug mode from the code2 which is having problem. The 1st code doesn't throw any error and it's working correctly.
The count in the file is correct but for some unkonwn reason it's showing error.
The code on 1 runs on HP-UX
and code on server 2 runs on SUNos