1.shell 四舍五入
echo 1 |awk 'BEGIN {printf "%.0f\n",((51/10))}
=>5
echo 1 |awk 'BEGIN {printf "%.0f\n",((56/10))}'
=>6
2.shell 向上取整
echo 1 |awk '{print int(100/3)==(100/3)?int(100/3):int(100/3)+1}'
3.监控命令执行情况
watch -n 1 ls -l
4.赋值时,左值包含变量
例如a='11'
b_$a=20会报错
用eval b_$a=20正常
5.变量传递
a=10
b=a
echo $b
=>a
echo ${!b}
=>10