I may be wrong, but the bar in front of 1024 is to escape the argument passed to /root/.ssh/rsync_rsa
(as per response in SeverFault ):
ssh -i /root/.ssh/rsync_rsa $remote "
perl -'MDigest::MD5 md5' -ne 'BEGIN{\$/=24};print md5(\$_)' $dev2 | lzop -c" |
lzop -dc | perl -'MDigest::MD5 md5' -ne 'BEGIN{$/=24};$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{\$/=} if (\$_ eq\"s\") {\$s++} else {if (\$s) {
seek STDOUT,\$s*1024,1; \$s=0}; read ARGV,\$buf,1024; print \$buf}' 1<> $dev2"
Then in your case as you are not rsync_rsa and instead typing direct, you do not need to "escape" the number, just do this:
export dev2='/dev/sdb';
perl -'MDigest::MD5 md5' -ne 'BEGIN{\$/=1024};print md5(\$_)' $dev2
I have no terminal emulator, but if it still fails it is because I do not need to escape the $
within '...'
(I can not say, I have not used Linux / Unix for a while):
export dev2='/dev/sdb';
perl -'MDigest::MD5 md5' -ne 'BEGIN{$/=1024};print md5($_)' $dev2