• Post Reply Bookmark Topic Watch Topic
  • New Topic

manipulating files on a unix machine

 
Karina Guenther
Ranch Hand
Posts: 65
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have an application that connects via a socket to a unix box and uses ssh commands to copy / move files and do some other shell commands.
However, I need to read one of these flat files, add to it or create a new one and then create an md5 checksum file for it.
What is the best way? it seems as if copying the remote file to where my app is running, do what I need to it, then creating the md5 checksum file and then copying them back down seems tedious.
I could use shell script commands like cat or echo to create / write the data I need to the 1st file, but how about reading it and then calculating the checksum and creating that file?

Is there a better way where I could do all that on the remote box?
 
Tim Holloway
Bartender
Posts: 18417
58
Android Eclipse IDE Linux
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It sounds like this is what you want:



It does require that the "md5sum" utility be already installed on the remote machine. Which it probably is, since MD5 is so popular.
 
Karina Guenther
Ranch Hand
Posts: 65
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hmm.
I have a SSH object that opens a socket connection and submits commands. with the md5sum tool I don't need my app to calc it, I can just do: md5sum myfile.dat > myfile.md5.
thanks, I didn't know that there was md5sum there until I checked for it.

 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!