USB的读写
先把对应大小的文件放在tmp,然后拷贝到指定地址
#!/bin/sh #mkdir /sda #mkfs.ext4 /dev/sda1 #mount -t ext4 /dev/sda1 /sda count=1 while [ 1 ]; do md5_usb=c33f04ad3d677779f6f9986a0604b1ee cp /tmp/ubuntu-18.04.4-desktop-amd64.iso /sda/test.iso sync md5_usb_write=`md5sum /sda/test.iso | awk '{print$1}'` if [ $md5_usb = $md5_usb_write ] then echo -e " " echo "===the $count times usb_md5 copy success===" let count=$count+1 rm /sda/test.iso else echo "usb_md5 failed" fi done