Hi All,
i am writing a shellscript to compare cksum of the file in local machine and after copying to remote machine. i am not able to assign command output value to variable in remote machine through SSH. PFB code for this.
code:
###### Get File size of the file in local remote system
cd $artifact_location
localsystem_filesize=`cksum $filename`
echo "local file size is :$localsystem_filesize"
###### Get File size of the file in local remote system
ssh -l $scp_username $hostname <<EOF 2>/dev/null
Y
cd $remote_release_path
remotesystem_filesize=`cksum $filename`
echo "remote file size is :$remotesystem_filesize
if [ $localsystem_filesize == $remotesystem_filesize ]
then
echo "file size is equal"
else
echo "file size is diffrent"
exit 1
fi
EOF
can any one please help me here.....
Thanks,
Katam Sivakumar