Using KORN to compare local and remote MD5
Clash Royale CLAN TAG#URR8PPP
up vote
0
down vote
favorite
I am in need of creating and checking checksums between a local file, and the remote file I just pushed. If the MD5 checks, continue, else break. This needs to be in KORN shell scripting because we are using AIX machines.
here's the code I have so far:
for file in <<Directory>>; do
-- Get MD5 of local file
LOCALMD5=!chsum "$(basename "$file")"
sftp <<USER>>@<<IP>> <<EOF
PUT file <<SFTP OUTPUT FOLDER>>
REMOTEMD5= <<<COMMAND HERE>>>> <<--- HELP NEEDED HERE
IF [[LOCALMD5!=REMOTEMD5]]; THEN
RETURNVALUE = -1
BREAK
done
print RETURNVALUE
How do I get the remote MD5 checksum?
aix sftp hashsum
New contributor
 |Â
show 1 more comment
up vote
0
down vote
favorite
I am in need of creating and checking checksums between a local file, and the remote file I just pushed. If the MD5 checks, continue, else break. This needs to be in KORN shell scripting because we are using AIX machines.
here's the code I have so far:
for file in <<Directory>>; do
-- Get MD5 of local file
LOCALMD5=!chsum "$(basename "$file")"
sftp <<USER>>@<<IP>> <<EOF
PUT file <<SFTP OUTPUT FOLDER>>
REMOTEMD5= <<<COMMAND HERE>>>> <<--- HELP NEEDED HERE
IF [[LOCALMD5!=REMOTEMD5]]; THEN
RETURNVALUE = -1
BREAK
done
print RETURNVALUE
How do I get the remote MD5 checksum?
aix sftp hashsum
New contributor
Are you actually callingcksum
, or ischsum
some other local utility/function/wrapper?
â Jeff Schaller
30 mins ago
this is new code, so we are using cksum right now.
â arcee123
30 mins ago
New to Korn Scripting
â arcee123
29 mins ago
do you havecsum
available? (AIX 7's supports MD5)
â Jeff Schaller
23 mins ago
do you have ksh93 available? (for array support)
â Jeff Schaller
22 mins ago
 |Â
show 1 more comment
up vote
0
down vote
favorite
up vote
0
down vote
favorite
I am in need of creating and checking checksums between a local file, and the remote file I just pushed. If the MD5 checks, continue, else break. This needs to be in KORN shell scripting because we are using AIX machines.
here's the code I have so far:
for file in <<Directory>>; do
-- Get MD5 of local file
LOCALMD5=!chsum "$(basename "$file")"
sftp <<USER>>@<<IP>> <<EOF
PUT file <<SFTP OUTPUT FOLDER>>
REMOTEMD5= <<<COMMAND HERE>>>> <<--- HELP NEEDED HERE
IF [[LOCALMD5!=REMOTEMD5]]; THEN
RETURNVALUE = -1
BREAK
done
print RETURNVALUE
How do I get the remote MD5 checksum?
aix sftp hashsum
New contributor
I am in need of creating and checking checksums between a local file, and the remote file I just pushed. If the MD5 checks, continue, else break. This needs to be in KORN shell scripting because we are using AIX machines.
here's the code I have so far:
for file in <<Directory>>; do
-- Get MD5 of local file
LOCALMD5=!chsum "$(basename "$file")"
sftp <<USER>>@<<IP>> <<EOF
PUT file <<SFTP OUTPUT FOLDER>>
REMOTEMD5= <<<COMMAND HERE>>>> <<--- HELP NEEDED HERE
IF [[LOCALMD5!=REMOTEMD5]]; THEN
RETURNVALUE = -1
BREAK
done
print RETURNVALUE
How do I get the remote MD5 checksum?
aix sftp hashsum
aix sftp hashsum
New contributor
New contributor
edited 31 mins ago
Jeff Schaller
33.8k851113
33.8k851113
New contributor
asked 32 mins ago
arcee123
101
101
New contributor
New contributor
Are you actually callingcksum
, or ischsum
some other local utility/function/wrapper?
â Jeff Schaller
30 mins ago
this is new code, so we are using cksum right now.
â arcee123
30 mins ago
New to Korn Scripting
â arcee123
29 mins ago
do you havecsum
available? (AIX 7's supports MD5)
â Jeff Schaller
23 mins ago
do you have ksh93 available? (for array support)
â Jeff Schaller
22 mins ago
 |Â
show 1 more comment
Are you actually callingcksum
, or ischsum
some other local utility/function/wrapper?
â Jeff Schaller
30 mins ago
this is new code, so we are using cksum right now.
â arcee123
30 mins ago
New to Korn Scripting
â arcee123
29 mins ago
do you havecsum
available? (AIX 7's supports MD5)
â Jeff Schaller
23 mins ago
do you have ksh93 available? (for array support)
â Jeff Schaller
22 mins ago
Are you actually calling
cksum
, or is chsum
some other local utility/function/wrapper?â Jeff Schaller
30 mins ago
Are you actually calling
cksum
, or is chsum
some other local utility/function/wrapper?â Jeff Schaller
30 mins ago
this is new code, so we are using cksum right now.
â arcee123
30 mins ago
this is new code, so we are using cksum right now.
â arcee123
30 mins ago
New to Korn Scripting
â arcee123
29 mins ago
New to Korn Scripting
â arcee123
29 mins ago
do you have
csum
available? (AIX 7's supports MD5)â Jeff Schaller
23 mins ago
do you have
csum
available? (AIX 7's supports MD5)â Jeff Schaller
23 mins ago
do you have ksh93 available? (for array support)
â Jeff Schaller
22 mins ago
do you have ksh93 available? (for array support)
â Jeff Schaller
22 mins ago
 |Â
show 1 more comment
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
arcee123 is a new contributor. Be nice, and check out our Code of Conduct.
arcee123 is a new contributor. Be nice, and check out our Code of Conduct.
arcee123 is a new contributor. Be nice, and check out our Code of Conduct.
arcee123 is a new contributor. Be nice, and check out our Code of Conduct.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f474645%2fusing-korn-to-compare-local-and-remote-md5%23new-answer', 'question_page');
);
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Are you actually calling
cksum
, or ischsum
some other local utility/function/wrapper?â Jeff Schaller
30 mins ago
this is new code, so we are using cksum right now.
â arcee123
30 mins ago
New to Korn Scripting
â arcee123
29 mins ago
do you have
csum
available? (AIX 7's supports MD5)â Jeff Schaller
23 mins ago
do you have ksh93 available? (for array support)
â Jeff Schaller
22 mins ago