文章分类 -  Scripts

摘要:1 数组 arr_string=("sadf" "adsf"); arr_string_len=${#arr_string[@]} echo ${arr_string[1]} 2 echo 0x00000 到二进制文件 echo 0x88888888 | xxd -r -ps > file 如何换字 阅读全文
posted @ 2018-04-30 13:12 JustRelax 阅读(186) 评论(0) 推荐(0)
摘要:a.bin Split a.bin to c.bin d.bin at 32 bytes postion. dd if=a.bin of=c.bin ibs=32 count=1 Now, we got c.bin dd if=a.bin of=d.bin ibs=32 skip=1 Now, we 阅读全文
posted @ 2017-11-28 21:59 JustRelax 阅读(128) 评论(0) 推荐(0)
摘要:#!/bin/sh foreachd () { echo $1 for file in $1/* do if [ -d $file ] then echo "directory $file" foreachd $file fi if [ -f $file ] then echo "file $file" dos2unix $file chmod -x $file fi done } ech... 阅读全文
posted @ 2017-04-27 20:42 JustRelax 阅读(132) 评论(0) 推荐(0)
摘要:Shell: align.sh (未测试) 注意运算符两边要有空格。 #!/bin/bashfile_size=`ls -l $2 | awk '{print $ 5}'`align_size=`expr $file_size + $1 - 1`block_num=`expr $align_size 阅读全文
posted @ 2017-04-24 22:46 JustRelax 阅读(178) 评论(0) 推荐(0)
摘要:@echo off echo 正在清除系统垃圾文件,请稍等...... del /f /s /q %systemdrive%\*.tmp del /f /s /q %systemdrive%\*._mp del /f /s /q %systemdrive%\*.log del /f /s /q %s 阅读全文
posted @ 2016-08-01 22:40 JustRelax 阅读(132) 评论(0) 推荐(0)
摘要:1 删除每行前N个字符,经常从网上拷贝代码,但是都带行号的,用这个不错。 2 sed 比对每一行数据,如附和样式,执行指定操作。删除D 3 替换S/打印P (取用附和样式的字符串) 4 awk的工作方式是:读取数据文件,将每一行数据实为一条记录。每笔记录以字段分隔符分成若干段。 5 打印ifconf 阅读全文
posted @ 2016-06-17 21:35 JustRelax 阅读(124) 评论(0) 推荐(0)