I may be wrong, but the bar in front of 1024 is to escape the argument passed to the /root/.ssh/rsync_rsa
(in accordance with response in the Severfault):
ssh -i /root/.ssh/rsync_rsa $remote "
perl -'MDigest::MD5 md5' -ne 'BEGIN{\$/=\1024};print md5(\$_)' $dev2 | lzop -c" |
lzop -dc | perl -'MDigest::MD5 md5' -ne 'BEGIN{$/=\1024};$b=md5($_);
read STDIN,$a,16;if ($a eq $b) {print "s"} else {print "c" . $_}' $dev1 | lzop -c |
ssh -i /root/.ssh/rsync_rsa $remote "lzop -dc |
perl -ne 'BEGIN{\$/=\1} if (\$_ eq\"s\") {\$s++} else {if (\$s) {
seek STDOUT,\$s*1024,1; \$s=0}; read ARGV,\$buf,1024; print \$buf}' 1<> $dev2"
So in your case as you don’t is flowing by rsync_rsa and yes typing straight, do not need to "escape" the number, just do that:
export dev2='/dev/sdb';
perl -'MDigest::MD5 md5' -ne 'BEGIN{\$/=1024};print md5(\$_)' $dev2
I am without terminal emulator, but if it still fails it is because it does not need to escape the $
inside '...'
(I can’t say I haven’t used Linux/Unix in a while):
export dev2='/dev/sdb';
perl -'MDigest::MD5 md5' -ne 'BEGIN{$/=1024};print md5($_)' $dev2