Link to home
Start Free TrialLog in
Avatar of aman_greval
aman_greval

asked on

Error while chech-in

I sent files to the configuration management team to check-in certain files.

They sent me this reply. Can you tell me what is wrong?

The files have been checked in. However conk_prod.sql could not be checked in and encountered following error.                

 

"ERROR [/home/nims/source/SCCS/Release223/congo/production/s.conk_prod.sql]: No newline at end of file 'conk_prod.sql' (de18)
dev.sh: Failed during delta""
ASKER CERTIFIED SOLUTION
Avatar of tfewster
tfewster
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of aman_greval
aman_greval

ASKER

Thanks  for your help, Yes it did work.

We do not get such errors everytime we check-in our files. Why did we encounter this error this time.

Please tell me what precautions we should take (during check-in) so that this error is not repeated in future.
You needs to look at how conk_prod.sql is created; If it's created by vi for example, vi will always append a newline character at the end of the last line, even if you didn't type <Return>. But if it's generated by a program, e.g.
   printf "sql statement" > conk_prod.sql
there may not be a newline.

A simple way of fixing text files might be:
for FILE in *.sql
do
  echo "" >> $FILE
done

(Even though we're appending "nothing" to the file, it creates the newline at the end. But _please_ make copies of your files first, in case this breaks them.)