I have spooled some data in a file (a.dat, b.dat etc..) and after that I want to get the size and checksum of spooled file (a.dat, b.dat etc..) in a log file(file_info.log).
By the way I dont want lost the previous output file info(Append data).
See the "man" page for the unix "cksum" command.
This command outputs the fields in the following order:
cksum <filename>
<checksum> <size in bytes> <filename>
Try it.
Then uses the unix Shell redirect ">" to write the output from the command to your log file (after possibly using the "awk" or "cut" commands to change the order of the output).
The question suggests the order of field output from the old unix "sum" command but the file size in this case would be in 512 byte blocks. The unix "cksum" command is much preferred to the unix "sum" command and the unix "cksum" command picks up simple transposition which the old unix "sum" command misses.
cksum <file_name>, it works but in every excution, log file was refreshed. I mean it does not append the new data after previous, always it shows the new file's info.