1、以指定时格式显示时间 2000-03-12 22:30:22
date +"%Y-%m-%d %k:%M:%S"
2、计算百分比
x=1y=2rate=$(awk -v vx=$x -v vy=$y 'BEGIN{printf "%.2f%%",(vx/vy)*100}')
3、sed替换
把 ">All Tests<\/stat> 替换为空sed 's/">All Tests<\/stat>//'
4、shell中加法计算
a=1 b=2 c=$((a+b))
Copyright @ 2024 zhenxing1114 Powered by .NET 9.0 on Kubernetes Powered by: .Text and ASP.NET Theme by: .NET Monster