基础数据

awk

sed

#sed 's#正则#结果#g'
echo 123abc456  | sed 's#abc#_#'
echo 123abc456  | sed 's#[2-9]#x#g'

awk  '/00:00:01/,/00:00:04/' /tmp/nginx.log
sed -n '/00:00:01/,/00:00:04/p' /tmp/nginx.log

语法题

awk '{print $7}' /tmp/nginx.log |sed -e "s#[0-9]\{1,\}#*#g" -e 's#?.*##' -e 's#/[^/]*\.png.*##'|  sort | uniq -c | sort -nr |head -10

Linux 测试

for i in $(seq 1 20);do time=$(date +%H:%M:%S);  info=$(ps -o %cpu -o %mem 9081 | tail -1 );echo $time $info ;sleep 1;done
16:46:50 0.9 0.2
16:46:58 0.9 0.3
16:47:00 0.9 0.2

while true; do count=$(jobs -l | grep Running|wc -l); [ $count -le 5 ] && { time curl https://testerhome.com/topics/17870 &>/dev/null  & } || echo $count waiting ;done

App 测试

adb shell "uiautomator dump && cat /sdcard/window_dump.xml"
adb shell input tap x y
adb shell input text 123
adb shell "uiautomator dump && cat /sdcard/window_dump.xml" |grep -oE  "<node[^>]*>" | grep -v 'resource-id=""' | grep -oE 'bounds=".*?]"'  | sed 's#[^0-9]\{1,\}# #g'

获取界面结构 xml -> node -> 坐标 -> input

持续集成

可视化

echo '1
3
2
4
6' | gnuplot -e "set terminal dumb;plot '<cat' using 1 with line"


↙↙↙阅读原文可查看相关链接,并与作者交流