随机读取文件做算checksum shell 脚本
来源:互联网 发布:威士忌推荐 知乎 编辑:程序博客网 时间:2024/05/16 09:16
#!/bin/sh## usage: sh test_cp.sh 20 1024## rand(){ min=$1 max=$(($2-$min+1)) #num=$(date +%s) num=$(cat /proc/sys/kernel/random/uuid|cksum|cut -f1 -d" ") echo $(($num%$max+$min)) }min_1=1max_2=10000lastchecksum="0"rm -f test.bin_$1 rm -f result_$1.txtwhile [ $min_1 -le $max_2 ]do rnd=$(rand 1 102400) if [ "$rnd" -gt "0" ] then echo "rand: "$rnd >>result_$1.txt rm -f test.bin_$1 dd if=bin_file of=test.bin_$1 skip=$rnd count=$1 bs=$2 checksum=`echo $(cat test.bin_$1|cksum)|cut -f1 -d" "`echo "checksum:"$checksum >>result_$1.txt if [ $lastchecksum != "0" ];then if [ $checksum != $lastchecksum ];then echo $checksum >> result_$1.txt echo "checksum error" >> result_$1.txtbreak fi fi lastchecksum=$checksumecho "lastchecksum="$lastchecksum min_1=`expr $min_1 + 1` fidone
阅读全文
0 0
- 随机读取文件做算checksum shell 脚本
- shell读取文件 随机读取
- shell脚本读取文件
- linux shell 读取文件脚本
- shell脚本之读取文件
- shell脚本-----按行读取文件
- shell脚本-----按行读取文件
- shell脚本-----按行读取文件-转
- shell脚本 - sed文件读取指定行
- shell脚本随机输出一个文件的25行
- shell 脚本实现文件的随机无重复筛选
- shell脚本 操作日志文件 && 读取文件 && 查询进程ID
- shell脚本 操作日志文件 && 读取文件 && 查询进程ID
- shell脚本读取配置文件
- shell脚本读取配置文件
- shell脚本读取配置文件
- 读取随机文件
- java随机读取文件
- 一周AI回顾 | 特斯拉AI负责人说神经网络正在改变编程,机器学习大神Bengio新论文专注RNN优化
- Dash相关领域知识总结
- 看懂人心
- ffmpeg常用基本命令(转)
- iOS 强制旋转屏幕
- 随机读取文件做算checksum shell 脚本
- Clion破解
- Linux,CentOs7下安装MySql 填了好多好多百度经验的坑!
- react native 之hello world
- html调用servlet(JDBC在Servlet中的使用)
- 网页设计师和网页前端开发我该选择哪一个
- dubbo多协议和多注册中心
- Oracle 11gR2(11.2.0.3) Patchset 中7个不同文件的作用说明
- eclipse中安装python插件