I'm writing a script. The idea is to compare MD5 checksums between a local file and a remote one.
The local file checksum is saved into a local variable:
LOCALMD5=!chsum "$(basename "$file")"
I was just recommended this script to get the md5 checksum on the remote file. do:
ssh user@remote-dns-name cd path/to/file csum -h MD5 >MD5-hashsum-filename
Assuming I can successfully run
csum in an ssh environment, how do I set the output of that command back to a local variable that I can use into the future?