# Script file to be embedded cat> /tmp/check_md5.sh << EOF #!/bin/bash< br>dir=/data/web n=\`wc -l /tmp/md5.list\` # Since there can be no spaces in the lines of the file in the for loop, all the loop conditions are converted to the number of lines of the file for i in \`seq 1 \$n\` # Take the value of the variable $n and escape it, otherwise it is the value of $n do file_name=\`sed -n “\ $i”p /tmp/md5.list |awk'{print $2}’\` md5=\`sed -n “\$i”p /tmp/md5.list |awk'{print $1}’ \` if [-f \$file_name ] then md5_b=\`md5sum \$file_name\` if [\$md5_b != \$md5 ] then echo “\$file_name has cha nged” fi else echo “\$file_name is lost” fi done EOF scp /tmp/check_md5.sh B:/tmp/ ssh B “/bin/bash /tmp/check_md5.sh” #ssh after connecting to machine B, run /bin/bash /tmp/check_md5.sh